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
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/providers/summary_providers/primitive_summary_provider.py
src/providers/summary_providers/primitive_summary_provider.py
import numpy as np import yaml from utils.infer_higher_is_better import higher_is_better_from_metric_key, is_neutral_key from .base.summary_provider_base import SummaryProviderBase from ..path_provider import PathProvider class PrimitiveSummaryProvider(SummaryProviderBase): def __init__(self, path_provider: Path...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/providers/summary_providers/noop_summary_provider.py
src/providers/summary_providers/noop_summary_provider.py
from .base.summary_provider_base import SummaryProviderBase class NoopSummaryProvider(SummaryProviderBase): def __init__(self): super().__init__() self.summary = {} def update(self, *args, **kwargs): self.summary.update(*args, **kwargs) def __setitem__(self, key, value): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/providers/summary_providers/__init__.py
src/providers/summary_providers/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/providers/summary_providers/base/summary_provider_base.py
src/providers/summary_providers/base/summary_provider_base.py
import logging class SummaryProviderBase: def __init__(self): self.logger = logging.getLogger(type(self).__name__) def update(self, *args, **kwargs): raise NotImplementedError def __setitem__(self, key, value): raise NotImplementedError def __getitem__(self, key): ra...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/providers/summary_providers/base/__init__.py
src/providers/summary_providers/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/modules/__init__.py
src/modules/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/pdearena/conditional_twod_resnet.py
src/modules/pdearena/conditional_twod_resnet.py
# Adapted from https://github.com/microsoft/pdearena/blob/main/pdearena/modules/conditioned/twod_resnet.py # Adaptions: # - conditional embedding is passed to the model instead of creating a sincos timestep embedding within the model # - remove last projection (handled by decoder) # - removed explicit fp32 conversions ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/pdearena/__init__.py
src/modules/pdearena/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/graph/gnn_layer.py
src/modules/graph/gnn_layer.py
import torch from torch import nn from torch_geometric.nn.conv import MessagePassing class GNNLayer(MessagePassing): def __init__(self, input_dim, hidden_dim): super().__init__() self.message_net = nn.Sequential( nn.Linear(2 * input_dim + 1, hidden_dim), nn.SiLU(), ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/graph/__init__.py
src/modules/graph/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/graph/topk.py
src/modules/graph/topk.py
from typing import Callable, Optional, Union import torch from torch import Tensor from torch_geometric.nn.inits import uniform from torch_geometric.nn.pool.select import Select, SelectOutput from torch_geometric.nn.resolver import activation_resolver from torch_geometric.utils import cumsum, scatter def topk( ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/graph/sag_pool.py
src/modules/graph/sag_pool.py
from typing import Callable, Optional, Tuple, Union import torch from torch import Tensor from torch_geometric.nn import GraphConv from torch_geometric.nn.pool.connect import FilterEdges from .topk import SelectTopK from torch_geometric.typing import OptTensor class SAGPoolingFixedNumNodes(torch.nn.Module): """...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_gnn_pool.py
src/modules/gno/cfd_gnn_pool.py
from functools import partial import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias, init_truncnormal_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_geometric.nn.conv import MessagePassing from modules.graph.sag_pool import SAGPoolingFixed...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_gino_mesh_to_grid.py
src/modules/gno/cfd_gino_mesh_to_grid.py
import einops import numpy as np import torch from kappamodules.layers import ContinuousSincosEmbed, LinearProjection, Residual from torch import nn from torch_scatter import segment_csr from kappamodules.init import init_xavier_uniform_zero_bias, init_truncnormal_zero_bias class CfdGinoMeshToGrid(nn.Module): def...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/gino_grid_to_mesh.py
src/modules/gno/gino_grid_to_mesh.py
import einops import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class GinoGridToMesh(nn.Module): def __init__( self, input_dim, hid...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_mesh_to_grid_sdf_og.py
src/modules/gno/rans_gino_mesh_to_grid_sdf_og.py
import einops import numpy as np import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class RansGinoMeshToGridSdfOg(nn.Module): def __init__(self, hidden_dim, output_dim,...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_posembed_message.py
src/modules/gno/rans_posembed_message.py
import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_geometric.nn.conv import MessagePassing class RansPosembedMessage(MessagePassing): def __init__(self, dim, ndim): super().__init__(aggr=...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_gino_grid_to_mesh.py
src/modules/gno/cfd_gino_grid_to_mesh.py
import einops import torch from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class CfdGinoGridToMesh(nn.Module): def __init__(self, input_dim, hidden_dim, output_dim, ndim): super().__init__() self.input_dim = input_dim self.hi...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_grid_to_mesh.py
src/modules/gno/rans_gino_grid_to_mesh.py
import einops import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class RansGinoGridToMesh(nn.Module): def __init__(self, input_dim, hidden_dim, output_dim, ndim): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_grid_to_mesh_og.py
src/modules/gno/rans_gino_grid_to_mesh_og.py
import einops import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class RansGinoGridToMeshOg(nn.Module): def __init__( self, input_dim, ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_latent_to_mesh.py
src/modules/gno/rans_gino_latent_to_mesh.py
import einops import torch from torch_scatter import segment_csr from .gino_grid_to_mesh import GinoGridToMesh class RansGinoLatentToMesh(GinoGridToMesh): # noinspection PyMethodOverriding def forward(self, x, query_pos): assert query_pos.ndim == 3 # convert to sparse tensor _, seqle...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_mesh_to_grid_og.py
src/modules/gno/rans_gino_mesh_to_grid_og.py
import einops import numpy as np import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class RansGinoMeshToGridOg(nn.Module): def __init__(self, dim, resolution): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_pool_gaussian_sincos_pos.py
src/modules/gno/cfd_pool_gaussian_sincos_pos.py
import einops import numpy as np import torch from kappamodules.layers import ContinuousSincosEmbed, LinearProjection, Residual from kappamodules.init import init_xavier_uniform_zero_bias, init_truncnormal_zero_bias from torch import nn from torch_scatter import segment_csr class CfdPoolGaussianSincosPos(nn.Module): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_mesh_to_grid.py
src/modules/gno/rans_gino_mesh_to_grid.py
import einops import numpy as np import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class RansGinoMeshToGrid(nn.Module): def __init__(self, dim, resolution): su...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_gino_mesh_to_grid_old.py
src/modules/gno/cfd_gino_mesh_to_grid_old.py
import einops import numpy as np import torch from kappamodules.layers import ContinuousSincosEmbed, LinearProjection, Residual from torch import nn from torch_scatter import segment_csr class CfdGinoMeshToGridOld(nn.Module): def __init__(self, input_dim, hidden_dim, resolution): super().__init__() ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_gino_mesh_to_grid_sdf.py
src/modules/gno/rans_gino_mesh_to_grid_sdf.py
import einops import numpy as np import torch from kappamodules.init.functional import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr class RansGinoMeshToGridSdf(nn.Module): def __init__(self, dim, resolution): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_pool.py
src/modules/gno/cfd_pool.py
import einops import numpy as np import torch from kappamodules.layers import ContinuousSincosEmbed, LinearProjection, Residual from kappamodules.init import init_xavier_uniform_zero_bias, init_truncnormal_zero_bias from torch import nn from torch_scatter import segment_csr class CfdPool(nn.Module): def __init__(...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/__init__.py
src/modules/gno/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_interpolate_grid_to_mesh.py
src/modules/gno/cfd_interpolate_grid_to_mesh.py
import einops import torch from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_scatter import segment_csr import torch.nn.functional as F class CfdInterpolateGridToMesh(nn.Module): @staticmethod def forward(x, query_pos): assert torch.all(query_pos.abs() <= 1) ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/rans_pool.py
src/modules/gno/rans_pool.py
import einops import numpy as np import torch from kappamodules.layers import ContinuousSincosEmbed, LinearProjection, Residual from kappamodules.init import init_xavier_uniform_zero_bias, init_truncnormal_zero_bias from torch import nn from torch_scatter import segment_csr class RansPool(nn.Module): def __init__...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/gno/cfd_interpolate_mesh_to_grid.py
src/modules/gno/cfd_interpolate_mesh_to_grid.py
import einops import numpy as np import torch from kappamodules.layers import ContinuousSincosEmbed, LinearProjection, Residual from torch import nn from torch_scatter import segment_csr from kappamodules.init import init_xavier_uniform_zero_bias, init_truncnormal_zero_bias from torch_geometric.nn.unpool.knn_interpolat...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/mesh_embed/baseline_mesh_embed.py
src/modules/mesh_embed/baseline_mesh_embed.py
import einops import torch from kappamodules.init import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from modules.graph.gnn_layer import GNNLayer class BaselineMeshEmbed(nn.Module): def __init__(self, dim, depth, resolution, input_dim): super()...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/mesh_embed/gnn_mesh_embed_v2.py
src/modules/mesh_embed/gnn_mesh_embed_v2.py
import torch from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_geometric.data import Data from modules.graph.sag_pool import SAGPoolingFixedNumNodes from modules.graph.gnn_layer import GNNLayer class GNNMeshEmbedV2(torch.nn.Module): def __init__(self, input_dim, gnn_dim, pool_...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/mesh_embed/gnn_mesh_embed.py
src/modules/mesh_embed/gnn_mesh_embed.py
import torch from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_geometric.data import Data from torch_geometric.nn.conv import MessagePassing from torch_geometric.nn.pool import SAGPooling from modules.graph.sag_pool import SAGPoolingFixedNumNodes class GNNLayer(MessagePassing): ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/mesh_embed/__init__.py
src/modules/mesh_embed/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/modules/mesh_embed/dummy_mesh_embed.py
src/modules/mesh_embed/dummy_mesh_embed.py
import math import einops import torch.nn.functional as F from kappamodules.init import init_xavier_uniform_zero_bias from kappamodules.layers import ContinuousSincosEmbed from torch import nn from torch_geometric.nn.pool import SAGPooling import torch class DummyMeshEmbed(nn.Module): def __init__(self, in_feature...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/configs/wandb_config.py
src/configs/wandb_config.py
class WandbConfig: MODES = ["disabled", "online", "offline"] def __init__(self, mode: str, host: str = None, entity: str = None, project: str = None): assert mode in self.MODES self.mode = mode if not self.is_disabled: assert host is not None and isinstance(host, str), f"wan...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/configs/static_config.py
src/configs/static_config.py
import logging import os from pathlib import Path from typing import Optional import kappaconfig as kc from distributed.config import is_distributed, is_managed, get_world_size, get_local_rank from .wandb_config import WandbConfig class StaticConfig: def __init__(self, uri: str, datasets_were_preloaded: bool = ...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/configs/__init__.py
src/configs/__init__.py
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/src/configs/cli_args.py
src/configs/cli_args.py
import logging from argparse import ArgumentParser from dataclasses import dataclass from pathlib import Path from .wandb_config import WandbConfig @dataclass class CliArgs: hp: str accelerator: str devices: str num_workers: int pin_memory: bool wandb_mode: str wandb_config: str cudnn...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/data/shapenetcar/preprocess.py
data/shapenetcar/preprocess.py
# conda create --name open3d python=3.9 # pip install open3d # pip install meshio # pip install torch # pip install tempfile import os import tempfile from argparse import ArgumentParser from pathlib import Path import meshio import numpy as np import open3d as o3d import torch from tqdm import tqdm def parse_args()...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/data/transientflow/MeshGenerator.py
data/transientflow/MeshGenerator.py
import gmsh import math import numpy as np import random import meshio import argparse def compute_centroid(points): centroid = [sum(x for x, _ in points) / len(points), sum(y for _, y in points) / len(points)] return centroid def polar_angle(point,centroid): x, y = point angle = math.atan2(y - cent...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/data/transientflow/generateCase.py
data/transientflow/generateCase.py
import os import argparse import shutil import random import time from tqdm import tqdm import pickle from fluidfoam import readscalar from fluidfoam import readmesh from fluidfoam import readvector from sklearn.cluster import DBSCAN import meshio from shapely.geometry import Point,Polygon import torch import numpy as...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/data/transientflow/cfddataset_from_openfoam.py
data/transientflow/cfddataset_from_openfoam.py
import os import pickle import shutil from argparse import ArgumentParser from pathlib import Path import torch from torch.utils.data import Dataset, DataLoader from tqdm import tqdm def parse_args(): parser = ArgumentParser() parser.add_argument("--src", type=str, required=True, help="/OpenFOAM/") parse...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
ml-jku/UPT
https://github.com/ml-jku/UPT/blob/f148ef187973ef4958e8a5324c6692dd2582ad97/data/transientflow/cfddataset_norm.py
data/transientflow/cfddataset_norm.py
import os from argparse import ArgumentParser from pathlib import Path import einops import torch from tqdm import tqdm from torch.utils.data import Dataset, DataLoader def parse_args(): parser = ArgumentParser() parser.add_argument("--root", type=str, required=True, help="e.g. /system/user/publicdata/CVSim/...
python
MIT
f148ef187973ef4958e8a5324c6692dd2582ad97
2026-01-05T07:12:15.158856Z
false
dhingratul/Stock-Price-Prediction
https://github.com/dhingratul/Stock-Price-Prediction/blob/940b95271f0befe13752dca7d82aa1f84ebf7137/src/helper.py
src/helper.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 10 12:45:51 2017 @author: dhingratul """ import numpy as np import matplotlib.pyplot as plt def normalize_windows(win_data): """ Normalize a window Input: Window Data Output: Normalized Window Note: Run from load_data() Note...
python
MIT
940b95271f0befe13752dca7d82aa1f84ebf7137
2026-01-05T07:12:22.817686Z
false
dhingratul/Stock-Price-Prediction
https://github.com/dhingratul/Stock-Price-Prediction/blob/940b95271f0befe13752dca7d82aa1f84ebf7137/src/timeSeriesPredict.py
src/timeSeriesPredict.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 10 13:54:11 2017 @author: dhingratul Predicts the next day (closing) stock prices for S&P 500 data using LSTM, and 1D conv layer """ from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM from keras.models ...
python
MIT
940b95271f0befe13752dca7d82aa1f84ebf7137
2026-01-05T07:12:22.817686Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/train.py
train.py
from keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard, LearningRateScheduler from keras.optimizers import SGD, Adam from keras.losses import squared_hinge import os import argparse import keras.backend as K from models.model_factory import build_model from utils.config_utils import Config from utils....
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/personal_config/__init__.py
personal_config/__init__.py
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/models/__init__.py
models/__init__.py
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/models/model_factory.py
models/model_factory.py
from keras.models import Sequential, Model from keras import regularizers from keras.layers import Reshape, Activation, Conv2D, Input, MaxPooling2D, BatchNormalization, Flatten, Dense, Lambda, concatenate from keras.layers.advanced_activations import LeakyReLU from keras.regularizers import l2 import numpy as np from ...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/utils/load_data.py
utils/load_data.py
# Copyright 2017 Bert Moons # This file is part of QNN. # QNN is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # QNN is distributed i...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/utils/__init__.py
utils/__init__.py
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/utils/config_utils.py
utils/config_utils.py
import warnings def import_from(mdl, name): mdl = __import__(mdl, fromlist=[name]) return getattr(mdl, name) #required, default (if not required), type, subtype*(if previous type is list or tuple) parameter_specs = { 'cpu' :[True, None, bool], 'epochs' :[True, ...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/layers/binary_layers.py
layers/binary_layers.py
# -*- coding: utf-8 -*- import numpy as np from keras import backend as K from keras.layers import InputSpec, Layer, Dense, Conv2D from keras import constraints from keras import initializers from binary_ops import binarize class Clip(constraints.Constraint): def __init__(self, min_value, max_value=None): ...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/layers/quantized_ops.py
layers/quantized_ops.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import keras.backend as K import tensorflow as tf import numpy as np def round_through(x): '''Element-wise rounding to the closest integer with full gradient propagation. A trick from [Sergey Ioffe](http://stackoverflow.com/a/36480182) ''' ...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/layers/quantized_layers.py
layers/quantized_layers.py
# -*- coding: utf-8 -*- import numpy as np from keras import backend as K from keras.layers import InputSpec, Layer, Dense, Conv2D from keras import constraints from keras import initializers from quantized_ops import quantize, clip_through class Clip(constraints.Constraint): def __init__(self, min_value, max_...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/layers/binary_ops.py
layers/binary_ops.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import keras.backend as K import tensorflow as tf def round_through(x): '''Element-wise rounding to the closest integer with full gradient propagation. A trick from [Sergey Ioffe](http://stackoverflow.com/a/36480182) ''' rounded = K.round...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/layers/__init__.py
layers/__init__.py
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/config/config_MNIST.py
config/config_MNIST.py
# test using cpu only cpu = False # type of network to be trained, can be bnn, full-bnn, qnn, full-qnn, tnn, full-tnn network_type = 'full-qnn' # bits can be None, 2, 4, 8 , whatever bits=None wbits = 4 abits = 4 # finetune an be false or true finetune = False dataset='MNIST' dim=28 channels=1 classes=10 #regulariza...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/config/config_CIFAR-10.py
config/config_CIFAR-10.py
# test using cpu only cpu = False # type of network to be trained, can be bnn, full-bnn, qnn, full-qnn, tnn, full-tnn network_type = 'full-qnn' # bits can be None, 2, 4, 8 , whatever bits=None wbits = 4 abits = 4 # finetune an be false or true finetune = False dataset='CIFAR-10' dim=32 channels=3 classes=10 #regular...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/config/config.py
config/config.py
# test using cpu only cpu = False # type of network to be trained, can be bnn, full-bnn, qnn, full-qnn, tnn, full-tnn network_type = 'full-qnn' # bits can be None, 2, 4, 8 , whatever bits=None wbits = 4 abits = 4 # finetune an be false or true finetune = False dataset='CIFAR-10' dim=32 channels=3 classes=10 #regular...
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow
https://github.com/BertMoons/QuantizedNeuralNetworks-Keras-Tensorflow/blob/2eb9f8fbd4ce3c0160be95580c9bb452d7055538/config/__init__.py
config/__init__.py
python
BSD-3-Clause
2eb9f8fbd4ce3c0160be95580c9bb452d7055538
2026-01-05T07:10:58.474336Z
false
Kozea/Flask-WeasyPrint
https://github.com/Kozea/Flask-WeasyPrint/blob/580e83d1a4d3ca2e51af417c5479acf9d7b80a60/tests/test_flask_weasyprint.py
tests/test_flask_weasyprint.py
"""Tests for Flask-WeasyPrint.""" import pytest from flask import Flask, json, jsonify, redirect, request from flask_weasyprint import CSS, HTML, make_url_fetcher, render_pdf from weasyprint import __version__ as weasyprint_version from werkzeug.test import ClientRedirectError from . import app, document_html def t...
python
BSD-3-Clause
580e83d1a4d3ca2e51af417c5479acf9d7b80a60
2026-01-05T07:12:27.148520Z
false
Kozea/Flask-WeasyPrint
https://github.com/Kozea/Flask-WeasyPrint/blob/580e83d1a4d3ca2e51af417c5479acf9d7b80a60/tests/__init__.py
tests/__init__.py
"""Demonstration and testing application for Flask-WeasyPrint.""" from flask import Flask, abort, redirect, render_template, request, url_for from weasyprint import __version__ as weasyprint_version # Disable the Flask’s default static file handling. (See below.) app = Flask(__name__, static_folder=None) # This is ...
python
BSD-3-Clause
580e83d1a4d3ca2e51af417c5479acf9d7b80a60
2026-01-05T07:12:27.148520Z
false
Kozea/Flask-WeasyPrint
https://github.com/Kozea/Flask-WeasyPrint/blob/580e83d1a4d3ca2e51af417c5479acf9d7b80a60/docs/conf.py
docs/conf.py
# Flask-WeasyPrint documentation build configuration file. import flask_weasyprint # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.autose...
python
BSD-3-Clause
580e83d1a4d3ca2e51af417c5479acf9d7b80a60
2026-01-05T07:12:27.148520Z
false
Kozea/Flask-WeasyPrint
https://github.com/Kozea/Flask-WeasyPrint/blob/580e83d1a4d3ca2e51af417c5479acf9d7b80a60/flask_weasyprint/__init__.py
flask_weasyprint/__init__.py
"""Make PDF in your Flask app with WeasyPrint.""" from io import BytesIO from urllib.parse import urljoin, urlsplit from flask import current_app, has_request_context, request, send_file from werkzeug.test import Client, ClientRedirectError, EnvironBuilder from werkzeug.wrappers import Response VERSION = __version__...
python
BSD-3-Clause
580e83d1a4d3ca2e51af417c5479acf9d7b80a60
2026-01-05T07:12:27.148520Z
false
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/tests/test_cli.py
tests/test_cli.py
"""Tests for CLI argument parsing""" from github_dependents_info.__main__ import app from typer.testing import CliRunner runner = CliRunner() def test_cli_no_duplicate_param_warnings(): """Test that help command doesn't show duplicate parameter warnings""" result = runner.invoke(app, ["--help"]) assert ...
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
false
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/tests/__init__.py
tests/__init__.py
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
false
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/tests/test_gh_dependents_info/test_gh_dependents_info.py
tests/test_gh_dependents_info/test_gh_dependents_info.py
"""Tests for gh_dependents_info""" import os import tempfile import uuid from github_dependents_info import GithubDependentsInfo SINGLE_PACKAGE_REPO = "nvuillam/npm-groovy-lint" SINGLE_PACKAGE_TOTAL_DOC_URL = "https://nvuillam/npm-groovy-lint" SINGLE_PACKAGE_REPO_PUBLIC_DEPENDENTS_MIN = 10 MULTI_PACKAGE_REPO = "nvui...
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
false
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/tests/test_gh_dependents_info/__init__.py
tests/test_gh_dependents_info/__init__.py
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
false
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/github_dependents_info/gh_dependents_info.py
github_dependents_info/gh_dependents_info.py
import asyncio import inspect import json import logging import math import os import re from collections import Counter from pathlib import Path import httpx import numpy as np import pandas as pd from bs4 import BeautifulSoup class GithubDependentsInfo: def __init__(self, repo, **options) -> None: self...
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
true
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/github_dependents_info/__main__.py
github_dependents_info/__main__.py
import logging from typing import Annotated import typer from github_dependents_info import version from github_dependents_info.gh_dependents_info import GithubDependentsInfo from rich.console import Console app = typer.Typer( name="github-dependents-info", help="""Collect information about dependencies betwe...
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
false
nvuillam/github-dependents-info
https://github.com/nvuillam/github-dependents-info/blob/59a406df22d1f42803182c6f4da71e3efeeeb161/github_dependents_info/__init__.py
github_dependents_info/__init__.py
""" Collect information about dependencies between a github repo and other repositories. Results available in JSON, markdown and badges. """ from importlib import metadata as importlib_metadata from .gh_dependents_info import GithubDependentsInfo # noqa def get_version() -> str: try: return importlib_m...
python
MIT
59a406df22d1f42803182c6f4da71e3efeeeb161
2026-01-05T07:12:28.185048Z
false
rodlaf/KalshiMarketMaker
https://github.com/rodlaf/KalshiMarketMaker/blob/8cd2cb26b6c4eaa3a4ab3ffeeb9683951439a42f/mm.py
mm.py
import abc import time from typing import Dict, List, Tuple import requests import logging import uuid import math class AbstractTradingAPI(abc.ABC): @abc.abstractmethod def get_price(self) -> float: pass @abc.abstractmethod def place_order(self, action: str, side: str, price: float, quantity:...
python
MIT
8cd2cb26b6c4eaa3a4ab3ffeeb9683951439a42f
2026-01-05T07:12:29.367532Z
false
rodlaf/KalshiMarketMaker
https://github.com/rodlaf/KalshiMarketMaker/blob/8cd2cb26b6c4eaa3a4ab3ffeeb9683951439a42f/runner.py
runner.py
import argparse import logging from concurrent.futures import ThreadPoolExecutor import yaml from dotenv import load_dotenv import os from typing import Dict from mm import KalshiTradingAPI, AvellanedaMarketMaker def load_config(config_file): with open(config_file, 'r') as f: return yaml.safe_load(f) def...
python
MIT
8cd2cb26b6c4eaa3a4ab3ffeeb9683951439a42f
2026-01-05T07:12:29.367532Z
false
SmartLi8/stella
https://github.com/SmartLi8/stella/blob/8023dfa91ee2a74511e091902ceba5a3911cc610/run_train.py
run_train.py
# coding=utf8 import os import logging import yaml import torch from torch.utils.data import DataLoader from os.path import join from copy import deepcopy from transformers import AutoTokenizer, AutoModel, BertModel from transformers import TrainingArguments, Trainer import shutil os.environ["WANDB_DISABLED"] = "tru...
python
Apache-2.0
8023dfa91ee2a74511e091902ceba5a3911cc610
2026-01-05T07:12:29.713333Z
false
SmartLi8/stella
https://github.com/SmartLi8/stella/blob/8023dfa91ee2a74511e091902ceba5a3911cc610/src/run_eval_stella.py
src/run_eval_stella.py
""" eval for stella model """ import numpy as np import torch import random import argparse import functools from typing import List, Dict from sentence_transformers import SentenceTransformer from mteb import MTEB, DRESModel from C_MTEB.tasks import * parser = argparse.ArgumentParser(description='evaluation for CMTE...
python
Apache-2.0
8023dfa91ee2a74511e091902ceba5a3911cc610
2026-01-05T07:12:29.713333Z
false
SmartLi8/stella
https://github.com/SmartLi8/stella/blob/8023dfa91ee2a74511e091902ceba5a3911cc610/src/utils.py
src/utils.py
# coding=utf8 from transformers import TrainingArguments from transformers import TrainerCallback, TrainerControl, TrainerState import torch from os.path import join def get_mean_params(model): """ :param model: :return:Dict[para_name, para_weight] """ result = {} for param_name, param in mo...
python
Apache-2.0
8023dfa91ee2a74511e091902ceba5a3911cc610
2026-01-05T07:12:29.713333Z
false
SmartLi8/stella
https://github.com/SmartLi8/stella/blob/8023dfa91ee2a74511e091902ceba5a3911cc610/src/__init__.py
src/__init__.py
from .data_collator import ( InBatchDataSet, in_batch_collate_fn, PairDataSet, pair_collate_fn, comb_data_loader, VecDataSet ) from .utils import cosent_loss, get_mean_params, SaveModelCallBack
python
Apache-2.0
8023dfa91ee2a74511e091902ceba5a3911cc610
2026-01-05T07:12:29.713333Z
false
SmartLi8/stella
https://github.com/SmartLi8/stella/blob/8023dfa91ee2a74511e091902ceba5a3911cc610/src/data_collator.py
src/data_collator.py
# coding=utf8 import collections import random import torch from torch.utils.data import Dataset import json from loguru import logger class InBatchDataSet(Dataset): def __init__(self, data_paths: str, data_name: str, model_name: str): self.data = [] self.data_paths = data_paths self.data_...
python
Apache-2.0
8023dfa91ee2a74511e091902ceba5a3911cc610
2026-01-05T07:12:29.713333Z
false
SmartLi8/stella
https://github.com/SmartLi8/stella/blob/8023dfa91ee2a74511e091902ceba5a3911cc610/src/add_new_pos_embed.py
src/add_new_pos_embed.py
""" 扩展当前BERT的长度,新扩展的emebdding用层次分解的位置编码进行初始化 """ import torch import json import os import shutil if __name__ == "__main__": read_dir = r"E:\PublicModels\piccolo-base-zh" save_dir = r"E:\PublicModels\piccolo-base-zh-1024" ori_pos = 512 new_pos = 1024 hp_alpha = 0.2 # 创建目录 os.makedirs(save_...
python
Apache-2.0
8023dfa91ee2a74511e091902ceba5a3911cc610
2026-01-05T07:12:29.713333Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/manage.py
abstract-base-user-example/manage.py
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello_django.settings") try: from django.core.management import execute_from_command_line except...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/views.py
abstract-base-user-example/users/views.py
from django.urls import reverse_lazy from django.views import generic from .forms import CustomUserCreationForm class SignUp(generic.CreateView): form_class = CustomUserCreationForm success_url = reverse_lazy("login") template_name = "signup.html"
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/admin.py
abstract-base-user-example/users/admin.py
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .forms import CustomUserCreationForm, CustomUserChangeForm from .models import CustomUser class CustomUserAdmin(UserAdmin): add_form = CustomUserCreationForm form = CustomUserChangeForm model = CustomUser list_displ...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/models.py
abstract-base-user-example/users/models.py
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _ from .managers import CustomUserManager class CustomUser(AbstractBaseUser, PermissionsMixin): email = models.EmailField(_...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/managers.py
abstract-base-user-example/users/managers.py
from django.contrib.auth.base_user import BaseUserManager from django.utils.translation import gettext_lazy as _ class CustomUserManager(BaseUserManager): """ Custom user model manager where email is the unique identifiers for authentication instead of usernames. """ def create_user(self, email, p...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/__init__.py
abstract-base-user-example/users/__init__.py
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/tests.py
abstract-base-user-example/users/tests.py
from django.contrib.auth import get_user_model from django.test import TestCase class UsersManagersTests(TestCase): def test_create_user(self): User = get_user_model() user = User.objects.create_user(email="normal@user.com", password="foo") self.assertEqual(user.email, "normal@user.com") ...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/apps.py
abstract-base-user-example/users/apps.py
from django.apps import AppConfig class UsersConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" name = "users"
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/forms.py
abstract-base-user-example/users/forms.py
from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import CustomUser class CustomUserCreationForm(UserCreationForm): class Meta: model = CustomUser fields = ("email",) class CustomUserChangeForm(UserChangeForm): class Meta: model = CustomUser ...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/urls.py
abstract-base-user-example/users/urls.py
from django.urls import path from . import views urlpatterns = [path("signup/", views.SignUp.as_view(), name="signup"), ]
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/migrations/0001_initial.py
abstract-base-user-example/users/migrations/0001_initial.py
# Generated by Django 4.1.5 on 2023-01-21 21:10 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ("auth", "0012_alter_user_first_name_max_length"), ] operations = [ migrations.CreateModel( ...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/users/migrations/__init__.py
abstract-base-user-example/users/migrations/__init__.py
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/hello_django/asgi.py
abstract-base-user-example/hello_django/asgi.py
""" ASGI config for hello_django project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault("DJANGO_...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/hello_django/settings.py
abstract-base-user-example/hello_django/settings.py
""" Django settings for hello_django project. Generated by 'django-admin startproject' using Django 4.1.5. For more information on this file, see https://docs.djangoproject.com/en/4.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.1/ref/settings/ """ from pa...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/hello_django/__init__.py
abstract-base-user-example/hello_django/__init__.py
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/hello_django/wsgi.py
abstract-base-user-example/hello_django/wsgi.py
""" WSGI config for hello_django project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-base-user-example/hello_django/urls.py
abstract-base-user-example/hello_django/urls.py
from django.contrib import admin from django.urls import path, include from django.views.generic.base import TemplateView urlpatterns = [ path("", TemplateView.as_view(template_name="home.html"), name="home"), path("admin/", admin.site.urls), path("users/", include("users.urls")), path("users/", includ...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false
testdrivenio/django-custom-user-model
https://github.com/testdrivenio/django-custom-user-model/blob/1136e836d233d4c8d76564826d77a567d4482491/abstract-user-example/manage.py
abstract-user-example/manage.py
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello_django.settings") try: from django.core.management import execute_from_command_line except...
python
MIT
1136e836d233d4c8d76564826d77a567d4482491
2026-01-05T07:12:30.363478Z
false