Skip to content
forked from therfoo/therfoo

An embedded deep learning library for Go.

License

Notifications You must be signed in to change notification settings

cam-per/therfoo

 
 

Repository files navigation

GoDoc Go Report Card

Therfoo

An easy to use machine learning library written in pure Golang. The API is inspired by Keras, however, the library is written from scratch and does not rely on a different library for computations.

Example

package main

import (
	"github.com/therfoo/datasets/basic"

	"github.com/therfoo/therfoo/layers/dense"
	"github.com/therfoo/therfoo/model"
	"github.com/therfoo/therfoo/optimizers/sgd"
	"github.com/therfoo/therfoo/tensor"
)

func main() {
	m := model.New(
		model.WithBinaryAccuracy(),
		model.WithCrossEntropyLoss(),
		model.WithEpochs(25),
		model.WithInputShape(tensor.Shape{2}),
		model.WithOptimizer(
			sgd.New(sgd.WithBatchSize(1), sgd.WithLearningRate(0.05)),
		),
		model.WithTrainingGenerator(basic.New()),
		model.WithValidatingGenerator(basic.New()),
		model.WithVerbosity(true),
	)

	m.Add(4, dense.New(dense.WithReLU()))
	m.Add(1, dense.New(dense.WithSigmoid()))

	m.Compile()

	m.Fit()

}

Contribution

Contributions are more than welcome, fork, create a PR, get a +1, rebase and merge.

About

An embedded deep learning library for Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%