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?