GithubHelp home page GithubHelp logo

justincpresley / go-bareml Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 18 KB

go-bareml: A bare-bones, from scratch, no external dependency, entirely Go-based Machine Learning Library which fully implements an Artificial Neural Network.

License: GNU Lesser General Public License v2.1

Go 100.00%
bare-metal go golang golang-library golang-package layer machine-learning matrix-multiplication neural-network neural-networks

go-bareml's Introduction

A Bare-bones Machine Learning Library in Go

This Go library provides an API which allows for basic machine learning capability. This library contains no external dependencies, is completely go-based, and fully implements a neural network.

I followed along with a C++ version while making this library. Links to that version are below.

Links: Repository - Videos

Documentation / Usage

The full API documentation is available on pkg.go.dev.

Installation

go get -u github.com/justincpresley/go-bareml

Or use your favorite golang vendoring tool.

Example

package main

import (
	"fmt"

	"github.com/justincpresley/go-bareml"
)

func main() {
	var input = []float64{0.2, 0.5, 0.1}
	var target = []float64{0.2, 0.5}

	// The first int must be len(input) and the last int must be len(target)
	var topology = []int{3, 2, 10, 2}

	var (
		learningRate float64 = 0.05
		momentum     float64 = 1
		bias         float64 = 1
	)

	neuralnet := bareml.NewNeuralNetwork(topology)

	fmt.Printf("Begin Training...\n")
	for i := 0; i < 1000; i++ {
		neuralnet.Train(input, target, bias, learningRate, momentum)
		fmt.Printf("Epoch: %d | Error %f\n", i, neuralnet.TotalError())
	}
}

Notes

This was a learning project for me to get comfortable with Go. I originally aimed to improve the design and add additional features / models. However, I am now unable to maintain this library due to more pressing work in networking and cybersecurity. Feel free to fork the repository and build off it though!

go-bareml's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.