ClikaRT::nn::CrossEntropyLossOptions
struct
Header: ClikaRT/nn/generated/loss.h
Settings of CrossEntropyLoss: chain the setters, or assign the fields.
Member functions
weight(OptionalTensor)
CrossEntropyLossOptions& weight(OptionalTensor v)
Sets weight, a per-class weight [C]; unset weighs every class 1.
Declared in ClikaRT/nn/generated/loss.h, line 370
weight()
const OptionalTensor& weight() const
Reads weight.
Declared in ClikaRT/nn/generated/loss.h, line 375
ignore_index(optional<int64_t>)
CrossEntropyLossOptions& ignore_index(std::optional<std::int64_t> v)
Sets ignore_index, a target value whose positions contribute no loss; unset masks nothing.
Declared in ClikaRT/nn/generated/loss.h, line 381
ignore_index()
const std::optional<std::int64_t>& ignore_index() const
Reads ignore_index.
Declared in ClikaRT/nn/generated/loss.h, line 386
reduction(ops::Reduction)
CrossEntropyLossOptions& reduction(ops::Reduction v)
Sets reduction, how the per-position losses reduce.
Declared in ClikaRT/nn/generated/loss.h, line 392
reduction()
ops::Reduction reduction() const
Reads reduction.
Declared in ClikaRT/nn/generated/loss.h, line 394
Data members
weight_
OptionalTensor weight_ = {}
A per-class weight [C]; unset weighs every class 1. Default {}.
Declared in ClikaRT/nn/generated/loss.h, line 377
ignore_index_
std::optional<std::int64_t> ignore_index_ = std::nullopt
A target value whose positions contribute no loss; unset masks nothing. Default std::nullopt.
Declared in ClikaRT/nn/generated/loss.h, line 389
reduction_
ops::Reduction reduction_ = ops::Reduction::Mean
How the per-position losses reduce. Default ops::Reduction::Mean.
Declared in ClikaRT/nn/generated/loss.h, line 396