This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
78 lines (73 loc) · 4.74 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
README
for bubble dynamics with multiscale residual neural networks
=============================================================
gen_data.py
=============================================================
Numerically solves system of ODEs given by Rayleigh-Plesset using RK4 (adaptive step-sizes)
Does this many times for a range of initial conditions to generate data for training and testing various ResNets.
Parameters are adjusted in file 'parameters.yml'
=============================================================
train_models.py
=============================================================
Trains ResNets with adjustable architectures. Each ResNet is a time-stepper trained at different step-sizes.
Parameters are adjusted in file 'parameters.yml'
=============================================================
plot_models.py
=============================================================
Visualizes predictions made by individual time-steppers (ResNets).
Determines which "combination" of time-steppers (ResNets) produces the best means-square-error (MSE) by removing smallest time-steppers first.
Visualizes MSE of individual time-steppers and multi-scale time-steppers, the ensemble of ResNets.
Visualizes predictions made by multi-scale time-steppers, the ensemble of ResNets.
Final plot color codes the 3 larget time-steppers for predictions made by multi-scale ResNets.
=============================================================
script_DTP.py
=============================================================
Calls the algorithms listed above in the following order:
(D) Data generated by calling gen_data.py
(T) Trains ResNets by calling train_models.py
(P) Plots results and errors by calling plot_models.py
=============================================================
parameters.yml
=============================================================
Adjust parameters for generating data and training your ResNets (time-steppers).
Read by algorithms as a Python dictionary.
--------------------------------------------------------------
(1) Parameters for both data and training time-steppers (ResNets)
--------------------------------------------------------------
system = 'RP' stands for Rayleigh-Plesset and is used in file names saved by python scripts
dt = smallest time step for data describing the Rayleigh-Plesset equation
k_max = determines the largest time step for a ResNet to make predictions, e.g. time_step = 2^k * dt
model_steps = the number of steps the largest time-stepper takes during training, which will also be the number of steps all other time-steppers take during training.
n_train = number of training samples for the largest time-stepper.
n_val = number of validation samples for the largest time-stepper.
n_test = number of test samples for all time-steppers.
batch_size = number of samples in a batch, sampled from training data during training.
--------------------------------------------------------------
(2) Parameters for ODE (the Rayleigh-Plesset equation)
--------------------------------------------------------------
u = (Pa * s) dynamic viscosity (u=0 means no viscosity)
R0 = (meters) physical diameter for bubble, before normalization (meters)
Pv = (Pa) vapor pressure inside bubble
exponent = used in RP-equation ( )^(exponent). usually between [1 , 2]
P0 = (Pa) external pressure of environment far from bubble
S = (N/m) don't remember
rho = (kg/m^3) density of fluid external to wall
abs_tol = absolute error tolerance for RK4 to generate data
rel_tol = relative error tolerance for RK4 to generate data
--------------------------------------------------------------
(3) Range of initial conditiosn for ODE data and test samples (the Rayleigh-Plesset equation)
--------------------------------------------------------------
P_min = minimum initial pressure (t=0) allowed for ODE data, RP-equation
P_max = maximum initial pressure (t=0) allowed for ODE data, RP-equation
R_min = minimum initial radius (t=0) allowed for ODE data, RP-equation
R_max = maximum initial radius (t=0) allowed for ODE data, RP-equation
R_test = initial radius (t=0) for test ODE data, RP-equation
Rdot_min = minimum initial velocity (t=0) allowed for ODE data, RP-equation
Rdot_max = maximum initial velocity (t=0) allowed for ODE data, RP-equation
Rdot_test = initial velocity (t=0) for test ODE data, RP-equation
--------------------------------------------------------------
(4) Parameters for ResNet architecture
--------------------------------------------------------------
width = number of nodes/weights in each ResNet layer
num_layers = number of ResNet layers, each of size 'layer_size'
num_inputs = number of ResNet inputs, which is also be the number of ResNet outputs (same as the number of equations for system of ODEs)