Skip to content

SLIMM-Lab/pyprnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physically Recurrent Neural Networks

Intact constitutive models embedded in an encoder-decoder MLP architecture.

If you have accurate material models at the microscale and would like to perform computational homogenization, those same models can be directly embedded into a hybrid architecture to make macroscale predictions.

Because the models in the architecture are the exact same as in the micromodel, a number of features can be directly inherited and therefore not learned from data:

  • Path dependency (loading/unloading/reloading) without training for it
  • Strain rate dependency while training with only a single rate
  • Consistent step size dependence (independent for inviscid models; correct dependence for viscous models)
  • Between $10\times$ and $100\times$ less training data than RNNs for comparable performance

Related code

Journal papers and preprints

In this repository

The code in this repository contains a standalone demonstration of PRNNs for a 2D micromodel with $J_2$ elastoplasticity (matrix) and linear elasticity (fibers):

  • prnn-demo.ipynb: Jupyter notebook with a few ready-to-run examples. START HERE!
  • J2Tensor_vect.py: a simple $J_2$ plasticity model in plane stress. This code comes directly from an FE package, demonstrating how PRNNs can embed existing material models with little to no changes in code;
  • prnn.py: A PyTorch network class that implements the PRNN, with single-layer encoder and decoder;
  • rnn.py: Implements GRU and LSTM networks with variational Gaussian dropout. For comparing predictions and learning performance with PRNNs;
  • utils.py: Implements a custom dataset class for handling stress and strain paths, and a class for training and evaluating networks, with the ability of saving and loading checkpoints;
  • pyprnn.yml: Conda environment file that should take care of all dependencies for running the code.

The demonstration notebook also provides three different types of strain path for training, validation and testing:

  • A set of 18 canonical paths, comprising uniaxial and biaxial combinations of tension/compression and shear. This dataset is made to mimic traditional fitting of constitutive models. PRNNs already perform remarkably well even when trained only on these simple paths;
  • A set of 100 proportional paths in random directions in stress space containing a single unloading-reloading cycle;
  • A set of 100 non-proportional GP paths, sampled from suitable Gaussian Process priors and designed to be as general as possible.

About

Physically Recurrent Neural Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors