You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Markus Bergholz abbe64202d add derivative of tanh activation 1 year ago
.gitignore Initial commit 1 year ago
LICENSE Initial commit 1 year ago
README.md update README 1 year ago
mUnittest.m add unittest framework 1 year ago
octann.m add derivative of tanh activation 1 year ago
test_octann.m replace input with data_input 1 year ago

README.md

octann

Octann is a minimal and simple library for training and using feedforward artificial neural networks (ANN) in GNU Octave and Matlab.

usage

  • init a neural network
number_of_inputs = 2;
number_of_neurons_in_hidden_layer = 3;
number_of_outputs = 1;
nn = octann (number_of_inputs, number_of_neurons_in_hidden_layer, number_of_outputs);
nn.repeat_training
ans =  1

The default repeat_training is 1. You can change the value in the object itself or change while init the network.

nn = octann (number_of_inputs, number_of_neurons_in_hidden_layer, number_of_outputs, 'repeat_training', 5000);
nn.repeat_training
ans =  5000
  • train the network
input = [0, 0; 0, 1; 1, 0; 1, 1];
desired_output = [0; 1; 1; 0];
learning_rate = .1;
nn = nn.train(input, desired_output, learning_rate);

  • run the network
nn.run(input)
ans =

   0.0422092
   0.9819420
   0.9819409
   0.0049450

unittesting

octave:1> mUnittest('test_octann')


 mUnittest: test_octann 


1 	 ✓ 	 CLASSDEF FILE:learn xor must be 0
2 	 ✓ 	 CLASSDEF FILE:learn xor must be 1
3 	 ✓ 	 CLASSDEF FILE:learn xor must be 1
4 	 ✓ 	 CLASSDEF FILE:learn xor must be 0
5 	 ✓ 	 CLASSDEF FILE:learn AND must be 0
6 	 ✓ 	 CLASSDEF FILE:learn AND must be 0
7 	 ✓ 	 CLASSDEF FILE:learn AND must be 0
8 	 ✓ 	 CLASSDEF FILE:learn AND must be 1

 PASSED 8 OF 8 


status / limitation

  • early development status
  • only sigmoid is available as activation function
  • supports only one hidden layer

Inspiration