Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
tags:
|
| 4 |
+
- weather-forecasting
|
| 5 |
+
- diffusion-models
|
| 6 |
+
- rectified-flow
|
| 7 |
+
- meteorology
|
| 8 |
+
- pytorch
|
| 9 |
+
- deep-learning
|
| 10 |
+
license: mit
|
| 11 |
+
datasets:
|
| 12 |
+
- meteolibre
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# MeteoLibre Rectified Flow Model
|
| 16 |
+
|
| 17 |
+
This is a rectified flow diffusion model trained for meteorological data forecasting using the MeteoLibre dataset. The model uses a 3D U-Net architecture with FiLM conditioning for efficient weather pattern generation.
|
| 18 |
+
|
| 19 |
+
## Model Description
|
| 20 |
+
|
| 21 |
+
- **Model type**: Rectified Flow Diffusion Model
|
| 22 |
+
- **Architecture**: 3D DC-AE U-Net with FiLM conditioning
|
| 23 |
+
- **Input**: Meteorological data patches (12 channels, 3D spatio-temporal)
|
| 24 |
+
- **Output**: Generated weather forecast data
|
| 25 |
+
- **Training data**: MeteoLibre meteorological dataset
|
| 26 |
+
- **Language(s)**: Python
|
| 27 |
+
- **License**: MIT
|
| 28 |
+
|
| 29 |
+
## Intended Use
|
| 30 |
+
|
| 31 |
+
This model is designed for:
|
| 32 |
+
- Weather pattern generation and forecasting
|
| 33 |
+
- Meteorological data augmentation
|
| 34 |
+
- Research in atmospheric science and weather prediction
|
| 35 |
+
- Educational purposes in machine learning for climate modeling
|
| 36 |
+
|
| 37 |
+
## Model Architecture
|
| 38 |
+
|
| 39 |
+
The model consists of:
|
| 40 |
+
- **UNet_DCAE_3D**: 3D convolutional U-Net with encoder-decoder architecture
|
| 41 |
+
- **FiLM Conditioning**: Feature-wise linear modulation for temporal context
|
| 42 |
+
- **Rectified Flow**: Efficient generative modeling approach
|
| 43 |
+
- **Input channels**: 12 (meteorological variables)
|
| 44 |
+
- **Output channels**: 12 (forecast variables)
|
| 45 |
+
- **Features**: [64, 128, 256] channel progression
|
| 46 |
+
- **Context frames**: 4 (temporal conditioning)
|
| 47 |
+
|
| 48 |
+
## Training
|
| 49 |
+
|
| 50 |
+
The model was trained using:
|
| 51 |
+
- **Framework**: PyTorch with Hugging Face Accelerate
|
| 52 |
+
- **Optimizer**: Adam (lr=5e-4)
|
| 53 |
+
- **Batch size**: 64
|
| 54 |
+
- **Epochs**: 200
|
| 55 |
+
- **Precision**: Mixed precision (bf16)
|
| 56 |
+
- **Distributed training**: Multi-GPU support
|
| 57 |
+
|
| 58 |
+
## Usage
|
| 59 |
+
|
| 60 |
+
### Loading the Model
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from safetensors.torch import load_file
|
| 64 |
+
import torch
|
| 65 |
+
from meteolibre_model.models.dc_3dunet_film import UNet_DCAE_3D
|
| 66 |
+
|
| 67 |
+
# Load model weights
|
| 68 |
+
state_dict = load_file("epoch_141_rectified_flow.safetensors")
|
| 69 |
+
|
| 70 |
+
# Create model
|
| 71 |
+
model = UNet_DCAE_3D(
|
| 72 |
+
in_channels=12,
|
| 73 |
+
out_channels=12,
|
| 74 |
+
features=[64, 128, 256],
|
| 75 |
+
context_dim=4,
|
| 76 |
+
context_frames=4,
|
| 77 |
+
num_additional_resnet_blocks=2
|
| 78 |
+
)
|
| 79 |
+
|
| 80 |
+
model.load_state_dict(state_dict)
|
| 81 |
+
model.eval()
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
### Inference
|
| 85 |
+
|
| 86 |
+
```python
|
| 87 |
+
# Example inference code
|
| 88 |
+
with torch.no_grad():
|
| 89 |
+
generated_data = model(input_batch)
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
## Performance
|
| 93 |
+
|
| 94 |
+
The model checkpoints are saved at regular intervals:
|
| 95 |
+
- epoch_1_rectified_flow.safetensors through epoch_141_rectified_flow.safetensors
|
| 96 |
+
- Best performing checkpoints available for different training stages
|
| 97 |
+
|
| 98 |
+
## Limitations
|
| 99 |
+
|
| 100 |
+
- Model trained on specific meteorological dataset
|
| 101 |
+
- May not generalize to all weather patterns or regions
|
| 102 |
+
- Requires significant computational resources for inference
|
| 103 |
+
- Temporal context limited to 4 frames
|
| 104 |
+
|
| 105 |
+
## Ethical Considerations
|
| 106 |
+
|
| 107 |
+
- Weather forecasting models should be used responsibly
|
| 108 |
+
- Consider environmental impact of computational requirements
|
| 109 |
+
- Validate predictions against ground truth data
|
| 110 |
+
- Not intended for critical decision-making without human oversight
|
| 111 |
+
|
| 112 |
+
## Citation
|
| 113 |
+
|
| 114 |
+
If you use this model in your research, please cite:
|
| 115 |
+
|
| 116 |
+
```bibtex
|
| 117 |
+
@misc{meteolibre-rectified-flow,
|
| 118 |
+
title={MeteoLibre Rectified Flow Weather Forecasting Model},
|
| 119 |
+
author={MeteoLibre Development Team},
|
| 120 |
+
year={2025},
|
| 121 |
+
publisher={Hugging Face},
|
| 122 |
+
url={https://huggingface.co/meteolibre-dev/meteolibre-rectified-flow}
|
| 123 |
+
}
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
## Contact
|
| 127 |
+
|
| 128 |
+
For questions or issues, please open an issue on the [MeteoLibre GitHub repository](https://github.com/meteolibre-dev/meteolibre_model).
|