From 8f2b071aca443033c590cd36af1a4db0d9216eb5 Mon Sep 17 00:00:00 2001 From: luptmoor Date: Fri, 10 Apr 2026 13:09:53 +0200 Subject: [PATCH] added gitignore, smoothened structure slightly --- app/main.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/app/main.py b/app/main.py index 2e5fb10..f144470 100644 --- a/app/main.py +++ b/app/main.py @@ -77,10 +77,10 @@ from pathlib import Path from typing import NamedTuple import numpy as np -import torch -import torch.nn as nn -import torch.nn.functional as F -from torch.utils.data import DataLoader, Dataset +import torch # type: ignore +import torch.nn as nn # type: ignore +import torch.nn.functional as F # type: ignore +from torch.utils.data import DataLoader, Dataset # type: ignore # --------------------------------------------------------------------------- @@ -134,14 +134,9 @@ class UpBlock(nn.Module): avoids checkerboard artefacts common in urban grid-like rasters. """ - def __init__( - self, - in_ch: int, - skip_ch: int, - out_ch: int, - dropout_p: float = 0.0, - ): + def __init__(self, in_ch: int, skip_ch: int, out_ch: int, dropout_p: float = 0.0): super().__init__() + self.up = nn.Sequential( nn.Upsample(scale_factor=2, mode="bilinear", align_corners=False), nn.Conv2d(in_ch, out_ch, kernel_size=1, bias=False), @@ -231,9 +226,7 @@ class UrbanClimateUNet(nn.Module): # ── Bottleneck ─────────────────────────────────────────────────────── # Receives: enc4-pooled (c*8 = 512 ch) + coarse context (128 ch) # → 640 ch input, 512 ch output - self.bottleneck = ConvBlock( - c * 8 + coarse_ch, c * 8, dropout_p=dropout_bot - ) + self.bottleneck = ConvBlock(c * 8 + coarse_ch, c * 8, dropout_p=dropout_bot) # ── Decoder ────────────────────────────────────────────────────────── # UpBlock(in_ch, skip_ch, out_ch):