PND
|
Public Member Functions | |
PND () | |
void | defineParams (int numberOfAtoms) |
std::pair< torch::Tensor, torch::Tensor > | LossPreTrain (torch::Tensor t_seq, std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > icfs, int n, int Np, int d) |
virtual std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > | Loss (torch::Tensor t_seq, std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > icfs, torch::Tensor totalEnergy, torch::Tensor kineticEnergy, torch::Tensor potentialEnergy, int n, int Np, int d) |
virtual std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > | UpdateParamsNADAM (torch::Tensor t_seq, std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > icfs, torch::Tensor velocities, torch::Tensor S, torch::Tensor totalEnergy, torch::Tensor kineticEnergy, torch::Tensor potentialEnergy, int epoch, int n, int Np, int d, double alpha, double epsilon, torch::Tensor beta) |
virtual std::pair< torch::Tensor, torch::Tensor > | mainTrain (torch::Tensor params, torch::Tensor t_seq, std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > icfs, int num_epochs, torch::Tensor totalEnergy, torch::Tensor kineticEnergy, torch::Tensor potentialEnergy, int n, int Np, int d, double learn_rate=0.0001, double momentum=0.99) |
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > | UpdatePreParamsNADAM (torch::Tensor t_seq, std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > icfs, torch::Tensor velocities, torch::Tensor S, int epoch, int n, int Np, int d, double alpha=0.001, double epsilon=pow(10, -7), torch::Tensor beta=torch::tensor({0.999, 0.999})) |
std::pair< torch::Tensor, torch::Tensor > | PreTrain (torch::Tensor t_seq, std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > icfs, int num_epochs, int n, int Np, int d, double learn_rate=0.001, double momentum=0.99) |
Public Attributes | |
int | PreTrainEpochs |
int | MainTrainEpochs |
int | StepTrain |
int | nodes |
torch::Tensor | params |
PND::PND | ( | ) |
Constructor definition - prompts objects to read input file which specifies the number of time grids to predict, epochs for training and other network properties such as number of nodes.
Default input file /Source/pnd.in
void PND::defineParams | ( | int | numberOfAtoms | ) |
Method to define the number of atoms that the system comprises of. Used while reading the atom trajectories from the simulation data
numberOfAtoms | This is the number of atoms in the molecular dynamics simulation |
|
virtual |
Define a Loss function for the network which is a set of DEs governing the evolution of the system. Only method declaration provided, method must be defined when user's working class inherits from PND
t_seq | time sequences for which the pre-training is carried out |
icfs | initial and final positions and velocites that are to be used for the pre-training task |
totalEnergy | system total energy across time steps |
kineticEnergy | system kinetic energy across time steps |
potentialEnergy | system potential energy across time steps |
n | Number of neurons in the NN |
Np | Number of atoms in the MD system |
d | dimensionality of the space (d = 3 when data in x,y,z co-ordinates is available) |
Reimplemented in ScratchPad.
std::pair< torch::Tensor, torch::Tensor > PND::LossPreTrain | ( | torch::Tensor | t_seq, |
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > | icfs, | ||
int | n, | ||
int | Np, | ||
int | d | ||
) |
Define a Loss function for the network and before starting the main training task. Method can be overridden when class inherits from PND
t_seq | time sequences for which the pre-training is carried out |
icfs | initial and final positions and velocites that are to be used for the pre-training task |
n | number of neurons in the NN |
Np | number of atoms in the MD system |
d | dimensionality of the space (d = 3 when data in x,y,z co-ordinates is available) |
|
virtual |
Routine to follow for main-training the NN, i.e., training for the target data. Users may decide to call their parameter updating algorithm implementation in each training iteration.
params | inital parameters of the NN which will be trained |
t_seq | time sequences for which the pre-training is carried out |
icfs | initial and final positions and velocites that are to be used for the pre-training task |
num_epochs | number of epochs for which training is to be carried out |
totalEnergy | system total energy across time steps |
kineticEnergy | system kinetic energy across time steps |
potentialEnergy | system potential energy across time steps |
n | number of neurons in the NN |
Np | number of atoms in the MD system |
d | number of atoms in the MD system |
learn_rate | learning rate for optimizer |
momentum | parameter to pass to the optimizer that uses momentum |
Reimplemented in ScratchPad.
std::pair< torch::Tensor, torch::Tensor > PND::PreTrain | ( | torch::Tensor | t_seq, |
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > | icfs, | ||
int | num_epochs, | ||
int | n, | ||
int | Np, | ||
int | d, | ||
double | learn_rate = 0.001 , |
||
double | momentum = 0.99 |
||
) |
Routine to follow for pre-training the NN, i.e., training with a data set. Method definition trains the NN over a number of epochs with the UpdatePreParams(...) optimizer
t_seq | time sequences for which the pre-training is carried out |
icfs | initial and final positions and velocites that are to be used for the pre-training task |
num_epochs | number of epochs for which pre-trainig is to be carried out |
n | number of neurons in the NN |
Np | number of atoms in the MD system |
d | dimensionality of the space (d = 3 when data in x,y,z co-ordinates is available) |
learn_rate | parameter to pass to the optimizer |
momentum | parameter to pass to the optimizer that uses momentum |
|
virtual |
Defines an optimizer for adjusting the parameters in each main training iteration. We provide the declaration and method must be defined when user's working class inherits from PND
t_seq | time sequences for which the pre-training is carried out |
icfs | initial and final positions and velocites that are to be used for the pre-training task |
velocities | |
S | |
totalEnergy | system total energy across time steps |
kineticEnergy | system kinetic energy across time steps |
potentialEnergy | system potential energy across time steps |
epoch | defines the number of steps |
n | number of neurons in the NN |
Np | number of atoms in the MD system |
d | dimensionality of the space (d = 3 when data in x,y,z co-ordinates is available) |
alpha | parameters for optimizers |
epsilon | constant for stability |
beta | parameters for optimizers |
Reimplemented in ScratchPad.
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > PND::UpdatePreParamsNADAM | ( | torch::Tensor | t_seq, |
std::tuple< torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor > | icfs, | ||
torch::Tensor | velocities, | ||
torch::Tensor | S, | ||
int | epoch, | ||
int | n, | ||
int | Np, | ||
int | d, | ||
double | alpha = 0.001 , |
||
double | epsilon = pow(10, -7) , |
||
torch::Tensor | beta = torch::tensor( {0.999, 0.999}) |
||
) |
Defines an optimizer for adjusting the parameters in each pre-training iteration
t_seq | time sequences for which the pre-training is carried out |
icfs | initial and final positions and velocites that are to be used for the pre-training task |
velocities | |
S | |
epoch | defines the number of steps |
n | number of neurons in the NN |
Np | number of atoms in the MD system |
d | dimensionality of the space (d = 3 when data in x,y,z co-ordinates is available) |
alpha | a parameter for optimizer |
epsilon | constant for stability |
beta | tuple with values for the exponential decay rate for the 1st moment estimates and exponential decay rate for the exponentially weighted infinity norm |