Git Product home page Git Product logo

cnn_drag_prediction's Introduction

cnn_drag_prediction

This repository contains a Python code that performs the training of a VGG-like convolutional neural network (CNN) to make drag prediction of arbitrary 2D shapes in low-Reynolds laminar flows (Re = 10). It exploits a custom dataset of random shapes and associated reference drag values for training. The prediction can then be extrapolated to arbitrary shapes, such as geometrical shapes or airfoils.

Citation

The publication associated to this repository can be found here (article) and here (pre-print).
If you use this repository for your own research, please consider citing it.

Usage

The dataset is zipped in the MDS0/ folder to save space on the github repository. You need to unzip it before proceeding further. You will need tensorflow and keras installed.

network

Training

To train the network described in the paper, just run python3 train_network.py. First, the dataset will be loaded from the MDS0 folder. Then, training will start. Training on a decent GPU card is highly recommended (approx. 25 minutes are required on a single Tesla V100 card). Once learning is over, the best model best.h5 is saved in the working repository. If you wish to make changes, most parameters are accessible in params.py.

loss

Predicting

You can test the produced model on the test subset using python3 predict_test_drag.py. The test subset will be loaded, and the relative errors will be computed. Remember that the multiple sources of randomness (including GPU cards) can lead to slightly different results from one run to another. Same as above, most parameters are accessible in params.py.

drag_test

You can also predict the drag of a shape of your choice by running python3 predict_image_drag.py (see the parameters at the top of the file). Several shapes are available in the imgs repository.

drag_predictions

Related repositories

You can find an expanded version of the shape-generation tool contained in this repository here.

cnn_drag_prediction's People

Contributors

jviquerat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cnn_drag_prediction's Issues

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.