In the Harris-Wilson model,
Let
The parameters
with given initial conditions
In this model, we infer the cost matrix HarrisWilson
model.
The following are the default model parameters:
# Settings for the dataset, which is loaded externally or can be synthetically generated using the ABM
Data:
synthetic_data:
# Number of steps in the synthetic time series
num_steps: 500
# Origin zone and destination zone size
N_origin: 10
N_destination: 5
# Size, convenience, cost, noise, and responsiveness parameters
alpha: 1.2
beta: 4
kappa: 2
sigma: 0
epsilon: 10
# Time differential
dt: 0.001
# Initialisation of the network weights
init_network_weights:
distribution: normal
parameters:
mean: 1.2
std: 1.2
# Initialisation of the origin sizes
init_origin_sizes:
distribution: normal
parameters:
mean: 1
std: 0.2
# Fluctuations of the origin zones over time
origin_size_std: 0.05
# Initialisation of the destination sizes
init_dest_sizes:
distribution: normal
parameters:
mean: 1
std: 0.2
# Number of independently training sets to use
training_set_size: 1
# Number of training steps to use
num_training_steps: 300
num_steps
generates a time series of that length, of which the last num_training_steps
steps
are used to train the model. training_set_size
sets the number of time series to
generate from different initial conditions, and num_steps
sets the number of steps per training set.
You must specify the true values of Training
section of the config. This is to ensure the numerical solver runs with the same parameter values as for the training data, especially if the training data was loaded externally. If you are generating synthetic data before training, you can use YAML anchors so save yourself having to type the parameters out
again:
Data:
synthetic_data:
alpha: &alpha 1.2
beta: &beta 3
kappa: &kappa 8
epsilon: &epsilon 3
sigma: &sigma 0
dt: &dt 0.001
Training:
true_parameters:
alpha: *alpha
beta: *beta
kappa: *kappa
epsilon: *epsilon
sigma: *sigma
dt: *dt
This will automatically use the parameters you used to generate the training data during the neural net training run.
You can of course use different values for
Instead of generating synthetic data, you can also load data from an .h5
File. Specify the paths to the
origin sizes, destination sizes, and network files from the load_from_dir
entry of the config:
Data:
load_from_dir:
network: path/to/file.h5
origin_zones: path/to/file.h5
destination_zones: path/to/file.h5
You do not need to provide the paths to all three -- any missing files will be synthetically generated using
the settings from the synthetic_data
entry.
The following configuration sets are included in the model:
London_dataset
: trains on a synthetic dataset using the London dataset as an initial condition. The data is provided in thedata/HarrisWilsonNW/
folder. You can generate it by calling
python3 models/HarrisWilsonNW/cfgs/London_dataset/generate_London_data.py
This will automatically generate data using the settings in the London_dataset
configuration set and write it
to the data/HarrisWilonNW
folder (it will overwrite any previous files!)
You can run this set simply by calling
utopya run HarrisWilsonNW --cs London_dataset