# How to suppress printing of Flux.@epochs?

**URL:** <https://discourse.julialang.org/t/how-to-suppress-printing-of-flux-epochs/16063>\
**Category:** Machine Learning\
**Tags:** first-steps, flux\
**Created:** [October 9, 2018, 10:44am UTC](https://discourse.julialang.org/t/how-to-suppress-printing-of-flux-epochs/16063 "2018-10-09T10:44:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [October 9, 2018, 10:44am UTC](https://discourse.julialang.org/t/how-to-suppress-printing-of-flux-epochs/16063/1 "2018-10-09T10:44:41Z")

</div>

`Flux.@epochs` prints out lots of info. How do I suppress its input totally? Current Suppressor.jl doesn’t work on v1.0.x so can’t use that.

MWE

```julia
using Flux
model = Flux.Chain(
  Dense(14*16+4, 128, relu),    
  Dense(128, 64, relu),    
  Dense(64, 32, relu),
  Dense(32, 16, relu),
  Dense(16, 1, relu));
loss(x,y) = sum((model(x) .- y).^2)
opt = ADAM(params(model))

x = rand(Bool, 14*16+4)
y = 100
Flux.@epochs 100 Flux.train!(loss, [(x,y)], opt)

```

---

<div class="post-metadata">

**Author:** ![MikeInnes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikeinnes/32/3656_2.png) [@MikeInnes](https://discourse.julialang.org/u/MikeInnes)\
**Post date:** [October 9, 2018, 11:03am UTC](https://discourse.julialang.org/t/how-to-suppress-printing-of-flux-epochs/16063/2 "2018-10-09T11:03:35Z")

</div>

If you don’t want the info you can just write `for i = 1:100 ...`

---

<div class="post-metadata">

**Author:** ![kdyrhage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdyrhage/32/2326_2.png) [@kdyrhage](https://discourse.julialang.org/u/kdyrhage)\
**Post date:** [October 9, 2018, 11:05am UTC](https://discourse.julialang.org/t/how-to-suppress-printing-of-flux-epochs/16063/3 "2018-10-09T11:05:31Z")

</div>

`@epochs` just expands to a `for` loop with some extra printing:

```julia
macro epochs(n, ex)
  :(@progress for i = 1:$(esc(n))
      @info "Epoch $i"
      $(esc(ex))
    end)
end

```

So if you don’t want that, just use `for`.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [October 9, 2018, 11:36am UTC](https://discourse.julialang.org/t/how-to-suppress-printing-of-flux-epochs/16063/4 "2018-10-09T11:36:57Z")

</div>

Ok. Thats what i did in the end. Somehow epoch macro feels fasfer. Even thought it shouldnt
