go-neural, 基于golang的神经网络实现

分享于 

2分钟阅读

GitHub

  繁體 雙語
Neural network implementation on golang
  • 源代码名称:go-neural
  • 源代码网址:http://www.github.com/NOX73/go-neural
  • go-neural源代码文档
  • go-neural源代码下载
  • Git URL:
    git://www.github.com/NOX73/go-neural.git
    Git Clone代码到本地:
    git clone http://www.github.com/NOX73/go-neural
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/NOX73/go-neural
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    go神经安装
    
     go get github.com/NOX73/go-neural
    
    
     go get github.com/NOX73/go-neural/persist
    
    
     go get github.com/NOX73/go-neural/learn
    
    
    
    
    神经网络

    创建新网络:

    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})
     
    保持网络

    存到文件:

    import"github.com/NOX73/or-neural/persist" persist.ToFile("/path/to/file.json", network)

    从 file: 加载

    import"github.com/NOX73/go-neural/persist"network:= persist.FromFile("/path/to/file.json")
    学习
    import"github.com/NOX73/go-neural/learn"varinput, idealOutput []float64// Learning speed [0..1]varspeedfloat64 learn.Learn(network, in, idealOut, speed)

    你可以获得学习质量的估计:

    e:= learn.Evaluation(network, in, idealOut)
    引擎

    用于并发学习的&转储神经网络。

    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})
    实时示例

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


    相关文章