repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/jSymbolic_lib/threshold.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:47.446329 | import random
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler, MinMaxScaler
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import os
import warnings
from sklearn.manifold import TSNE
from scipy.stats import pearsonr
from sklearn.feature... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/command_seq_generator.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:47.859855 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from fairseq import search, utils
from fairseq.data im... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/controlled_task.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:47.906098 | from fairseq.data.base_wrapper_dataset import BaseWrapperDataset
import numpy as np
from fairseq.data import data_utils
from fairseq.tasks.language_modeling import LanguageModelingTask, LanguageModelingConfig
from fairseq.tasks import register_task
import logging
from .linear import transformer_lm
from fairseq import... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/linear/causal_linear_attention.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:47.907120 | #
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>,
# Apoorv Vyas <avyas@idiap.ch>
#
"""Implement causally masked linear attention."""
import torch
from torch.nn import Module
from fast_transformers.causal_product import causal_do... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/linear/attention_layer.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:47.908353 | #
# Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>,
# Apoorv Vyas <avyas@idiap.ch>
#
"""The base attention layer performs all the query key value projections and
output projections leaving the implementation of the attention to the ... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/linear/transformer_layer.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:47.960736 | from typing import Dict, List, Optional
import torch
from torch import Tensor
from fairseq.modules.transformer_layer import TransformerDecoderLayer, TransformerEncoderLayer
# from fast_transformers.attention.attention_layer import AttentionLayer
# from fast_transformers.attention.causal_linear_attention import Causal... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/linear/transformer_lm.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:48.282975 | from fairseq.models.transformer_lm import TransformerLanguageModel, TransformerLanguageModelConfig, \
DEFAULT_MAX_TARGET_POSITIONS, transformer_lm_gpt, base_lm_architecture
from fairseq import options
from fairseq.modules import AdaptiveInput, CharacterTokenEmbedder
from fairseq.models import register_model, regist... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/train.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:48.285255 | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a new model on one or across multiple GPUs.
"""
import argparse
import logging
import math
import os
impo... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | emogen/linear_decoder/linear/transformer.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:48.514258 | from fairseq.models.transformer import Linear
from fairseq.models import FairseqDecoder
import math, gc
from typing import Any, Dict, List, Optional
import torch
import torch.nn as nn
from torch.utils.checkpoint import checkpoint
from fairseq import utils
from fairseq.models.fairseq_encoder import EncoderOut
from fai... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/data/bigdata.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:49.181119 | from torch.utils.data import Dataset
import numpy as np
import torch
from getmusic.data.indexed_datasets import IndexedDataset
import random
import itertools as it
class BigDataset(Dataset):
def __init__(self, prefix, vocab_size, path=None):
self.data_dir = path
self.prefix = prefix
self.ds... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/data/indexed_datasets.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:49.375572 | import pickle
import numpy as np
class IndexedDataset:
def __init__(self, path):
super().__init__()
self.path = path
self.data_file = None
self.data_offsets = np.load(f"{path}.idx", allow_pickle=True).item()['offsets']
self.data_file = open(f"{path}.data", 'rb', buffering=-... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/data/build.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:49.377073 | import torch
from torch.utils.data import ConcatDataset
from getmusic.utils.misc import instantiate_from_config
import numpy as np
import os
def build_dataloader(config, args=None, return_dataset=False):
dataset_cfg = config['dataloader']
train_dataset = []
for ds_cfg in dataset_cfg['train_datasets']:
... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/distributed/distributed.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:49.444295 | import pickle
import torch
from torch import distributed as dist
from torch.utils import data
LOCAL_PROCESS_GROUP = None
def is_primary():
return get_rank() == 0
def get_rank():
if not dist.is_available():
return 0
if not dist.is_initialized():
return 0
return dist.get_rank()
... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/engine/solver.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:49.711902 | import os
import time
import math
import torch
from torch.nn.utils import clip_grad_norm_, clip_grad_norm
from getmusic.utils.misc import instantiate_from_config, format_seconds
from getmusic.distributed.distributed import reduce_dict
from getmusic.distributed.distributed import is_primary
from getmusic.utils.misc impo... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/modeling/build.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:49.802308 | from getmusic.utils.misc import instantiate_from_config
def build_model(config, args=None):
return instantiate_from_config(config['model'])
|
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/engine/logger.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.016016 | import os
import time
import torch
from getmusic.utils.io import write_args, save_config_to_yaml
from getmusic.distributed.distributed import is_primary
import torch.utils.tensorboard as tensorboard
class Logger(object):
def __init__(self, args):
self.args = args
self.save_dir = args.save_dir
... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/modeling/roformer/diffusion_roformer.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.025065 | import torch
from torch import nn
import torch.nn.functional as F
from tqdm import tqdm
from getmusic.utils.misc import instantiate_from_config
import numpy as np
from torch.cuda.amp import autocast
import getmusic.utils.midi_config as mc
eps = 1e-8
def sum_except_batch(x, num_dims=1):
return x.reshape(*x.shape[:... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/modeling/models/dfm.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.056230 | import torch
from torch import nn
from getmusic.utils.misc import instantiate_from_config
from torch.cuda.amp import autocast
def disabled_train(self, mode=True):
return self
class DFM(nn.Module):
def __init__(
self,
*,
diffusion_config
):
super().__init__()
self.... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/engine/ema.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.057453 | import torch
import copy
class EMA(object):
def __init__(self,
model,
decay=0.99,
update_interval=1,
device=torch.device('cpu')):
self.decay = decay
self.update_iterval = update_interval
self.device = device
sel... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/engine/lr_scheduler.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.084722 | import torch
import math
from torch._six import inf
from torch.optim.optimizer import Optimizer
from torch.optim.lr_scheduler import _LRScheduler, CosineAnnealingLR
class LinearDecayLRWithWarmup(object):
"""
adjust lr:
args:
warmup_lr: float or None, the learning rate to be touched after warmup
... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/modeling/roformer/roformer.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.085991 | import math
import os
from typing import Optional, Tuple, Union
import numpy as np
import torch
import torch.utils.checkpoint
from torch import nn
from transformers import RoFormerPreTrainedModel, PretrainedConfig
from transformers import RoFormerModel
from transformers.modeling_outputs import BaseModelOutputWithPastA... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/modeling/roformer/roformer_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.393205 | from .roformer import RoFormerConfig, DiffusionRoFormerModel
import torch.nn as nn
import torch
class DiffusionRoformerModel(nn.Module):
def __init__(
self,
vocab_size=None,
cond_weight=None,
):
super().__init__()
self.vocab_size = vocab_size
config = RoFormer... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/modeling/utils/misc.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.466076 | import torch
import random
def logits_top_k(logits, filter_ratio = 0.5, minimum=1, pad_value=None):
logits = logits.contiguous()
if filter_ratio < 0:
filter_ratio = - filter_ratio
if filter_ratio >= 0 and filter_ratio <= 1.0:
num_logits = logits.shape[-1]
k = max(int((1 - filter_ra... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/utils/magenta_chord_recognition.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.607999 | # Copyright 2021 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/utils/io.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.672033 | import sys
import yaml
import torch
import json
def load_yaml_config(path):
with open(path) as f:
config = yaml.full_load(f)
return config
def save_config_to_yaml(config, path):
assert path.endswith('.yaml')
with open(path, 'w') as f:
f.write(yaml.dump(config))
f.close()
def ... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/utils/misc.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.672727 | import importlib
import random
import numpy as np
import torch
import warnings
import os
def seed_everything(seed, cudnn_deterministic=False):
"""
Function that sets seed for pseudo-random number generators in:
pytorch, numpy, python.random
Args:
seed: the integer value seed for global ra... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/position_generation.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.706139 | import argparse
import os
import warnings
import time
import torch
from getmusic.modeling.build import build_model
from getmusic.data.build import build_dataloader
from getmusic.utils.misc import seed_everything, merge_opts_to_config, modify_config_for_debug
from getmusic.utils.io import load_yaml_config
from getmusic.... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/utils/midi_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:50.786031 | pos_resolution = 4 # 16 # per beat (quarter note)
bar_max = 32
velocity_quant = 4
tempo_quant = 12 # 2 ** (1 / 12)
min_tempo = 16
max_tempo = 256
duration_max = 4 # 2 ** 8 * beat
max_ts_denominator = 6 # x/1 x/2 x/4 ... x/64
max_notes_per_bar = 1 # 1/64 ... 128/64 #
beat_note_factor = 4 # In MIDI format a note i... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/engine/clip_grad_norm.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:53.967663 | from torch.nn.utils import clip_grad_norm_
class ClipGradNorm(object):
def __init__(self,
start_iteration=0,
end_iteration=-1, # if negative, the norm will be always clipped
max_norm=0.5):
self.start_iteration = start_iteration
self.end_iteratio... |
microsoft/muzic | https://github.com/microsoft/muzic | null | null | null | null | 4,910 | null | null | mit | null | null | null | null | null | null | null | getmusic/getmusic/distributed/launch.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:53.968612 | import os
import torch
from torch import distributed as dist
from torch import multiprocessing as mp
import getmusic.distributed.distributed as dist_fn
def find_free_port():
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("", 0))
port = sock.getsockname()[1]
sock... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | autograd/two_layer_net_autograd.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.231088 | import torch
"""
A fully-connected ReLU network with one hidden layer and no biases, trained to
predict y from x by minimizing squared Euclidean distance.
This implementation computes the forward pass using operations on PyTorch
Tensors, and uses PyTorch autograd to compute gradients.
When we create a PyTorch Tensor... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | nn/dynamic_net.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.234793 | import random
import torch
"""
To showcase the power of PyTorch dynamic graphs, we will implement a very strange
model: a fully-connected ReLU network that on each forward pass randomly chooses
a number between 1 and 4 and has that many hidden layers, reusing the same
weights multiple times to compute the innermost hi... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | nn/two_layer_net_module.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.237813 | import torch
"""
A fully-connected ReLU network with one hidden layer, trained to predict y from x
by minimizing squared Euclidean distance.
This implementation defines the model as a custom Module subclass. Whenever you
want a model more complex than a simple sequence of existing Modules you will
need to define your... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | autograd/two_layer_net_custom_function.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.239192 | import torch
"""
A fully-connected ReLU network with one hidden layer and no biases, trained to
predict y from x by minimizing squared Euclidean distance.
This implementation computes the forward pass using operations on PyTorch
Tensors, and uses PyTorch autograd to compute gradients.
In this implementation we imple... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | nn/two_layer_net_nn.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.241172 | import torch
"""
A fully-connected ReLU network with one hidden layer, trained to predict y from x
by minimizing squared Euclidean distance.
This implementation uses the nn package from PyTorch to build the network.
PyTorch autograd makes it easy to define computational graphs and take gradients,
but raw autograd can... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | autograd/tf_two_layer_net.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.242030 | import tensorflow as tf
import numpy as np
"""
A fully-connected ReLU network with one hidden layer and no biases, trained to
predict y from x by minimizing squared Euclidean distance.
This implementation uses basic TensorFlow operations to set up a computational
graph, then executes the graph many times to actually ... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | build_readme.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.243394 | import os
"""
GitHub doesn't provide an include mechanism for README files so we have to
implement our own.
"""
def main():
build_readme('README_raw.md', 'README.md')
for d in os.listdir('.'):
if not os.path.isdir(d) or d.startswith('.'):
continue
in_path = os.path.join(d, 'README_raw.md')
out_p... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | tensor/two_layer_net_numpy.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.243827 | import numpy as np
"""
A fully-connected ReLU network with one hidden layer and no biases, trained to
predict y from x using Euclidean error.
This implementation uses numpy to manually compute the forward pass, loss, and
backward pass.
A numpy array is a generic n-dimensional array; it does not know anything about
d... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | nn/two_layer_net_optim.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.244504 | import torch
"""
A fully-connected ReLU network with one hidden layer, trained to predict y from x
by minimizing squared Euclidean distance.
This implementation uses the nn package from PyTorch to build the network.
Rather than manually updating the weights of the model as we have been doing,
we use the optim packag... |
jcjohnson/pytorch-examples | https://github.com/jcjohnson/pytorch-examples | null | null | null | null | 4,888 | null | null | mit | null | null | null | null | null | null | null | tensor/two_layer_net_tensor.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:56.248996 | import torch
"""
A fully-connected ReLU network with one hidden layer and no biases, trained to
predict y from x by minimizing squared Euclidean distance.
This implementation uses PyTorch tensors to manually compute the forward pass,
loss, and backward pass.
A PyTorch Tensor is basically the same as a numpy array: i... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/_registry/_lookup.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.581960 | """Registry lookup methods.
This module exports the following methods for registry lookup:
all_objects(object_types, filter_tags)
lookup and filtering of objects
"""
# based on the sktime module of same name
__author__ = ["fkiraly"]
# all_objects is based on the sklearn utility all_estimators
from inspect impo... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | examples/nbeats_with_kan.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.585585 | import sys
import lightning.pytorch as pl
from lightning.pytorch.callbacks import EarlyStopping
import pandas as pd
from pytorch_forecasting import NBeatsKAN, TimeSeriesDataSet
from pytorch_forecasting.data import NaNLabelEncoder
from pytorch_forecasting.data.examples import generate_ar_data
from pytorch_forecasting.... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | examples/ar.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.586149 | import warnings
import lightning.pytorch as pl
from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor
import pandas as pd
from pandas.errors import SettingWithCopyWarning
import torch
from pytorch_forecasting import GroupNormalizer, TimeSeriesDataSet
from pytorch_forecasting.data import NaNLabelEn... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | examples/stallion.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.587732 | import pickle
import warnings
import lightning.pytorch as pl
from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor
from lightning.pytorch.loggers import TensorBoardLogger
import numpy as np
from pandas.errors import SettingWithCopyWarning
from pytorch_forecasting import (
GroupNormalizer,
... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.598604 | """
PyTorch Forecasting package for timeseries forecasting with PyTorch.
"""
__version__ = "1.7.0"
from pytorch_forecasting.data import (
EncoderNormalizer,
GroupNormalizer,
MultiNormalizer,
NaNLabelEncoder,
TimeSeriesDataSet,
)
from pytorch_forecasting.metrics import (
MAE,
MAPE,
MASE... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | build_tools/changelog.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.599508 | """RestructuredText changelog generator."""
from collections import defaultdict
import os
HEADERS = {
"Accept": "application/vnd.github.v3+json",
}
if os.getenv("GITHUB_TOKEN") is not None:
HEADERS["Authorization"] = f"token {os.getenv('GITHUB_TOKEN')}"
OWNER = "sktime"
REPO = "pytorch-forecasting"
GITHUB_R... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/_registry/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.625818 | """PyTorch Forecasting registry."""
from pytorch_forecasting._registry._lookup import all_objects
__all__ = ["all_objects"]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | examples/nbeats.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.627763 | import sys
import lightning.pytorch as pl
from lightning.pytorch.callbacks import EarlyStopping
import pandas as pd
from pytorch_forecasting import NBeats, TimeSeriesDataSet
from pytorch_forecasting.data import NaNLabelEncoder
from pytorch_forecasting.data.examples import generate_ar_data
sys.path.append("..")
pri... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | docs/source/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.655490 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/main/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If exte... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/base/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:58.656689 | """Base classes for pytorch-forecasting."""
from pytorch_forecasting.base._base_object import _BaseObject
__all__ = ["_BaseObject"]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.226151 | """
Utilities for time series dataset construction and preprocessing.
This subpackage provides dataset classes, normalization and encoding
utilities, and batching tools required to transform raw time series data
into model-ready PyTorch datasets.
"""
from pytorch_forecasting.data.encoders import (
EncoderNormaliz... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/base/_base_object.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.226715 | """Base object class for pytorch-forecasting metrics."""
from skbase.base import BaseObject as _SkbaseBaseObject
__all__ = ["_BaseObject"]
class _BaseObject(_SkbaseBaseObject):
pass
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/base/_base_pkg.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.236246 | from pathlib import Path
import pickle
from typing import Any, Optional, Union
from lightning import Trainer
from lightning.pytorch.callbacks import ModelCheckpoint
from lightning.pytorch.core.datamodule import LightningDataModule
import torch
from torch.utils.data import DataLoader
import yaml
from pytorch_forecasti... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/examples.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.266472 | """
Example datasets for tutorials and testing.
"""
from pathlib import Path
from urllib.request import urlretrieve
import numpy as np
import pandas as pd
BASE_URL = "https://github.com/sktime/pytorch-forecasting/raw/main/examples/data/"
DATA_PATH = Path(__file__).parent
def _get_data_by_filename(fname: str) -> P... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/_tslib_data_module.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.267796 | """
Experimental data module for integrating `tslib` time series deep learning library.
"""
from collections.abc import Callable
from typing import Any, Optional
import warnings
from lightning.pytorch import LightningDataModule
import numpy as np
import pandas as pd
from sklearn.preprocessing import RobustScaler, Sta... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/samplers.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.271891 | """
Samplers for sampling time series from the :py:class:`~pytorch_forecasting.data.timeseries.TimeSeriesDataSet`
""" # noqa: E501
import warnings
import numpy as np
import pandas as pd
from sklearn.utils import shuffle
from torch.utils.data.sampler import Sampler
class GroupedSampler(Sampler):
"""
Samples... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/callbacks/predict.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.273094 | from typing import Any, Optional
from warnings import warn
from lightning import Trainer
from lightning.pytorch import LightningModule
from lightning.pytorch.callbacks import BasePredictionWriter
import torch
from pytorch_forecasting.utils import detach, move_to_device
class PredictCallback(BasePredictionWriter):
... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/data_module.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.287978 | #######################################################################################
# Disclaimer: This data-module is still work in progress and experimental, please
# use with care. This data-module is a basic skeleton of how the data-handling pipeline
# may look like in the future.
# This is D2 layer that will ha... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/encoders.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.289329 | """
Encoders for encoding categorical variables and scaling continuous data.
"""
from collections.abc import Callable, Iterable
from copy import deepcopy
from typing import Any, Optional, Union
import warnings
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
import torch... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/tests/test_tslib_data_module.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.889899 | import numpy as np
import pandas as pd
import pytest
import torch
from pytorch_forecasting.data._tslib_data_module import TslibDataModule
from pytorch_forecasting.data.timeseries import TimeSeries
@pytest.fixture(scope="session")
def sample_timeseries_data():
"""Fixture to generate a sample TimeSeries."""
n... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/timeseries/_timeseries_v2.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.904576 | """
Timeseries dataset - v2 prototype.
Beta version, experimental - use for testing but not in production.
"""
from typing import Optional, Union
from warnings import warn
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
from pytorch_forecasting.utils._coerce import _coerce_t... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_attention/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.914673 | """
Attention Layers for pytorch-forecasting models.
"""
from pytorch_forecasting.layers._attention._attention_layer import AttentionLayer
from pytorch_forecasting.layers._attention._full_attention import (
FullAttention,
TriangularCausalMask,
)
__all__ = ["AttentionLayer", "FullAttention", "TriangularCausalM... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/data/timeseries/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.915705 | """Data loaders for time series data."""
from pytorch_forecasting.data.timeseries._timeseries import (
TimeSeriesDataSet,
_find_end_indices,
check_for_nonfinite,
)
from pytorch_forecasting.data.timeseries._timeseries_v2 import TimeSeries
__all__ = [
"_find_end_indices",
"check_for_nonfinite",
... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_attention/_full_attention.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.917164 | """
Full Attention Layer.
"""
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class TriangularCausalMask:
"""
Triangular causal mask for attention mechanism.
"""
def __init__(self, B, L, device="cpu"):
mask_shape = [B, 1, L, L]
... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_blocks/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.938024 | from pytorch_forecasting.layers._blocks._residual_block_dsipts import ResidualBlock
__all__ = ["ResidualBlock"]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.939643 | """
Architectural deep learning layers from `nn.Module`.
"""
from pytorch_forecasting.layers._attention import (
AttentionLayer,
FullAttention,
TriangularCausalMask,
)
from pytorch_forecasting.layers._blocks import ResidualBlock
from pytorch_forecasting.layers._decomposition import SeriesDecomposition
from... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_blocks/_residual_block_dsipts.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.940828 | import torch.nn as nn
class ResidualBlock(nn.Module):
def __init__(
self, in_size: int, out_size: int, dropout_rate: float, activation_fun: str = ""
):
"""Residual Block as basic layer of the architecture.
MLP with one hidden layer, activation and skip connection
Basically dim... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_attention/_attention_layer.py | null | null | null | null | null | null | Python | 2026-05-04T01:51:59.975388 | """
Implementation of attention layers from `nn.Module`.
"""
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class AttentionLayer(nn.Module):
"""
Attention layer that combines query, key, and value projections with an attention
mechanism.
... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_decomposition/_series_decomp.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.706662 | """
Series Decomposition Block for time series forecasting models.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_forecasting.layers._filter._moving_avg_filter import MovingAvg
class SeriesDecomposition(nn.Module):
"""
Series decomposition block from Autoformer.
Dec... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_embeddings/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.709187 | """
Implementation of embedding layers for PTF models imported from `nn.Modules`
"""
from pytorch_forecasting.layers._embeddings._data_embedding import (
DataEmbedding_inverted,
)
from pytorch_forecasting.layers._embeddings._en_embedding import EnEmbedding
from pytorch_forecasting.layers._embeddings._positional_em... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_embeddings/_en_embedding.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.710715 | """
Implementation of endogenous embedding layers from `nn.Module`.
"""
import math
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_forecasting.layers._embeddings._positional_embedding import (
PositionalEmbedding,
)
class EnEmbedding(nn.... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_encoders/_encoder_layer.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.711715 | """
Implementation of EncoderLayer for encoder-decoder architectures from `nn.Module`.
"""
import math
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class EncoderLayer(nn.Module):
"""
Encoder layer for the TimeXer model.
Parameters
-----... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_embeddings/_positional_embedding.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.712823 | """
Positional Embedding Layer for PTF.
"""
import math
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class PositionalEmbedding(nn.Module):
"""
Positional embedding module for time series data.
Parameters
----------
d_model : int
... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_decomposition/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.714280 | """
Decomposition layers for PyTorch Forecasting.
"""
from pytorch_forecasting.layers._decomposition._series_decomp import SeriesDecomposition
__all__ = [
"SeriesDecomposition",
]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_encoders/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.715932 | """
Encoder layers for neural network models.
"""
from pytorch_forecasting.layers._encoders._encoder import Encoder
from pytorch_forecasting.layers._encoders._encoder_layer import EncoderLayer
__all__ = ["Encoder", "EncoderLayer"]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_embeddings/_sub_nn.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.717227 | from typing import Union
import torch
import torch.nn as nn
class embedding_cat_variables(nn.Module):
# at the moment cat_past and cat_fut together
def __init__(self, seq_len: int, lag: int, d_model: int, emb_dims: list, device):
"""Class for embedding categorical variables, adding 3 positional varia... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_encoders/_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.718157 | """
Implementation of encoder layers from `nn.Module`.
"""
import math
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
"""
Encoder module for the TimeXer model.
Parameters
----------
layers : list
List... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_embeddings/_data_embedding.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:00.719041 | """
Data embedding layer for exogenous variables.
"""
import math
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class DataEmbedding_inverted(nn.Module):
"""
Data embedding module for time series data.
Parameters
----------
c_in : int... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_normalization/_revin.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.367474 | """
Reverse Instance Normalization (RevIN) layer.
---------------------------------------------
"""
import torch
import torch.nn as nn
class RevIN(nn.Module):
def __init__(self, num_features, eps=1e-5, affine=True, subtract_last=False):
"""
Reverse Instance Normalization (RevIN) layer.
P... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_nbeats/_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.391281 | """
Utility functions for N-BEATS model implementation.
"""
import numpy as np
import torch.nn as nn
def linear(input_size, output_size, bias=True, dropout: int = None):
"""
Initialize linear layers for MLP block layers.
"""
lin = nn.Linear(input_size, output_size, bias=bias)
if dropout is not No... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_kan/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.402046 | """
KAN (Kolmogorov Arnold Network) layer implementation.
"""
from pytorch_forecasting.layers._kan._kan_layer import KANLayer
__all__ = ["KANLayer"]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_nbeats/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.402732 | """
Implementation of N-BEATS model blocks and utilities.
"""
from pytorch_forecasting.layers._nbeats._blocks import (
NBEATSBlock,
NBEATSBlockKAN,
NBEATSGenericBlock,
NBEATSGenericBlockKAN,
NBEATSSeasonalBlock,
NBEATSSeasonalBlockKAN,
NBEATSTrendBlock,
NBEATSTrendBlockKAN,
)
__all__ =... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_filter/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.403206 | """
Filtering layers for time series forecasting models.
"""
from pytorch_forecasting.layers._filter._moving_avg_filter import MovingAvg
__all__ = [
"MovingAvg",
]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_kan/_kan_layer.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.407625 | # The following implementation of KANLayer is inspired by the pykan library.
# Reference: https://github.com/KindXiaoming/pykan/blob/master/kan/KANLayer.py
import numpy as np
import torch
import torch.nn as nn
from pytorch_forecasting.layers._kan._utils import (
coef2curve,
curve2coef,
extend_grid,
sp... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_kan/_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.408297 | """
Utility functions for KAN (Kolmogorov Arnold Network) Layer.
Contains B-spline computations, curve transformations, and grid manipulation functions.
"""
import torch
def b_batch(x, grid, k=0):
"""
Evaluate x on B-spline bases
Parameters
----------
x : torch.Tensor
2D tensor of inputs... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_nbeats/_blocks.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.437168 | """
Implementation of ``nn.Modules`` for N-Beats model.
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_forecasting.layers._kan._kan_layer import KANLayer
from pytorch_forecasting.layers._nbeats._utils import linear, linspace
class SeasonalMixin:
"""
Mi... |
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_normalization/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.466920 | """
RevIN: Reverse Instance Normalization
"""
from pytorch_forecasting.layers._normalization._revin import RevIN
__all__ = ["RevIN"]
|
sktime/pytorch-forecasting | https://github.com/sktime/pytorch-forecasting | null | null | null | null | 4,882 | null | null | mit | null | null | null | null | null | null | null | pytorch_forecasting/layers/_filter/_moving_avg_filter.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:02.551375 | """
Moving Average Filter Block
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class MovingAvg(nn.Module):
"""
Moving Average block for smoothing and trend extraction from time series data.
A moving average is a smoothing technique that creates a series of averages from
diffe... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/automatic_upgrader.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.610164 | import os
import json
import datetime
# To prevent import errors in thread with datetime
import locale # noqa
import time
import sublime
from . import sys_path
from .activity_indicator import ActivityIndicator
from .console_write import console_write
from .package_tasks import PackageTaskRunner
class AutomaticUpgr... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/activity_indicator.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.623076 | import sublime
from threading import RLock
class ActivityIndicator:
"""
An animated text-based indicator to show that some activity is in progress.
The `target` argument should be a :class:`sublime.View` or :class:`sublime.Window`.
The indicator will be shown in the status bar of that view or window.... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/bootstrap.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.626042 | import json
import os
import zipfile
from textwrap import dedent
from threading import Thread
import sublime
from . import library, sys_path
from .clear_directory import delete_directory
from .console_write import console_write
from .package_cleanup import PackageCleanup
from .package_disabler import PackageDisabler
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clients/bitbucket_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.627269 | import re
from urllib.parse import urlencode, quote
from ..downloaders.downloader_exception import DownloaderException
from ..package_version import version_match_prefix
from .json_api_client import JSONApiClient
# A predefined list of readme filenames to look for
_readme_filenames = [
'readme',
'readme.txt'... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/ca_certs.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.643356 | import os
import sys
from . import sys_path
from .console_write import console_write
from .downloaders.downloader_exception import DownloaderException
try:
import certifi
except ImportError:
certifi = None
try:
from .deps.oscrypto import trust_list # noqa
from .deps.oscrypto.errors import CACertsErr... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clear_directory.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.656674 | import errno
import os
import stat
import sys
from datetime import datetime
from hashlib import sha1
from . import sys_path
IS_WIN = sys.platform == 'win32'
if IS_WIN:
import ctypes
def is_symlink(path):
if IS_WIN:
FILE_ATTRIBUTE_REPARSE_POINT = 0x0400
attributes = ctypes.windll.kernel32.Ge... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/cache.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:04.657191 | import time
# A cache of channel and repository info to allow users to install multiple
# packages without having to wait for the metadata to be downloaded more
# than once. The keys are managed locally by the utilizing code.
_channel_repository_cache = {}
def clear_cache():
_channel_repository_cache.clear()
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clients/readme_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.696085 | import re
import os
import base64
from urllib.parse import urlencode
from .json_api_client import JSONApiClient
# Used to map file extensions to formats
_readme_formats = {
'.md': 'markdown',
'.mkd': 'markdown',
'.mdown': 'markdown',
'.markdown': 'markdown',
'.textile': 'textile',
'.creole': ... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/commands/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.697942 | from .add_channel_command import AddChannelCommand
from .add_repository_command import AddRepositoryCommand
from .clear_package_cache_command import ClearPackageCacheCommand
from .create_package_command import CreatePackageCommand
from .disable_package_command import DisablePackageCommand
from .disable_packages_command... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/cmd.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.700492 | import os
import subprocess
import re
from .console_write import console_write
from .show_error import show_error
from . import text
if os.name == 'nt':
from ctypes import windll, create_unicode_buffer
try:
# Allow using this file on the website where the sublime
# module is unavailable
import sublim... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clients/json_api_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.701009 | import json
from urllib.parse import urlencode, urlparse
from .client_exception import ClientException
from ..download_manager import http_get
class JSONApiClient:
def __init__(self, settings):
self.settings = settings
def fetch(self, url):
"""
Retrieves the contents of a URL
... |
sublimehq/package_control | https://github.com/sublimehq/package_control | null | null | null | null | 4,874 | null | null | mit | null | null | null | null | null | null | null | package_control/clients/gitlab_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:52:05.703302 | import re
from urllib.parse import urlencode, quote
from ..downloaders.downloader_exception import DownloaderException
from ..package_version import version_match_prefix
from .json_api_client import JSONApiClient
class GitLabClient(JSONApiClient):
@staticmethod
def user_repo_branch(url):
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.