bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitrl::torch_utils Namespace Reference

Functions

template<typename ContainerType>
torch_tensor_t create_mask (const ContainerType &container)
 create_mask. Create a boolean mask from the given container. The container should hold values convertible to bool
template<typename TorchNetType>
void copy_parameters (const TorchNetType &from, TorchNetType &to)
 copy_parameters. Copy the parameters and buffers of one network into another of the same type, for example into the target network of DQN
template<typename TorchNetType>
void copy_parameters_to (TorchNetType &to, const std::string &params_path)
 copy_parameters_to. Copy into to the parameters and buffers of a network of the same type that was saved with torch::save to params_path. TorchNetType must be default constructible

Function Documentation

◆ copy_parameters()

template<typename TorchNetType>
void bitrl::torch_utils::copy_parameters ( const TorchNetType & from,
TorchNetType & to )

copy_parameters. Copy the parameters and buffers of one network into another of the same type, for example into the target network of DQN

Exceptions
std::invalid_argumentif to lacks a parameter or buffer of from

◆ copy_parameters_to()

template<typename TorchNetType>
void bitrl::torch_utils::copy_parameters_to ( TorchNetType & to,
const std::string & params_path )

copy_parameters_to. Copy into to the parameters and buffers of a network of the same type that was saved with torch::save to params_path. TorchNetType must be default constructible

◆ create_mask()

template<typename ContainerType>
torch_tensor_t bitrl::torch_utils::create_mask ( const ContainerType & container)

create_mask. Create a boolean mask from the given container. The container should hold values convertible to bool