Skip to content
/ goml Public

Neural Networks from scratch in Go (standard library only)

Notifications You must be signed in to change notification settings

vtech6/goml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 

Repository files navigation

goml

Neural Networks from scratch in Go (standard library only)

Limitations:

  • No external libraries or modules
  • For simplicity, I limit the input shape to (1,x)

Goal:

  • Multilayer Perceptron (done)
  • Binary classification (done)
  • Support for multiple outputs (Multiple classification) (halted)
  • Visualization (in progress)

Current status:

  • Define basic data types (Input, Neuron, Layer)
  • Calculate neuron outputs [type: (1,x) array of weight*input+bias]
  • Define gradient methods and neural structure (heavily inspired by Karpathy's video)
  • Backpropagate and train for k steps
  • Produce and validate output
  • More activation functions (Sigmoid and ReLU)
  • Binary crossentropy

Goml Visualizer (in progress):

goml-visualizer

The Goml Visualizer was written using Wails with React in Typescript for the frontend. The gif above shows the test mode, which allows you to browse your test set and see which values were correctly predicted by the model.

References and inspiration:

How to run

  • Make sure you have a valid Go installation by running go version
  • Clone the repo
  • Run with go run .
  • The network parameters can be tweaked inside the lib/network/run.go file. Neuron activation functions can be found under lib/network/neuron.go and the engine blocks can be found under lib/network/value.go.