newton.actuators.ControllerNeuralLSTM#
- class newton.actuators.ControllerNeuralLSTM(model_path)[source]#
Bases:
ControllerLSTM-based neural network controller.
Uses a pre-trained LSTM network to compute joint effort from position error and joint velocity. Hidden and cell state are maintained across timesteps.
Torch checkpoints use the Torch backend and preserve the Torch state interface. They accept pt2 archives (
.pt2saved withtorch.export.save; preferred) and the deprecated TorchScript (.ptsaved withtorch.jit.save) and module-bundle ({"model": <network module>, "metadata": {...}}saved withtorch.save) formats..pt2and.onnxcheckpoints must recordnum_layersandhidden_sizein metadata; only legacy Torch checkpoints may omit them, since their loaded networks expose a livelstmattribute to inspect..onnxcheckpoints use Warp-NN. The exported ONNX model must have three inputs (input, initial hidden, and initial cell) and three graph outputs (effort, hidden output, and cell output). Metadata properties map those names to controller roles.- classmethod resolve_arguments(args)#
- __init__(model_path)#
Initialize LSTM controller from a checkpoint file.
- Parameters:
model_path (str) – Path to the
.onnx,.pt2,.pt, or.pthcheckpoint.
- compute(positions, velocities, target_pos, target_vel, feedforward, pos_indices, vel_indices, target_pos_indices, target_vel_indices, forces, state, dt, device=None)#
- finalize(device, num_actuators)#
- is_graphable()#
- is_stateful()#
- state(num_actuators, device)#
- update_state(current_state, next_state)#