affine error messages

This commit is contained in:
Mike J Innes 2017-02-21 13:31:41 +00:00
parent 8d63bf8053
commit 0bb44f5ace

View File

@ -34,10 +34,11 @@ graph(::typeof(vcat), a...) = graph(cat, 1, a...)
graph(::Input, x) = x graph(::Input, x) = x
graph(ctx::Context, d::Affine, x) = graph(ctx::Context, d::Affine, x) =
mx.FullyConnected(data = x, register(ctx,
num_hidden = size(d.W.x, 2), mx.FullyConnected(data = x,
weight = var(ctx, d.W), num_hidden = size(d.W.x, 2),
bias = var(ctx, d.b, size(d.b, 2))) weight = var(ctx, d.W),
bias = var(ctx, d.b, size(d.b, 2))))
# TODO: use actual params} # TODO: use actual params}
graph(ctx::Context, c::Conv2D, x) = graph(ctx::Context, c::Conv2D, x) =
@ -91,7 +92,7 @@ using Juno
Juno.errmsg(e::mx.MXError) = e.msg Juno.errmsg(e::mx.MXError) = e.msg
function errnode(e::mx.MXError) function errnode(e::mx.MXError)
m = match(r"Error in (\w+):", e.msg) m = match(r"Error in (\w+)", e.msg)
m == nothing && return m == nothing && return
Symbol(m.captures[1]) Symbol(m.captures[1])
end end