WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

NetInsert [chain,layer,i]

inserts a layer into a NetChain before the layer at position i.

NetInsert [chain,"name"->layer,"pos"]

inserts a named layer into a NetChain before the layer at the given position.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Possible Issues  
See Also
Tech Notes
Related Guides
History
Cite this Page

NetInsert [chain,layer,i]

inserts a layer into a NetChain before the layer at position i.

NetInsert [chain,"name"->layer,"pos"]

inserts a named layer into a NetChain before the layer at the given position.

Details

  • If a chain was created using the association form <|"name1"->layer1,"name2"->layer2,|>, then NetInsert [chain,"name"->layer,pos] should be used.
  • If a chain was created using the list form {layer1,layer2,}, then NetInsert [chain,layer,i] should be used.
  • The inserted layer must be compatible with the output of the previous layer and the input of the next layer.

Examples

open all close all

Basic Examples  (2)

Insert a layer at the end of a chain:

Insert a named layer in the middle of a chain:

Possible Issues  (1)

When inserting a layer into a chain containing named layers, the key must not already exist:

Wolfram Research (2018), NetInsert, Wolfram Language function, https://reference.wolfram.com/language/ref/NetInsert.html.

Text

Wolfram Research (2018), NetInsert, Wolfram Language function, https://reference.wolfram.com/language/ref/NetInsert.html.

CMS

Wolfram Language. 2018. "NetInsert." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NetInsert.html.

APA

Wolfram Language. (2018). NetInsert. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetInsert.html

BibTeX

@misc{reference.wolfram_2025_netinsert, author="Wolfram Research", title="{NetInsert}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/NetInsert.html}", note=[Accessed: 06-January-2026]}

BibLaTeX

@online{reference.wolfram_2025_netinsert, organization={Wolfram Research}, title={NetInsert}, year={2018}, url={https://reference.wolfram.com/language/ref/NetInsert.html}, note=[Accessed: 06-January-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /