Commit 574f8ea6 authored by Chris Jewell's avatar Chris Jewell
Browse files

Adjustments for poetry-ised repo

parent 18e24dc1
#!/bin/bash
#$ -S /bin/bash
#$ -P chicas
#$ -q gpu
#$ -l ngpus=1
# -l ncpus=2
......@@ -10,26 +11,25 @@
#$ -cwd
. /etc/profile
. $HOME/.bashrc
. $HOME/.bash_profile
module add cuda/10.1
conda activate covid19uk
module add cuda/11.0
export XLA_FLAGS="--xla_gpu_cuda_data_dir=$CUDA_HOME"
echo Args: "$@"
echo -n "Preparing config..."
CONFIG=`python prepare_config.py "$@"`
CONFIG=`poetry run python prepare_config.py "$@"`
echo "Done"
echo Using config: $CONFIG
echo Working directory: `pwd`
echo -n "Run inference..."
python inference.py -c "$CONFIG"
echo "Done"
#echo -n "Run inference..."
#poetry run python inference.py -c "$CONFIG"
#echo "Done"
echo -n "Create summary..."
python summary.py -c "$CONFIG"
poetry run python summary.py -c "$CONFIG"
echo "Done"
......@@ -132,9 +132,7 @@ if __name__ == "__main__":
return tfp.mcmc.TransformedTransitionKernel(
inner_kernel=AdaptiveRandomWalkMetropolis(
target_log_prob_fn=target_log_prob_fn,
initial_covariance=[
np.eye(shape[0], dtype=model_spec.DTYPE) * 1e-1
],
initial_covariance=np.eye(shape[0], dtype=model_spec.DTYPE) * 1e-1,
covariance_burnin=200,
),
bijector=tfp.bijectors.Exp(),
......@@ -147,9 +145,7 @@ if __name__ == "__main__":
def fn(target_log_prob_fn, _):
return AdaptiveRandomWalkMetropolis(
target_log_prob_fn=target_log_prob_fn,
initial_covariance=[
np.eye(shape[0], dtype=model_spec.DTYPE) * 1e-1
],
initial_covariance=np.eye(shape[0], dtype=model_spec.DTYPE) * 1e-1,
covariance_burnin=200,
name=name,
)
......
......@@ -11,7 +11,7 @@ import covid.data as data
tfd = tfp.distributions
DTYPE = np.float64
STOICHIOMETRY = tf.constant([[-1, 1, 0, 0], [0, -1, 1, 0], [0, 0, -1, 1]])
STOICHIOMETRY = np.array([[-1, 1, 0, 0], [0, -1, 1, 0], [0, 0, -1, 1]])
TIME_DELTA = 1.0
XI_FREQ = 14 # baseline transmission changes every 14 days
NU = tf.constant(0.5, dtype=DTYPE) # E->I rate assumed known.
......
......@@ -17,6 +17,7 @@ xlrd = "^1.2.0"
tqdm = "^4.50.2"
openpyxl = "^3.0.5"
h5py = "^2.10.0"
tf-nightly = "^2.4.0.dev20201021"
gemlib = {git = "http://fhm-chicas-code.lancs.ac.uk/GEM/gemlib.git"}
[tool.poetry.dev-dependencies]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment