class MXNet::Gluon::Loss::L1Loss
Overview
Calculates the mean absolute error between prediction and label.
Inputs "prediction" and "label" can have arbitrary shape as long
as they have the same number of elements.
Defined in:
mxnet/gluon/loss.cr
Constructors
Constructor methods inherited from class MXNet::Gluon::Loss
new(weight : Float64?, batch_axis : Int32, **kwargs)
new
export(filename, epoch = 0)
export,
forward(inputs : Array(T)) : Array(T) forall T
forward,
hybrid_forward(inputs : Array(T), params : Hash(String, T) = {} of String => T) : Array(T) forall T
hybrid_forward,
hybridize(active = true, flags = {} of String => String)
hybridize,
register_child(block, name = nil)
register_child
clear_cache
clear_cache,
infer_dtype(args)
infer_dtype,
infer_shape(args)
infer_shape
new(**kwargs)
new
call(inputs : Array(T)) : Array(T) forall T
call,
children
children,
collect_params(selector = nil)
collect_params,
forward(inputs : Array(T)) : Array(T) forall T
forward,
get_attr(name : String) : Block | Parameter | Nil
get_attr,
hybridize(active = true)
hybridize,
init(init = nil, ctx = nil, force_reinit = false)
init,
load_parameters(fname, ctx = MXNet.cpu, allow_missing = false, ignore_extra = false)
load_parameters,
params : MXNet::Gluon::ParameterDict
params,
prefix : String
prefix,
register_child(block, name = nil)
register_child,
register_parameter(param, name = nil)
register_parameter,
save_parameters(fname)
save_parameters,
scope : MXNet::Gluon::BlockScope?
scope,
set_attr(name : String, value : Block | Parameter | Nil)
set_attr,
with_name_scope(&)
with_name_scope
Constructor methods inherited from class MXNet::Gluon::Block
new(prefix = nil, params = nil)
new
Constructor Detail
def self.
new(weight =
nil, batch_axis =
0, **kwargs)
#
Creates a new instance.
Parameters
- weight (
Float
or nil
, default = nil
)
Global scalar weight for loss. - batch_axis (
Int
, default 0)
The axis that represents the mini-batch.