Skip to content

Symulation

TakMashido edited this page Sep 8, 2017 · 1 revision

Symulation:

The class representation of network is Network:).

First you should read from disk previusly maked network. Use FileS.readNetwork(String fileName) ,or create weights data manualy in code(just float[layers][neurons][connections] array), choose what output function it should use(choose one from functions source package). to second option you have this constructors: -public Network(int inputNumber, float[][][] weights, Function function) -public Network(int inputNumber, float[][][] weights, Function function, boolean initializeOpenCL)

about initializeOpenCL bool search info there(I must add link).

when you have your network use simulate(float[] inputData) to simulate network.

Sample code:

I skiped class and method declaration lines

First option:

String fileName="yourNetwork";

Network network=FileS.readNetwork(fileName); //Load your network from disc

float[] inputData=new float[]{1,1}; System.out.println(input data);

Second option:

int inputNumber=2;

float[][][] weights=new float[1][2][2] float[0][0][0]=1; float[0][0][1]=2; float[0][1][0]=3; float[0][1][1]=4;

Function fuction=new Linear();

Network network=new Network(inputNumber,weights,function);

float[] inputData=new float[]{1,1}; System.out.println(network.simulate(inputData);

Clone this wiki locally