From 6d3a2a2210bb06aa9ada0784b79d3127e076aafb Mon Sep 17 00:00:00 2001 From: CarloLucibello Date: Wed, 11 Oct 2017 13:18:50 +0200 Subject: [PATCH] change argument name for better clarity --- src/optimise/train.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/optimise/train.jl b/src/optimise/train.jl index 0a91e978..618ecf66 100644 --- a/src/optimise/train.jl +++ b/src/optimise/train.jl @@ -4,10 +4,10 @@ using Flux.Tracker: back! tocb(f) = f tocb(fs::AbstractVector) = () -> foreach(call, fs) -function train!(m, data, opt; cb = () -> ()) +function train!(loss, data, opt; cb = () -> ()) cb = tocb(cb) @progress for x in data - l = m(x...) + l = loss(x...) isinf(l.data[]) && error("Loss is Inf") isnan(l.data[]) && error("Loss is NaN") back!(l)