如何使用神经网络建立基本的Go项目?

I am super new go Go and need some help setting things up. First, the $GOPATH. It seems that all of my go projects should be in the same place on my machine? So I have that set:

$ echo $GOPATH
/sites/gopath

Inside, I set up the folders recommended:

$ ls -a /sites/gopath
.   ..  bin pkg src

Inside src, I have a folder called github.com, which has a folder in it called shamoons which has a folder in it called go-ann-test.

Inside that, I have a folder called autompg and inside that, I have a file called autompg.go.

Phew! That's a lot of set up for a project! But I'm going assume that I'm either doing it wrong or that it's somehow worth it.

In my autompg.go, I have:

package main

import (
  "fmt"
  "github.com/fxsjy/gonn"
)

func main() {
  nn := gonn.DefaultNetwork(2,3,1,true)
  inputs := [][]float64{
    []float64{0,0},
    []float64{0,1},
    []float64{1,0},
    []float64{1,1},
  }

  targets := [][]float64{
    []float64{0},//0+0=0
    []float64{1},//0+1=1
    []float64{1},//1+0=1
    []float64{2},//1+1=2
  }

  nn.Train(inputs,targets,1000)

  for _,p := range inputs{
    fmt.Println(nn.Forward(p))
  }
}

And when I type go install autompg from my go-ann-test folder, I get:

$ go install autompg 
can't load package: package autompg: cannot find package "autompg" in any of:
    /usr/local/Cellar/go/1.4.1/libexec/src/autompg (from $GOROOT)
    /sites/gopath/src/autompg (from $GOPATH)

So what am I doing wrong and how can I properly set up the project to accept the external package?

go install autompg from my go-ann-test folder:

No, you need to go to the go-ann-test/autompg folder, and there type go install

That will compile autompg.go into an executable autompg and put in in your $GOPATH/bin.

Finally, you can add, commit and push to https://github.com/shamoons/go-ann-test.

The OP Shamoon adds in the comments:

I get

 autompg.go:35:3: no buildable Go source files in /sites/gopath/src/github.com/fxsjy/gonn

That means a go get github.com/fxsjy/gonn is needed to import and compile github.com/fxsjy/gonn first.

Considering that imported repo structure https://github.com/fxsjy/gonn, it actually needed:

cd /sites/gopath/src/github.com/fxsjy/gonn/gonn
go install 

That means the actual import was:

import github.com/fxsjy/gonn/gonn