sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
c2ad668df40731d8ce279273eb6ab74b6febda35352696e7afd6d6be7db9f2a9 | Python | 15,672 | 317 | """Prompt building blocks shared by the prompt-tuning wrappers.
These four modules turn a raw context window into a small set of prompt vectors:
SegmentedStatsExtractor -> per-segment summary statistics of the context
Chronos2StatsExtractor -> whole-window summary statistics (non-segmented path)
SegmentR... |
0d248589edff072c7df84007e08520c5fb1ce8e3907198db875dc404d8ded0c5 | Python | 15,688 | 332 | """ Trainer for meta-train phase. """
import os.path as osp
import os,json
import tqdm
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from models.NetworkPre import FeatureNet
from misc import Averager, count_acc, count_mem_acc, ensure_path
from tensorboardX impor... |
d7655b7ae84ccab85338dab54b06d0136cc35ec3aa2372b643a7fe2e2a54cc8a | Python | 15,689 | 441 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Bindings for the fused energy fitting operator of the graph lower.
The operator ``deepmd::graph_fitting`` evaluates the whole energy fitting
network on the flat node axis -- one fp32 SIMT GEMM kernel per layer, with the
bias, activation, residual and energy head fused in... |
a0ad2577e336c3d36a4688cdbf9a7fed3396cf87427676422be4ca8458aa7caf | Python | 15,693 | 449 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 agr... |
23358f181f0f9e7811b937a5ca8fa68d14586c44cc1ea0c748b8240028db0151 | Python | 15,695 | 473 | """Supervised Time Series Forest Classifier (STSF).
Interval based STSF classifier extracting summary features from intervals selected
through a supervised process.
"""
__author__ = ["matthewmiddlehurst"]
__all__ = ["SupervisedTimeSeriesForest"]
import math
import numpy as np
from scipy import signal, stats
from sk... |
7b2e6aee2539039b9e0bc16cd59284faeff9d9c536b84b08c245da6724dcbd3e | Python | 15,696 | 318 | """ Trainer for meta-train phase. """
import os.path as osp
import os,json
import tqdm
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from dataloader.samplers import CategoriesSampler
from models.NetworkPre import FeatureNet
from utils.misc import Averager, count... |
05c0397346adee6969fd38495bc29658bd4c2ba8f6b8c2785eb0edbdfe8612ba | Python | 15,706 | 459 | """
Perform analysis of IVs pip from model_run
Provides basic analysis for::
1. Current clamp IV
2. Voltage clamp IV
3. Count spikes and get FI
This module is part of *vcnmodel*.
Support::
NIH grants:
DC R01 DC015901 (Spirou, Manis, Ellisman),
DC R01 DC004551 (Manis, 2013-2019, Early develop... |
b8df28d24c48d73640974202e4c2fb0da4f46307fa661fecc73d4a9f8feb6705 | Python | 15,729 | 335 | '''
JobConfig reads the input file and sets up the settings object used for the computation
.. codeauthor:: Nicholas Browning
.. codeauthor:: Simon Duerr dev@simonduerr.eu
'''
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_alias... |
7fea1e38f2609110e5bf2ce433b8de932dc4e373a6e7d7a29835fa217707b0e1 | Python | 15,732 | 385 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""The pt DPA4/SeZM training paths: bindings, and gradients against the dense path.
The accelerated training paths are two mutually independent layers over the
same block. The Triton layer (``DP_TRITON_TRAIN``) replaces individual stages
-- the rotations, the block-diagonal... |
1bb4f384503efe8954c8800e571e1327ff2c620a152bb3ba3c5bb9426165131d | Python | 15,744 | 397 | """ explainers.py
Define the different explainers: GraphSVX and baselines
"""
# Import packages
import random
import time
from copy import deepcopy
from itertools import combinations
from scipy.sparse import csr_matrix
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from tqdm import tqdm
... |
82ca25ad57a16348ac6773aba704381894076f543d9d9d2542febc1d68b3e156 | Python | 15,753 | 390 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... |
853f93ea0291a194053d6be2b66d61bfe0e83249068f3f8d7ea4b1ee485f2d1d | Python | 15,762 | 394 | # Copyright 2018-2025
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
a4d581740a8fd6192f73d67d330a6ef066fd8444c3c5385274f89a05b27eea42 | Python | 15,770 | 452 | # coding=utf-8
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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
#
# ... |
678ac5dd1cdc56b2ad255b964574e00dd2ae527bb0bcf97e101e1dc6ba5fd795 | Python | 15,776 | 412 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 agr... |
0752eae1ac0f580678303e82ba474be50292ca5493cb092a1f830747e07c0243 | Python | 15,796 | 381 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from gym.spaces import Box, Discrete
import numpy as np
import logging
from mprl.rl.common.weights_utils_policy_mixin import WeightsUtilsPolicyMixin
from ray.rllib.agents.dqn.dqn_policy import _postprocess_dqn... |
21595211d58bc00015172067bac6eb9acd51aee6aed2481103c57a19ab179094 | Python | 15,796 | 361 | """Tests for the rich-formatted multi-image features of bcblib.scripts.imaging_cli.
All images are synthetic (numpy + nibabel) built in ``tmp_path`` — no external
data required. The fixtures deliberately mirror realistic neuroimaging scenarios:
nii_float32 : float32, shape (12, 14, 10), 1 mm isotropic — "T1/tra... |
3fe610d55ba1c997711f36508b7342ec25bf7d3d197155c64245a31558dfb7de | Python | 15,807 | 480 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
# Ported from skchange (BSD-3-Clause), original authors: johannvk
"""Multivariate T distribution likelihood cost."""
__author__ = ["johannvk"]
import numpy as np
import pandas as pd
from sktime.detection._utils import (
CovType,
MeanType... |
8f27079346993fa5aa07a1b89549963a17f0a7eaf81f5c12125786edb8598024 | Python | 15,810 | 452 | # Copyright 2019-2026 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
"""Reporting for graph partition strategies.
This module provides reporting ca... |
38cb37082ecb0baa46958e1286354af76d2652838f5d9f42b6be260e09e3ddb2 | Python | 15,816 | 406 | #-------------------------------------------------------------------------------
# elftools: elf/dynamic.py
#
# ELF Dynamic Tags
#
# Mike Frysinger (vapier@gentoo.org)
# This code is in the public domain
#-------------------------------------------------------------------------------
from __future__ import annotations
... |
79d3d5494ae393821a5e849b401ce6903e86834e467c11af2d82768b02109896 | Python | 15,822 | 404 | from typing import List, Tuple
import torch
import logging
from lgn.cg_lib import CGModule, ZonalFunctionsRel, ZonalFunctions
from lgn.cg_lib.cg_dict import CGDict
from lgn.cg_lib.zonal_functions import p_cplx_to_rep, rep_to_p
from lgn.g_lib import GTau, GVec
from lgn.models.lgn_cg import LGNCG
from lgn.nn import Rad... |
19a0ff0facfb90bb73e5dbd2ce92ed7a0a7928f060d3607468b032c5b684b444 | Python | 15,836 | 423 | """CIF classifier.
Interval based CIF classifier extracting catch22 features from random intervals.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["CanonicalIntervalForest"]
import math
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.tree import DecisionTreeClassifier
from sklearn.utils i... |
2dc0f7e3289bc48d4ab1d7f6fad47c3c1b716e8cb3544afa0fc5601a7c244403 | Python | 15,847 | 395 | #!/usr/bin/env python3
"""Look look up ontology terms on the command line.
Usage:
scig v [--api=A --local --verbose --key=KEY] <id>...
scig i [--api=A --local --verbose --key=KEY] <id>...
scig t [--api=A --local --verbose --limit=LIMIT --key=KEY --prefix=P...] <term>...
scig s [--api=A --lo... |
393d6893922a1b3a2abb5ac55ba7cd27e068e3277f52ffec63b187a283459516 | Python | 15,853 | 439 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# 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 appl... |
8802ac576f916f50b0cfe7ee76eadfb53ef10debc3620d5a06d47e3fb0cb0311 | Python | 15,860 | 459 | """
test_mechanisms.py
This program displays the results of inserting NEURON mechaanisms from .mod files
into a point cell to voltage steps in voltage clamp.
This code is primarily for visual verification of model function.
usage: test_mechanisms.py [-h] [-e]
test ion channel mechanisms
positional arguments:
{Ca... |
e2c88bd4e56e59f4b8ec120e53fd0475d469d7100276ae3ff22552311ddcda54 | Python | 15,870 | 417 | """Base class for probabilistic forecasters with vectorized predict_proba support.
This module provides a BaseProbaForecaster class that extends sktime's BaseForecaster
to support vectorized predict_proba for hierarchical/panel forecasting.
The standard BaseForecaster raises NotImplementedError when predict_proba is ... |
e684b6ad2570f48c89e57712fc5efc6aa9aeca76d30ceaba7fc29190ee441d37 | Python | 15,876 | 331 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
from .EmbeddingModel import EmbeddingModel, register_model
from ampligraph.late... |
8bd0204b339bd8a9e94fe3b362eefbed4c16f63ba65a6e50755bee70245cd232 | Python | 15,882 | 418 | import csv
import json
import random
import uuid
from argparse import ArgumentTypeError
from pathlib import Path
import numpy as np
import pandas as pd
from bcblib.tools.spreadsheet_io_utils import import_spreadsheet
def str_to_lower(value):
"""
Convert a string to lowercase. Mostly useful for argparse argum... |
9c22b9576c5a653c1603f6661b63120816a87c038ee0ffbae0e07b5e8cc3cee9 | Python | 15,886 | 296 | import ray
from mprl.utility_services.cloud_storage import connect_storage_client
from mprl.utility_services.worker import ConsoleManagerInterface
from mprl.utility_services.lock_server.lock_client_interface import LockServerInterface
from mprl.utility_services.payoff_table import PayoffTable, PolicySpec
import logging... |
1efdee6c823aca3f74bfa489cc743dae30cb04655550babc89a8b74e31dc4129 | Python | 15,887 | 551 | from os import stat
from typing import Tuple, Union
import torch
import numpy as np
from scipy import stats
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
NUM_BINS = 81 # Number of bins for all histograms
PLOT_FONT_SIZE = 14
def get_magnitude(p, gpu=True):
"""Get the momentum magnitude |p... |
e925b41e557d8f6ca83d929a0d42e3b03e248c5990bdb600c316a91509004491 | Python | 15,916 | 481 | # SPDX-License-Identifier: LGPL-3.0-or-later
import logging
import os
from collections.abc import (
Iterator,
)
from functools import (
cached_property,
)
from multiprocessing.dummy import (
Pool,
)
from typing import (
Any,
)
import h5py
import numpy as np
import torch
import torch.distributed as dist... |
f7bf1fe49500a59985d479e19b33b07b998c884c486ed4ea41262be2854cf97e | Python | 15,931 | 446 | # SPDX-License-Identifier: LGPL-3.0-or-later
import json
import unittest
from typing import (
NamedTuple,
)
import numpy as np
import paddle
import tensorflow.compat.v1 as tf
from deepmd.pd.utils import (
env,
)
tf.disable_eager_execution()
from pathlib import (
Path,
)
from deepmd.common import (
... |
66d5b59a68dbf97ea727675bfade3e4fa3c27ad5c2d480c1092912357efe28db | Python | 15,937 | 533 | """Control plot style and scaling using the matplotlib rcParams interface."""
import functools
import matplotlib as mpl
from cycler import cycler
from . import palettes
__all__ = ["set_theme", "set", "reset_defaults", "reset_orig",
"axes_style", "set_style", "plotting_context", "set_context",
"s... |
e6803aa47e10fac13eac8beece72e3679362e497a788ac1465d43fdf7507d5c6 | Python | 15,944 | 410 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
import os
os.environ["CUDA_VISIBLE_DEVICES"]="6" # Choose which GPUs by checking current use with nvidia-smi
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.applications import ResNet152V2
from tensorflow.keras.applications import ResNet101V2
... |
2f904d9fc694ff59c2655482c66e87cc36850c86e60b35d9f086e145df0ddaf7 | Python | 15,949 | 509 | """Tests for the bin/odp CLI wrapper.
Exercises the argument-parsing layer and the command-construction logic
without actually invoking snakemake.
"""
from __future__ import annotations
import importlib.util
import subprocess
import sys
from pathlib import Path
import pytest
REPO_ROOT = Path(__file__).resolve().pa... |
ca4c34703bbf28425c44f393258ca6b454fbce4b7c38adc382d2531ffc40427d | Python | 15,958 | 473 | from typing import Optional, Tuple, Union
from utils.jet_analysis.utils import PLOT_FONT_SIZE
from utils.utils import make_dir
import os.path as osp
import numpy as np
import torch
import matplotlib
import matplotlib.pyplot as plt
import awkward as ak
from coffea.nanoevents.methods import vector
ak.behavior.update(vec... |
00f6c43778f54d1ed8310de3a1dcd4842da54ad35a6d5f407901e395e13c75cc | Python | 15,961 | 367 | """
This scripts generates figure 3g : Choice decoding
Internal notes:
top panel is from :
bottom panel is from: figure-4-paper-w-pip-reviewer-updates-checkpoint-2021-11-30
"""
import pandas as pd
import pickle as pkl
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
import matplotlib as mpl
fr... |
ee24bcec63bbd3767d0b66575add01faab86981b0603ee78e30bf990085bd626 | Python | 15,963 | 354 | """Extension template for parameter estimators.
Purpose of this implementation template:
quick implementation of new estimators following the template
NOT a concrete class to import! This is NOT a base class or concrete class!
This is to be used as a "fill-in" coding template.
How to use this implementati... |
50ca337b9d1f89875ab754d348d37cafe8ac834f25cb18b9f175ba5cd85b74f0 | Python | 15,965 | 465 | from __future__ import print_function
import math
import matplotlib
matplotlib.use('TkAgg')
import numpy as np
from itertools import groupby
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
# implement the defa... |
b8f1b4e9b7222b664c2ed009066bb4ce604745c4bc880066662da8f828c96084 | Python | 15,969 | 341 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Implements mixin class for probabilistic prediction defaulting behaviour."""
__author__ = ["fkiraly"]
__all__ = ["_PredictProbaMixin"]
import numpy as np
import pandas as pd
from sktime.datatypes import convert_to
class _PredictProbaMixin:
... |
a06954c29cb3c7f6b36b5330e544aed80d8218cf8c21133990ce0bebacc354d3 | Python | 15,973 | 476 | """Losses for ParaDime routines.
The :mod:`paradime.loss` module implements the specification of losses for
ParaDime routines. The supported losses are
:class:`paradime.loss.RelationLoss`,
:class:`paradime.loss.ClassificationLoss`,
:class:`paradime.loss.ReconstructionLoss`, and
:class:`paradime.loss.CompoundLoss`.
"""... |
00450743b510c5cc22043e5c38196ee9f3b301f75846ce2593749990a1d19a7f | Python | 15,987 | 293 | import numpy as np
import networkx as nx
from typing import Optional
import matplotlib.pyplot as plt
from .plotting import _plot_template, \
_plot_edges, _plot_nodes, _plot_spheres,\
_scale_nodes, _add_axis_arrows, _plot_parcels,\
_select_single_hemisphere_nodes, _add_subplot_title, get_frame_input,\
_s... |
98a8fb83ae80c0ac5563c2629254efc7925f8350cdd5ed1f1594316440bf2ef2 | Python | 16,003 | 397 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import pytest
import onnx
import onnx.reference
from onnx import helper, numpy_helper
class TestNumpyHelper:
@pytest.mark.parametrize(
"dtype", [np.float32, np.float16, ... |
3e50a5cd2dd87a64985e2de853f73c942221315996f892cf512a519f8b438ed7 | Python | 16,032 | 408 | import numpy as np
import tensorflow as tf
from tensorflow.python.keras import Model
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.layers import (BatchNormalization, Dense, Dropout,Layer)
from tensorflow.python.keras.utils import tf_utils
from tensorflow.python.ops import array_ops
clas... |
353c0e276fc26eded8fea2bcb3af816c9651e6dc18304ec35da06e584249cd27 | Python | 16,038 | 415 | from __future__ import print_function
__author__ = 'pbmanis'
"""
ManageANSpikes is a class to read the output of the Zilany et al. 2009 AN model into
python, and provides services to access that data.
Basic usage is to create an instance of the class, and specify the data directory
if necessary.
You may then get the ... |
cecb8d39a402155398932b9b9b810cf4808a9ca56f41993b1e1d2017075abb36 | Python | 16,039 | 456 | # Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import typing
import numpy as np
import onnx
from onnx import TensorProto
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.model import expect
def SequenceEmptyImpl() -> list... |
fb0a381b38ac4475cbfa8f0f9a4e6a90b721357565a1fb8f447237c1dbd6bde2 | Python | 16,051 | 454 | """Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .p... |
0fa4af2651b92492716c5e3af2035b2b76eeb9437b48867d534bd7b9a4412091 | Python | 16,091 | 437 | """Utilities for loading panel datasets."""
__author__ = ["Emiliathewolf", "TonyBagnall", "jasonlines", "achieveordie"]
__all__ = [
"generate_example_long_table",
"make_multi_index_dataframe",
"_load_dataset",
]
import os
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from ... |
433dd73d2e68acf6c90c24f3cbca41b544585a9714dfc936e7387e96a8a01f8a | Python | 16,091 | 402 | from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class Node():
"""Node class.
Args:
C_list: child node list
P_list: parent node list
"""
def __init__(self,name,C_list=[],P_list=[]):
self.name=name
self.C_name_list =... |
8d44d27c6f5f4ea6bd33f5facd64613b81cf760c0ceac537c10b346e222c963d | Python | 16,093 | 438 | # Copyright 2018-2026
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
5fd479a5bf9baae00d6d27dd4250abef235bd272533cc6c685e52ceabe55bd58 | Python | 16,103 | 476 | from typing import Optional, Tuple, Union
from utils.jet_analysis.utils import PLOT_FONT_SIZE
from utils.utils import make_dir
import os.path as osp
import numpy as np
import torch
import matplotlib
import matplotlib.pyplot as plt
import awkward as ak
from coffea.nanoevents.methods import vector
ak.behavior.update(vec... |
a28426a6741f7a847319278b5e127a9919c38807714f1c6709908d89d6bff318 | Python | 16,129 | 476 | """Testing utilities in the datatype module."""
__author__ = ["fkiraly"]
import numpy as np
import pandas as pd
import pytest
from sktime.datatypes import update_data
from sktime.datatypes._check import check_is_mtype
from sktime.datatypes._examples import get_examples
from sktime.datatypes._utilities import (
_... |
867fcd4d92ef0c86e860e991bc8a24726da3048a3cd2b6f6c0dae854169fe7e2 | Python | 16,130 | 535 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... |
2a7b7181a38fc4c86b1693fe7fbd379cad81ec924ab4493a1c85e1ffb163e35e | Python | 16,136 | 370 | #!/usr/bin/env python3
"""
Polarity-evidence ribbon panel.
A 3-row ribbon plot showing how a hypothesized fusion / fission event
maps across three species:
top row unfused-side species: two distinct chromosomes carrying
two ancestral linkage groups (e.g. ALG-A and ALG-B).
middle row outgr... |
eeef198176c73a315e1859681c808423ff5f168514f8bbc8bde775c6c8b3dfbe | Python | 16,141 | 469 | import numpy as np
import json
from collections import defaultdict
import os, sys
from glob import glob
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------
# Functions for handling observertions/bed files
# -... |
8cd4dd02b8f93d0837848626cc45ad68db4b486054a3deb621d713c85bed7bb7 | Python | 16,207 | 383 | """
*Functions*
check_finished_calcs: Checks if the calculations finished normally or not.
prep_cp2k: Prepares the directories to run calculations with CP2K.
prep_vasp: Prepares the directories to run calculations with VASP.
get_jobs_status: Returns a list of job status for a list of job ids.
submit_jobs: Submits... |
e52cb5b0081aa9e1911645a9ba8ffbac3dea200fd0cd55ff5b8a6feff305ae35 | Python | 16,213 | 387 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
from ampligraph.datasets import load_wn18, load_fb15k, load_fb15k_237, load_yag... |
de2e9ab71cf553722be0ab3dc8296a45f65fe8da2960fdf11f8ad5b7248099db | Python | 16,254 | 432 | import numpy as np
import scipy
from typing import Dict, List, Union, Tuple
from pylibrary.tools.cprint import cprint as CP
"""
This code was taken from McTavish's code.
Main change is that we specify the CCF window as tstart--tend. rather than a window around
0.
"""
"""
Spike train utility methods.
Utility methods... |
88bfde4cb5afdd591b6c92f6e7b8021c3e94c61112b730607b05379c393fcfcc | Python | 16,255 | 412 | """Testing panel converters - internal functions and more extensive fixtures."""
import numpy as np
import pandas as pd
import pytest
from skbase.utils.dependencies import _check_soft_dependencies
from sktime.datasets import generate_example_long_table, make_multi_index_dataframe
from sktime.datatypes import convert
... |
556982c7cb10dc7a7e0ea86879b80bf18e9702929e0ac8d755de8203abb8b3af | Python | 16,256 | 472 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Preset output bias of atomic models.
The ``preset_out_bias`` model option assigns the output bias of selected atom
types, typically their energy in vacuum. An assigned output is fixed by the
preset alone: every type that occurs in the training data must be assigned,
the ... |
68f5d6925aa27142e70485f6a830e1e0acd9a03bb50f13d6bb59f6ae96ef5213 | Python | 16,259 | 364 | from networkunit.tests.correlation_matrix_test import correlation_matrix_test
from networkunit.capabilities.ProducesSpikeTrains import ProducesSpikeTrains
from networkunit.plots import alpha as _alpha
from elephant.spike_train_correlation import cch
import matplotlib.pyplot as plt
# from matplotlib import colors, color... |
0d285ebb24e429de82eae8311f89b048de02f4f7a7470c8280b02562af65dc6d | Python | 16,262 | 402 | import keras
from keras.preprocessing import text
from keras.preprocessing import sequence
from keras.layers import Embedding, Bidirectional, concatenate, Conv2D, BatchNormalization, MaxPool2D
from keras.layers import *
from keras.models import *
from keras.callbacks import EarlyStopping
import numpy as np
from... |
c4d4653bfa85bab3b011f30d03b06e20f09901f509340086d91f7ac00fc6c879 | Python | 16,267 | 451 | # Copyright 2022 DeepMind Technologies Limited
#
# 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 agr... |
b9673880856e060b27a092f4863b5eb4f10413434e151756eef01522cb312b93 | Python | 16,271 | 405 | from copy import deepcopy
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class Node():
"""Node class.
Args:
C_list: child node list
P_list: parent node list
"""
def __init__(self,name,C_list=[],P_list=[]):
self.name=name
self.C_name_list =... |
231ae75296e84dc7e21405fa74a444201f9775b18ad52d278842c340858f3aa7 | Python | 16,285 | 457 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... |
4e7fbf8da315539f854f15c002907b910bef582f7d8ff3e6b32fd17aace7937d | Python | 16,315 | 403 | import keras
from keras.preprocessing import text
from keras.preprocessing import sequence
from keras.layers import merge, Embedding, Bidirectional, concatenate, Conv2D, BatchNormalization, MaxPool2D
from keras.layers.core import *
from keras.models import *
from keras.layers.recurrent import LSTM
from keras.cal... |
402d51fbe311e9f298095d70f81e805482fb8ef3132d666eb4d57f9f96fe597f | Python | 16,324 | 378 | import logging
from collections import OrderedDict
import torch
import torch.nn as nn
import numpy as np
'''Base class for all neural network modules'''
from torch.nn.parallel import DataParallel, DistributedDataParallel
import models.networks as networks
import models.lr_scheduler as lr_scheduler
from .base_model impo... |
4e14f2224b8e8454a8d4d650b3cd85037080e3b798023349581f1411bb6df03e | Python | 16,324 | 521 | import argparse
from email.policy import default
import numpy as np
import torch
def get_bool(arg: argparse.Namespace) -> bool:
"""Parse boolean from input string.
Adapted from https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse
"""
if isinstance(arg, bool):
retur... |
eacd8f8cb78492ff94f07b1321b45d6940e481ad59ee9c92f2467ca2d620712e | Python | 16,331 | 531 | """Extract reference documentation from the NumPy source tree.
"""
from __future__ import division, absolute_import, print_function
import inspect
import textwrap
import re
import pydoc
from warnings import warn
import collections
import sys
class Reader(object):
"""A line-based string reader.
"""
def ... |
9d6a77ef53ce279a8caa42d53fedc34fa8ea99dc62c29daf6bd7e4a1d3e80c35 | Python | 16,341 | 397 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# 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 appl... |
cbe153d58cf67bd96a329bf5c9529fa459d6daf315dd18acc3cb13ad3aefaa90 | Python | 16,377 | 382 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""The Uni-Mol to deepmd data conversion."""
import os
import pickle
import shutil
import tempfile
import unittest
import unittest.mock
import numpy as np
from deepmd.dpmodel.descriptor.unimol import (
UNIMOL_ELEMENTS,
)
from deepmd.dpmodel.loss.unimol import (
Un... |
65bf5a349c22b0c4916deff3fe7a63bee8f9fe6bf3dd28d70cdd8e89794478b5 | Python | 16,382 | 430 | # coding=utf-8
# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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
#
# ... |
c642f7a9e1f80f8ea4efa3dc780ec0a2ff7a0331ce1a6765ded975b30c36f45b | Python | 16,394 | 494 | from argparse import Namespace
import logging
from typing import Optional
import numpy as np
from lgn.models.lgn_decoder import LGNDecoder
from lgn.models.lgn_encoder import LGNEncoder
from torch.utils.data import DataLoader
from torch.optim import Optimizer
from utils.jet_analysis import plot_p
from utils.utils import... |
2ab143d7510038b060c5c72df1af5d5b9adbc8d1dd8b3ec741dbcafc64ca3efb | Python | 16,396 | 496 | from argparse import Namespace
import logging
from typing import Optional
import numpy as np
from lgn.models.lgn_decoder import LGNDecoder
from lgn.models.lgn_encoder import LGNEncoder
from torch.utils.data import DataLoader
from torch.optim import Optimizer
from utils.jet_analysis import plot_p
from utils.utils import... |
d12e070e69f72b8577c2df8f67d1b9ce8230b79347beffe81fc5e3374baeb7af | Python | 16,397 | 466 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Unit tests for the ``bridging_method`` sugar expansion (issue #5948).
``expand_bridging_method`` is the ONE owner of the sugar: it rewrites a
flag-form config into the canonical ``linear_ener`` composition over the
learned model and an ``inner_potential`` sub-model. Thes... |
0169db17c658524728b01c0d0425dc61df1b525288adee8dccea2932a4da8050 | Python | 16,404 | 399 | # Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... |
fbcff25e55ff64a0be5f371f16069150be8952a3a6d1c8e5c4ff840e6fbc321b | Python | 16,419 | 383 | import numpy as np
from scipy.spatial.distance import euclidean
from sklearn.metrics import auc
#%% Initialization functions ###
def init_mic_features(N, dim):
''' Sample random coordinates within the N-dimensional unit sphere,
with uniform distribution across the space'''
features = []
while len(fea... |
68bc44c5cb46cfa2b56cdfac0a8f4814f2fe0ed1c75753b60c30ef7f93f895f8 | Python | 16,422 | 363 | ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Yaoyao Liu
## Modified from: https://github.com/Sha-Lab/FEAT
## Tianjin University
## liuyaoyao@tju.edu.cn
## Copyright (c) 2019
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the r... |
a20af7e8178316ee60b00b0854b8d9e01b437d116795184af49b627b48422d45 | Python | 16,427 | 337 | # Copyright 2019-2021 The AmpliGraph Authors. All Rights Reserved.
#
# This file is Licensed under the Apache License, Version 2.0.
# A copy of the Licence is available in LICENCE, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
from .EmbeddingModel import EmbeddingModel, register_model
from ampligraph.late... |
002462b6d30004c6702cfcc69efe59e44e9c20725f0855aff39d6ce4183ced64 | Python | 16,442 | 452 | # Copyright 2018-2025
# Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH
# 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/LICE... |
c7b6d238c5dc4d7634e22aa625758395b3307f97d828a3d579ab2e3328fd14be | Python | 16,453 | 329 | """
This module builds a classifier that uses a static decision tree
where thresholds are trained but the order of using the attribues
are static.
"""
# Authors: Taro Tezuka <tez@sings.jp>
from __future__ import division
import warnings
# from abc import ABCMeta
# from abc import abstractmethod
import numpy as np
... |
22416b09832f33105af33dfa74e315362d39a9ac3e4e3af92fab8077788b62a0 | Python | 16,456 | 464 | """
Defines:
Internal functions:
_validate_scalar_to_multi(value, size=None, dtype=None)
_validate_ndarray(array, dtype=None, minimum_ndim=0, required_ndim=None,
forbid_object_dtype=True, broadcast_to_shape=None, reshape_to_shape=None, required_shape=None)
_validate_resolution(r... |
a89e021d5e9e88b48f5a9a56a3dfb783493f27fe5266f0c40b27b5cad011d0b2 | Python | 16,466 | 372 | #-------------------------------------------------------------------------------
# elftools: dwarf/die.py
#
# DWARF Debugging Information Entry
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from __future__ import... |
ce76db01c89e3ee032832cf3a5758ff6123f81ec087077eb8f5db0fa811bbd7e | Python | 16,479 | 403 | import torch
import torch.nn as nn
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'r... |
5831fa7ee5f42002e9c15739525ba666b7f7fead183ec5e82b2209ec07551e10 | Python | 16,494 | 362 | #!/usr/bin/env python3
from pyontutils.config import auth
__doc__ = f"""Sync the scicrunch registry to a ttl file for loading into scigraph for autocomplete.
Usage:
registry-sync [options]
Options:
-u --user=USER [default: nif_eelg_secure]
-h --host=HOST [default: nif-mys... |
6f245f78e69101a50de8d76d59faf49d442d13d5ed2d07e94fe71caf38efad5d | Python | 16,507 | 512 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 agr... |
ca22bca0e8522f0adff7a4455bcb8304e1fb15bafba3ee14c3b123174b949aeb | Python | 16,511 | 419 | # SPDX-License-Identifier: LGPL-3.0-or-later
r"""Pair interaction kernels of the latent-charge long-range modules.
A kernel is a function :math:`K(r)` of the distance between two charges, in
Å⁻¹, so that charges in units of :math:`e` interact with the energy
:math:`k_e q_i q_j K(r_{ij})` in eV, where :math:`k_e` is th... |
2379300cd48ce32406ad71672df979f7864fc70a466df2be4871795bb609fb60 | Python | 16,532 | 548 | import argparse
import numpy as np
import torch
def parse_data_settings(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
parser.add_argument(
"-j",
"--jet-type",
type=str,
default="qcd",
help="Jet type to train. Options: ('qcd', 'g', 'q', 't', 'w', 'z').",
)... |
f581b8072c4263198ec22f5413fa4e2e2fd2df406155fd2298180fc33c460b81 | Python | 16,540 | 462 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# 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 appl... |
2a6f026541cb3c9d9c11c326dfa1a2c6a5a3c53f9f190d57116310286c1e75a7 | Python | 16,558 | 467 | # This file includes code adapted from:
# https://github.com/utkuozbulak/pytorch-cnn-visualizations
# Copyright (c) 2025 utkuozbulak
# Licensed under the MIT License
from collections import OrderedDict
from typing import Dict, Callable
import torch
from skimage import io
import torchvision.transforms as transforms
imp... |
eaa57fc02c75be861399d2550d0cdcf628e856633d9db2816d89177396a6dea5 | Python | 16,572 | 411 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Interface for TSPulse anomaly detection via granite-tsfm."""
__author__ = ["Faakhir30"]
__all__ = ["TSPulseAnomalyDetector"]
import numpy as np
import pandas as pd
from skbase.utils.dependencies import _check_soft_dependencies
from sktime.det... |
67d4061555f25e94f0cf5515df33fd6eb3561969324e55bdf231bf4a8d524b43 | Python | 16,576 | 436 | # Copyright 2026 DeepMind Technologies Limited
#
# 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 agr... |
8a9cc08d27dec71775b8e8d16123c26f357022b159c3b4177a41c1336a7436a7 | Python | 16,586 | 551 | """Control plot style and scaling using the matplotlib rcParams interface."""
from distutils.version import LooseVersion
import functools
import matplotlib as mpl
from . import palettes, _orig_rc_params
mpl_ge_150 = LooseVersion(mpl.__version__) >= '1.5.0'
mpl_ge_2 = LooseVersion(mpl.__version__) >= '2.0'
__all__ =... |
9900e65366c2bbe8d99da9d10f7d4d2b7528923ff9ad2540c41377447c607c18 | Python | 16,587 | 414 | #!/Users/ssg/.pyenv/shims/python
# -*- coding: utf-8 -*-
import sys
import threading
from os import listdir
import numpy as np
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow, QLineEdit, QLabel, QSlider, QComboBox
from parameterSetup import ParameterSetup
i... |
0351c22dd2ec903bb87867ce628ae4fce6ca1c2b05ea443b8a67b4ed9dd9130d | Python | 16,608 | 466 | """Random Interval Spectral Ensemble (RISE)."""
__author__ = ["TonyBagnall"]
__all__ = [
"RandomIntervalSpectralEnsemble",
"ps",
]
import numpy as np
from sklearn.base import clone
from sklearn.ensemble._base import _partition_estimators
from sklearn.tree import DecisionTreeClassifier
from sklearn.utils.valid... |
8bde3060d44254ec9763cf75a98d7dfb7e7409388e1a2eed840a1e13cd732648 | Python | 16,657 | 456 | from __future__ import division
import os
import re
import numpy as np
import pandas as pd
from scipy.interpolate import griddata
from skimage import io
from mayavi import mlab
import warnings
from helper_lib import filelib
import SPHARM.lib.transformation as tr
from SPHARM.classes.spectrum import Spectrum
class S... |
c3df035c681fda7cbd95d14b6080f11775331959f6f02cab1c844700635de4f7 | Python | 16,669 | 426 | # Copyright 2022 Diagnostic Image Analysis Group, Radboudumc, Nijmegen, The Netherlands
#
# 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... |
ae1ecd161719d1cae32d4ebd60520fbd0ec8136e33edc11b62eba1315772222f | Python | 16,676 | 349 | import numpy as np
import os
import pickle
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
import keras
# My Scripts
from scripts import models_util
from scripts_tl import training_util_tl
from scripts_tl import testing_util_tl
gl_init_lr = 0.002
def create_data... |
e6dfc35db082b05cb94f46207ce20c886c044ed71e0fe86a960fbc99b7efd467 | Python | 16,681 | 438 | import logging
import numpy as np
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.tf.misc import normc_initializer, get_activation_fn
from ray.rllib.models.catalog import ModelCatalog
from ray.rllib.policy.rnn_sequencing import add_time_dimension
... |
2576ea5d3e6ac03f455555d8807833844ffbcaaa45979a1806ee085c8bf2389f | Python | 16,685 | 473 | import os
import math
import pickle
import random
import numpy as np
import torch
import cv2
####################
# Files & IO
####################
###################### get image path list ######################
IMG_EXTENSIONS = ['.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP','.tif... |
2ecbbd9161eee5e70011b702acd9096b0812f0d903f13bddeed7955fdbe4a244 | Python | 16,687 | 324 | # -*- encoding: utf-8 -*-
from ._db import add_table_data
#: Mouse synaptic convregence table
mouse_convergence = u"""
Convergence defines the average number of presynaptic cells of a particular
type (rows) that synapse onto a single postsynaptic cell of a particular
type (columns).
This connectivity matrix is curren... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.