Inpainting
influpaint.batch.inpainting
Atomic inpainting script for generating forecasts using trained diffusion models. Runs a single scenario, for a single date, with a single config (fully parallelizable).
Usage
Single atomic run
python inpaint.py -s 5 -r "abc123def456" -e "exp" --forecast_date "2022-11-14" --config_name "celebahq_try1"
With filesystem fallback
python inpaint.py -s 5 -m "/path/to/model.pth" -e "exp" --forecast_date "2022-11-14" --config_name "celebahq_try1"
load_model(ddpm, run_id=None, model_path=None)
Load model from MLflow or filesystem. Note that mlflow run_id are unique and thus we don't need to know the training run experiment name here.
Source code in influpaint/batch/inpainting.py
log_forecast_artifacts(fluforecasts, fluforecasts_ti, forecasts_national, inpaint_folder)
Log forecast results as MLflow artifacts
Source code in influpaint/batch/inpainting.py
main(scn_id, run_id, model_path, experiment_name, outdir, forecast_date, config_name, image_size, channels, batch_size)
Run inpainting/forecasting for a specific scenario using a trained model
Source code in influpaint/batch/inpainting.py
run_inpainting(scenario_spec, ddpm, dataset, image_size, channels, batch_size, device, inpaint_folder, forecast_date, config_name)
Run inpainting for a single scenario, date, and config
Source code in influpaint/batch/inpainting.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |