pythonmachine-learningneural-networkevolutionary-algorithmneuralfit

How to disable status after each epoch in NeuralFit?


I use the neuralfit package to evolve a neural network, but am not sure how I can avoid printing completely. I would simply like to plot the history after training. I currently have:

import neuralfit
import numpy as np

x = np.asarray([[0],[1]])
y = np.asarray([[1],[0]])
model = neuralfit.Model(1,1)

model.compile('alpha', loss='mse')
model.evolve(x,y)

But it prints

...
Epoch 96/100 - 1/1 [==============================] - 3ms 1ms/step - loss: 0.000000    
Epoch 97/100 - 1/1 [==============================] - 3ms 1ms/step - loss: 0.000000    
Epoch 98/100 - 1/1 [==============================] - 4ms 2ms/step - loss: 0.000000
Epoch 99/100 - 1/1 [==============================] - 3ms 1ms/step - loss: 0.000000    
Epoch 100/100 - 1/1 [==============================] - 4ms 2ms/step - loss: 0.000000

Solution

  • From the NeuralFit documentation in model.evolve(), you can use the 'verbose' parameter.

    model.evolve(x,y,verbose=0)