Questions tagged [neurolab]

For questions related to library of basic neural networks algorithms and learning algorithms for Python.

should be used on questions related to library of basic neural networks algorithms and learning algorithms for

Sample

import neurolab as nl

# Create network
net = nl.net.newff([[-1, 1]], [5, 1])

# Change train function
net.trainf = nl.train.train_bfgs

# Change init function
for l in net.layers:
    l.initf = nl.init.InitRand([-2., 2.], 'wb')

# new inicialized
net.init()

# Change error function
net.errorf = nl.error.MSE()

# Change weight of input layer
net.layers[0].np['w'][:] = 0.0
net.layers[0].np['w']
# => array([[ 0.],
#           [ 0.],
#           [ 0.],
#           [ 0.],
#           [ 0.]])

# Change bias of input layer
net.layers[0].np['b'][:] = 1.0
net.layers[0].np['b']
# => array([ 1.,  1.,  1.,  1.,  1.])

# Save network in file
net.save('test.net')

# Load network
net = nl.load('mynetwork.net')

References

13 questions
4
votes
1 answer

How would I install numpy library on Coding Ground?

I tried to install neurolab, termcolor libraries on Coding Ground for python into the working folder using pip install --target=. neurolab pip install --target=. termcolor and they both worked. But when I tried: pip install --target=. numpy it…
Tin Tran
  • 6,194
  • 3
  • 19
  • 34
2
votes
2 answers

Time series forecast with recurrent Elman network in neurolab

I use the Elman recurrent network from neurolab to predict a time series of continuous values. The network is trained from a sequence such that the input is the value at index i and the target is the value at index i+1. To make predictions beyond…
2
votes
0 answers

Neurolab randomly fails to train

I set up a neural network using the neurolab package for Python 2.7 as follows (loosely based on the sample at https://pythonhosted.org/neurolab/ex_newff.html). Normally, when training occurs (the line with net.train()), information is printed to…
Alphalpha
  • 21
  • 2
1
vote
1 answer

ImportError: No module named neurolab

I try to import nuurolab using this code: import neurolab as nl But it gives this error : ModuleNotFoundError: No module named 'neurolab' Then I try to install neurolab using sudo pip3 install neurolab Then this message shows : Requirement…
Gihan Chathuranga
  • 442
  • 10
  • 16
1
vote
0 answers

Convert Matlab code into Python using Neural Network Library

I am trying to convert this code of matlab in python... parpool X = power; T = coi; net = feedforwardnet(10); net = train(net,X,T,'useParallel','no','showResources','yes'); Y = net(X); figure; plot(X,T,'o',X,Y,'x'); Here is Target File…
Uzair
  • 231
  • 4
  • 18
1
vote
1 answer

Getting Assertion Error when training data in neural network in python?

I have a file BCICIV1bAF3.dat which contain data. The file size is 20x1 This is my code... In newff function the range i decide based on Min/Max but i dont know how to decide the other parameters. How much hidden layer do i want etc. import numpy…
Uzair
  • 231
  • 4
  • 18
1
vote
1 answer

Showing Neurolabs Weights/Bias for each node?

Is there a simple way to show the bias or weight for each property that I feed into a ANN developed using neurolab after it has already been trained?
DrTchocky
  • 515
  • 1
  • 5
  • 14
0
votes
0 answers

python Neurolab - How Can I get parameters of rectangle?

Could anyone explain to me how to use this library: http://code.google.com/p/neurolab/ to create a Neural Network that follows these rules: A Neural network Neurolab must calculate the parameters of the rectangle Input: The lengths of two…
0
votes
0 answers

How can i change the activation function of the nodes in hidden layer using neurolab?

Hello dear users of neuorlab, I want to change the activation function nodes of the hidden layer to ReLU and keep Linear function in output nodes import numpy as np import neurolab as nl # Create train samples input = np.random.uniform(-1, 1, (5,…
0
votes
0 answers

Can't train dataset with neurolab

I try to use neurolab to classyfing dataset, but I got error 'AssertionError', for now my code is names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'] dataset = pandas.read_csv('./glass.data', sep= ',', names = names) # dataset =…
Lukasz
  • 63
  • 8
0
votes
1 answer

Building a Vector quantizer with neurolab receiving an error

Below is the code I am trying to execute, and the following error message I am receiving. Thank your for the assistance in advance. ----> 6 nn = nl.net.newlvq(nl.tool.minmax(data), num_input_neurons, weights) # Define a neural network with 2 layers:…
QAA
  • 81
  • 1
  • 5
0
votes
0 answers

do neural network in/output need to be [-1:1]?

I'm curious if neural networks (or neurolab in particular) needs the target/input data to be [-1:1]? I'm trying to train a network to predict water evaporation from my kitchen garden, given these inputs: temperature (C), barometer (mbar),…
-1
votes
1 answer

How to get final Neural Network error with NeuroLab?

I already know how to train a neural net with NeuroLab and get the error every X epochs, but I want to get the final error after training the net. nn = nl.net.newff([[min_val, max_val]], [40, 26, 1]) # Gradient descent nn.trainf =…