alagez 0 Newbie Poster

Hi there,
I am bit confused about this. I am doing assignment on neuron analysis by using python neurolab.

Hidden layer Architecture
1 [9-1-1] // 9=input nodes 1=hidden nodes 1=output
1 [9-2-1] // 9="" 2=hidden nodes 1=output
1 [9-3-1]
1 [9-4-1]
1 [9-5-1]
1 [9-6-1]

from the description above. I will use neurolab to justify which architecture makes the error reduce much.
I have modified codes that already have to do Multilayer Feed forward Network. for example architecture number 3
which use 3 nodes in hidden layer. IS IT CORRECT IF I PLACE LIKE THIS???

import neurolab as nl
import numpy as np

# Create train samplesy = np.linspace(start, stop, num=num, endpoint=endpoint)
x = np.linspace(-9, 9, 20)
y = np.sin(x) * 0.5

size = len(x)

inp = x.reshape(size,1)
tar = y.reshape(size,1)

# Create network with 2 layers and random initialized
net = nl.net.newff([[-9.0, 9.0]],[9, 3, 1])   ##PLEASE LOOK THIS: IS IT CORRECT IF I PLACE LIKE THIS?????

# Train network
error = net.train(inp, tar, epochs=501, show=10, goal=0.02)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.