(model,X,Y)
| 15 | BS = getenv("BS", 2) |
| 16 | |
| 17 | def train_one_step(model,X,Y): |
| 18 | params = get_parameters(model) |
| 19 | pcount = 0 |
| 20 | for p in params: |
| 21 | pcount += np.prod(p.shape) |
| 22 | optimizer = optim.SGD(params, lr=0.001) |
| 23 | print("stepping %r with %.1fM params bs %d" % (type(model), pcount/1e6, BS)) |
| 24 | st = time.time() |
| 25 | train(model, X, Y, optimizer, steps=1, BS=BS) |
| 26 | et = time.time()-st |
| 27 | print("done in %.2f ms" % (et*1000.)) |
| 28 | |
| 29 | def check_gc(): |
| 30 | if Device.DEFAULT == "CL": |
no test coverage detected
searching dependent graphs…