added gitignore, smoothened structure slightly
This commit is contained in:
21
app/main.py
21
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):
|
||||
|
||||
Reference in New Issue
Block a user