top
(README.md)
go-neural
==============

# Install

```
  go get github.com/NOX73/go-neural
  go get github.com/NOX73/go-neural/persist
  go get github.com/NOX73/go-neural/learn
```

# Neural Network

Create new network:

```go

  import "github.com/NOX73/go-neural"

  //...

  // Network has 9 enters and 3 layers 
  // ( 9 neurons, 9 neurons and 4 neurons).
  // Last layer is network output.
  n := neural.NewNetwork(9, []int{9,9,4})
  // Randomize sypaseses weights
  n.RandomizeSynapses()
  
  result := n.Calculate([]float64{0,1,0,1,1,1,0,1,0})
  
```

# Persist network

Save to file:

```go
  import "github.com/NOX73/or-neural/persist"

  persist.ToFile("/path/to/file.json", network)
```

Load from file:

```go
  import "github.com/NOX73/go-neural/persist"

  network := persist.FromFile("/path/to/file.json")
```

# Learning

```go
  import "github.com/NOX73/go-neural/learn"

  var input, idealOutput []float64
  // Learning speed [0..1]
  var speed float64

  learn.Learn(network, in, idealOut, speed)
```

You can get estimate of learning quality:

```go
  e := learn.Evaluation(network, in, idealOut)
```

# Engine 

For concurrent learn, calculate & dump neural network.

```go
	network := neural.NewNetwork(2, []int{2, 2})
	engine := New(network)
	engine.Start()

	engine.Learn([]float64{1, 2}, []float64{3, 3}, 0.1)

	out := engine.Calculate([]float64{1, 2})
```

# Live example

Dirty live example: [https://github.com/NOX73/go-neural-play]

Imported by 33 package(s)

  1. github.com/AlexeySpiridonov/go-neural-play/play
  2. github.com/ArchieT/go-neural-play/play
  3. github.com/KopfKrieg/go-neural-play/play
  4. github.com/KopfKrieg/go-neural/engine
  5. github.com/KopfKrieg/go-neural/learn
  6. github.com/KopfKrieg/go-neural/persist
  7. github.com/NOX73/go-neural-play/play
  8. github.com/NOX73/go-neural/engine
  9. github.com/NOX73/go-neural/learn
  10. github.com/NOX73/go-neural/persist
  11. github.com/PeterCxy/gotgbot/blackgun/rich
  12. github.com/Talos208/jongGo
  13. github.com/baek0429/go-neural/engine
  14. github.com/baek0429/go-neural/learn
  15. github.com/baek0429/go-neural/persist
  16. github.com/jbowles/go-neural/engine
  17. github.com/jbowles/go-neural/lern
  18. github.com/jbowles/go-neural/persist
  19. github.com/leonardaustin/go-neural/engine
  20. github.com/leonardaustin/go-neural/learn
  21. github.com/leonardaustin/go-neural/persist
  22. github.com/mathiask/neurogo/gonet
  23. github.com/mathiask/neurogo/test
  24. github.com/r0fls/go-neural/engine
  25. github.com/r0fls/go-neural/learn
  26. github.com/r0fls/go-neural/persist
  27. github.com/vornet/go-neural/engine
  28. github.com/vornet/go-neural/learn
  29. github.com/vornet/go-neural/persist
  30. github.com/wjessop/go-neural-play/play
  31. github.com/wjessop/go-neural/engine
  32. github.com/wjessop/go-neural/learn
  33. github.com/wjessop/go-neural/persist

Test imports 1 package(s)

  1. launchpad.net/gocheck