How to train this using one hidden layer neural network?

64 views
Skip to first unread message

Shenghan Gao

unread,
Oct 19, 2014, 1:13:47 AM10/19/14
to py-ne...@googlegroups.com

Here is my code:


import neurolab as nl
import numpy as np
 
inputs
= np.eye(8)
inp
= inputs[0]
inp
= inp.reshape(1,8)
inputs
= np.delete(inputs , 5, 0)


net
= nl.net.newff([[0, 1]] * 8, [3, 8], transf=[nl.trans.LogSig()] * 2)
error
= net.train(inputs, inputs)

# inp is [1, 0, 0, 0, 0, 0, 0, 0]
out =net.sim(inp)


But the out put is pretty terrible. 

Is there have something wrong?

Evgeny Zuev

unread,
Nov 16, 2014, 11:53:02 PM11/16/14
to py-ne...@googlegroups.com
I think your train samples is not correct. Add more data

What you want this?
>>> train(inputs, inputs)

Shenghan Gao

unread,
Nov 17, 2014, 11:28:40 AM11/17/14
to py-ne...@googlegroups.com
According to the problem, the input and the output is the same. So I just use the input as output to train the network. 
After I send the email. I tried other training algorithms and finds that backpropagation could output the result I want. 
Are you the owner of this project? I think some part of document has English syntax errors. How could I contribute to this project? 

--
Вы получили это сообщение, поскольку подписаны на одну из тем в группе "NeuroLab".
Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/py-neurolab/TaRGTVtrEN4/unsubscribe.
Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес py-neurolab...@googlegroups.com.
Чтобы настроить другие параметры, перейдите по ссылке https://groups.google.com/d/optout.

Shenghan Gao

unread,
Nov 17, 2014, 11:31:01 AM11/17/14
to py-ne...@googlegroups.com
train_rprop algorithm could give me best output.

On Mon Nov 17 2014 at 11:28:41 AM Shenghan Gao <gaosheng...@gmail.com> wrote:
According to the problem, the input and the output is the same. So I just use the input as output to train the network. 
After I send the email. I tried other training algorithms and finds that backpropagation could output the result I want. 
Are you the owner of this project? I think some part of document has English syntax errors. How could I contribute to this project? 

On Sun Nov 16 2014 at 11:53:02 PM Evgeny Zuev <zue...@gmail.com> wrote:
I think your train samples is not correct. Add more data

What you want this?
>>> train(inputs, inputs)

--
Вы получили это сообщение, поскольку подписаны на одну из тем в группе "NeuroLab".
Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/py-neurolab/TaRGTVtrEN4/unsubscribe.
Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес py-neurolab+unsubscribe@googlegroups.com.

Evgeny Zuev

unread,
Nov 17, 2014, 11:44:53 PM11/17/14
to py-ne...@googlegroups.com
Ок! I added you to project members. Now you may make a commits. Use svn (https://code.google.com/p/neurolab/source/checkout):

Make changes and commit result!

Regards!

17 ноября 2014 г., 21:30 пользователь Shenghan Gao <gaosheng...@gmail.com> написал:
Вы получили это сообщение, поскольку подписаны на группу "NeuroLab".
Чтобы отменить подписку на эту группу и больше не получать от нее сообщения, отправьте письмо на электронный адрес py-neurolab...@googlegroups.com.

Shenghan Gao

unread,
Nov 18, 2014, 12:22:15 AM11/18/14
to py-ne...@googlegroups.com
thank you!!!

Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес py-neurolab...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages