repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
andybrandt/mcp-simple-pubmed
https://github.com/andybrandt/mcp-simple-pubmed/blob/de245d350c456df353363a50051ed5547dedafc0/mcp_simple_pubmed/pubmed_fetch.py
mcp_simple_pubmed/pubmed_fetch.py
""" Full text fetching functionality for PubMed articles. This module focuses solely on retrieving full text content from PMC using Bio.Entrez. """ import logging from typing import Optional import xml.etree.ElementTree as ET from Bio import Entrez, Medline logging.basicConfig(level=logging.INFO) logger = logging.get...
python
MIT
de245d350c456df353363a50051ed5547dedafc0
2026-01-05T07:12:06.493732Z
false
tmb5cg/Fifa-Autobidder
https://github.com/tmb5cg/Fifa-Autobidder/blob/a68e84e070c73e8595ea238791e49c9e025a7cd4/src/run.py
src/run.py
from cProfile import label from posixpath import split import tkinter as tk from tkinter import ttk from gui import GUI if __name__ == "__main__": root = tk.Tk() root.title("TMB's FIFA Autobidder") # Set theme root.tk.call("source", "azure.tcl") root.tk.call("set_theme", "dark") app = GUI(ro...
python
MIT
a68e84e070c73e8595ea238791e49c9e025a7cd4
2026-01-05T07:11:03.703387Z
false
tmb5cg/Fifa-Autobidder
https://github.com/tmb5cg/Fifa-Autobidder/blob/a68e84e070c73e8595ea238791e49c9e025a7cd4/src/gui.py
src/gui.py
from cProfile import label from datetime import datetime import importlib from posixpath import split import queue import threading import time import tkinter as tk from tkinter import ttk import configparser from turtle import color from helpers import checkStartupFiles, create_driver, getFilters, log_event, setup_a...
python
MIT
a68e84e070c73e8595ea238791e49c9e025a7cd4
2026-01-05T07:11:03.703387Z
false
tmb5cg/Fifa-Autobidder
https://github.com/tmb5cg/Fifa-Autobidder/blob/a68e84e070c73e8595ea238791e49c9e025a7cd4/src/autobidder.py
src/autobidder.py
import csv from os import path from platform import platform import random from csv import reader from datetime import datetime from datetime import date from decimal import Decimal from time import sleep from turtle import position from selenium import webdriver from selenium.common.exceptions import ( NoSuchEle...
python
MIT
a68e84e070c73e8595ea238791e49c9e025a7cd4
2026-01-05T07:11:03.703387Z
true
tmb5cg/Fifa-Autobidder
https://github.com/tmb5cg/Fifa-Autobidder/blob/a68e84e070c73e8595ea238791e49c9e025a7cd4/src/helpers.py
src/helpers.py
import configparser from datetime import datetime import json import os from os import path import platform import random import re from time import sleep from selenium import webdriver from selenium.common.exceptions import ( NoSuchElementException, TimeoutException, WebDriverException) from selenium.webdriver imp...
python
MIT
a68e84e070c73e8595ea238791e49c9e025a7cd4
2026-01-05T07:11:03.703387Z
false
MichaelStott/KivMob
https://github.com/MichaelStott/KivMob/blob/1e6591541a1164cf9080f4d0e64c166f54bd4c55/setup.py
setup.py
from setuptools import setup setup( name="kivmob", version="2.0", description="Provides AdMob support for Kivy.", url="http://github.com/MichaelStott/KivMob", author="Michael Stott", license="MIT", py_modules=["kivmob"], install_requires=["kivy"], zip_safe=False, )
python
MIT
1e6591541a1164cf9080f4d0e64c166f54bd4c55
2026-01-05T07:11:54.574300Z
false
MichaelStott/KivMob
https://github.com/MichaelStott/KivMob/blob/1e6591541a1164cf9080f4d0e64c166f54bd4c55/kivmob.py
kivmob.py
from kivy.core.window import Window from kivy.logger import Logger from kivy.metrics import dp from kivy.utils import platform if platform == "android": try: from jnius import autoclass, cast, PythonJavaClass, java_method from android.runnable import run_on_ui_thread activity = autoclass(...
python
MIT
1e6591541a1164cf9080f4d0e64c166f54bd4c55
2026-01-05T07:11:54.574300Z
false
MichaelStott/KivMob
https://github.com/MichaelStott/KivMob/blob/1e6591541a1164cf9080f4d0e64c166f54bd4c55/docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
python
MIT
1e6591541a1164cf9080f4d0e64c166f54bd4c55
2026-01-05T07:11:54.574300Z
false
MichaelStott/KivMob
https://github.com/MichaelStott/KivMob/blob/1e6591541a1164cf9080f4d0e64c166f54bd4c55/demo/main.py
demo/main.py
from kivmob import KivMob, TestIds, RewardedListenerInterface import kivy.utils from kivymd.app import MDApp from kivy.lang import Builder from kivy.config import Config from kivy.utils import platform from kivy.core.window import Window from kivy.uix.floatlayout import FloatLayout from kivy.uix.screenmanager import S...
python
MIT
1e6591541a1164cf9080f4d0e64c166f54bd4c55
2026-01-05T07:11:54.574300Z
false
jacob-bd/notebooklm-mcp
https://github.com/jacob-bd/notebooklm-mcp/blob/1ca3bba360852de0534ca33e0ccf7258a0efd306/src/notebooklm_mcp/api_client.py
src/notebooklm_mcp/api_client.py
#!/usr/bin/env python3 """NotebookLM MCP API client (notebooklm.google.com). Internal API. See CLAUDE.md for full documentation. """ import json import os import re import urllib.parse from dataclasses import dataclass from datetime import datetime, timezone from typing import Any import httpx # Ownership constant...
python
MIT
1ca3bba360852de0534ca33e0ccf7258a0efd306
2026-01-05T07:12:11.692365Z
true
jacob-bd/notebooklm-mcp
https://github.com/jacob-bd/notebooklm-mcp/blob/1ca3bba360852de0534ca33e0ccf7258a0efd306/src/notebooklm_mcp/auth_cli.py
src/notebooklm_mcp/auth_cli.py
#!/usr/bin/env python3 """CLI tool to authenticate with NotebookLM MCP. This tool connects to Chrome via DevTools Protocol, navigates to NotebookLM, and extracts authentication tokens. If the user is not logged in, it waits for them to log in via the Chrome window. Usage: 1. Start Chrome with remote debugging: ...
python
MIT
1ca3bba360852de0534ca33e0ccf7258a0efd306
2026-01-05T07:12:11.692365Z
false
jacob-bd/notebooklm-mcp
https://github.com/jacob-bd/notebooklm-mcp/blob/1ca3bba360852de0534ca33e0ccf7258a0efd306/src/notebooklm_mcp/__init__.py
src/notebooklm_mcp/__init__.py
"""NotebookLM MCP Server. This MCP provides access to NotebookLM (notebooklm.google.com) using undocumented internal APIs. Tested with personal/free tier accounts. May work with Google Workspace accounts but has not been tested. WARNING: This uses undocumented internal APIs that may change at any time. """ __version...
python
MIT
1ca3bba360852de0534ca33e0ccf7258a0efd306
2026-01-05T07:12:11.692365Z
false
jacob-bd/notebooklm-mcp
https://github.com/jacob-bd/notebooklm-mcp/blob/1ca3bba360852de0534ca33e0ccf7258a0efd306/src/notebooklm_mcp/server.py
src/notebooklm_mcp/server.py
"""NotebookLM MCP Server.""" from typing import Any from fastmcp import FastMCP from .api_client import NotebookLMClient, extract_cookies_from_chrome_export, parse_timestamp # Initialize MCP server mcp = FastMCP( name="notebooklm", instructions="""NotebookLM MCP - Access NotebookLM (notebooklm.google.com). ...
python
MIT
1ca3bba360852de0534ca33e0ccf7258a0efd306
2026-01-05T07:12:11.692365Z
true
jacob-bd/notebooklm-mcp
https://github.com/jacob-bd/notebooklm-mcp/blob/1ca3bba360852de0534ca33e0ccf7258a0efd306/src/notebooklm_mcp/auth.py
src/notebooklm_mcp/auth.py
"""Authentication helper for NotebookLM MCP. Uses Chrome DevTools MCP to extract auth tokens from an authenticated browser session. If the user is not logged in, prompts them to log in via the Chrome window. """ import json import os import time from dataclasses import dataclass from pathlib import Path @dataclass ...
python
MIT
1ca3bba360852de0534ca33e0ccf7258a0efd306
2026-01-05T07:12:11.692365Z
false
eriklindernoren/PyTorch-Deep-Dream
https://github.com/eriklindernoren/PyTorch-Deep-Dream/blob/637de95ffca461d49ae49538d0d44f0e89ffdf0f/deep_dream.py
deep_dream.py
import torch import torch.nn as nn from torch.autograd import Variable from torchvision import models import numpy as np import matplotlib.pyplot as plt from PIL import Image import argparse import os import tqdm import scipy.ndimage as nd from utils import deprocess, preprocess, clip def dream(image, model, iteratio...
python
MIT
637de95ffca461d49ae49538d0d44f0e89ffdf0f
2026-01-05T07:12:12.077056Z
false
eriklindernoren/PyTorch-Deep-Dream
https://github.com/eriklindernoren/PyTorch-Deep-Dream/blob/637de95ffca461d49ae49538d0d44f0e89ffdf0f/utils.py
utils.py
import numpy as np import torch from torchvision import transforms mean = np.array([0.485, 0.456, 0.406]) std = np.array([0.229, 0.224, 0.225]) preprocess = transforms.Compose([transforms.ToTensor(), transforms.Normalize(mean, std)]) def deprocess(image_np): image_np = image_np.squeeze().transpose(1, 2, 0) ...
python
MIT
637de95ffca461d49ae49538d0d44f0e89ffdf0f
2026-01-05T07:12:12.077056Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/eval_cfd.py
src/eval_cfd.py
import os import platform from argparse import ArgumentParser from copy import deepcopy from pathlib import Path import wandb import yaml def parse_args(): parser = ArgumentParser() parser.add_argument("--stage_id", type=str, required=True) parser.add_argument("--checkpoint", type=str, default="best_mode...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/train_stage.py
src/train_stage.py
import logging import os from pathlib import Path import kappaprofiler as kp import yaml from torch.distributed import broadcast_object_list from wandb.util import generate_id from callbacks.base.callback_base import CallbackBase from configs.cli_args import CliArgs from configs.static_config import StaticConfig from...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/main_train.py
src/main_train.py
from utils.version_check import check_versions check_versions(verbose=False) import logging import os import kappaprofiler as kp import torch from configs.cli_args import parse_run_cli_args from configs.static_config import StaticConfig from distributed.config import barrier, get_rank, get_local_rank, get_world_siz...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/main_sbatch.py
src/main_sbatch.py
import os import platform import shlex import sys import uuid from argparse import ArgumentParser from datetime import datetime from pathlib import Path import yaml import kappaconfig as kc def get_parser(): parser = ArgumentParser() # how many GPUs gpus_group = parser.add_mutually_exclusive_group() ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/main_run_folder.py
src/main_run_folder.py
import argparse import logging import os import random import shutil import subprocess from pathlib import Path from time import sleep import yaml from utils.logging_util import add_stdout_handler from utils.version_check import check_versions def parse_args(): parser = argparse.ArgumentParser() parser.add_...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/default_initializer.py
src/initializers/default_initializer.py
from .base.initializer_base import InitializerBase class DefaultInitializer(InitializerBase): """ implicitly applies the torch default initialization useful e.g. when defining a list of initializers to sweep over """ def init_weights(self, model): pass
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/functional.py
src/initializers/functional.py
import torch.nn as nn ALL_BATCHNORMS = ( nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d, nn.LazyBatchNorm1d, nn.LazyBatchNorm2d, nn.LazyBatchNorm3d, nn.SyncBatchNorm, ) _ALL_NORMS = ( *ALL_BATCHNORMS, nn.LayerNorm, nn.InstanceNorm1d, nn.InstanceNorm2d, nn.InstanceNorm3d...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/previous_run_initializer.py
src/initializers/previous_run_initializer.py
from .base.checkpoint_initializer import CheckpointInitializer class PreviousRunInitializer(CheckpointInitializer): """ initializes a model from a checkpoint of a previous run (specified by the stage_id) load_optim=False as this is usually used for frozen/pretrained models """ def __init__( ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/resume_initializer.py
src/initializers/resume_initializer.py
import os import torch from models.base.composite_model_base import CompositeModelBase from models.base.single_model_base import SingleModelBase from utils.checkpoint import Checkpoint from .base.checkpoint_initializer import CheckpointInitializer class ResumeInitializer(CheckpointInitializer): """ initiali...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/__init__.py
src/initializers/__init__.py
from utils.factory import instantiate def initializer_from_kwargs(kind, **kwargs): return instantiate( module_names=[f"initializers.{kind}"], type_names=[kind.split(".")[-1]], **kwargs )
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/pretrained_initializer.py
src/initializers/pretrained_initializer.py
from pathlib import Path import torch from models.ssl_heads.masked_decoder import MaskedDecoder from .base.initializer_base import InitializerBase class PretrainedInitializer(InitializerBase): """ initialize with weights from an external, pretrained checkpoints (e.g. original facebook MAE checkpoints) """ ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/base/initializer_base.py
src/initializers/base/initializer_base.py
import logging from providers.path_provider import PathProvider class InitializerBase: def __init__(self, path_provider: PathProvider = None): self.logger = logging.getLogger(type(self).__name__) self.path_provider = path_provider # check if children overwrite the correct method ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/base/checkpoint_initializer.py
src/initializers/base/checkpoint_initializer.py
import torch from initializers.base.initializer_base import InitializerBase from models.base.single_model_base import SingleModelBase from utils.checkpoint import Checkpoint from utils.factory import create class CheckpointInitializer(InitializerBase): def __init__(self, stage_id, model_name, checkpoint, load_op...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/initializers/base/__init__.py
src/initializers/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/optimizer_wrapper.py
src/optimizers/optimizer_wrapper.py
import logging import torch from kappaschedules import object_to_schedule from torch.cuda.amp import GradScaler from utils.bidict import Bidict from utils.factory import create_collection, create from utils.formatting_util import float_to_scientific_notation from .lr_scalers import lr_scaler_from_kwargs from .lr_scal...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/interleaved_optimizer.py
src/optimizers/interleaved_optimizer.py
import logging from kappaschedules import object_to_schedule class InterleavedOptimizer: """ selects an optimizer from a set of optimizers per update step according to a schedule the schedule should return the index of the current optimizer """ def __init__(self, model, optim_ctors, schedule, up...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/__init__.py
src/optimizers/__init__.py
from copy import deepcopy from functools import partial from optimizers.interleaved_optimizer import InterleavedOptimizer from optimizers.optimizer_wrapper import OptimizerWrapper from utils.factory import get_ctor def optim_ctor_from_kwargs(kind, **kwargs): kwargs = deepcopy(kwargs) if kind == "interleaved_...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/custom/lars.py
src/optimizers/custom/lars.py
# https://raw.githubusercontent.com/Lightning-AI/lightning-bolts/master/pl_bolts/optimizers/lars.py import torch from torch.optim.optimizer import Optimizer class LARS(Optimizer): def __init__( self, params, lr, momentum=0, dampening=0, weigh...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/custom/lion.py
src/optimizers/custom/lion.py
import torch from torch.optim.optimizer import Optimizer class Lion(Optimizer): """ https://raw.githubusercontent.com/lucidrains/lion-pytorch/main/lion_pytorch/lion_pytorch.py """ def __init__(self, params, lr=1e-4, betas=(0.9, 0.99), weight_decay=0.0): assert lr > 0. assert all([0. <= beta <...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/custom/__init__.py
src/optimizers/custom/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/lr_scalers/linear_lr_scaler.py
src/optimizers/lr_scalers/linear_lr_scaler.py
class LinearLrScaler: def __init__(self, divisor=256): super().__init__() self.divisor = divisor def __str__(self): return f"{type(self).__name__}(divisor={self.divisor})" def scale_lr(self, base_lr, lr_scale_factor): return base_lr * lr_scale_factor / self.divisor
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/lr_scalers/sqrt_lr_scaler.py
src/optimizers/lr_scalers/sqrt_lr_scaler.py
import math class SqrtLrScaler: def __init__(self, divisor=256): super().__init__() self.divisor = divisor def __str__(self): return f"{type(self).__name__}(divisor={self.divisor})" def scale_lr(self, base_lr, lr_scale_factor): return base_lr * math.sqrt(lr_scale_factor /...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/lr_scalers/__init__.py
src/optimizers/lr_scalers/__init__.py
from utils.factory import instantiate def lr_scaler_from_kwargs(kind, **kwargs): return instantiate( module_names=[f"optimizers.lr_scalers.{kind}"], type_names=[kind], **kwargs )
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/param_group_modifiers/vit_norm_lr_scale_modifier.py
src/optimizers/param_group_modifiers/vit_norm_lr_scale_modifier.py
from .base.param_group_modifier import ParamGroupModifier class VitNormLrScaleModifier(ParamGroupModifier): def __init__(self, scale, start_block_index=None): self.scale = scale self.start_block_index = start_block_index def get_properties(self, model, name, param): assert self.start_...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/param_group_modifiers/layerwise_lr_decay_modifier.py
src/optimizers/param_group_modifiers/layerwise_lr_decay_modifier.py
from .base.param_group_modifier import ParamGroupModifier class LayerwiseLrDecayModifier(ParamGroupModifier): def __init__(self, decay, skip_layers=None): self.decay = decay self.skip_layers = skip_layers def get_properties(self, model, name, param): # adapted from BEiT: https://githu...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/param_group_modifiers/exclude_from_wd_by_name_modifier.py
src/optimizers/param_group_modifiers/exclude_from_wd_by_name_modifier.py
from .base.param_group_modifier import ParamGroupModifier class ExcludeFromWdByNameModifier(ParamGroupModifier): def __init__(self, name): super().__init__() self.name = name self.param_was_found = False def get_properties(self, model, name, param): if name == self.name: ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/param_group_modifiers/__init__.py
src/optimizers/param_group_modifiers/__init__.py
from utils.factory import instantiate def param_group_modifier_from_kwargs(kind, **kwargs): return instantiate( module_names=[f"optimizers.param_group_modifiers.{kind}"], type_names=[kind], **kwargs )
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/param_group_modifiers/base/param_group_modifier.py
src/optimizers/param_group_modifiers/base/param_group_modifier.py
class ParamGroupModifier: def get_properties(self, model, name, param): raise NotImplementedError def __repr__(self): return str(self) def __str__(self): raise NotImplementedError @staticmethod def was_applied_successfully(): return True
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/optimizers/param_group_modifiers/base/__init__.py
src/optimizers/param_group_modifiers/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/__init__.py
src/summarizers/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/summary_summarizers/best_metric_summary_summarizer.py
src/summarizers/summary_summarizers/best_metric_summary_summarizer.py
import fnmatch import numpy as np from utils.infer_higher_is_better import higher_is_better_from_metric_key from .base.summary_summarizer_base import SummarySummarizerBase class BestMetricSummarySummarizer(SummarySummarizerBase): def __init__(self, pattern, **kwargs): super().__init__(**kwargs) ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/summary_summarizers/__init__.py
src/summarizers/summary_summarizers/__init__.py
from utils.factory import instantiate def summary_summarizer_from_kwargs(kind, **kwargs): return instantiate(module_names=[f"summarizers.summary_summarizers.{kind}"], type_names=[kind], **kwargs)
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/summary_summarizers/base/summary_summarizer_base.py
src/summarizers/summary_summarizers/base/summary_summarizer_base.py
import logging from providers.summary_providers.base.summary_provider_base import SummaryProviderBase from providers.summary_providers.noop_summary_provider import NoopSummaryProvider class SummarySummarizerBase: def __init__(self, summary_provider: SummaryProviderBase): self.logger = logging.getLogger(t...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/summary_summarizers/base/__init__.py
src/summarizers/summary_summarizers/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/stage_summarizers/group_best_metric_summarizer.py
src/summarizers/stage_summarizers/group_best_metric_summarizer.py
from .base.stage_summarizer_base import StageSummarizerBase from .best_metric_summarizer import BestMetricSummarizer class GroupBestMetricSummarizer(StageSummarizerBase): def __init__(self, source_group, target_group=None, **kwargs): super().__init__(**kwargs) self.source_group = source_group ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/stage_summarizers/best_metric_summarizer.py
src/summarizers/stage_summarizers/best_metric_summarizer.py
import numpy as np from utils.infer_higher_is_better import higher_is_better_from_metric_key from .base.stage_summarizer_base import StageSummarizerBase class BestMetricSummarizer(StageSummarizerBase): """ looks at the best source_key metric and logs the target_key metric at that global_step e.g. source_...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/stage_summarizers/__init__.py
src/summarizers/stage_summarizers/__init__.py
from utils.factory import instantiate def stage_summarizer_from_kwargs(kind, **kwargs): return instantiate(module_names=[f"summarizers.stage_summarizers.{kind}"], type_names=[kind], **kwargs)
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/stage_summarizers/base/stage_summarizer_base.py
src/summarizers/stage_summarizers/base/stage_summarizer_base.py
import logging import yaml from providers.path_provider import PathProvider from providers.summary_providers.base.summary_provider_base import SummaryProviderBase from providers.summary_providers.noop_summary_provider import NoopSummaryProvider from utils.checkpoint import Checkpoint class StageSummarizerBase: ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/summarizers/stage_summarizers/base/__init__.py
src/summarizers/stage_summarizers/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/losses/elementwise_loss.py
src/losses/elementwise_loss.py
import torch import torch.nn as nn from losses import basic_loss_fn_from_kwargs from utils.factory import create from utils.loss_utils import apply_reduction from utils.vit_util import patchify_as_1d from .basic.mse_loss import MseLoss class ElementwiseLoss(nn.Module): def __init__(self, loss_function): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/losses/__init__.py
src/losses/__init__.py
from utils.factory import instantiate def loss_fn_from_kwargs(kind, update_counter=None, **kwargs): return instantiate( module_names=[f"losses.{kind}", f"losses.basic.{kind}", "torch.nn"], type_names=[kind.split(".")[-1]], # pass update_counter to SchedulableLoss but not to e.g. torch.nn.M...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/losses/basic/l1_loss.py
src/losses/basic/l1_loss.py
import torch.nn as nn import torch.nn.functional as F class L1Loss(nn.Module): @staticmethod def forward(pred, target, reduction="mean"): return F.l1_loss(pred, target, reduction=reduction)
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/losses/basic/mse_loss.py
src/losses/basic/mse_loss.py
import torch.nn as nn import torch.nn.functional as F class MseLoss(nn.Module): @staticmethod def forward(pred, target, reduction="mean"): return F.mse_loss(pred, target, reduction=reduction)
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/losses/basic/__init__.py
src/losses/basic/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/freezers/full_freezer.py
src/freezers/full_freezer.py
from .base.freezer_base import FreezerBase class FullFreezer(FreezerBase): def __str__(self): return type(self).__name__ def _update_state(self, model, requires_grad): model.eval() for param in model.parameters(): param.requires_grad = requires_grad
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/freezers/__init__.py
src/freezers/__init__.py
from utils.factory import instantiate def freezer_from_kwargs(kind, **kwargs): return instantiate( module_names=[f"freezers.{kind}"], type_names=[kind.split(".")[-1]], **kwargs )
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/freezers/base/freezer_base.py
src/freezers/base/freezer_base.py
import logging from kappaschedules import object_to_schedule, PeriodicBoolSchedule from utils.update_counter import UpdateCounter class FreezerBase: def __init__(self, update_counter: UpdateCounter = None, schedule=None): self.logger = logging.getLogger(type(self).__name__) self.update_counter =...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/freezers/base/__init__.py
src/freezers/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/dummy_dataset.py
src/datasets/dummy_dataset.py
import torch from torchvision.transforms.functional import to_pil_image from .base.dataset_base import DatasetBase class DummyDataset(DatasetBase): def __init__( self, x_shape, size=None, n_classes=10, n_abspos=10, is_multilabel=False, ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/lagrangian_dataset.py
src/datasets/lagrangian_dataset.py
import os import json import h5py import wget import zipfile import torch from torch_geometric.data import Data from torch_geometric.nn.pool import radius_graph, radius from torch_geometric.transforms import KNNGraph from .base.dataset_base import DatasetBase from kappadata.copying.image_folder import copy_imagefolde...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/__init__.py
src/datasets/__init__.py
import logging from utils.factory import instantiate def dataset_from_kwargs( kind, dataset_config_provider, dataset_wrappers=None, sample_wrappers=None, **kwargs, ): dataset = instantiate( module_names=[f"datasets.{kind}", f"datasets.wrappers.{kind}"], typ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/cfd_dataset.py
src/datasets/cfd_dataset.py
import os import einops import numpy as np import scipy import torch from kappadata.copying.image_folder import copy_imagefolder_from_global_to_local from kappautils.param_checking import to_2tuple from torch_geometric.nn.pool import radius, radius_graph from distributed.config import barrier, is_data_rank0 from util...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
true
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/shapenet_car.py
src/datasets/shapenet_car.py
import einops import scipy import os import shutil import meshio import numpy as np import torch from kappautils.param_checking import to_3tuple, to_2tuple from torch_geometric.nn.pool import radius, radius_graph from distributed.config import barrier, is_data_rank0 from .base.dataset_base import DatasetBase class ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/base/dataset_base.py
src/datasets/base/dataset_base.py
from kappadata.datasets import KDDataset from providers.dataset_config_provider import DatasetConfigProvider from providers.path_provider import PathProvider from utils.collator_from_kwargs import collator_from_kwargs from utils.factory import create_collection from utils.param_checking import to_path class DatasetB...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/base/__init__.py
src/datasets/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/rans_interpolated_collator.py
src/datasets/collators/rans_interpolated_collator.py
import einops import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.utils.data import default_collate class RansInterpolatedCollator(KDSingleCollator): def collate(self, batch, dataset_mode, ctx=None): # make sure that batch was not collated ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/cfd_interpolated_collator.py
src/datasets/collators/cfd_interpolated_collator.py
import einops import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.utils.data import default_collate from torch.nn.utils.rnn import pad_sequence class CfdInterpolatedCollator(KDSingleCollator): def collate(self, batch, dataset_mode, ctx=None): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/lagrangian_simformer_collator.py
src/datasets/collators/lagrangian_simformer_collator.py
import einops import torch from torch.nn.utils.rnn import pad_sequence from torch.utils.data import default_collate from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.utils.data import default_collate from torch_geometric.data import Data from torch_geometric.transfo...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/rans_baseline_collator.py
src/datasets/collators/rans_baseline_collator.py
import einops import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.utils.data import default_collate class RansBaselineCollator(KDSingleCollator): def collate(self, batch, dataset_mode, ctx=None): # make sure that batch was not collated ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/rans_simformer_nognn_collator.py
src/datasets/collators/rans_simformer_nognn_collator.py
import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.nn.utils.rnn import pad_sequence from torch.utils.data import default_collate class RansSimformerNognnCollator(KDSingleCollator): def collate(self, batch, dataset_mode, ctx=None): # make sur...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/cfd_simformer_collator.py
src/datasets/collators/cfd_simformer_collator.py
import einops import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.nn.utils.rnn import pad_sequence from torch.utils.data import default_collate class CfdSimformerCollator(KDSingleCollator): def __init__(self, num_supernodes=None, **kwargs): s...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/__init__.py
src/datasets/collators/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/cfd_baseline_collator.py
src/datasets/collators/cfd_baseline_collator.py
import einops import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.utils.data import default_collate class CfdBaselineCollator(KDSingleCollator): def collate(self, batch, dataset_mode, ctx=None): # make sure that batch was not collated ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/datasets/collators/rans_gino_encdec_sdf_collator.py
src/datasets/collators/rans_gino_encdec_sdf_collator.py
import einops import torch from kappadata.collators import KDSingleCollator from kappadata.wrappers import ModeWrapper from torch.utils.data import default_collate class RansGinoEncdecSdfCollator(KDSingleCollator): def collate(self, batch, dataset_mode, ctx=None): # make sure that batch was not collated ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/metrics/__init__.py
src/metrics/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/cfd_interpolated_trainer.py
src/trainers/cfd_interpolated_trainer.py
from functools import cached_property import einops from kappadata.wrappers import ModeWrapper from torch import nn from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.cfd_interpolated_collator import CfdInterpolatedCollator from losses import loss_fn_from_kwargs...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/rans_gino_encdec_sdf_trainer.py
src/trainers/rans_gino_encdec_sdf_trainer.py
from functools import cached_property import torch from kappadata.wrappers import ModeWrapper from torch import nn from torch_scatter import segment_csr from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.rans_gino_encdec_sdf_collator import RansGinoEncdecSdfColl...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/rans_simformer_nognn_sdf_trainer.py
src/trainers/rans_simformer_nognn_sdf_trainer.py
from functools import cached_property import torch from kappadata.wrappers import ModeWrapper from torch import nn from torch_scatter import segment_csr from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.rans_simformer_nognn_collator import RansSimformerNognnCol...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/gns_trainer.py
src/trainers/gns_trainer.py
import kappamodules.utils.tensor_cache as tc import os from functools import cached_property import torch import einops from torch import nn from kappadata.wrappers import ModeWrapper from losses import loss_fn_from_kwargs from utils.factory import create from .base.sgd_trainer import SgdTrainer from datasets.collator...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/cfd_baseline_trainer.py
src/trainers/cfd_baseline_trainer.py
from torch_scatter import segment_csr import torch from functools import cached_property import einops from kappadata.wrappers import ModeWrapper from torch import nn from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.cfd_baseline_collator import CfdBaselineCol...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/lagrangian_simformer_trainer.py
src/trainers/lagrangian_simformer_trainer.py
import kappamodules.utils.tensor_cache as tc import os from functools import cached_property import torch import einops from torch import nn from kappadata.wrappers import ModeWrapper from losses import loss_fn_from_kwargs from utils.factory import create from .base.sgd_trainer import SgdTrainer from datasets.collator...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/rans_baseline_trainer.py
src/trainers/rans_baseline_trainer.py
from functools import cached_property import torch from kappadata.wrappers import ModeWrapper from torch import nn from torch_scatter import segment_csr from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.rans_baseline_collator import RansBaselineCollator from lo...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/rans_interpolated_trainer.py
src/trainers/rans_interpolated_trainer.py
from functools import cached_property import torch from kappadata.wrappers import ModeWrapper from torch import nn from torch_scatter import segment_csr from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.rans_interpolated_collator import RansInterpolatedCollator...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/cfd_simformer_trainer.py
src/trainers/cfd_simformer_trainer.py
from functools import cached_property import kappamodules.utils.tensor_cache as tc import torch from kappadata.wrappers import ModeWrapper from torch import nn from torch_geometric.nn.pool import radius_graph from torch_scatter import segment_csr from callbacks.online_callbacks.update_output_callback import UpdateOut...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/lagrangian_large_t_simformer_trainer.py
src/trainers/lagrangian_large_t_simformer_trainer.py
import kappamodules.utils.tensor_cache as tc import os from functools import cached_property import torch import einops from torch import nn from kappadata.wrappers import ModeWrapper from losses import loss_fn_from_kwargs from utils.factory import create from .base.sgd_trainer import SgdTrainer from datasets.collator...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/__init__.py
src/trainers/__init__.py
from utils.factory import instantiate def trainer_from_kwargs(kind, **kwargs): if "eval" in kind: return instantiate(module_names=[f"trainers.eval.{kind}"], type_names=[kind], **kwargs) return instantiate(module_names=[f"trainers.{kind}"], type_names=[kind.split(".")[-1]], **kwargs)
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/rans_simformer_nognn_trainer.py
src/trainers/rans_simformer_nognn_trainer.py
from functools import cached_property import torch from kappadata.wrappers import ModeWrapper from torch import nn from torch_scatter import segment_csr from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.rans_simformer_nognn_collator import RansSimformerNognnCol...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/cfd_hybrid_trainer.py
src/trainers/cfd_hybrid_trainer.py
import torch from functools import cached_property import einops from kappadata.wrappers import ModeWrapper from torch import nn from callbacks.online_callbacks.update_output_callback import UpdateOutputCallback from datasets.collators.cfd_hybrid_collator import CfdHybridCollator from losses import loss_fn_from_kwarg...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/base/sgd_trainer.py
src/trainers/base/sgd_trainer.py
import logging from functools import partial import kappaprofiler as kp import torch import torch.nn as nn from kappadata.wrappers import KDMultiViewWrapper, XRepeatWrapper from torch.cuda.amp import GradScaler from torch.distributed import all_gather_object from torch.nn.parallel import DistributedDataParallel from ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
true
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/base/functional.py
src/trainers/base/functional.py
import logging import einops import torch from torch.utils.data import DataLoader from distributed.config import get_world_size from utils.functional import get_powers_of_two, is_power_of_two def calculate_effective_batch_size_per_device(effective_batch_size, world_size=None): world_size = world_size or get_wor...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/base/__init__.py
src/trainers/base/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/early_stoppers/metric_early_stopper.py
src/trainers/early_stoppers/metric_early_stopper.py
from callbacks.base.callback_base import CallbackBase from utils.infer_higher_is_better import higher_is_better_from_metric_key from .base.early_stopper_base import EarlyStopperBase class MetricEarlyStopper(EarlyStopperBase): def __init__(self, metric_key, tolerance, **kwargs): super().__init__(**kwargs) ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/early_stoppers/__init__.py
src/trainers/early_stoppers/__init__.py
from utils.factory import instantiate def early_stopper_from_kwargs(kind, **kwargs): return instantiate(module_names=[f"trainers.early_stoppers.{kind}"], type_names=[kind], **kwargs)
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/trainers/early_stoppers/loss_divergence_early_stopper.py
src/trainers/early_stoppers/loss_divergence_early_stopper.py
from collections import deque import numpy as np from callbacks.base.callback_base import CallbackBase from .base.early_stopper_base import EarlyStopperBase class LossDivergenceEarlyStopper(EarlyStopperBase): """ stop training if loss diverges organize losses into [...] + [reference_window] + [tolerance...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false