Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:58:16+00:00 2026-05-31T10:58:16+00:00

I am creating a neural network using MATLAB (version specified in title). After reading

  • 0

I am creating a neural network using MATLAB (version specified in title).

After reading the documentation and research on the internet, I am still confused as to whether net.numLayers includes the input layer.

In other words, if I want to create a 3-Layer neural network as follows:

Input Layer – Hidden Layer – Output Layer

should I specify

net.numLayers = 3 or net.numLayers = 2?

I am confused because there is a command net.inputs{i}.range where i specifies the index on the input layer. May I remind you that i is “0” if it does not exist, otherwise it should be a positive integer. (Please refer to the documentation for more details)

However many tutorials on the internet which seem reliable are making me think otherwise:

http://www-cs.ccny.cuny.edu/~csolb/CscI1900/xor.htm
http://web.eecs.umich.edu/~someshs/nn/matlab_nn_starter.htm

If you have a look at the links provided, you will realize that they build a neural network for the XOR function. I am aware that the version of MATLAB may be different, however most of the commands are the same, otherwise in the newer version there is different syntax for the equivalent functionality. In both tutorials the number of layers specified is 2 (for hidden and output layer), but the second tutorial makes use net.layers{1}.transferFcn = 'logsig'; where “1” would definitely be referring to the hidden layer.

If someone could clarify this it would be very helpful.

I look forward to reading some answers. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:58:18+00:00Added an answer on May 31, 2026 at 10:58 am

    No it does not include the input layer.

    Here is a trick, after you have created your network (say, net=feedforwardnet(10), where the 10 is the size of your input layers). You could type view(net) to get a visual view of the networkenter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For my graduate research I am creating a neural network that trains to recognize
For my university project I am creating a neural network that can classify the
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
Creating the closure is easy but using it is confusing for me. Here is
creating 20 viewcontrollers and calling them one after the other from the mainviewcontroller as
I'm not looking for a Neural Networks library, since I'm creating new kinds of
Creating a zip file using Send To -> Compressed folder excludes .hg folder on
Creating My Windows Form Application and using ADO.Net as Data Access layer and SQL
Creating a simple UI using MS Access, hoping to do minimal actual coding (actually
Creating an object and giving ownership to a container using a unique_ptr is no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.