{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# A deep neural network of energy absorbing structures" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "In this notebook you will implement a deep neural network to represent the response of foam-filled aluminium extrusions.\\\n", "\n", "In our dataset we have three inputs which are the width of the squared aluminium profile, the yield strength of the aluminium alloy as well as the density of the foam. As outputs we have the maximum force and the mean force during crushing of the profile.\n", "\n", "You have to go through the following steps:\n", "1. Import the dataset Data_Example_3.txt, the dataset contains 3 inputs and 2 outputs, the text file contains 1000 set of measurements\n", "2. Scale the data using sklearn\n", "3. Split the data into training and validation using sklearn (use a 80/20 split)\n", "4. Build an ANN with two hidden layers consisting of 10 neurons with the ReLu activation function\n", "5. Train the ANN for 100 epochs using the adam optimizer\n", "6. Plot the training and validation losses, can you comment on them?\n", "7. Load the dataset called Data_Example_3_interpolation.txt (384 set of measurements) and Data_Example_3_Extrapolation.txt (140 set of measurements)\n", "8. Evaluate the trained ANN on these two additional datasets, can you comment on the results?\n", "9. What can you do to improve the results?\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# We import the necessary packages\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import warnings\n", "warnings.filterwarnings('ignore')\n", "import tensorflow as tf\n", "#----------------------------------------------------------------------------------------------------------------\n", "# Import SciKitLearn for normalization and splitting of data\n", "#----------------------------------------------------------------------------------------------------------------\n", "from sklearn.model_selection import train_test_split\n", "from sklearn import preprocessing" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }