Skip to content

Instantly share code, notes, and snippets.

@nilsleh
nilsleh / laplace_example.py
Last active January 23, 2024 07:44
Laplace Example Constant UQ Reproduce
import os
from functools import lru_cache
from typing import Any, Dict, Optional
import kornia.augmentation as K
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import timm
import torch
@nilsleh
nilsleh / min_example.py
Last active April 9, 2024 09:26
DeepSensor Reproducable Example
from typing import Any
import deepsensor.torch
import numpy as np
import xarray as xr
from deepsensor.data.loader import TaskLoader
from deepsensor.data.processor import DataProcessor
from deepsensor.train import Trainer
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
@nilsleh
nilsleh / inpainting.py
Created May 22, 2024 14:22
Inpainting procedure with DDPM and RePaint
from glob import glob
import os
import matplotlib.pyplot as plt
import torch
from denoising_diffusion_pytorch import Unet
from denoising_diffusion_pytorch.repaint import GaussianDiffusion as RePaint
from PIL import Image
from torch.utils.data import DataLoader
from torchvision.datasets import VisionDataset
@nilsleh
nilsleh / config.yaml
Created September 17, 2024 12:17
Hyperparam tuning with optuna
experiment:
experiment_name: "eurosat"
exp_dir: "/mnt/SSD2/nils/projects/hyper_param/results"
wandb:
project: eurosat_hparam
entity: nleh
mode: offline
model:
_target_: lightning_uq_box.uq_methods.DeterministicClassification
@nilsleh
nilsleh / config.yaml
Last active November 19, 2024 18:21
Oceanbench osse_gf_nadir_sst reproduce
train_patcher_kw:
patches:
time: 15
lon: 200
lat: 200
strides:
time: 1
lon: 50
lat: 50
domain_limits:
@nilsleh
nilsleh / dynamic_earthnet_metadata.csv
Created March 20, 2025 06:23
dynamic earthnet metadat and paths
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 9 columns, instead of 6 in line 4.
split,planet_path,label_path,year_month,missing_label,s1_path,s2_path,missing_s1,missing_s2
train,planet/10N/23E-188N/1311_3077_13/PF-SR,labels/1311_3077_13_10N/Labels/Raster/10N-122W-40N-L3H-SR/10N-122W-40N-L3H-SR-2018_01_01.tif,2018-01,False,sentinel1/1311_3077_13/1311_3077_13_2018_01.tif,sentinel2/1311_3077_13/2018_01.tif,False,False
train,planet/10N/23E-188N/1311_3077_13/PF-SR,labels/1311_3077_13_10N/Labels/Raster/10N-122W-40N-L3H-SR/10N-122W-40N-L3H-SR-2018_02_01.tif,2018-02,False,sentinel1/1311_3077_13/1311_3077_13_2018_02.tif,sentinel2/1311_3077_13/2018_02.tif,False,False
train,planet/10N/23E-188N/1311_3077_13/PF-SR,labels/1311_3077_13_10N/Labels/Raster/10N-122W-40N-L3H-SR/10N-122W-40N-L3H-SR-2018_03_01.tif,2018-03,False,sentinel1/1311_3077_13/1311_3077_13_2018_03.tif,sentinel2/1311_3077_13/2018_03.tif,False,False
train,planet/10N/23E-188N/1311_3077_13/PF-SR,labels/1311_3077_13_10N/Labels/Raster/10N-122W-40N-L3H-SR/10N-122W-40N-L3H-SR-2018_04_01.tif,2018-04,False,sentinel1/1311_3077_13/1311_3077_13_201