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_optimizer=True)
Load a checkpoint from MLflow or filesystem.
Keep load_optimizer=True when resuming the original training state.
Set load_optimizer=False for fine-tuning workflows that should reuse
weights but start Adam from a clean state.
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
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 274 275 276 277 | |