NetTake
✖
NetTake
[Experimental]
Details

- The following forms can be used for start and end:
-
n,"layer" a specified layer NetPort[{layer,"port"}] the specified input or output port of a layer NetPort["port"] an input or output port of the entire graph All all of the inputs or outputs of the graph {spec1,spec2,…} the union of the speci - NetTake[net,spec,"port1"->spec1,…] can be used to give types for the input and/or output of the resulting NetChain or NetGraph, using the normal type specifications those functions allow. The new port specifications will replace any existing NetEncoder, NetDecoder or type.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Take the first two layers of a chain:
In[1]:=1

✖
https://wolfram.com/xid/0en00vc1c-zc962y
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0en00vc1c-v0iwu1
Out[2]=2

In[3]:=3

✖
https://wolfram.com/xid/0en00vc1c-m48bwh
Out[3]=3

Create a net with two outputs:
In[1]:=1

✖
https://wolfram.com/xid/0en00vc1c-vyawke
Out[1]=1

Use NetTake to obtain a subnet that computes only one of the outputs:
In[2]:=2

✖
https://wolfram.com/xid/0en00vc1c-hppyoh
Out[2]=2

In[3]:=3

✖
https://wolfram.com/xid/0en00vc1c-86z31g
Out[3]=3

Scope (1)Survey of the scope of standard use cases
Add a new NetDecoder while taking layers:
In[1]:=1

✖
https://wolfram.com/xid/0en00vc1c-e5lxbw
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0en00vc1c-gn5kni
Out[2]=2

Wolfram Research (2018), NetTake, Wolfram Language function, https://reference.wolfram.com/language/ref/NetTake.html.
✖
Wolfram Research (2018), NetTake, Wolfram Language function, https://reference.wolfram.com/language/ref/NetTake.html.
Text
Wolfram Research (2018), NetTake, Wolfram Language function, https://reference.wolfram.com/language/ref/NetTake.html.
✖
Wolfram Research (2018), NetTake, Wolfram Language function, https://reference.wolfram.com/language/ref/NetTake.html.
CMS
Wolfram Language. 2018. "NetTake." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NetTake.html.
✖
Wolfram Language. 2018. "NetTake." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NetTake.html.
APA
Wolfram Language. (2018). NetTake. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetTake.html
✖
Wolfram Language. (2018). NetTake. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetTake.html
BibTeX
✖
@misc{reference.wolfram_2025_nettake, author="Wolfram Research", title="{NetTake}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/NetTake.html}", note=[Accessed: 26-March-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_nettake, organization={Wolfram Research}, title={NetTake}, year={2018}, url={https://reference.wolfram.com/language/ref/NetTake.html}, note=[Accessed: 26-March-2025
]}