I just had the following stack trace output, and I'm trying to be better about using it to debug
brendan:~/Documents/mygo$ go test nnet
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x78 pc=0x35420]
goroutine 18 [running]:
nnet.(*Net).seqLossAndDerivative(0x0, 0x2103897c0, 0x5, 0x3c, 0x2103d83c0, ...)
/Users/brendan/Documents/mygo/src/nnet/nnet.go:502 +0xb0
nnet.(*trainStruct).Compute(0x210312c60)
/Users/brendan/Documents/mygo/src/nnet/par.go:43 +0xc4
nnet.func·001()
/Users/brendan/Documents/mygo/src/nnet/par.go:112 +0x4c
created by nnet.(*Net).launchTrainWorkers
/Users/brendan/Documents/mygo/src/nnet/par.go:113 +0x564
goroutine 1 [chan receive]:
testing.RunTests(0x18a9f8, 0x223fe0, 0xb, 0xb, 0x1, ...)
/usr/local/go/src/pkg/testing/testing.go:434 +0x88e
testing.Main(0x18a9f8, 0x223fe0, 0xb, 0xb, 0x227580, ...)
/usr/local/go/src/pkg/testing/testing.go:365 +0x8a
main.main()
nnet/_test/_testmain.go:63 +0x9a
goroutine 12 [chan receive]:
nnet.(*Net).parLossAndDerivative(0x2102e4600, 0x21030b850, 0x2103d4a60, 0x4, 0x4, ...)
/Users/brendan/Documents/mygo/src/nnet/par.go:134 +0xb2
nnet.TestParLossAndDeriv(0x210312750)
/Users/brendan/Documents/mygo/src/nnet/nnet_test.go:625 +0x344
testing.tRunner(0x210312750, 0x2240b8)
/usr/local/go/src/pkg/testing/testing.go:353 +0x8a
created by testing.RunTests
/usr/local/go/src/pkg/testing/testing.go:433 +0x86b
goroutine 13 [select]:
nnet.(*trainStruct).Compute(0x210312c60)
/Users/brendan/Documents/mygo/src/nnet/par.go:41 +0x172
nnet.func·001()
/Users/brendan/Documents/mygo/src/nnet/par.go:112 +0x4c
created by nnet.(*Net).launchTrainWorkers
/Users/brendan/Documents/mygo/src/nnet/par.go:113 +0x564
goroutine 14 [select]:
nnet.(*trainStruct).Compute(0x210312c60)
/Users/brendan/Documents/mygo/src/nnet/par.go:41 +0x172
nnet.func·001()
/Users/brendan/Documents/mygo/src/nnet/par.go:112 +0x4c
created by nnet.(*Net).launchTrainWorkers
/Users/brendan/Documents/mygo/src/nnet/par.go:113 +0x564
... bunch more goroutines that look like 13 and 14
2) What does nnet.func·001() mean? The line it reports is close to (but not identical to) the launching of the goroutine. Is that just an identifier?
func (net *Net) seqLossAndDerivative(inputs, trueOutputs [][]float64, totalDeriv []float64, tmpMemory []float64) (totalLoss float64)
Looking at the pointers in the call to seqLossAndDerivative for goroutine 18, I see