pytorch3d.implicitron.models.global_encoder.global_encoder

global_encoder

class pytorch3d.implicitron.models.global_encoder.global_encoder.GlobalEncoderBase(*args, **kwargs)[source]

Bases: ReplaceableBase

A base class for implementing encoders of global frame-specific quantities.

The latter includes e.g. the harmonic encoding of a frame timestamp (HarmonicTimeEncoder), or an autodecoder encoding of the frame’s sequence (SequenceAutodecoder).

get_encoding_dim()[source]

Returns the dimensionality of the returned encoding.

calculate_squared_encoding_norm() Tensor | None[source]

Calculates the squared norm of the encoding to report as the autodecoder_norm loss of the model, as a zero dimensional tensor.

forward(*, frame_timestamp: Tensor | None = None, sequence_name: LongTensor | List[str] | None = None, **kwargs) Tensor[source]

Given a set of inputs to encode, generates a tensor containing the encoding.

Returns:

encoding – The tensor containing the global encoding.

class pytorch3d.implicitron.models.global_encoder.global_encoder.SequenceAutodecoder(*args, **kwargs)[source]

Bases: GlobalEncoderBase, Module

A global encoder implementation which provides an autodecoder encoding of the frame’s sequence identifier.

autodecoder: Autodecoder
get_encoding_dim()[source]
forward(*, frame_timestamp: Tensor | None = None, sequence_name: LongTensor | List[str] | None = None, **kwargs) Tensor[source]
calculate_squared_encoding_norm() Tensor | None[source]
class pytorch3d.implicitron.models.global_encoder.global_encoder.HarmonicTimeEncoder(*args, **kwargs)[source]

Bases: GlobalEncoderBase, Module

A global encoder implementation which provides harmonic embeddings of each frame’s timestamp.

n_harmonic_functions: int = 10
append_input: bool = True
time_divisor: float = 1.0
get_encoding_dim()[source]
forward(*, frame_timestamp: Tensor | None = None, sequence_name: LongTensor | List[str] | None = None, **kwargs) Tensor[source]
calculate_squared_encoding_norm() Tensor | None[source]