Giter VIP home page Giter VIP logo

bsld's Introduction

Bayesian Stability Lobe Diagram(BSLD)

Introduction

This code is a simplified step-by-step implement for better understanding of the submitted manuscript: Physics-informed Bayesian Inference for Milling Stability Analysis. Please contact [email protected] if there is any mistake or confusion.

1. Due to the randomness of the sampling, the results of each run may be slightly different. You can run the step5_final.py to get the result (Fig. 8. in the manuscript).

Fig_-_David.png

2. To illustrate the algorithm clearly, the total procedure is separated into the 8 steps. Run the following steps in sequence to get the data for the intermediate steps and the final result:

  1. step1.1_SampleForAgent.py Sampling 800 points from the prior distributions to train the surrogate models of spectral radius. Sobol sampling strategy is adopted here for efficient space-density sampling. The model parameters comes from David. The spectral radius is calculated by FDM. The default parameters of stability lobe diagram is defined in the function FDM_function.
  2. step1.2_SortData.py The sampled data is organized from 800 groups of SLDs to 2295 (the grids of SLD is 27*85=2295) groups of spectral radius.
  3. step2_TrainAgentModel.py 2295 surrogate models are trained using the datasets $[\mathbf{w}, \lambda]$. The surrogate models are simple multi-layer perceptions in pytorch.
  4. step3_BSLD.py Inferring the posterior distribution using Laplace approximation. The model of the distribution $\mathbf{w}_{*}$ is obtained by maximizing the posterior function using gradient decent in pytorch. Note that the Hessian matrix is calculated using the auto-grad graph of pytorch. The experimental training data used in this step is MTM_newCase_partial.csv.
  5. step4.1_SampleForProbabilisticLobes.py Sample 500 points from the posterior distribution. Note that this sample strategy is distribution-density sample rather than space-density sample in step1. This step takes some time because of FDM calculation. The spectral_radius for posterior distribution can also be obtained the trained surrogate models.
  6. step4.2_SortDataForProbabilisticLobes.py Organise the dataset, the same as step 2.
  7. step4.3_GetProbabilisticLobeDiagram.py Calculate the number $N_{\text {chatter }}$ based on the value of spectral radius.
  8. step5_final.py Plot the probabilistic SLD using iso-probability boundaries.

3. We also have trained all surrogate models in GeneratedData\Step2Model , so you can directly run the step3_BSLD.py to inference the posterior distribution of parameters.

4. The following important packages need to be configured in order to run the code:

pytorch 1.6.0
sobol_seq (pip install git+https://github.com/naught101/[email protected]#egg=sobol_seq)

Acknowledgement

Here, we also would like to greatly acknowledge the help of Dr. David for data sharing in the case study.

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.