xiazeyu / PyTorchFire

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyTorchFire: A GPU-Accelerated Wildfire Simulator with Differentiable Cellular Automata

Hatch project Read the Docs Code DOI Dataset DOI

Installation

Install with minimal dependencies:

pip install pytorchfire

Install with dependencies for examples:

pip install 'pytorchfire[examples]'

Quick Start

pip install pytorchfire

Then,

To perform wildfire prediction:

from pytorchfire import WildfireModel

model = WildfireModel() # Create a model with default parameters and environment data
model = model.cuda() # Move the model to GPU
# model.reset(seed=seed) # Reset the model with a seed
for _ in range(100): # Run the model for 100 steps
    model.compute() # Compute the next state

To perform parameter calibration:

import torch
from pytorchfire import WildfireModel, BaseTrainer

model = WildfireModel()

trainer = BaseTrainer(model)

trainer.train()
trainer.evaluate()

API Documents

See at Our Read the Docs.

About

License:MIT License


Languages

Language:Python 100.0%