move epochs

This commit is contained in:
Mike Innes 2018-03-05 22:56:22 +00:00
parent 5c7f856115
commit 5153cde847
2 changed files with 21 additions and 21 deletions

View File

@ -34,3 +34,24 @@ function train!(loss, data, opt; cb = () -> ())
cb() == :stop && break
end
end
"""
@epochs N body
Run `body` `N` times. Mainly useful for quickly doing multiple epochs of
training in a REPL.
```julia
julia> @epochs 2 println("hello")
INFO: Epoch 1
hello
INFO: Epoch 2
hello
```
"""
macro epochs(n, ex)
:(@progress for i = 1:$(esc(n))
info("Epoch $i")
$(esc(ex))
end)
end

View File

@ -153,24 +153,3 @@ function jacobian(m,x)
end
J'
end
"""
@epochs N body
Run `body` `N` times. Mainly useful for quickly doing multiple epochs of
training in a REPL.
```julia
julia> @epochs 2 println("hello")
INFO: Epoch 1
hello
INFO: Epoch 2
hello
```
"""
macro epochs(n, ex)
:(@progress for i = 1:$(esc(n))
info("Epoch $i")
$(esc(ex))
end)
end