Skip to content

TriTranDev/neuralnetwork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

neuralnetwork

What is it?

This is back-propagation neural network for only one hidden layer. I will update it for multiple hidden layer later.

Installation

Use go get to install this package

go get github.com/TriTranDev/neuralnetwork

Usage

Please check Example.
first create config

config := neuralnetwork.NeuralNetConfig{
		InputNeurons:  inputNumber,
		OutputNeurons: outputNumber,
		HiddenNeurons: hiddenNumber,
		NumEpochs:     5000,
		LearningRate:  0.01,
	}

inputNumber: lenght of your input put data
outputNumber: lenght of your out put data
hiddenNumber: lenght of your hidden you want to use example 10,20,100....
NumEpochs: number of loops when you train the neural
LearningRate: it use for training neural, check google for more information.

inputParam := neuralnetwork.InputParamNetwork{
		Config:       config,
		CountRow:     rowInput,
		CountInput:   config.InputNeurons,
		CountOutput:  config.OutputNeurons,
		InputData:    input.RawMatrix().Data,
		OutputData:   labels.RawMatrix().Data,
		CountRowTest: rowTest,
		TestData:     testInputs.RawMatrix().Data,
		LabelData:    testLabels.RawMatrix().Data,
	}

this is param for build the network

result := neuralnetwork.ProcessNeural(inputParam)
	fmt.Println("Correlation Coefficient ", result.CorrelationValue)

call ProcessNeural to build the network and check the Correlation Coefficient

Correlation Coefficient  0.9903012888981333

The result look so good. It maybe different in your version.

Note

Maybe prepare your data if you use different data format

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages