Module NeuroController
[hide private]
[frames] | no frames]

Module NeuroController

source code

Example controller which uses a prelearned neural network for controlling the inverted pendulum.

Classes [hide private]
  NeuroController
Neural net controller.
Functions [hide private]
 
transpose(matrix)
transpose a matrix
source code
 
vectormatrixmultiply(a, b)
multiply vector with matrix.
source code
 
matrixmatrixmultiply(a, b)
multiply two matrices.
source code
 
applyfuncvector(f, vector)
apply function to all elements of vector
source code
 
applyfuncmatrix(f, matrix)
apply function to all elements of matrix
source code
 
prepareWeightMatrices(weights)
build array and transpose
source code
 
makeVector(data)
build vector from list
source code
 
sigmoid(x)
sigmoidal function.
source code
 
feedForwardStep(data, weights)
Feed forward data from one layer to the next through the weight matrix.
source code
Variables [hide private]
  input_hidden1 = prepareWeightMatrices(([0, 0, 0, 0, 0], [1.352...
weights from input layer to hidden layer 1
  hidden1_hidden2 = prepareWeightMatrices(([0, 0, 0, 0, 0, 0, 0,...
weights from hidden layer 1 to hidden layer 2
  hidden2_output = prepareWeightMatrices(([2.6952314,-2.1971807,...
weights from hidden layer 2 to output layer 2
  arctanh_0_8 = 1.098612
scaling factor for in-/outputs
Function Details [hide private]

vectormatrixmultiply(a, b)

source code 

multiply vector with matrix. b must be transposed

matrixmatrixmultiply(a, b)

source code 

multiply two matrices. b must be transposed


Variables Details [hide private]

input_hidden1

weights from input layer to hidden layer 1

Value:
prepareWeightMatrices(([0, 0, 0, 0, 0], [1.3523004,-67.2762222,-2.7101\
681,-1.2252374,-0.1924101], [3.5358984,-3.0979257, 11.8105240,-2.04001\
95,-5.6440673], [2.2998035,-6.4394584,-0.4456880, 13.2240639,-1.941612\
4], [-5.3507094,-25.7565060,-0.8581331,-2.4438772, 0.3309670], [-11.85\
40325,-27.4872322,-0.4254195, 2.7986245, 0.8198755], [-2.3312118,-0.40\
25910,-2.0389884, 3.8539076, 3.2488785], [-14.8030014,-19.3887348,-2.1\
227808,-2.5157831,-1.3637272], [-21.9581738,-38.1970100,-0.7618715, 2.\
2844830, 1.3290895]))

hidden1_hidden2

weights from hidden layer 1 to hidden layer 2

Value:
prepareWeightMatrices(([0, 0, 0, 0, 0, 0, 0, 0, 0], [-0.2244532, 6.822\
6333, 5.7899127, 1.6202815, 8.7983570,-15.6285400, 3.5351822,-8.275008\
2,-6.9833350], [-14.1263733,-9.2765779, 12.6322460, 0.0562423,-7.27849\
58,-4.2336187, 6.9077992, 3.8148420,-4.8503165], [-1.7320144,-2.200586\
8,-0.0205769, 2.0873408, 3.7128136,-3.4949446, 2.3434448, 7.4144168,-9\
.0030613], [-13.3777761, 14.2169991, 6.5337262,-1.3075531,-8.6651535,-\
24.3653679, 2.9219866,-10.9699783,-7.3186345]))

hidden2_output

weights from hidden layer 2 to output layer 2

Value:
prepareWeightMatrices(([2.6952314,-2.1971807,-1.7768925,-1.1596987,-3.\
1659257],))