Skip to content

Commit

Permalink
Merge c2d670b into 7b90e8c
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmang committed Feb 10, 2021
2 parents 7b90e8c + c2d670b commit 80111b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,6 +29,7 @@ cudamodules.go
/vendor

# Example files
*.dot
examples/convnet/tmp.dot
examples/iris/cmd/theta.bin
examples/iris/theta.bin
Expand Down
4 changes: 2 additions & 2 deletions example_concurrent_training_test.go
Expand Up @@ -80,7 +80,7 @@ func (t *concurrentTrainer) train(x, y Value, costChan chan cost, wg *sync.WaitG
func trainEpoch(bs []batch, ts []*concurrentTrainer, threads int) {
// costs := make([]float64, 0, len(bs))
chunks := len(bs) / len(ts)
for chunk := 0; chunk < chunks; chunk++ {
for chunk := 0; chunk <= chunks; chunk++ {
costChan := make(chan cost, len(bs))

var wg sync.WaitGroup
Expand Down Expand Up @@ -149,7 +149,7 @@ func prep() (x, y Value, bs []batch) {
}

func concurrentTraining(xV, yV Value, bs []batch, es int) {
threads := runtime.GOMAXPROCS(-1) // reserve one thread for the CPU locked thread
threads := runtime.NumCPU()

ts := make([]*concurrentTrainer, threads)
for chunk := 0; chunk < threads; chunk++ {
Expand Down

0 comments on commit 80111b4

Please sign in to comment.