sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
37df2f5275e0018393e09382083e83ca8132e8ca743b0c6cd98cb73225c34f00 | Python | 17,754 | 497 | # 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... |
9d958f7a3507c3e9faf820377764b5ad2a83914e44f9056d92a40027d530e32c | Python | 17,756 | 586 | # 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... |
669495e5469fe4dfd071c2e0dfc7ad5565be3d2fb5a2f5f052e062ac8a88f701 | Python | 17,789 | 291 | import torch
import numpy as np
from numpy import newaxis as na
from utils_lrp import gru_cell,linear,lrp_linear,gru_lrp,initialization,init_decoder,moveToNumpy,init_encoder
class lrp_decoder_encoder:
def __init__(self, cfg,len_static, wi_tuples,wh_tuples,bi_tuples,bh_tuples,wl,bl):
self.num_layers=cfg.n... |
c9a9c020eb1cb60fc8ae293eeeb2271072254bed490e8f873380eee056dc2846 | Python | 17,809 | 318 | """
Module for post-processing and collecting results from the GNN model training.
"""
import os
from datetime import date, datetime
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import csv
import torch
from torch_geometric.loader import DataLoader
from sklearn.metrics import r2_score
from... |
1870ac5400003a93a97560d0063025a7eef7fa474d0d3fb3e750e1c76c5ce741 | Python | 17,821 | 349 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © 2013 Charles E. Vejnar
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://www.mozilla.org/MPL/2.0/.
#
"""Merge & normalize cou... |
aaf8ba215cc2f86ce6a77d982154ee15e1c6f3891af3290c354afb2b78806e3c | Python | 17,883 | 445 | # Architectures and loss functions used in the paper.
# Potential improvements not explored published version:
# - Remove redundant Bias (use_bias=False) in the Dense layer before BatchNormalization layer
# - Add regularization and use 'elu' activation for first Dense layer of Encoder_T
# - Add regularization and use... |
3765c63d81730c2ff9506a0233aee8c8d346243052bd367b8f4d5d50c8207bdd | Python | 17,895 | 434 | """Tuning for time series classifiers."""
__author__ = ["fkiraly", "achieveordie", "yash-sangwan"]
import numpy as np
from sktime.base._panel._tune import (
_check_refit_for_predict,
_coerce_prediction,
_fit_tuner,
)
from sktime.classification._delegate import _DelegatedClassifier
# todo 1.3.0: remove ... |
588ff84281cbdfccdb32c108f54185811c663cfaa6d6728c5b037e63e1b63692 | Python | 17,905 | 501 | # 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... |
6e43db9dafa53475be4ef431aa6baf878e746d6378dfafaf94cf90b4c47d8ffa | Python | 17,915 | 513 | # 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... |
4d58a2e1ff51ad589823df0c8f07c3e40aa658c606dca7c80cf68997ac56484e | Python | 17,926 | 451 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Test LAMMPS model deviation with .pt2 (AOTInductor) models.
Uses model_devi_md0.pt2 and model_devi_md1.pt2 (two SE(A) models with different
seeds, fparam+aparam+default_fparam). Expected values are computed dynamically
from Python DeepPot inference so they track model r... |
634a8ab5c230f2e017f788c8b35142b1dccda37069d8e442b4e0011f0c219f7b | Python | 17,931 | 455 | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import os
import re
import uuid
import warnings
from itertools import chain
from typing import IO, TYPE_CHECKING
import onnx.checker as onnx_checker
import onnx.onnx_cpp2py_export.checker as c_checker
... |
b972d656d6299900e7f9342d7dc736da11dce31afc90928e481cac7da11c3c28 | Python | 17,934 | 454 | # 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... |
796adcdd820a41e9ac09e949767214b4f2287959af534d30c537619859dc7cec | Python | 17,938 | 540 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Shared harness for the DPA4 native-spin LAMMPS ``.pt2`` tests.
Owns the mechanics common to every DPA4 native-spin variant -- the 4-atom
NiO system, the live ``DeepPot`` reference, LAMMPS construction, magnetic
force gathering, the MPI subprocess/parser, and the single-r... |
bd61c8632a6b37ba3b0f3fc95494fd07ee1f7ba5cac9b7cfc5a4ab68af7a9726 | Python | 17,938 | 632 | """Tests for seaborn utility functions."""
import re
import tempfile
from types import ModuleType
from urllib.request import urlopen
from http.client import HTTPException
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from cycler import cycler
import pytest
from numpy.... |
960dbd8849bd11dc41e282f9555812ee4fd5d53beffd474d4a8d34387434354d | Python | 17,945 | 493 | #!/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file).
"""Implements ensemble forecasters.
Creates univariate (optionally weighted) combination of the predictions from underlying
forecasts.
"""
__author__ = ["mloning", "GuzalBulatova", "aiwalter", "RNKuhns", "AnH0ang"]
__al... |
edf19cd35656f0ae839ec0c8ace7bfa2d1f13e771fdc9aa642a4455757c463fc | Python | 17,948 | 601 | # 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... |
ba03d436e93c03e08757b37e02726cdbd9aa74897d483c36d8602e6def3719f6 | Python | 17,953 | 522 | # SPDX-License-Identifier: LGPL-3.0-or-later
from collections.abc import (
Callable,
)
from typing import (
Any,
NoReturn,
)
import array_api_compat
import numpy as np
from deepmd.dpmodel.array_api import (
Array,
xp_take_along_axis,
)
from deepmd.dpmodel.output_def import (
FittingOutputDef,
... |
fa80ad88da95cce4985b86f3cc89d8aa36d2aad03db20cf8779294e69e36749e | Python | 17,968 | 462 | from __future__ import annotations
from collections.abc import Iterable, Mapping, Sequence
from typing import Any, cast
import numpy as np
import torch
from torch import nn
from torch.jit import ScriptModule
from .enums import ColumnSettings
try:
from torch.nn.parameter import is_lazy
except ImportError:
d... |
ecf3e3b5f9a7cbf6ffd711dc6d98dffc67571f46825cb553da741ac9a96d663b | Python | 17,969 | 523 | """Grid search engine shared by the classification and regression tuners.
Contains the parameter candidate loop, the pinning of cross-validation folds,
and the assembly of sklearn style ``cv_results_``. Used by ``TSCGridSearchCV``
and ``TSRGridSearchCV``.
"""
__author__ = ["fkiraly", "achieveordie", "yash-sangwan"]
... |
b8f3258243b83837adbceaa41ac5919405ad9da5e4f3c7db039bc3483f5352ec | Python | 17,987 | 541 | import numpy as np
from sklearn.ensemble import IsolationForest, RandomForestClassifier
from sktime.classification.compose import ColumnEnsembleClassifier
from sktime.classification.dictionary_based import (
MUSE,
WEASEL,
BOSSEnsemble,
ContractableBOSS,
TemporalDictionaryEnsemble,
)
from sktime.cla... |
f61746aa8014f1ceb9481285e0aa841af26045e9b433f198665433e659727cd8 | Python | 18,019 | 500 | """Interface module to dtw-python package.
Exposes basic interface, excluding multivariate case.
"""
__author__ = ["fkiraly"]
import numpy as np
import pandas as pd
from skbase.utils.dependencies import _check_soft_dependencies
from sktime.alignment.base import BaseAligner
class AlignerDTW(BaseAligner):
"""Al... |
1608c06c34b62a78cacdf297577fa997e7c6d539de5d889065d364dc7c2c3aef | Python | 18,031 | 523 | """A rotation forest (RotF) vector classifier.
A rotation Forest sktime implementation for continuous values only. Fits sklearn
conventions.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["RotationForest"]
import time
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.decomp... |
791dce7caf025fab8c950e43db592b9b1608ac10a742446f85d852d369bea4c8 | Python | 18,053 | 480 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Bindings for the operator of the latent-charge long range.
The operator ``deepmd::latent_charge_sum`` evaluates, for the nodes of
complete frames, the potential that the charges of every other node of the
frame create at each node and the force between the charges. A non... |
bc4446728f8affd395d3374f42808ef96b5eaca55512aa14bbb517877a694903 | Python | 18,057 | 386 | """Extension template for time series classifiers.
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 implement... |
ab6d9703d8eb92a9111b11bcc6236919bf383a508d83082a3383bde376f14b48 | Python | 18,074 | 504 | """Information Gain-based Temporal Segmentation.
Information Gain Temporal Segmentation (IGTS) is a method for segmenting
multivariate time series based off reducing the entropy in each segment [1]_.
The amount of entropy lost by the segmentations made is called the Information
Gain (IG). The aim is to find the segme... |
16b858790a9b1d8a628f4da9a29e9c3720e6421269e4dfd3581d19dd432b87b5 | Python | 18,089 | 468 | #!/usr/bin/env python3
"""
Execute the TorchServe Benchmark. For instructions, run with the --help flag
"""
# pylint: disable=redefined-builtin
import argparse
import itertools
import multiprocessing
import os
import pprint
import shutil
import subprocess
import sys
import time
import traceback
from functools impor... |
fb8372fe389df4fecfbc31fcf273ab02d1f6e34ca8369f960d3cb448860d28ba | Python | 18,103 | 400 | import sys
from typing import TypedDict, Union, Sequence, List
from copy import deepcopy
from pathlib import Path
import random
import numpy as np
import torch
import torch.nn as nn
import torchvision.transforms as TF
from torch._utils import _accumulate
from torch.utils.data import Subset
from torch.utils.data.datase... |
45d454a27dc2cc818312df055195b435976962985aa73927be0c63d63e4b1815 | Python | 18,126 | 478 | #!/usr/bin/env python3 -u
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file).
"""Implements Bagging Forecaster."""
__author__ = ["fkiraly", "ltsaprounis"]
import numpy as np
import pandas as pd
from sklearn.utils import check_random_state
from sktime.datatypes._utilities import update_data
from... |
7ba3d21e941fa4cf3cbf36c64ae22c72210fd3bda9db7e85757e4c9bf2702a70 | Python | 18,132 | 510 | # 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... |
8af827efd804cf4119db8d96f801e6b69e0df3ff178e6ded8f29597f4cbf9649 | Python | 18,135 | 508 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""DeePMD change bias entrypoint script."""
import logging
import os
import shutil
import tempfile
from pathlib import (
Path,
)
from typing import (
Any,
)
import numpy as np
from deepmd.common import (
expand_sys_str,
j_loader,
)
from deepmd.dpmodel.util... |
a19279f9039f0cf6bfdba2dd2a52e4e202895ad888d90f7fa559b24d2fc14189 | Python | 18,144 | 523 | from __future__ import annotations
from collections import defaultdict
from concurrent.futures import ProcessPoolExecutor
from dataclasses import replace
from pathlib import Path
from typing import Any
import hiwenet
import networkx as nx
import numpy as np
from graynet import config_graynet as cfg
from graynet.atla... |
d9eef441ddc66e5f15569b8025cbb655019d77e8e2b98b3985e5596242a7ab56 | Python | 18,156 | 656 | # 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... |
abe9cc81f474fe7efa560f3f734e82b9deb149be896bf2d7a775d6c533b4b82f | Python | 18,172 | 488 | # SPDX-License-Identifier: LGPL-3.0-or-later
import math
from typing import (
Any,
NoReturn,
)
import array_api_compat
import numpy as np
from deepmd.dpmodel.array_api import (
Array,
)
from deepmd.dpmodel.common import (
NativeOP,
)
from deepmd.dpmodel.descriptor.base_descriptor import (
BaseDesc... |
3f3ff15da49f7f63933cee3ee3d6a17d4a663a22b3046a07ff6ef65a06e7d4f3 | Python | 18,183 | 438 | '''
- The nucleotide sequence feature construction code was mainly modified from Azimuth project(https://github.com/MicrosoftResearch/Azimuth).
- The structure features were inspired from WU-CRISPR(http://crispr.wustl.edu/)
- RNAfold binary should be configured in PATH environment. Vienna RNA package from ViennaRNA(... |
1de1d46178a144677e071ae311cb2d7a64cb4e93bc7dce781e0a493c877fff7d | Python | 18,188 | 500 | #!/usr/bin/env python
import random
import math
import os
import shutil
import subprocess
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
# This module more or less does this:
# row_no = math.floor(random.random() * 4)
# col_no = math.floor(random.rand... |
70afd0f19d2f3f451c10fa46edd85b51b5636ba946fb55d5a54be01c14c0fc58 | Python | 18,212 | 517 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Legacy optional GIFT-Eval-Pretrain streaming utilities.
This module is retained only to keep older research commands readable. It is
not exported from :mod:`tabby.data`, and the Tabby-Pretrain 165K release recipe
sets ``--gift_ratio 0`` because that checkpoint was train... |
c254c9c4a7e4f47268fad7f495bbf70ae1ba1603453b2aa6c47574c42948c04c | Python | 18,220 | 552 | """
Render reconstructions and place them into a 3-D space
Warning: This is currently broken!
"""
import argparse
import sys
from pathlib import Path
from typing import Union
import numpy as np
import pandas as pd
from matplotlib import pyplot as mpl
from mayavi import mlab
from neuronvis import hocRender as HR
imp... |
5d2b71df6cddbe956570b2a931e4a470e46a8ae748f5937bb2d3deff14453fa2 | Python | 18,248 | 445 | '''
- The nucleotide sequence feature construction code was mainly modified from Azimuth project(https://github.com/MicrosoftResearch/Azimuth).
- The structure features were inspired from WU-CRISPR(http://crispr.wustl.edu/)
- RNAfold binary should be configured in PATH environment. Vienna RNA package from ViennaRNA(... |
0173d7e41561888f6bd80681af8f45f865b6fa4638fdf75fb93e455624d2ce4b | Python | 18,253 | 538 | """Testing vectorization via VectorizedDF."""
__author__ = ["fkiraly"]
import numpy as np
import pandas as pd
import pytest
from sktime.datatypes._check import AMBIGUOUS_MTYPES, check_is_mtype
from sktime.datatypes._examples import get_examples
from sktime.datatypes._registry import generate_mtype_register, generate... |
679430c08a1f23b6af4e90ac534182e1480e57d084fec8c6357722870e3c19ce | Python | 18,259 | 567 | # 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... |
acace51dc37420e1660d7e91e53dacfa49f1b773b1dc90aa0a91469808820a03 | Python | 18,270 | 494 | from sklearn.feature_extraction import DictVectorizer
from sklearn import linear_model
import time
import numpy as np
from akkadian.data import increment_count, invert_dict, compute_vocab_count, build_tag_to_idx_dict
from akkadian.build_data import preprocess
from akkadian.hmm import hmm_choose_best_lamdas, hmm_compute... |
31f2a4f4c057078757c818902132e0ee669948b182394ac651aa0a1b05b83943 | Python | 18,310 | 653 | #Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software;
#you can redistribute it and/or modify
#it under the terms of the MIT License.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHA... |
8de22a76a9221a57757e955025e425ce934779f82849092c02874f9ac2536853 | Python | 18,314 | 504 | # 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... |
b2e116f69823f86ee770da30df02ffd5a13d60b674a7b5068ca957de09617836 | Python | 18,315 | 414 | 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
from tqdm import tqdm
# Plotting
import sciplotlib.polish as splpolish
import sciplotlib.style as splstyle
import jax
# Global flag to set a specific platform, must be used at sta... |
d36324748a91577956a96e6b8f87b674d3dc74089e709475f34fb5c90eb92b44 | Python | 18,320 | 463 | import numpy as np
import os
import seas.video
from seas.video import load, dfof, rotate, rescale
from seas.filemanager import sort_experiments, get_exp_span_string, read_yaml
from seas.rois import roi_loader, make_mask, get_masked_region, insert_masked_region, draw_bounding_box
from seas.hdf5manager import hdf5mana... |
472280f74ebd9cca80d80caa85764c70465a63e5b9a18c07112c276461c05116 | Python | 18,326 | 767 | # -*- encoding:utf-8 -*-
from __future__ import division, absolute_import, print_function
import sys, textwrap
from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc
from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc
from nose.tools import *
if sys.version_info[0] >= 3:
sixu = la... |
7c2849dcf98f8b08c8a4aa19e509031efa9579b252b3edac27ec645810dab777 | Python | 18,336 | 411 | """Extension template for early time series classifiers.
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 imp... |
32970e290e5c5788ef5cf44dc55153e1d1955d99bfdd0fca9e9c81ec2e1ae20f | Python | 18,343 | 428 | # -*-coding:utf-8-*-
# from __future__ import absolute_import
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
def conv1x1 (in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
def conv3x3 (in_planes, out_planes, stri... |
25c2f37b2d7fbbf8009cc51960288f3d27527fefcc44debad5d266015c3fde82 | Python | 18,346 | 514 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
# Upstream model: splunk/cisco-time-series-model, Apache-2.0 License
# https://github.com/splunk/cisco-time-series-model
"""Cisco Time Series Model (CTSM) forecaster for ``sktime``."""
__author__ = ["vedantag17"]
__all__ = ["CiscoTSMForecaster"]
... |
8acd03555f609c17d0f7b677b2a06cb322f7012ad1ae5869a00bdfbb71b7f912 | Python | 18,364 | 491 | #
from scipy import optimize
import matplotlib.pyplot as plt
import tqdm
import pickle
from scipy import stats
from scipy import sparse
import pandas as pd
import numpy as np
import time
from robustlink import utils
def set_venn_scale(ax, true_area, ref_area):
s = np.sqrt(ref_area/true_area)
ax.set_xlim(-s, s... |
a2209b051a9321e6617391cd0962515a063cc5773b6f5d12cb723b5e24696f0e | Python | 18,377 | 504 | # -*- coding: utf-8 -*-
import numpy as np
from pyqtgraph.Qt import QtGui, QtCore
from pyqtgraph.python2_3 import asUnicode, basestring
import pyqtgraph.metaarray as metaarray
__all__ = ['TableWidget']
def _defersort(fn):
def defersort(self, *args, **kwds):
# may be called recursively; only the first ca... |
ee5057cd7872aaf7a109e150094dca53ff710ec1c7a9564898f28a6a415343b7 | Python | 18,377 | 492 | import pytest
import numpy as np
from scipy.interpolate import interpn
from ardent.utilities import _validate_xyz_resolution
from ardent.utilities import _compute_axes
from ardent.utilities import _compute_coords
from ardent.preprocessing.resampling import _resample
from ardent.preprocessing.resampling import _downsa... |
33c233ea413e7e35d8c9dde11a9a509bff3a70244b0fd6aacb318c24be8af813 | Python | 18,378 | 527 | # SPDX-License-Identifier: LGPL-3.0-or-later
import tempfile
import unittest
from pathlib import (
Path,
)
from unittest.mock import (
patch,
)
import h5py
import numpy as np
import paddle
from deepmd.dpmodel.atomic_model import DPAtomicModel as DPDPAtomicModel
from deepmd.dpmodel.output_def import (
Fitt... |
60d76e763f7bb6da59f0d85014ee2108b12730c0890cda786a35621673aa2414 | Python | 18,392 | 606 | #%% [markdown]
# # Maggot connectome subset with seeds
#%%
import datetime
import time
import logging
import pymaid
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from graspologic.match import graph_match
from matplotlib.lines import Line2D
from matplotlib.transforms import... |
a6e6db1348faa032f2647cae23bff8366cebbf635bcbd4f25e44bff5f9a5cefb | Python | 18,414 | 343 | """
File to transform the processed data from Musall et al., 2019 into plot panels
"""
import argparse
import os
from os import path
from typing import Any
import matplotlib as mpl
import matplotlib.pyplot as pl
import seaborn as sns
import h5py
import numpy as np
import pandas as pd
import utilities
class CheckAr... |
d70f53f825e395556325a87f08de23e279f12dbb76318e207a203f2e3921b7f4 | Python | 18,430 | 443 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Toolkit-Ops (``nvalchemiops``) neighbor-list strategy.
A :class:`~deepmd.dpmodel.utils.neighbor_list.NeighborList` implementation that
builds the extended representation ``(extended_coord, extended_atype, nlist,
mapping)`` using the device-resident neighbor-list kernels ... |
f0637fa5d8d542126adcd1971771ae98d36db1f611d3063a6e8e97efae6b464b | Python | 18,442 | 498 | # 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... |
aab5bc73a82d287bb45fdbc8df829adc717b10e8f9a2ab09175d9c9b5856e702 | Python | 18,444 | 425 | import csv
import pickle
import sys
import logging
import argparse
import os
import numpy as np
import rdkit
import scipy
import multiprocessing
from functools import partial
from datetime import datetime
from collections import defaultdict
from pathlib import Path
from typing import List, Optional, Tuple, Union
from... |
f06ce6628c204b8695fd53bcff238fc2d09ca29bed8f9e03bfe99292ea69bf19 | Python | 18,450 | 484 | # -*- coding: utf-8 -*-
"""
August 2017
Module for crispro, a script to process sequencing data from dense CRISPR tiling screens.
"""
import os, re, itertools, urllib.request, urllib.parse, urllib.error, logging, csv, math, pickle
from math import cos, sin, pi, sqrt, acos, asin, atan2
import matplotlib as mpl
mpl.use... |
d99e8d90fe74dbf37e221d3b6269fa2e5295dc6f1d937b3fc2e3fb429fe98bb9 | Python | 18,470 | 356 |
import re, sys, string
###########################
## Regular expression
#Old regex
#G4_bulges = re.compile(r"(?=(G(?:[ATC]{0,6}?G){2}(?:[ATCG]{1,7}?G(?:[ATC]{0,6}?G){2}){3}))", re.I) # find each motif which overlap
#G4_bulges2 = re.compile(r"G([ATC]{0,6}?)G([ATC]{0,6}?)G[ATCG]{1,7}?G([ATC]{0,6}?)G([ATC]{0,6}?)G[ATC... |
b684d5b7196406941d04f59ce6e5192530067962da76545fe9c40164b1fc8df0 | Python | 18,488 | 538 | # SPDX-License-Identifier: LGPL-3.0-or-later
import itertools
import os
import textwrap
import unittest
from copy import (
deepcopy,
)
import numpy as np
from deepmd.dpmodel.common import (
get_xp_precision,
)
from deepmd.dpmodel.utils import (
EmbeddingNet,
FittingNet,
NativeLayer,
NativeNet,... |
2f18f29e42bcbb95a7770d30e3fe1cac953241346144b5ce5c84240dc1253a41 | Python | 18,493 | 473 | """Utilities for SingleCellFusion
"""
from __init__ import *
import functools
import collections
import itertools
import re
from scipy import sparse
from scipy.stats import zscore
import fbpca
import sys
import logging
from memory_profiler import profile
from datetime import datetime
import basic_utils
import clst_ut... |
7b02e80d37b9b8bb851de6ae32c1508a31cb12900ccf3559b789516b5eae1c95 | Python | 18,502 | 512 | """
This module has a few different sets of functions for "trimming" dendrites from
cells.
The first method (diff_files) takes one hoc file description of a neuron, and
compares it to another one. The file written out is trimmed version of the first
file, with the dendrite sections that are missing in the second file ... |
9e266cf6c1ae59e80beb249a90f65186b6d1693d79375bf5e81e279a3956e51c | Python | 18,504 | 432 | # -*- coding: utf-8 -*-
"""`RecombinationWeights` is a list of recombination weights for the CMA-ES.
The most delicate part is the correct setting of negative weights depending
on learning rates to prevent negative definite matrices when using the
weights in the covariance matrix update.
The dependency chain is
lamb... |
c4f05a97373b0d6acc4cf76f8fccf9b995cdb9f1201c497bceebcecf0cb80196 | Python | 18,512 | 517 | # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... |
f9e7c1bc8d6b737aa30647bfcff31cc78a0982cd752db3135bc6a019cda14dd4 | Python | 18,514 | 471 | # 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... |
bc41bbb4998a9613c0e88cafa1d12460c62597f13c09b987e17bd66ec6b4ddec | Python | 18,530 | 522 | # 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... |
7a7992974ea0ecc7f40ea785827613f8611e6fbf1198be4e3556f248d1d619a1 | Python | 18,539 | 338 | """ Dataloader for all datasets. """
import os,json,pdb,argparse
import os.path as osp
import numpy as np
import pandas as pd
from PIL import Image
import torch
from torch.utils.data import Dataset
from torchvision import transforms
import torch.nn.functional as F
from .augmentation_pool import RandAugmentMC,RandAugmen... |
60dce4feac2631cb70161acac29c337aca7003249528b04fd4fca2c90bad7910 | Python | 18,541 | 452 | """Implements adapter for pytorch deep learning estimators."""
__all__ = ["_PytorchDeepAdapter"]
__authors__ = ["geetu040", "RecreationalMath", "srupat"]
from collections.abc import Callable
import numpy as np
from sktime.utils._lookup import _lc_class_dict, _lookup_class
from sktime.utils.dependencies import _safe... |
f459341fa509fd735aea2555fcd256dffbc6917fd21402e8f9c7303969134b84 | Python | 18,572 | 503 | # SPDX-License-Identifier: LGPL-3.0-or-later
"""Unit tests for the SeZM / DPA-4 ``nvalchemi-toolkit`` wrapper.
The wrapper (:class:`deepmd.pt.nvalchemi.DPA4Wrapper`) drives a SeZM model
through its sparse-edge lower interface from an ``nvalchemi`` graph batch. The
gold-standard correctness check is parity with the mod... |
23d8a4a754bdfd44901b3a131c7a7e0cb1cb079452a232b15fad395d69972379 | Python | 18,596 | 549 | # 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... |
2af4b5dd5b378ac9b23e1d4aa3d9de9d9805d7b787a859e65caa2b6f97e64106 | Python | 18,596 | 453 | # SAFE TEAM
#
#
# distributed under license: CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) #
#
from compiler_provenance.s2v_classification_network_arith_mean import NetworkLSTM as arithMeanNetwork
from compiler_provenance.s2v_classification_network_rnn import NetworkLSTM as rrnFast... |
c007fcc47e1ef4d4395f3725a1f35e82d33332ab1d818e041656f9bfc745d7ed | Python | 18,601 | 423 | #!/usr/bin/env python
import logging
import os
import importlib
import sys
import pickle
import numpy as np
import pandas as pd
import utils
import process_features
import attention_model
import torch
from torch.utils import data
import torch_visual
from torch import save
from time import time
import random
import my_... |
c2527e281ac96536e191df0f015b98d1fd7273dd8b567197f582baca76760df3 | Python | 18,607 | 551 | # Copyright 2023 The TensorFlow Authors. 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 applica... |
176f6ff81555e8ef7cc93d48acc27457bbfbcefcb01768563b44619f07afe0d7 | Python | 18,644 | 490 | __author__ = ["chrisholder", "TonyBagnall"]
from abc import abstractmethod
from collections.abc import Callable
import numpy as np
from numpy.random import RandomState
from sklearn.utils import check_random_state
from sklearn.utils.extmath import stable_cumsum
from sktime.clustering.base import BaseClusterer
from skt... |
0503450b292f30044289904bee245eb74ff987aa7375d663a5375a6223b1a9f6 | Python | 18,653 | 464 | from sklearn.manifold import TSNE
from spine_metrics import SpineMetricDataset
from typing import List, Tuple, Set, Dict, Iterable, Callable, Union
from ipywidgets import widgets
from matplotlib import pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from abc import ABC, abstractmethod
import jso... |
ade17f4ea393414cec5c32832434ef67d41ab827d4aade4244d55c868f22854d | Python | 18,664 | 616 | # -*- coding: utf-8 -*-
# from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data.dataset import Dataset
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import _p... |
2b394d1c4cad2d22cc2c76e46f4ff133c75c031ab6d5412d09708432a224d860 | Python | 18,674 | 544 | from copy import deepcopy
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QPen, QBrush,QCursor
from PyQt5.QtCore import QPointF,QPoint
from PyQt5.Qt import Qt
from enum import Enum
from Switches_Static import num_channels,blob_sizes
BLOB_SIZE=30
PEN_SIZE=2
BlobColorsRGB={
"blue":(0,0,255),
"... |
bdac6705b84dd188842a56dc9ae4fe2bf711d7609c17af8f92be3f7a663c90ba | Python | 18,675 | 568 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
"""Tests for BaseObject universal base class.
tests in this module:
test_get_class_tags - tests get_class_tags inheritance logic
test_get_class_tag - tests get_class_tag logic, incl default value
test_get_tags - tests get_ta... |
df8bc1c46d618c42fd13b806f3799ae51971c76f3922a28d6a2cbff6a5177e4f | Python | 18,696 | 355 | import argparse
import gc
import logging
import os
import random
import sys
import traceback
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import torch.nn as nn
gc.enable()
from datetime import date, datetime
from functools import partial
from pathlib import Path
from typing impor... |
ef1455ac6c3a4f0980e6a5136ca0c80a4dfb64407db3bd216dfdbb3875e084bb | Python | 18,696 | 589 | # test_roifile.py
# Copyright (c) 2020-2026, Christoph Gohlke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... |
1b18cc98c46031130aec7ca786d79a65d40be8656897908512d07360a6ed6c60 | Python | 18,701 | 452 | from __future__ import annotations
import math
import re
from collections.abc import Sequence
import numpy as np
import torch
from torch import nn
def grouped_softmax(scores: torch.Tensor, group_index: torch.Tensor, n_groups: int) -> torch.Tensor:
"""Apply a numerically stable softmax independently inside every... |
2883758690daec1511afdfae4691ee9af64177a3f3138d298a6ac395e55ac372 | Python | 18,701 | 419 | """Machine Learning"""
import importlib
import glob
import json
from jsonschema import validate
from re import A
from datetime import datetime
import os
from pathlib import Path
import pickle
from time import time
import numpy as np
import pandas as pd
from pyriemann.estimation import Covariances
from timeflux.core.... |
ea80f1fadb2f40887e306f36dfeeb22e9547bebfab3a84bef82291db6192c310 | Python | 18,706 | 505 | # 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... |
d2466faf3eea8abbc3ebd31a0dab9b5a6323b30b086127a7dd58526b450d10bb | Python | 18,711 | 392 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 req... |
d161a1d2e7de4fa34881346f79aa35bd29ff496b4678fa0b05bf52b274915a53 | Python | 18,713 | 561 | # 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... |
93a34ff0d6f6bbeb16dc75433803862a00ca9d3606fd465e492d0b1aef16da84 | Python | 18,721 | 489 | # copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
# Ported from skchange (BSD-3-Clause), original authors: Tveten
"""Collective and point anomaly (CAPA) detection algorithm."""
__author__ = ["Tveten"]
__all__ = ["CAPA"]
import numpy as np
from sktime.detection._anomaly_scores._from_cost import ... |
bb7ef2a633a7e9c7e6bab77dfac3abb01a20225926e3a60874a31e15c52c15b7 | Python | 18,721 | 536 | import os
from os import linesep
import torch
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import torch.nn as nn
# torch.set_default_dtype(torch.float64)
mytype = torch.float
def update_surface(C, info):
'''
Dimensions
info.surf.xs: BATCH_SI... |
e9ab219d25fcf1bbf5a5879586c48ead849a6da44779f41481251b0445d638e8 | Python | 18,735 | 464 | """
This is the loadable seq2seq trainer library that is
in charge of training details, loss compute, and statistics.
See train.py for a use case of this library.
Note: To make this a general library, we implement *only*
mechanism things here(i.e. what to do), and leave the strategy
... |
66d3666ec11538c0e6a922fc927aed954f83b74c0ed39e111c2d7f2f60dbbcf7 | Python | 18,744 | 490 | """
Test synaptic connections between two different cell types.
Usage: python compare_simple_multisynapses.py <pre_celltype> <post_celltype>
This script:
1. Creates single pre- and postsynaptic cells
2. Creates a single synaptic terminal between the two cells, using the multisite synapse method.
3. Stimulates the ... |
b21b3cf1161e56420bdaadd01526ae575de26d89666f766c715e8da4cb5c771f | Python | 18,749 | 460 | from __future__ import absolute_import, division, print_function
import csv
import json
import logging
import os
from argparse import ArgumentParser
from glob import glob
from random import seed, shuffle
from datetime import datetime
from datetime import timedelta
import h5py
import numpy as np
import pandas as pd
im... |
6164b9f0a13a71ec8437697d864dae3e8f77905523997ece5768b84cdf965607 | Python | 18,753 | 436 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 4 11:38:51 2021
@author: Mesfin Diro
"""
import os.path as osp
from typing import Callable, List, Optional
import torch
from torch_geometric.data import InMemoryDataset, Data
import re
from tqdm import tqdm
from rdkit.Chem import AllChem
from rdkit... |
88381df4b798870973fb423ae185f14dadd278c452be4960be6cbdd80e4ab472 | Python | 18,757 | 535 | # 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... |
7ae7abe328fa3281dfe7b55685cd460c8798dabc8c103ad173ada0e36be054fc | Python | 18,776 | 436 | import logging
from typing import Literal, Optional
import torch
import flair
from flair.data import Dictionary, Sentence
from flair.embeddings import Embeddings
from flair.nn.distance import (
CosineDistance,
EuclideanDistance,
HyperbolicDistance,
LogitCosineDistance,
NegativeScaledDotProduct,
)
... |
648108df8c6c781d0efb45bde866b1f57817432bb8cfe47f19acb664e5aec0e2 | Python | 18,779 | 541 | # Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import numpy as np
import onnx
from onnx.backend.test.case.base import Base
from onnx.backend.test.case.node import expect
from onnx.reference.ops.op_linear_attention import (
LinearAttention as _R... |
3a1e83efe9b6c3ab028fee32427b71df35e921c9a8cceb8e02b0b868e855f57b | Python | 18,791 | 470 | # -*- coding: utf-8 -*-
"""
Created on Wed May 11 16:05:13 2016
@author: wanglab
"""
####file from: http://help.brain-map.org/display/api/Downloading+an+Ontology"s+Structure+Graph
###download: http://api.brain-map.org/api/v2/structure_graph_download/1.json
import pandas as pd, os, numpy as np
from tools.utils.io imp... |
61ffd5addd3104b162a5f9cca0a5ed3c26ed8afcb23d327725a08faaa097902d | Python | 18,804 | 438 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import subprocess
import pdb
import json
import argparse
import ast
from sklearn.pipeline import Pipeline
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import ShuffleSplit, cross_val_sco... |
5b0aff65ab9545f9615735d84641e8a92a5a6b28142ad0ff3dbe482c01ce9691 | Python | 18,805 | 514 | # Copyright 2019-2020 The ASReview Authors. 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... |
d914f52884652de874c2936329f5c8c0b5a4ca5a35dc019fbdfa0a4250e1c149 | Python | 18,807 | 411 | import os
os.environ['PATH'] += ';C:\Program Files\cudnn\cudnn-11.2\cuda/bin/'
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import tensorflow as tf
import numpy as np
import datetime
import voxelmorph as vxm
import distutils.dir_util
import pandas as pd
from tensorflow.keras.models import save_model
import conf... |
4d8c6d62b89b836f3a85fbb7c7ead86ef7971b65126ee40cb735b47badc8a2ad | Python | 18,816 | 469 | from pathlib import Path
import pandas as pd
from sqlalchemy import create_engine, inspect, Table, Column
from collections import defaultdict
from ilxutils.tools import light_degrade, open_pickle, create_pickle
import os
#ELASTIC = 'https://5f86098ac2b28a982cebf64e82db4ea2.us-west-2.aws.found.io:9243/interlex/term/'
TE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.