Supervised Samples #
Typed input-target records used by datasets and trainers.
Application code works with the named input and target fields. The runtime conversion to its
heterogeneous graph-argument representation is confined to Sample.Internal.
def
TorchLean.Sample.instReprSupervised.repr
{α✝ : Type}
{inst✝ : Storage α✝}
{σ✝ τ✝ : Shape}
[Repr α✝]
:
Supervised α✝ σ✝ τ✝ → ℕ → Std.Format
Instances For
@[instance_reducible]
instance
TorchLean.Sample.instReprSupervised
{α✝ : Type}
{inst✝ : Storage α✝}
{σ✝ τ✝ : Shape}
[Repr α✝]
:
Repr (Supervised α✝ σ✝ τ✝)
def
TorchLean.Sample.mapInput
{α : Type}
[Storage α]
{σ σ' τ : Shape}
(f : Tensor α σ → Tensor α σ')
(sample : Supervised α σ τ)
:
Supervised α σ' τ
Map the input tensor, optionally changing its shape.
Instances For
def
TorchLean.Sample.mapTarget
{α : Type}
[Storage α]
{σ τ τ' : Shape}
(f : Tensor α τ → Tensor α τ')
(sample : Supervised α σ τ)
:
Supervised α σ τ'
Map the target tensor, optionally changing its shape.
Instances For
def
TorchLean.Sample.map
{α β : Type}
[Storage α]
[Storage β]
{σ τ σ' τ' : Shape}
(mapInput : Tensor α σ → Tensor β σ')
(mapTarget : Tensor α τ → Tensor β τ')
(sample : Supervised α σ τ)
:
Supervised β σ' τ'
Map both tensors, optionally changing their element type and shapes.
Instances For
def
TorchLean.Sample.Internal.arguments
{α : Type}
[Storage α]
{σ τ : Shape}
(sample : Supervised α σ τ)
:
Convert a supervised record to the generic argument representation used by graph runtimes.