base
base
¶
MLP-based proprioceptive state encoder.
ProprioceptiveEncoder
¶
ProprioceptiveEncoder(input_keys, output_dim, hidden_dimensions=None, activation=value, dropout=0.0, pretrained=False, frozen=False, model_dtype=None)
Bases: Encoder
Encoding proprioceptive state (robot joint positions, velocities, etc.) with a Feedforward Fully-Connected NN.
Initialize proprioceptive encoder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_keys
|
str | list[str]
|
Keys for proprioceptive inputs |
required |
output_dim
|
int
|
Output feature dimension |
required |
hidden_dimensions
|
list[int] | None
|
Hidden layer dimensions. If None or [], creates simple linear layer. If [128], creates one hidden layer. If [256, 128], creates two hidden layers. |
None
|
activation
|
str
|
Activation function from ActivationFunction enum |
value
|
dropout
|
float
|
Dropout rate between layers |
0.0
|
pretrained
|
bool
|
Whether to use pretrained weights (unused for proprio encoder) |
False
|
frozen
|
bool
|
Whether to freeze encoder weights |
False
|
model_dtype
|
str | None
|
Precision string from experiment config (e.g. |
None
|
Source code in src/versatil/models/encoding/encoders/proprioceptive/base.py
encode
¶
Encode proprioceptive state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
dict[str, Tensor]
|
Dict with state tensors, each as (B, D). |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Tensor]
|
Dict with proprioceptive features. |
Source code in src/versatil/models/encoding/encoders/proprioceptive/base.py
get_output_dims
¶
validate_input_metadata
¶
Validate that input metadata is not camera metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Observation key being validated. |
required |
metadata
|
BaseMetadata
|
Metadata from the observation space. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Error message if incompatible, None if valid. |
Source code in src/versatil/models/encoding/encoders/proprioceptive/base.py
get_output_specification
¶
Get structured output specification with feature names and dimensions.
Returns:
| Type | Description |
|---|---|
list[FeatureMetadata]
|
List of FeatureMetadata with proprioceptive feature and dimension. |