Git Product home page Git Product logo

leopoldoagorio / solid-mechanics-ml Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 2.0 2.83 MB

This repository contains code for a project that trains a neural network to solve solid mechanics problems faster than the traditional finite element method. It includes a pipeline for generating a database of FEM solutions and experiments comparing the neural network model to the FEM.

License: MIT License

MATLAB 15.53% Shell 7.61% TeX 40.31% Python 36.55%
computational-physics finite-element-methods machine-learning neural-networks solid-mechanics surrogate-models

solid-mechanics-ml's Introduction

solid-mechanics-ML

First tests in automating a pipeline for generating automatically a database of FEM solutions to unidimensional compression/extension problem, and learning with a Neural Network to solve same mechanical problem.

The loop that generates the data is in the file download_data.sh and the script that trains the Neural Network is in surrogateMLP.py. The data is stored in the folder data.

The final documentation for the project is in the file documentacion.pdf.

Acknowledgments

This work was funded by the Comisión Sectorial de Investigación Científica agency of Universidad de la República, through the Project Definición de estrategias para la aplicación de métodos de identificación de material al diagnóstico no invasivo de Cáncer de mama.

solid-mechanics-ml's People

Contributors

bbazzano avatar jorgepz avatar leopoldoagorio avatar mvanzulli avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jorgepz onsas

solid-mechanics-ml's Issues

Add minutes from the last meeting

Topics:

  • Data visualization seems to not be useful since we have an analytic solution for the displacements
  • Mauricio shares this reference about surrogate modes to predict breast displacements field.
  • Leo shows showed scripts to generate .csv results. Features [ $L_x$ , $E$ , $p$ ] targets [ $u_x$ , $u_y$ , $u_z$ ]
  • Bruno contributes to the analytic solution of the uni-axial compression example.

Mejorar informe de cierre

Hice un primer informe pero hay muchas cosas que siguen siendo placeholder. En particular faltan

  • Imágenes del problema (tanto uniaxial como cantilever) #43
  • Incorporar las imágenes de loss
  • Incorporar los datos de error y loss
  • Lectura por alguien que no sea @leopoldoagorio
  • Incorporar error para un ejemplo fuera del training set.

Update test set uniaxial-compression example

  • Set the same number of samples for validation and test set. Moreover, check all test samples are inside the hypercube used for testing.
  • Sample test not with a uniform distribution
  • Compute the error versus the NN and ONSAS solution for an outlier (most flexible case).

Create a Model.test()

This function must compute the target values with the analytical solution for u_y and u_z given the input features

Aclaratorio lectura

Que quede claro que es un único punto para el cual se trata de aprender el desplazamiento en funcion de los parametros

Write a paper

  • Abstract
  • ANNs methodology
  • Integration with ONSAS.jl
  • [ ]

Crear un informe de cierre

  • Intro (Refs, describiendo (1 parrafo minimo)
  • Herramientas utilizadas (1 parrafo minimo)
  • Resutlados numéricos
  • Conclusiones

Create a model class from `torch.nn.Module`

class MLP(torch.nn.Module):
    def __init__(self, depth, n_neurons_per_layer):
        super(MLP, self).__init__()
        self.depth = depth
        self.loss = []
        self.n_neurons_per_layer = n_neurons_per_layer
        self.disc = torch.nn.Sequential(
            # Input: (N,4,64,64)
            torch.nn.Conv2d(channels * 2, features_d, 4, 2, 1),  # (N,8,32,32)
            torch.nn.LeakyReLU(0.2),
            torch.nn.Conv2d(features_d, features_d * 2, 4, 2, 1),  # (N,16,16,16)
            torch.nn.LeakyReLU(0.2),
            torch.nn.Conv2d(features_d * 2, features_d * 4, 4, 2, 1),  # (N,32,8,8)
            torch.nn.LeakyReLU(0.2),
            torch.nn.Flatten(),  # (N,2048)
            torch.nn.Linear(features_d * 256, 1),  # (N, 1)
            torch.nn.Sigmoid(),
        )
        self.initialize_weights()

TQDM

Use tqdm for progress bar

Analytic test set still wrong

Not able to produce menaningful comparisons. Must check in detail.

  • Try to eval MLP and analytic in meaningful points
  • Debug dataset generation
  • Check math

See loss plot for 100 epochs (train/val/analytic) to understand the error
badtrainval

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.