Documentation ¶
Overview ¶
Neural Network Helper package. Create and Load Neural Network from file or string. Read CSV files and convert its values from string to float
Index ¶
- func Create(inputCount, hiddenCount, outputCount int, regression bool, ...)
- func CsvToFloat(in [][]string) (out [][]float64, err error)
- func MaxFloatPosition(in []float64) int
- func ReadCsv(filePath string) (out [][]float64, err error)
- func ReadCsvFile(filePath string) ([][]string, error)
- func TimeToFloat(time string) (out float64, err error)
- type NeuralNetwork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(inputCount, hiddenCount, outputCount int, regression bool, inpupCsv, targetCsv, resultNN string, print ...bool)
Create Neural Network
func CsvToFloat ¶
CsvToFloat convert string csv array to float
func MaxFloatPosition ¶ added in v0.0.3
MaxFloatPosition return position of maximum weight value in float array, or -1 if array is empty
func ReadCsvFile ¶
ReadCsvFile read csv file and return string array
func TimeToFloat ¶
TimeToFloat convert string time of day to float value
Types ¶
type NeuralNetwork ¶
type NeuralNetwork struct {
*gonn.NeuralNetwork
}
Neural Network
func LoadFromString ¶
func LoadFromString(nnstrig string) *NeuralNetwork
Load neural network from string
func (*NeuralNetwork) Answer ¶
func (nn *NeuralNetwork) Answer(in ...float64) (out []float64)
Get answer from neural network (get weight array), return output array
func (*NeuralNetwork) AnswerToHuman ¶ added in v0.0.3
func (nn *NeuralNetwork) AnswerToHuman(out []float64, human []string) (string, int)
AnswerToHuman translate nn answer to human answer, return human string value and index in output array
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
sam01
Example sam01 description: The task of this neural network is to decide what the game character should do, based on 3 parameters: - Amount of health (from 1 to 100) - The presence of weapons - Number of enemies Depending on the outcome, one of the following decisions may be taken: - Attack - Steal - Run away - Nothing to do Examples for traning: Health Weapons The enemies Decision 50 1 1 Attack 90 1 2 Attack 80 0 1 Attack 30 1 1 Steal 60 1 2 Steal 40 0 1 Steal 90 1 7 Run away 60 1 4 Run away 10 0 1 Run away 60 1 0 Nothing to do 100 0 0 Nothing to do
|
Example sam01 description: The task of this neural network is to decide what the game character should do, based on 3 parameters: - Amount of health (from 1 to 100) - The presence of weapons - Number of enemies Depending on the outcome, one of the following decisions may be taken: - Attack - Steal - Run away - Nothing to do Examples for traning: Health Weapons The enemies Decision 50 1 1 Attack 90 1 2 Attack 80 0 1 Attack 30 1 1 Steal 60 1 2 Steal 40 0 1 Steal 90 1 7 Run away 60 1 4 Run away 10 0 1 Run away 60 1 0 Nothing to do 100 0 0 Nothing to do |
sam02
Example sam02 description: The task of this neural network is to decide what human time of day is selected in input parameter: - time of day in 24hour time fromat: 11:30 or 22:30, etc.
|
Example sam02 description: The task of this neural network is to decide what human time of day is selected in input parameter: - time of day in 24hour time fromat: 11:30 or 22:30, etc. |
sam03
Example sam03 description: Minus by Minus give Plus Input parameters: - first float parameter - second float parameter Output parameters: - result is Plus - result is Minus
|
Example sam03 description: Minus by Minus give Plus Input parameters: - first float parameter - second float parameter Output parameters: - result is Plus - result is Minus |
Click to show internal directories.
Click to hide internal directories.