not clear in example

44 views
Skip to first unread message

Maksim Shcherbakov

unread,
Aug 1, 2014, 6:36:38 AM8/1/14
to py-ne...@googlegroups.com
Hi

It's not clear to me: hereby the extract from the example published here: https://code.google.com/p/neurolab/

 >>> # Create network with 2 inputs, 5 neurons in input layer and 1 in output layer
        >>> net = nl.net.newff([[-0.5, 0.5], [-0.5, 0.5]], [5, 1])


Two questions:
  1. It seems 5 neurons in the hidden layer?
  2. len(net.layers) gives '2'. it means 'newff' doesn;t count input layer?
Thanks for help, 

Maxim

Mark Vicuna

unread,
Aug 1, 2014, 7:25:45 PM8/1/14
to py-ne...@googlegroups.com
Hi,
  This is just a guess.

  The input layer connects to layer 0 so it doesn't need any inputs or outputs so it can ignored as a seperate layer.
  
  Look at the example on modifying the weights and biases and look at the Layer class. You'll see the inputs represented in the data.

  net.layers[0].np['w'] should have an array of a shape (2,5) i.e. 2 inputs connected to 5 nodes.

Evgeny Zuev

unread,
Aug 2, 2014, 5:48:49 AM8/2/14
to py-ne...@googlegroups.com
 Не понял, а что вы ожидали получить 
>>>  len(net.layers)

от 2х слойной сети?

Maksim Shcherbakov

unread,
Aug 7, 2014, 4:08:27 AM8/7/14
to py-ne...@googlegroups.com
Mark, thanks

суббота, 2 августа 2014 г., 3:25:45 UTC+4 пользователь Mark Vicuna написал:

Maksim Shcherbakov

unread,
Aug 7, 2014, 4:11:13 AM8/7/14
to py-ne...@googlegroups.com
Евгений, 

получается в вашей реализации входной слой = скрытый слой? Это мне и было непонятно. Спасибо за разъяснение.



суббота, 2 августа 2014 г., 13:48:49 UTC+4 пользователь Evgeny Zuev написал:
Reply all
Reply to author
Forward
0 new messages