Tinkex.Types.LossFnType (Tinkex v0.3.4)
View SourceLoss function type.
Mirrors Python tinker.types.LossFnType.
Supported Loss Functions
:cross_entropy- Standard cross-entropy loss:importance_sampling- Importance-weighted sampling loss:ppo- Proximal Policy Optimization loss:cispo- Constrained Importance Sampling Policy Optimization loss:dro- Distributionally Robust Optimization loss
Wire Format
String values: "cross_entropy" | "importance_sampling" | "ppo" | "cispo" | "dro"
Examples
iex> LossFnType.parse("cross_entropy")
:cross_entropy
iex> LossFnType.to_string(:ppo)
"ppo"
Summary
Functions
Parse wire format string to atom.
Convert atom to wire format string.
List all valid loss function types.
Types
Functions
Parse wire format string to atom.
Examples
iex> LossFnType.parse("cross_entropy")
:cross_entropy
iex> LossFnType.parse("cispo")
:cispo
iex> LossFnType.parse("unknown")
nil
Convert atom to wire format string.
Examples
iex> LossFnType.to_string(:cross_entropy)
"cross_entropy"
iex> LossFnType.to_string(:dro)
"dro"
@spec values() :: [t()]
List all valid loss function types.