## Neural(fname)

Constructor

#### # new Neural(fname)

Create a artificial neural network.

Note: Neural module must be loaded by calling LoadLibrary("neural") before using!

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | file name of training data previously stored by Save()

See:
  - LoadLibrary()
  - Save()

# Methods

#### # Close()

free ressources of the neural network.

#### # Run(inp) → {Array.<number>}

Run the network on some input and get a response.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inp` | Array.<number> | DoubleArray | Input data. must contain at least the number of input values as specified when creating the ANN.

Returns:

The networks response to the input.

Type: Array.<number>

#### # Save(fname)

Store training data of the network to disk.

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | The file name.

#### # Train(inp, outp, rate)

Train the network with a single dataset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inp` | Array.<number> | DoubleArray | Input data. Must contain at least the number of input values as specified when creating the ANN.
`outp` | Array.<number> | DoubleArray | Expected output data. Must contain at least the number of output values as specified when creating the ANN.
`rate` | number | Learning rate (>0).

## Neural(inputs, num_hidden, hidden, outputs)

Constructor

#### # new Neural(inputs, num_hidden, hidden, outputs)

Create a artificial neural network.

Note: Neural module must be loaded by calling LoadLibrary("neural") before using!

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputs` | number | size of input layer
`num_hidden` | number | number of hidden layers
`hidden` | number | size of the hidden layers
`outputs` | number | size of output layer

See:
  - LoadLibrary()

# Methods

#### # Close()

free ressources of the neural network.

#### # Run(inp) → {Array.<number>}

Run the network on some input and get a response.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inp` | Array.<number> | DoubleArray | Input data. must contain at least the number of input values as specified when creating the ANN.

Returns:

The networks response to the input.

Type: Array.<number>

#### # Save(fname)

Store training data of the network to disk.

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | The file name.

#### # Train(inp, outp, rate)

Train the network with a single dataset.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inp` | Array.<number> | DoubleArray | Input data. Must contain at least the number of input values as specified when creating the ANN.
`outp` | Array.<number> | DoubleArray | Expected output data. Must contain at least the number of output values as specified when creating the ANN.
`rate` | number | Learning rate (>0).