repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
brightyu/impedance.py
[ "76fd9c7b6c2b3ad87ce2ea8450cade402e9b3709" ]
[ "impedance/tests/test_circuits.py" ]
[ "from impedance.circuits import Randles\nimport numpy as np\n\n# store some global test data\nfrequencies = np.array([0.0031623, 0.0039811, 0.0050119, 0.0063096,\n 0.0079433, 0.01, 0.012589, 0.015849, 0.019953,\n 0.025119, 0.031623, 0.039811, 0.050119, 0.063096,\n ...
[ [ "numpy.imag", "numpy.array" ] ]
cmashraf/kmpy
[ "7fdd55c7e620b7c014fdc3788d93b1bf2f6de214" ]
[ "kinexns/parse_chemkin.py" ]
[ "import numpy as np\nfrom .constants import GAS_CONST, PR_ATM\nfrom .constants import KCAL_JL, HT_JL, CAL_JL\nimport math\nimport pandas as pd\nimport re\nfrom itertools import islice\n\n\ndef set_paths_chemkin_files(my_path):\n \"\"\"\n Set the absolute path to required files on the current machine.\n ***...
[ [ "pandas.read_csv", "numpy.log" ] ]
arnabmaji1981/scikit-image
[ "aff33569589fcc972084c0c930d85d8471a70bea" ]
[ "doc/examples/segmentation/plot_segmentations.py" ]
[ "\"\"\"\n====================================================\nComparison of segmentation and superpixel algorithms\n====================================================\n\nThis example compares four popular low-level image segmentation methods. As\nit is difficult to obtain good segmentations, and the definition ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "numpy.unique" ] ]
EkaterinaKuzkina/pandas
[ "87803d0c3abfbbac5261a2b1a94e6a76a934b1bf" ]
[ "pandas/core/window/rolling.py" ]
[ "\"\"\"\nProvide a generic structure to support window functions,\nsimilar to how we have a Groupby object.\n\"\"\"\nfrom __future__ import annotations\n\nimport copy\nfrom datetime import timedelta\nfrom functools import partial\nimport inspect\nfrom textwrap import dedent\nfrom typing import (\n TYPE_CHECKING,...
[ [ "pandas.core.window.doc.window_agg_numba_parameters", "pandas.core.algorithms.factorize", "pandas.util._exceptions.find_stack_level", "pandas.core.indexers.objects.FixedWindowIndexer", "numpy.where", "pandas.core.indexers.objects.GroupbyIndexer", "pandas.core.base.DataError", "nump...
mdeceglie/pvpro
[ "5c1f2c9be8e4e7a9399eab991f7e29bb2e240f03" ]
[ "examples/synth02_simulfit.py" ]
[ "\"\"\"\nExample full run of pv-pro analysis using synthetic data.\n\n@author: toddkarin\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.plotting import register_matplotlib_converters\n\nregister_matplotlib_converters()\n\nimport matplotlib\n\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.pyplot.xticks", "pandas.read_pickle", "numpy.nanmin", "matplotlib.pyplot.gca", "numpy.nanmax", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.axis", "pandas.plotting.register_matplotlib_converters", "matplotlib.use", ...
yzhhome/JDQA
[ "68e1d0259d316b3577a1f2fafa773b50f1885762" ]
[ "ranking/train_LM.py" ]
[ "'''\n@Author: dengzaiyong\n@Date: 2021-08-21 15:16:08\n@LastEditTime: 2021-08-27 19:37:08\n@LastEditors: dengzaiyong\n@Desciption: 训练tfidf, word2vec, fasttext语言模型\n@FilePath: /JDQA/ranking/train_LM.py\n'''\n\nimport os\nfrom collections import defaultdict\nfrom gensim import models, corpora\nimport config \nimport...
[ [ "pandas.read_csv" ] ]
resistics/resistics
[ "cba60747803b6c582eaaf1a670a7f455f5724ebd" ]
[ "resistics/project.py" ]
[ "\"\"\"\nClasses and methods to enable a resistics project\n\nA project is an essential element of a resistics environment together with a\nconfiguration.\n\nIn particular, this module includes the core Project, Site and Measurement\nclasess and some supporting functions.\n\"\"\"\nfrom typing import Iterator, Optio...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
yuwenxianglong/zhxsh.github.io
[ "196e32d2775ef3a3863603cb5c30023450a1944c" ]
[ "resdata/MatInf/matminer/elasticDataAPI/exportToMongoDB202004262308.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@Project : elasticDataAPI\n@Author : Xu-Shan Zhao\n@Filename: elasticDataAPI202004262110.py\n@IDE : PyCharm\n@Time1 : 2020-04-26 21:10:40\n@Time2 : 2020/4/26 21:10\n@Month1 : 4月\n@Month2 : 四月\n\"\"\"\n\nimport pymongo\nimport pandas as pd\n\nclient = pymongo.MongoClient(...
[ [ "pandas.DataFrame" ] ]
r3fang/MERlin
[ "2ee81a4e18c3fe406d91ee6ce65ca38b69ee9d68" ]
[ "merfishdecoder/apps/run_extract_pixel_traces.py" ]
[ "import os\nimport pickle\nimport pandas as pd\nimport numpy as np\n\nfrom merfishdecoder.core import zplane\nfrom merfishdecoder.util import utilities\nfrom merfishdecoder.util import barcoder\nfrom merfishdecoder.util import decoder\n\ndef run_job_old(dataSetName: str = None,\n fov: int = None,\n ...
[ [ "numpy.where", "numpy.load", "pandas.read_hdf" ] ]
alswhdgus10/Conditioned-Source-Separation-LaSAFT
[ "f8d8de82391fa04622bbe93e232bb627a9367feb" ]
[ "lasaft/source_separation/conditioned/cunet/dcun_gpocm.py" ]
[ "from argparse import ArgumentParser\n\nimport torch\n\nfrom lasaft.source_separation.conditioned.cunet.dcun_base import Dense_CUNet, Dense_CUNet_Framework\nfrom lasaft.source_separation.sub_modules.control_models import pocm_control_model, dense_control_block\nfrom lasaft.utils.PoCM_utils import Pocm_Matmul, Pocm_...
[ [ "torch.cat" ] ]
neptune-ai/project-time-series-forecasting
[ "84af0e7e0ab934c0a89e6e793adc94a66ff98eae" ]
[ "src/model.py" ]
[ "from keras.layers import Dropout\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers import LSTM\nfrom tensorflow.keras.metrics import RootMeanSquaredError, MeanAbsoluteError\nfrom tensorflow.keras.models import Sequential\n\n\ndef get_model(params, input_shape):\n model = Sequential()\n ...
[ [ "tensorflow.keras.metrics.MeanAbsoluteError", "tensorflow.keras.layers.Dense", "tensorflow.keras.metrics.RootMeanSquaredError", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.LSTM" ] ]
cacosandon/speaker_follower_with_objects
[ "f3d454fdbd1c8129887cf4ecc4743d231c7b9555" ]
[ "tasks/R2R/eval_speaker.py" ]
[ "''' Evaluation of agent trajectories '''\n\nimport json\nimport pprint; pp = pprint.PrettyPrinter(indent=4) # NoQA\n\nfrom utils import load_datasets, Tokenizer\nimport numpy as np\nfrom bleu import multi_bleu\n\n\nclass SpeakerEvaluation(object):\n ''' Results submission format:\n [{'instr_id': string,...
[ [ "numpy.mean" ] ]
wittler-github/A_MD_Analysis_of_Insulin
[ "952436ecae9f5f58ec95293ed4af860489787466" ]
[ "Chapter 6/Residues_Hbonds_Distances/HB_STAT_all_filenames.py" ]
[ "\nimport numpy as np\n\nQFC = np.genfromtxt('Results/datToPlotHB/HB_all_filenames.dat',dtype='U50',delimiter=\"\\n\");\n\neqt = 9.0\n\nmeanQFCarray = np.zeros((5,len(QFC)))\nsdQFCarray = np.zeros((5,len(QFC)))\n\nab = np.zeros(len(QFC),dtype=[('var1','U50'),('var2',float),('var3',float),('var4',float),('var5',floa...
[ [ "numpy.savetxt", "numpy.float", "numpy.genfromtxt", "numpy.power", "numpy.sqrt", "numpy.int_" ] ]
mulki214/chatbot_demo
[ "d0f11c40157c175170a06067900183a3f71b10ad" ]
[ "chatbot/model.py" ]
[ "# Copyright 2015 Conchylicultor. All Rights Reserved.\n# Modifications copyright (C) 2016 Carlos Segura\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache....
[ [ "tensorflow.contrib.rnn.DropoutWrapper", "tensorflow.train.AdamOptimizer", "tensorflow.constant_initializer", "tensorflow.summary.scalar", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.matmul", "tensorflow.transpose", "tensorflow.reshape", "tensorflow.variable_scope", ...
MLPA-DKU/Gait-Analysis
[ "2c288561be65e76bebd894df8293d856c4078e2c" ]
[ "Code/Model/cropNet_model.py" ]
[ "import tensorflow as tf\nimport tensorflow.keras as keras\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import Dropout\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers ...
[ [ "tensorflow.keras.layers.Conv1D", "tensorflow.keras.backend.sum", "numpy.zeros", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Flatten", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.stack", "tensorflow.keras.layers.LSTM", "tensor...
JobQiu/AttnGAN
[ "cf4eb54de04d840278b9feeb19e9e17cad22afeb" ]
[ "eval/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.parallel\nfrom torch.autograd import Variable\nfrom torchvision import models\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.functional as F\n\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom miscc.config import cfg\...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.nn.GRU", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.utils.model_zoo.load_url", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.functional.avg_pool2d", "torch.autograd.Variable", "torch.nn.functional....
mahehu/SGN-41007
[ "c8ed169a0a5f70fb87b99448e39a573c0df584b2" ]
[ "code/straightlineExample_ML.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Nov 10 15:58:23 2015\n\n@author: hehu\n\"\"\"\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nif __name__ == \"__main__\":\n \n np.random.seed(2016)\n \n x = np.linspace(-10,10,100)\n y = 1 / (1 + np.exp(-x))\n \n x = x + 0.1 * np.ran...
[ [ "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.save", "numpy.exp", "numpy.random.randn", "numpy.linalg.lstsq", "matplotlib.pyplot.y...
mczerwinski/kCSD-python
[ "fb7bae11dabd0709b2a6a36de45b3eae329f2791" ]
[ "kcsd/basis_functions.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nThis script is used to generate basis sources for the\nkCSD method Jan et.al (2012) for 1D,2D and 3D cases.\nTwo 'types' are described here, gaussian and step source,\nThese can be easily extended.\nThese scripts are based on Grzegorz Parka's,\nGoogle Summer of Code 2014, INFC/pykCSD...
[ [ "numpy.exp", "numpy.sqrt" ] ]
mfkiwl/where
[ "b0e7cbfc198ee0276d544b5a94765ff8a2e6d0f2" ]
[ "where/apriori/gravity.py" ]
[ "\"\"\"Get gravity coefficients for a given gravity field\n\nDescription:\n\nReads data from gravity files. The gravity field to read is found in the configuration file. Files are assumed to be in\nthe ICGEM format [1] as available from the International Centre for Global Earth Models (ICGEM) website [2].\n\nUsage ...
[ [ "numpy.zeros" ] ]
jingslaw/self-consist_concentration_calculation
[ "f024e0782bee4ffd39a38740af523061dd667bbe" ]
[ "formation energy.py" ]
[ "#!/usr/bin/env python3.5\r\n# -*- coding: utf-8 -*-\r\n\r\nimport re\r\nimport numpy as np\r\n__author__ = 'Weiguo Jing'\r\n\r\nkb = 8.617e-5 # unit eV / K\r\n\r\n\r\nclass ReadInput(object):\r\n def __init__(self, filename='formation energy input.txt'):\r\n with open(filename, 'r') as fp:\r\n ...
[ [ "numpy.array", "numpy.dot", "numpy.savetxt", "numpy.loadtxt", "numpy.linspace", "numpy.vstack" ] ]
RichardLitt/Vesper
[ "76e5931ca0c7fbe070c53b1362ec246ec9007beb" ]
[ "scripts/detector_eval/manual/plot_precision_vs_calls.py" ]
[ "\"\"\"\nScript that plots precision vs. number of calls for several detectors.\n\nThe plots are made for the archive of the current working directory\nusing the \"Classification\" and \"Detector Score\" annotations created\nby the detectors.\n\"\"\"\n\n\nfrom pathlib import Path\nimport itertools\nimport sqlite3\n...
[ [ "numpy.concatenate", "numpy.array", "matplotlib.ticker.MultipleLocator", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.grid", "matplotlib.pyplot.close", "matplotlib.backends.backend_pdf.PdfPages", "mat...
celtic108/face-decomp
[ "f1f0b75fd45b4a6d1b8fe9991ddc381a651b5b18" ]
[ "training.py" ]
[ "import numpy as np \nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior() \nimport image_utils\nfrom data_loader import get_batch\nimport training_params as params\nimport network_utils\nimport time\nimport sys\n\ndef update_running_loss(rl, l, i):\n i = min(i, 99)\n rl = (rl * i + l) / (i + 1)\n r...
[ [ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.ones_like", "numpy.exp", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.exp", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.split", ...
jjjump-tutu/depository
[ "2667e2217c4e0ee1dcdbcf2f94630487d3c14c70", "2667e2217c4e0ee1dcdbcf2f94630487d3c14c70" ]
[ "resnet/markov_grid_search.py", "classifier/train_classifier.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Mar 17 23:2 7:28 2019\r\n\r\n@author: Winham\r\n\r\n网络测试\r\n\"\"\"\r\n\r\nimport os\r\nimport numpy as np\r\nfrom keras.models import load_model\r\nfrom keras.utils import to_categorical\r\nfrom data_preprocess import *\r\nimport mit_utils as utils\r\nimport time...
[ [ "numpy.max", "numpy.array", "sklearn.metrics.accuracy_score", "numpy.argmax", "numpy.log2" ], [ "tensorflow.keras.callbacks.TensorBoard", "numpy.load" ] ]
Toktom/amiet_tools
[ "e4104db9a0c3784159378f680ebb89caa5ada053" ]
[ "amiet_tools/functions/discretizers.py" ]
[ "\"\"\"Author: Fabio Casagrande Hirono\"\"\"\nimport numpy as np\n\n\ndef chord_sampling(b, Nx=200, exp_length=2):\n \"\"\"\n Calculates 'Nx' points non-uniformly sampled over the half-open\n interval (-b, b], with the leading edge at '-b'.\n\n Parameters\n ----------\n b : float\n Airfoil ...
[ [ "numpy.array", "numpy.zeros", "numpy.diff", "numpy.linspace", "numpy.meshgrid" ] ]
RunxinXu/fairseq
[ "b8ce75a547b6b4e9d8035d3183e45878cc42cd71" ]
[ "fairseq/models/nat/levenshtein_transformer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom fairseq.iterative_refinement_generator import DecoderOu...
[ [ "torch.cat", "torch.nn.functional.dropout", "torch.cuda.device_of", "torch.nn.functional.log_softmax", "torch.nn.functional.linear", "torch.tensor", "torch.nn.functional.softmax", "torch.zeros_like" ] ]
fishfacegit/autogluon
[ "7c466d47c7727187afe434a85e49c3e8eb98f8e6", "7c466d47c7727187afe434a85e49c3e8eb98f8e6" ]
[ "autogluon/utils/tabular/ml/models/ensemble/bagged_ensemble_model.py", "autogluon/utils/tabular/ml/trainer/model_presets/presets.py" ]
[ "import copy\nimport logging\nimport os\nimport time\nfrom collections import Counter\nfrom statistics import mean\n\nimport numpy as np\nimport pandas as pd\n\nfrom ..abstract.abstract_model import AbstractModel\nfrom ...constants import MULTICLASS, REGRESSION, SOFTCLASS, REFIT_FULL_SUFFIX\nfrom ...utils import ge...
[ [ "numpy.where", "numpy.zeros", "pandas.concat" ], [ "sklearn.linear_model.LogisticRegression", "sklearn.linear_model.LinearRegression" ] ]
alex-treebeard/Cirq
[ "0ff2894e053e4ce3bb1b54e9b9de1cc4345d10b3", "10594c0edf7a4c26d5d21f985c6dc391197d3075" ]
[ "cirq/ops/phased_x_gate.py", "cirq/ops/pauli_string.py" ]
[ "# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.sin", "numpy.dot", "numpy.round", "numpy.exp", "numpy.conj", "numpy.cos" ], [ "numpy.copy", "numpy.empty", "numpy.reshape", "numpy.sqrt" ] ]
AWehenkel/Normalizing-Flows
[ "fe535e25cda32781296557ac5a523a6d2ade1761" ]
[ "NF/Step/AugmentedFlow.py" ]
[ "import torch\nimport torch.nn as nn\nfrom ..Conditionners import AutoregressiveConditioner\nfrom ..Normalizers import AffineNormalizer\nfrom ..Step import FCNormalizingFlow, NormalizingFlowStep\nfrom ..Utils.Distributions import NormalLogDensity\n\n\n# Todo defined as an augmented flow step which can be composed w...
[ [ "torch.zeros", "torch.nn.Sequential", "torch.nn.ConvTranspose2d", "torch.nn.Upsample", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
ArnabKar/tree_structured_rslds
[ "94debeb7e0a42037f0234e1e2634493a593bc325" ]
[ "examples/lorenz.py" ]
[ "import numpy as np\nimport numpy.random as npr\nfrom tqdm import tqdm\nfrom trslds.models import TroSLDS\nfrom numpy import newaxis as na\nfrom trslds import utils\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.gridspec as gridspec\nfrom trslds import initialize as ini...
[ [ "scipy.integrate.odeint", "numpy.zeros", "numpy.random.seed", "numpy.load", "matplotlib.pyplot.figure", "numpy.eye", "numpy.arange", "matplotlib.gridspec.GridSpec" ] ]
SAP-samples/security-research-mi-gen-nn
[ "15627f73fcc497c87a67f41957f6b82881dff353" ]
[ "Monte-Carlo-Attacks/Monte-Carlo-CIFAR_GAN/main_bb.py" ]
[ "import os\n\nfrom GAN import GAN\n'''\nfrom CGAN import CGAN\nfrom infoGAN import infoGAN\nfrom ACGAN import ACGAN\nfrom EBGAN import EBGAN\nfrom WGAN import WGAN\nfrom DRAGAN import DRAGAN\nfrom LSGAN import LSGAN\nfrom BEGAN import BEGAN\n'''\n\nfrom utils import show_all_variables\n\nimport tensorflow as tf\nim...
[ [ "tensorflow.ConfigProto" ] ]
hsinfan1996/emcee
[ "1bfababf13f0bc4166dd4812f7dd4fbd2d78822b" ]
[ "src/emcee/autocorr.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport logging\n\nimport numpy as np\n\n__all__ = [\"function_1d\", \"integrated_time\", \"AutocorrError\"]\n\nlogger = logging.getLogger(__name__)\n\n\ndef next_pow_two(n):\n \"\"\"Returns the next power of two greater than or equal to `n`\"\"\"\n i = 1\n while i < n:\n ...
[ [ "numpy.empty", "numpy.conjugate", "numpy.zeros", "numpy.argmin", "numpy.sum", "numpy.mean", "numpy.any", "numpy.atleast_1d", "numpy.cumsum" ] ]
lioritan/hucrl
[ "fb5b3aea0edf69a4169ab79d2908918111fc6072" ]
[ "curriculum_experiments/task_difficulty_estimate.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom rllib.util.rollout import rollout_agent\nfrom rllib.util.training.utilities import Evaluate\n\nfrom curriculum_experiments.environment_parameter import DiscreteParameter\nfrom curriculum_experiments.environment_wrapper import Environmen...
[ [ "numpy.arange" ] ]
jacobseiler/rsage
[ "b3b0a3fa3c676eab188991e37d06894396bfc74f" ]
[ "output/misc_plots.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\n\nimport os\nimport numpy as np\nimport pylab as plt\nimport matplotlib.colors as colors\nimport matplotlib.cm as cm\nfrom numpy import *\nfrom random import sample, seed\nfrom os.path import getsize as getFileSize\nimport math\nimport random\nimport csv\nfrom io import St...
[ [ "matplotlib.use", "numpy.where", "numpy.arange", "matplotlib.rcdefaults" ] ]
azraelzhor/allen-nlp-rc
[ "b114c00a8f364b18e3c427c1a447be9c65ede551" ]
[ "allennlp/data/dataset_readers/reading_comprehension/msmarcov20_confidence.py" ]
[ "import json\nimport logging\nfrom typing import Dict, List, Tuple\n\nfrom overrides import overrides\n\nfrom allennlp.common import Params\nfrom allennlp.common.file_utils import cached_path\nfrom allennlp.data.dataset_readers.dataset_reader import DatasetReader\nfrom allennlp.data.instance import Instance\nfrom a...
[ [ "sklearn.metrics.pairwise_distances", "numpy.lexsort", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
stianchris/GLHE
[ "80c3eecca81ffd50d5077f87027c9441292452f5" ]
[ "unit_tests/glhe/utilities/test_functions.py" ]
[ "import os\nimport tempfile\nimport unittest\n\nfrom math import cos, sin\nfrom numpy import arange, array\nfrom numpy.linalg import solve as lin_alg_solve\nfrom scipy.interpolate.interpolate import interp1d\nfrom scipy.interpolate.interpolate import interp2d\n\nfrom glhe.utilities.functions import c_to_k\nfrom glh...
[ [ "numpy.array", "numpy.arange", "numpy.linalg.solve" ] ]
Fournierp/FPL
[ "6210c6ab9d872b46a10804ba8ee9f5d0df735308" ]
[ "modeling/fixtures/dixon_coles.py" ]
[ "import pandas as pd\nimport numpy as np\nimport json\nfrom tqdm import tqdm\n\nfrom scipy.stats import poisson\nfrom scipy.optimize import minimize\n\nfrom utils import odds, clean_sheet, score_mtx, get_next_gw, time_decay\nfrom ranked_probability_score import ranked_probability_score, match_outcome\n\nimport warn...
[ [ "pandas.to_datetime", "numpy.select", "pandas.merge", "pandas.DataFrame", "numpy.exp", "scipy.stats.poisson.logpmf", "numpy.random.uniform", "numpy.arange", "pandas.concat", "pandas.read_csv", "scipy.optimize.minimize", "numpy.unique" ] ]
jkbgbr/wxmplot
[ "dcd0cb2268b0de8f8b78102d8f1e9e628365da05" ]
[ "wxmplot/imagematrixframe.py" ]
[ "#!/usr/bin/python\n##\n## Image Matrix Frame: 2 correlated images in a 2x2 grid:\n#\n# +-------------+--------------+\n# | | |\n# | mage1 | image 1+2 |\n# | | |\n# +-------------+--------------+\n# | | |\n#...
[ [ "numpy.where", "numpy.percentile", "numpy.arange", "numpy.zeros" ] ]
google-research/sunds
[ "751d31cc4017ebf01d79b4f558e4cc046f76d040" ]
[ "sunds/core/tf_geometry/isometry.py" ]
[ "# Copyright 2021 The sunds Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.transpose", "tensorflow.reshape", "tensorflow.linalg.matvec", "tensorflow.einsum" ] ]
tflovorn/tetra
[ "c5a1e1938f8720c9023b45a7a001220a3e06fa1d" ]
[ "tetra/fermi.py" ]
[ "from scipy.optimize import bisect\nfrom tetra.numstates import NumStates\nfrom tetra.ksample import OptimizeGs, MakeEks\nfrom tetra.submesh import MakeSubmesh, MakeTetra\n\ndef FindFermiToTol(n0, Efn, R, num_electrons, tol=None, tetras0=None, Eks0=None):\n '''Returns the Fermi energy E_F, at which the integrate...
[ [ "scipy.optimize.bisect" ] ]
jcreinhold/lesion-metrics
[ "88eb1295422af97fc86f4bad66c34838f412849b" ]
[ "lesion_metrics/cli/per_lesion.py" ]
[ "\"\"\"Console script for lesion_metrics on per-lesion basis.\"\"\"\nimport argparse\nimport builtins\nimport sys\nimport typing\nimport warnings\n\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=FutureWarning)\n warnings.filterwarnings(\"ignore\", category=UserWarning)\n im...
[ [ "pandas.DataFrame", "numpy.unique", "numpy.full_like" ] ]
rolandgvc/stable-baselines3
[ "805a87ed8b340c6a1a2e674468d5769a8cda38b0" ]
[ "stable_baselines3/ppo/policies.py" ]
[ "from typing import Optional, List, Tuple, Callable, Union, Dict, Type, Any\nfrom functools import partial\n\nimport gym\nimport torch as th\nimport torch.nn as nn\nimport numpy as np\n\nfrom stable_baselines3.common.policies import (BasePolicy, register_policy, MlpExtractor,\n ...
[ [ "torch.nn.Linear", "numpy.sqrt" ] ]
shaibagon/Theano
[ "ba2d2f74406243112e813df31429721c791a889a" ]
[ "theano/tensor/var.py" ]
[ "import copy\n\nimport numpy\n\nimport theano\nfrom theano.compat import all, PY3\nfrom theano.scalar import ComplexError, IntegerDivisionError\nfrom theano.gof import Constant, Variable\nfrom theano.gof.utils import hashtype\nfrom theano.tensor.utils import hash_from_ndarray\nfrom theano.tensor.type import TensorT...
[ [ "numpy.isinf", "numpy.isnan", "numpy.asarray", "numpy.ma.masked_array", "numpy.all", "numpy.unique" ] ]
nagey/pandas
[ "ba60321d00d686a3137ffe26f919d64e84d43aa0" ]
[ "pandas/tests/reshape/test_reshape.py" ]
[ "# -*- coding: utf-8 -*-\n# pylint: disable-msg=W0612,E1101\n\nimport pytest\n\nfrom pandas import DataFrame, Series\nimport pandas as pd\n\nfrom numpy import nan\nimport numpy as np\n\nfrom pandas.util.testing import assert_frame_equal\n\nfrom pandas.core.reshape.reshape import (\n melt, lreshape, get_dummies, ...
[ [ "pandas.core.reshape.reshape.melt", "pandas.compat.u", "pandas.CategoricalIndex", "pandas.core.reshape.reshape.get_dummies", "pandas.util.testing.assert_raises_regex", "pandas.compat.range", "pandas.util.testing.assert_numpy_array_equal", "pandas.DataFrame", "pandas.core.reshap...
linksdl/acs_project_maching-learning
[ "8cc034ec07432c3a79cefc2eacc8e9a77019748d" ]
[ "tensorflow/example2.py" ]
[ "# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n@Project : acs-project-machine_learning \n@File : example2.py\n@Author : Billy Sheng \n@Contact : shengdl999links@gmail.com \n@Date : 2020/12/25 3:52 下午\n@Version : 1.0.0\n@License : Apache License 2.0\n@Desc : None\n\"\"\"\n\nimport tenso...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.colorbar", "tensorflow.keras.layers.Flatten", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "tensorflow.keras.layers.Dense", "tensorflow.keras.losses.SparseCategorica...
Apaezmx/simplifai
[ "07fc221268edeb5dfb83f47375acd25bf38ec605" ]
[ "bottle_air/keras_utils.py" ]
[ "from keras import backend as K\nfrom keras.engine.topology import Layer\nimport numpy as np\nimport tensorflow as tf\n\ndef activate(activation, tensor):\n \"\"\" Maps a string activation to the keras backend function \"\"\"\n if activation == 'tanh':\n return K.tanh(tensor)\n elif activation == 'sigmoid':\n...
[ [ "tensorflow.slice" ] ]
xueyee/GroupFormer
[ "577234f8ad8425af2cd343c8859f8119e29f715c" ]
[ "group/utils/transforms.py" ]
[ "from __future__ import division\nimport torch\nimport math\nimport sys\nimport random\nfrom PIL import Image\ntry:\n import accimage\nexcept ImportError:\n accimage = None\nimport numpy as np\nimport numbers\nimport types\nimport collections\nimport warnings\n\nfrom . import functional as F\n\nif sys.version...
[ [ "torch.clamp", "torch.mm" ] ]
hefangwuwu/relaxrender
[ "adcf3fa5dc7d38f0af8308083fadf665dd30bdb2", "adcf3fa5dc7d38f0af8308083fadf665dd30bdb2" ]
[ "tests/test_camera.py", "tests/test_math.py" ]
[ "import unittest\nimport numpy as np\n\nimport relaxrender.camera as c\nimport relaxrender.triangle as t\nimport relaxrender.points as rp\n\nclass TestCamera(unittest.TestCase):\n\n def setUp(self):\n self.pos = np.array([1.0, 1.0, 1.0])\n self.up = np.array([1.0, 1.0, 0])\n self.right = np....
[ [ "numpy.array", "numpy.sqrt" ], [ "numpy.sum", "numpy.sqrt", "numpy.abs" ] ]
tistacorp/data
[ "4520089648b8cb529a568de69790a685f205258e" ]
[ "scripts/load-data/common/load-us-counties.py" ]
[ "#!/usr/bin/env python3\n# #############################################################################\n# Helper script to generate us-counties.csv file\n# * Download counties information from census.gov\n# * Download geo-location from datasciencetoolkit.org\n# Save result into the '../../common/us/counties.csv' ...
[ [ "pandas.read_excel" ] ]
egoddard/pandas
[ "a0c8425a5f2b74e8a716defd799c4a3716f66eff" ]
[ "pandas/core/frame.py" ]
[ "\"\"\"\nDataFrame\n---------\nAn efficient 2D container for potentially mixed-type time series or other\nlabeled data series.\n\nSimilar to its R counterpart, data.frame, except providing automatic data\nalignment and a host of useful data manipulation methods having to do with the\nlabeling information\n\"\"\"\n\...
[ [ "pandas.core.ops.add_flex_arithmetic_methods", "pandas.core.common.asarray_tuplesafe", "pandas.core.construction.extract_array", "pandas.core.dtypes.common.is_float_dtype", "pandas.core.dtypes.cast.maybe_convert_platform", "numpy.empty", "pandas.io.formats.style.Styler", "pandas.co...
wenqingchu/MMAN
[ "139145e7d4a6cd5a49c6e000d69ef6b4e7005b95" ]
[ "data/aligned_dataset.py" ]
[ "import os.path\nimport random\nimport torchvision.transforms as transforms\nimport torch\nimport torch.nn as nn\nimport math\nimport numpy as np\nfrom data.base_dataset import BaseDataset\nfrom data.image_folder import make_dataset\nfrom PIL import Image, ImageOps\n\ndef channel_1toN(img, num_channel):\n transf...
[ [ "numpy.asarray", "torch.FloatTensor", "torch.from_numpy", "numpy.where", "torch.LongTensor" ] ]
bic4907/MADDPG_simpletag
[ "4afcad1d1d17f1fd5d12e3ef72e04af984dfaba5" ]
[ "envs/multiagent/environment.py" ]
[ "import gym\nfrom gym import spaces\nfrom gym.envs.registration import EnvSpec\nimport numpy as np\nfrom multiagent.multi_discrete import MultiDiscrete\n\n# environment for all agents in the multiagent world\n# currently code assumes that no agents will be created/destroyed at runtime!\nclass MultiAgentEnv(gym.Env)...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.sum", "numpy.argmax", "numpy.cos", "numpy.all", "numpy.linspace" ] ]
ValentinaPansanella/ndlib
[ "e4dbfdbf8cc69c92c31f7cce524189110b009c9f" ]
[ "ndlib/models/opinions/AlgorithmicBiasMediaModel.py" ]
[ "from ndlib.models.DiffusionModel import DiffusionModel\nimport numpy as np\nimport tqdm\nimport random\nimport os\nimport time\nimport pickle\n\nclass AlgorithmicBiasMediaModel(DiffusionModel):\n \"\"\"\n Model Parameters to be specified via ModelConfig\n\n :param epsilon: bounded confidence threshold fro...
[ [ "numpy.full", "numpy.array", "numpy.delete", "numpy.random.rand", "numpy.sum", "numpy.random.random_sample", "numpy.argmax", "numpy.power", "numpy.abs", "numpy.cumsum", "numpy.all", "numpy.maximum" ] ]
alexpron/nnUNet
[ "77bc485ee025a61feb91cb0a0ed1c61a32a0f39f" ]
[ "nnunet/experiment_planning/alternative_experiment_planning/experiment_planner_baseline_3DUNet_v21_11GB.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
[ [ "numpy.round", "numpy.array", "numpy.prod", "numpy.argsort" ] ]
mullenkamp/pareora-current-state-2016
[ "017d6ca2e4c644335cb3d8c0b5c409a198d3c109" ]
[ "atmos/plots.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSurface water plotting functions.\n\"\"\"\n\n\ndef hydrograph_plot(flow, precip=None, x_period='day', x_n_periods=1, time_format='%d-%m %H', x_rot=45, alpha=0.6, flow_units='m^{3}/s', precip_units='mm', x_grid=False, export_path=None):\n \"\"\"\n Plotting function for hydrogr...
[ [ "matplotlib.pyplot.xlim", "pandas.DatetimeIndex", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "pandas.concat", "numpy.in1d", "matplotlib.pyp...
ruanton/qsim
[ "5cfe6fb5e20c85749490bf5c69921e9902fa2e75" ]
[ "tests/test_op_hadamard.py" ]
[ "import numpy as np\nfrom qsim import OperationHadamard, Circuit\n\n\ndef test_operation_hadamard():\n c = Circuit(qubit_count=1)\n o = OperationHadamard(c)\n assert o.qubits_count == 1\n assert np.array_equal(o.op_matrix, np.array([[1, 1], [1, -1]])*0.5**0.5)\n" ]
[ [ "numpy.array" ] ]
weirayao/leap
[ "8d10b8413d02d3be49d5c02a13a0aa60a741d8da" ]
[ "scripts/train_baselines_kitti.py" ]
[ "import torch\nimport random\nimport argparse\nimport numpy as np\nimport ipdb as pdb\nimport os, pwd, yaml\nimport pytorch_lightning as pl\nfrom torch.utils.data import DataLoader, random_split\nimport warnings\nwarnings.filterwarnings('ignore')\n\nfrom train_spline import pretrain_spline\nfrom leap.tools.utils im...
[ [ "torch.utils.data.DataLoader" ] ]
enjalot/adventures_in_opencl
[ "c222d15c076ee3f5f81b529eb47e87c8d8057096" ]
[ "experiments/chaotic_artist/cartist.py" ]
[ "#from OpenGL.GL import GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW, glFlush, glGenBuffers, glBindBuffer\nfrom OpenGL.GL import *\nfrom OpenGL.arrays import vbo\n\nimport numpy as np\nimport struct\nimport pyopencl as cl\n\nfrom initialize import timings \n\nclass ChaoticArtist(object):\n def __init__(self, ntracers,...
[ [ "numpy.array", "numpy.float32", "numpy.int32" ] ]
idiap/hesm_distrib
[ "ff37192733468b40f9bb7b7f573ff326a3aade14" ]
[ "acquisition/Thorcam/acquire_images.py" ]
[ "# License - for Non-Commercial Research and Educational Use Only\n# \n# Copyright (c) 2019, Idiap research institute\n# \n# All rights reserved.\n# \n# Run, copy, study, change, improve and redistribute source and binary forms, with or without modification, are permitted for non-commercial research and educa...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.close", "numpy.save", "matplotlib.pyplot.figure", "numpy.swapaxes", "matplotlib.pyplot.ioff", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
paperrune/deeplearning-practice
[ "77376c8e6963ea783ebee0402794d4d5ee0a7ff8" ]
[ "Recurrent-Layer/Tensorflow.py" ]
[ "import numpy as np\r\nimport tensorflow as tf\r\nimport time\r\n\r\nbatch_size = 128\r\nepochs = 100\r\nlearning_rate = 0.005\r\nmomentum = 0.9\r\ntime_step = 28\r\n\r\n(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()\r\n\r\nx_train = x_train.reshape([x_train.shape[0], time_step, 784 // t...
[ [ "tensorflow.zeros_initializer", "tensorflow.keras.utils.to_categorical", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.glorot_uniform_initializer", "tensorflow.argmax", "tensorflow.train.MomentumOptimizer", "tensorflow.matmul", "tensorflow.Session", "tensorflow.trans...
Yijia-Xiao/Protein-MSA
[ "86be48f15bee3052957a1c64aa80a2e9aa8f927b" ]
[ "finetune/insert_msa.py" ]
[ "import argparse\nimport math\nfrom tqdm import tqdm\nfrom Bio.SeqIO.FastaIO import Seq, SeqRecord\nimport lmdb\n\nfrom typing import Union, List, Tuple, Sequence, Dict, Any, Optional, Collection\nfrom copy import copy\nfrom pathlib import Path\nimport pickle as pkl\nimport logging\nimport random\n\nimport json\nim...
[ [ "numpy.indices", "numpy.ones_like", "numpy.abs", "scipy.spatial.distance.pdist" ] ]
amitport/google_research_federated
[ "b0dea245eb484f731f28d80e460795816d938b16" ]
[ "dp_ftrl/training_loop.py" ]
[ "# Copyright 2021, Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agree...
[ [ "tensorflow.summary.create_file_writer" ] ]
jotsif/shap
[ "0391dea90baaf7446dfd54f994c741fa585e4a6a" ]
[ "tests/explainers/test_gradient.py" ]
[ "import matplotlib\nimport numpy as np\nimport shutil\nmatplotlib.use('Agg')\nimport shap\n\nfrom .test_deep import _skip_if_no_pytorch, _skip_if_no_tensorflow\n\ndef test_tf_keras_mnist_cnn():\n \"\"\" This is the basic mnist cnn example from keras.\n \"\"\"\n\n _skip_if_no_tensorflow()\n import tensor...
[ [ "torch.nn.Linear", "torch.cat", "numpy.random.choice", "torch.ones", "tensorflow.keras.backend.get_session", "tensorflow.python.keras.layers.Activation", "tensorflow.python.keras.layers.Dense", "torch.nn.functional.nll_loss", "tensorflow.python.keras.models.Sequential", "te...
wmjpillow/FlameDetectionAPP
[ "c3761c9e15adccbd084b17cd6b6f63c561c7f856" ]
[ "DNN_Experiments/MaskRCNN/utils.py" ]
[ "\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport logging\nimport math\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport sci...
[ [ "numpy.dot", "numpy.minimum", "numpy.exp", "numpy.multiply", "numpy.where", "tensorflow.stack", "numpy.cumsum", "tensorflow.cast", "numpy.concatenate", "numpy.max", "numpy.divide", "numpy.empty", "numpy.log", "numpy.argmax", "numpy.arange", "numpy.sq...
russoale/imgaug
[ "8dd78f10ec5ae2c133e87850d50addb9d7c67354" ]
[ "checks/check_affine.py" ]
[ "from __future__ import print_function, division\n\nimport imageio\nimport numpy as np\nfrom skimage import data\n\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\n\nNB_ROWS = 10\nNB_COLS = 10\nHEIGHT = 200\nWIDTH = 256\nBB_X1 = 64\nBB_X2 = WIDTH - 64\nBB_Y1 = 64\nBB_Y2 = HEIGHT - 64\n\n\ndef main():\n ...
[ [ "numpy.hstack", "numpy.copy", "numpy.vstack" ] ]
lukasgarbas/flair
[ "041c85cf3d45940dccd453fc350767c1c85aad49" ]
[ "flair/embeddings/base.py" ]
[ "import inspect\nimport logging\nfrom abc import abstractmethod\nfrom typing import Dict, Generic, List, Sequence, Union\n\nimport torch\nfrom torch.nn import Parameter, ParameterList\n\nimport flair\nfrom flair.data import DT\n\nlog = logging.getLogger(\"flair\")\n\n\nclass Embeddings(torch.nn.Module, Generic[DT])...
[ [ "torch.split", "torch.cat", "torch.tensor" ] ]
geekac/workjets
[ "0e4bca01e0579aade353aeaeb8e087bb8da2037b" ]
[ "workjets/torchnets/RAUnet3D/RAUnet3D.py" ]
[ "# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\n\nclass ResidualBlock(nn.Module):\n \"\"\"\n implemention of Residual Block 残差机制\n https://arxiv.org/pdf/1603.05027.pdf\n \"\"\"\n def __init__(self, in_channels=None, out_channels=None):\n...
[ [ "torch.device", "torch.cat", "torch.nn.Sigmoid", "torch.nn.MaxPool3d", "torch.nn.ReLU", "torch.nn.Upsample", "torch.nn.Conv3d", "torch.nn.BatchNorm3d" ] ]
thbom001/improver
[ "6f6e334a1e8e44a151125cf123ecdda2c56dbec4", "6f6e334a1e8e44a151125cf123ecdda2c56dbec4" ]
[ "improver/generate_ancillaries/generate_ancillary.py", "improver_tests/ensemble_copula_coupling/test_ConvertLocationAndScaleParametersToPercentiles.py" ]
[ "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# (C) British Crown copyright. The Met Office.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following condit...
[ [ "numpy.logical_not", "numpy.array", "numpy.zeros", "numpy.mean", "numpy.ma.default_fill_value", "numpy.ma.masked_array" ], [ "numpy.repeat", "numpy.testing.assert_allclose", "numpy.array", "numpy.reshape", "numpy.ma.masked_array", "numpy.linspace", "numpy.br...
Aerospace-AI/AAS-18-290_3dof
[ "eed5d66de5514fdd2a19c48db8ae8120bd5e25ae" ]
[ "AAS_18-290_3dof/drdv_agent.py" ]
[ "import numpy as np\nimport env_utils as envu\nimport attitude_utils as attu\nfrom time import time\n\nclass DRDV_agent(object):\n\n def __init__(self, env):\n self.env = env\n self.state = {}\n self.prev_state = {}\n self.mass = 2000.\n\n def get_thrust(self,state):\n rg = ...
[ [ "numpy.max", "numpy.linalg.norm", "numpy.dot", "numpy.asarray", "numpy.zeros", "numpy.roots", "numpy.real", "numpy.mean", "numpy.std", "numpy.hstack", "numpy.imag" ] ]
OliRafa/SRFR-GAN
[ "b7995421f5a965d35dd83f3107e095d83446868b" ]
[ "utils/common.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\n\ndef tensor_to_image(tensor):\n return (np.squeeze(tensor.numpy()).clip(0, 1) * 255).astype(np.uint8)\n\n\n@tf.function\ndef denormalize_tensor(tensor):\n tensor = tf.math.multiply(tensor, 128)\n return tf.math.add(tensor, 127.5)\n\n\n@tf.function\ndef tenso...
[ [ "tensorflow.image.convert_image_dtype", "tensorflow.math.multiply", "tensorflow.math.add" ] ]
AymericBasset/Reinforcment_Learning_Tag
[ "d8ed1a21fc7ea31a5479297bdb9fdd7397f569a6" ]
[ "tag/Agent.py" ]
[ "import numpy as np\nfrom Brain import Brain\nimport Parameters as p \n\nclass Agent():\n def __init__(self,brain_spec=p.BRAIN_SPEC):\n\n #State and Physics init\n self.agent_reset()\n\n #Think_center init\n self.brain_spec = brain_spec\n self.brain = Brain(brain_spec)\n \n ...
[ [ "numpy.array", "numpy.argmax" ] ]
CosmoStat/autometacal
[ "974b2711ca9fd840c551fab30b0775ab2e5b0876" ]
[ "tests/test_metacal.py" ]
[ "# This module tests our implementation against ngmix\nimport numpy as np\nimport ngmix\nimport galsim\nimport autometacal\n\nfrom numpy.testing import assert_allclose\n\n# Generate some data, any old data will do\ndef make_data(rng, noise, shear):\n \"\"\"\n simulate an exponential object with moffat psf\n ...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.RandomState" ] ]
exoticDFT/drms
[ "c4d11749139249d7e8808d40747b830116a18f48" ]
[ "drms/utils.py" ]
[ "import re\n\nimport numpy as np\nimport pandas as pd\n\n__all__ = ['to_datetime']\n\n\ndef _pd_to_datetime_coerce(arg):\n return pd.to_datetime(arg, errors='coerce')\n\n\ndef _pd_to_numeric_coerce(arg):\n return pd.to_numeric(arg, errors='coerce')\n\n\ndef _split_arg(arg):\n \"\"\"\n Split a comma-sepa...
[ [ "pandas.to_datetime", "pandas.to_numeric", "numpy.isscalar", "pandas.Series" ] ]
HadrienNU/scikit-fem
[ "39d4cff53790725a865b1f2256dd3358c9ca878e", "39d4cff53790725a865b1f2256dd3358c9ca878e" ]
[ "skfem/assembly/basis/interior_basis.py", "docs/examples/ex24.py" ]
[ "from typing import Callable, Optional, Tuple\n\nimport numpy as np\nfrom numpy import ndarray\nfrom scipy.sparse import coo_matrix\nfrom skfem.element import DiscreteField, Element\nfrom skfem.mapping import Mapping\nfrom skfem.mesh import Mesh\n\nfrom .basis import Basis\n\n\nclass InteriorBasis(Basis):\n \"\"...
[ [ "numpy.max", "numpy.arange", "numpy.tile" ], [ "scipy.sparse.bmat", "numpy.zeros_like", "numpy.zeros", "matplotlib.tri.Triangulation", "numpy.split", "matplotlib.pyplot.subplots", "numpy.linspace" ] ]
intohole/caption_generator
[ "1bdd87d3c77dce6fb75e12391ade2778b15c0895" ]
[ "caption_generator/prepare_dataset.py" ]
[ "# coding=utf-8\r\n\r\n\r\nimport pickle\r\nfrom keras.preprocessing import image\r\nfrom vgg16 import VGG16\r\nimport numpy as np\r\nfrom keras.applications.imagenet_utils import preprocess_input\r\n\r\nimport os\r\n\r\nCUR_DIR = os.path.dirname(__file__)\r\n\r\ncounter = 0\r\n\r\n\r\ndef load_image(path):\r\n ...
[ [ "numpy.reshape", "numpy.asarray", "numpy.expand_dims" ] ]
abidlabs/scikit-network
[ "59e95a5c1e3e93dbce21c20282262e21e99acec0" ]
[ "sknetwork/embedding/louvain_embedding.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\"\"\"\nCreated on Sep 2020\n@author: Quentin Lutz <qlutz@enst.fr>\n\"\"\"\nfrom typing import Optional, Union\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom sknetwork.clustering.louvain import BiLouvain\nfrom sknetwork.embedding.base import BaseBiEmbedding, BaseEm...
[ [ "numpy.float32", "numpy.arange", "numpy.unique" ] ]
Szhang577/Sensitivity_To_Dual_Graph
[ "a52e689422dc5da59437d22e18e7514119a66ee3" ]
[ "Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py" ]
[ "import math\nimport random\nimport tqdm\nimport copy\nimport numpy as np\nimport statistics\nimport os\nimport json\nfrom collections import defaultdict\n\n# import matplotlib\n# matplotlib.use('Agg')\n\nimport matplotlib.pyplot as plt\nfrom functools import partial\nimport networkx as nx\n\n\nfrom gerrychain impo...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.random.uniform", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
yi-syong/Benga
[ "ef8cff66b8853d03c9615ef36d566cec27b9d9fd" ]
[ "profiling/tasks.py" ]
[ "from __future__ import absolute_import, unicode_literals\n\nimport os\nimport shutil\nimport zipfile\nimport pandas as pd\nfrom celery import shared_task\nfrom django.conf import settings\nfrom django.core.files import File\n\nfrom profiling.serializers import ProfileSerializer\nfrom profiling.models import Batch,...
[ [ "pandas.read_csv" ] ]
yougnen/pandapower
[ "d206bd91e68dd03675f7fe8ddee141621ef437fc", "24ed3056558887cc89f67d15b5527523990ae9a1" ]
[ "pandapower/pf/runpf_pypower.py", "pandapower/pypower/dSbus_dV.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 1996-2015 PSERC. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IE...
[ [ "numpy.setdiff1d", "numpy.zeros", "numpy.real", "numpy.argmax", "numpy.flatnonzero" ], [ "scipy.sparse.issparse", "numpy.asarray", "numpy.conj", "scipy.sparse.csr_matrix", "numpy.diag" ] ]
steven-mi/gpt-neox
[ "4401339dc71c8ea65349da2ade2fa414d3c469bd" ]
[ "train_enwik8.py" ]
[ "import argparse\nimport json\nimport random\nfrom collections import defaultdict\n\nimport deepspeed\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm.auto import trange\n\nfrom gpt_neox import (GPTNeoX, AutoregressiveWrapper, TextSamplerDataset, download_dataset,\n cycle, prep...
[ [ "torch.no_grad", "torch.utils.data.DataLoader" ] ]
ameyachawla99/cupy
[ "43d78a7d6fbbe0d9ca35177a14da31a483a827ef" ]
[ "cupy/_functional/vectorize.py" ]
[ "import numpy\n\nfrom cupy import core\nfrom cupyx.jit import _interface\nfrom cupyx.jit import _types\n\n\ndef _get_input_type(arg):\n if isinstance(arg, int):\n return 'l'\n if isinstance(arg, float):\n return 'd'\n if isinstance(arg, complex):\n return 'D'\n return arg.dtype.char...
[ [ "numpy.dtype" ] ]
Yonv1943/ElegantRL
[ "5332e154b2b41c440f2bdbc6c5f8fa024d2cccde" ]
[ "elegantrl/evaluator.py" ]
[ "import os\nimport time\nimport torch\nimport numpy as np\n\n\"\"\"[ElegantRL.2021.09.18](https://github.com/AI4Finance-LLC/ElegantRL)\"\"\"\n\n\nclass Evaluator:\n def __init__(self, cwd, agent_id, device, eval_env, eval_gap, eval_times1, eval_times2, ):\n self.recorder = list() # total_step, r_avg, r_s...
[ [ "matplotlib.use", "numpy.array", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.save", "torch.as_tensor" ] ]
yanconglin/VanishingPoint_HoughTransform_GaussianSphere
[ "0926733b1bd58531c0a50216017aa29a4cd18025", "0926733b1bd58531c0a50216017aa29a4cd18025" ]
[ "vpd/models/iht/test_grad_iht.py", "vpd/models/iht/iht_utils.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import gradcheck\n\nimport random\nimport numpy as np\nimport math\nimport scipy.io as sio\n\nfrom iht_cuda import IHT_CUDA\nfrom iht_utils import hough_transform\n\nrandom.seed(0)\nnp.random.seed(0)\ntorch.manual_seed(0)\n\n...
[ [ "torch.device", "torch.cuda.manual_seed", "numpy.random.seed", "numpy.load", "torch.autograd.gradcheck", "torch.cuda.device_count", "torch.manual_seed", "torch.from_numpy", "torch.cuda.is_available", "torch.randn" ], [ "numpy.concatenate", "numpy.ceil", "num...
mhagiwara/allennlp
[ "a05add5293f091e9dbcaa9db0783e782d77714cf", "a05add5293f091e9dbcaa9db0783e782d77714cf" ]
[ "allennlp/modules/seq2seq_encoders/intra_sentence_attention.py", "allennlp/modules/seq2seq_decoders/auto_regressive_seq_decoder.py" ]
[ "from overrides import overrides\nimport torch\nfrom torch.nn import Linear\n\nfrom allennlp.common.checks import ConfigurationError\nfrom allennlp.modules.matrix_attention.legacy_matrix_attention import LegacyMatrixAttention\nfrom allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder\nfrom allenn...
[ [ "torch.nn.Linear" ], [ "torch.rand", "torch.cat", "torch.max", "torch.nn.functional.log_softmax", "torch.Tensor" ] ]
TheMangalex/mask_rcnn_ros
[ "87e36f5c52f555694a1199b3cbfde6a6516d5aba" ]
[ "src/mask_rcnn_ros/scripts/mask_rcnn_node.py" ]
[ "#!/usr/bin/env python\nimport os\nimport threading\nimport numpy as np\nimport cv2\nfrom cv_bridge import CvBridge\nimport matplotlib.pyplot as plt\n\nimport rospy\nfrom sensor_msgs.msg import Image\nfrom sensor_msgs.msg import RegionOfInterest\n\nfrom mask_rcnn_ros import coco\nfrom mask_rcnn_ros import utils\nfr...
[ [ "matplotlib.backends.backend_agg.FigureCanvasAgg", "matplotlib.pyplot.subplots", "numpy.asscalar", "matplotlib.figure.Figure", "matplotlib.pyplot.subplots_adjust" ] ]
imhmhm/DeepHash
[ "9907613e1b73818985bc585af613a960c8df7d20", "9907613e1b73818985bc585af613a960c8df7d20" ]
[ "DeepHash/model/plot.py", "DeepHash/model/dch/util.py" ]
[ "import numpy as np\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport collections\nimport pickle as pickle\nimport os\n\n_since_beginning = collections.defaultdict(lambda: {})\n_since_last_flush = collections.defaultdict(lambda: {})\n\n_iter = [0]\ndef tick():\n\t_iter[0] += 1\n...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf" ], [ "numpy.arange", "numpy.random.shuffle", "numpy.zeros" ] ]
dvbvr/batch-ppo
[ "ab0688eef8622a512b27206dfd4da095d7ddeb39" ]
[ "agents/tools/in_graph_batch_env.py" ]
[ "# Copyright 2017 The TensorFlow Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.check_numerics", "tensorflow.zeros", "tensorflow.py_func", "tensorflow.ones", "tensorflow.zeros_like", "tensorflow.variable_scope", "tensorflow.name_scope", "tensorflow.scatter_update", "tensorflow.identity" ] ]
MitchellX/Pruning
[ "c1c0a094d7e427319da775bda4752bb2ddbd6ee8" ]
[ "sanity-checking-pruning/models/vgg.py" ]
[ "import math\n\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.init as init\n\n\n__all__ = [\n 'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',\n 'vgg19_bn', 'vgg19',\n]\n\n\nmodel_urls = {\n 'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
saransh13/hexrd3
[ "c09fb4f7123f14e645ca5e985dce6ed968892453" ]
[ "hexrd/unitcell.py" ]
[ "import numpy as np\nfrom hexrd import constants\nfrom hexrd import symmetry, symbols\nimport warnings\nimport h5py\nfrom pathlib import Path\nfrom scipy.interpolate import interp1d\nimport time\n\nclass unitcell:\n\n '''\n >> @AUTHOR: Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov\n ...
[ [ "numpy.arccos", "numpy.dot", "numpy.tan", "numpy.exp", "numpy.radians", "numpy.cos", "numpy.complex", "numpy.broadcast_to", "numpy.concatenate", "numpy.max", "numpy.sin", "numpy.linalg.norm", "numpy.arcsin", "numpy.logical_and", "numpy.arange", "nump...
mizkulg/Qcodes
[ "28448e2ce60041d436958a66529317d355ee4a9d" ]
[ "qcodes/instrument_drivers/AlazarTech/ATS9373.py" ]
[ "from distutils.version import LooseVersion\n\nimport numpy as np\n\nfrom qcodes.utils import validators\nfrom qcodes.instrument_drivers.AlazarTech.ATS import AlazarTech_ATS\nfrom qcodes.instrument_drivers.AlazarTech.utils import TraceParameter\n\n\nclass AlazarTech_ATS9373(AlazarTech_ATS):\n \"\"\"\n This cl...
[ [ "numpy.uint32" ] ]
ictnlp/GMA
[ "1c48db457f2d7f468a2f869d808a82e6c3f08f79" ]
[ "fairseq/search.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nimport pdb\nimport torch\n\n\nclass Search(object):\n def __init__(self, tgt_dict):\n self.pad = tgt_dict.pad...
[ [ "torch.stack", "torch.arange", "torch.gather", "torch.floor_divide", "torch.LongTensor", "torch.div" ] ]
nshervt/GSVAE
[ "6a7771a32634e39644be5549f1c24ee7507518b0" ]
[ "VAEmodel.py" ]
[ "\"\"\"\nAuthor: Navid Shervani-Tabar\n\"\"\"\nimport torch\n\nfrom torch import nn\nfrom torch.autograd import Variable\n\nfrom filter import scattering\n\n\nclass VAEmod(nn.Module):\n def __init__(self, args):\n super(VAEmod, self).__init__()\n\n # -- training parameters\n self.device = ar...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Softmax", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.BatchNorm1d" ] ]
catherinelandry/clandry_project
[ "3aec2e26740de868512d89a99f983ffe7cc5ac87" ]
[ "codes/linear_svc.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nfrom sklearn.model_selection import train_test_split \nfrom sklearn.model_selection import ShuffleSplit\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.decomposition import...
[ [ "numpy.array", "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.StandardScaler", "numpy.load", "matplotlib.pyplot.figure", "sklearn.svm.SVC", "numpy.vstack", "sklearn.model_selection.train_test_split", "sklearn.decomposition.PCA", "sklearn.model_selection.ShuffleS...
jbussemaker/smt
[ "4a4df255b9259965439120091007f9852f41523e" ]
[ "doc/preprocess_test.py" ]
[ "\"\"\"\nAuthor: Dr. John T. Hwang <hwangjt@umich.edu>\n \nThis package is distributed under New BSD license.\n\"\"\"\n\nimport os, sys\nimport inspect\nimport importlib\nimport contextlib\n\ntry:\n from StringIO import StringIO\nexcept:\n from io import StringIO\n\nimport matplotlib\n\nmatplotlib.use(...
[ [ "matplotlib.use", "matplotlib.pyplot.clf", "matplotlib.pyplot.savefig" ] ]
SmokinCaterpillar/NIGroupTalkDemo
[ "78f0ba639e3e90f9a49e8ebd0e456e253422a913" ]
[ "lifmodel/lifneuron.py" ]
[ "__author__ = 'Robert Meyer'\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef euler_neuron(V_init, I, tau_V, tau_ref, dt, duration):\n \"\"\" Simulation of a leaky integrate and fire neuron.\n\n Simulates the equation\n\n dV/dT = -1/tau_V * V + I\n\n with a simple Euler scheme.\n\n T...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.arange", "numpy.zeros" ] ]
brainsharks-fyp17/ZEST
[ "036d5b92ebde6053ad789b95a257bda9db296926" ]
[ "onmt/utils/parse.py" ]
[ "\"\"\"Copyright 2021 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in wri...
[ [ "torch.cuda.is_available" ] ]
masamuch/hepqpr-qallse
[ "46f5b36240689720d704850fbe594eb22b281ab4" ]
[ "src/hepqpr/qallse/seeding/config.py" ]
[ "import numpy as np\n\n\nclass SeedingConfig:\n\n def __init__(self, nLayers=10):\n self.nLayers = nLayers\n self.nPhiSlices = 53\n self.zTolerance = 3.0\n self.maxEta = 2.7\n self.maxDoubletLength = 300.0 # 200.0 # LL: longer, since we added a volume !\n self.minDouble...
[ [ "numpy.sin", "numpy.exp", "numpy.cos" ] ]
kbwestfall/BarFit
[ "e0f91d1813655c0aa9af77ccca32a85c5a9cfdc1" ]
[ "nirvana/tests/test_manga.py" ]
[ "\nfrom IPython import embed\n\nimport numpy\n\nfrom astropy.io import fits\n\nfrom scipy import signal\nfrom astropy import convolution\n\nfrom nirvana.data import manga\nfrom nirvana.data import util\nfrom nirvana.tests.util import remote_data_file, requires_remote\nfrom nirvana.tests.util import drp_test_version...
[ [ "numpy.full", "numpy.array", "numpy.array_equal", "numpy.zeros", "numpy.ma.MaskedArray", "numpy.arange" ] ]
areeh/dual-path-rnn
[ "3aaff44255744b8930bbc5f3eca3e7a49d0e711e" ]
[ "src/network.py" ]
[ "from __future__ import annotations\n\nimport attr\nimport tensorflow as tf\nfrom tensorflow import keras\n\n# This file hold implementation of the overall network structure as a keras model\n# including the DPRNN blocks as part of this structure.\n\n\n@attr.s(auto_attribs=True)\nclass DprnnBlock(keras.layers.Layer...
[ [ "tensorflow.keras.layers.Conv1D", "tensorflow.concat", "tensorflow.keras.layers.LSTM", "tensorflow.roll", "tensorflow.expand_dims", "tensorflow.keras.layers.Lambda", "tensorflow.transpose", "tensorflow.reshape", "tensorflow.keras.layers.LayerNormalization", "tensorflow.kera...
zaky-fetoh/MNIST-BayesianConvAutoEncoder
[ "3c483122f93165d664415f156bac5211adb40e22" ]
[ "model/SSIM_loss.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom math import exp\n\n\ndef gaussian(window_size, sigma):\n gauss = torch.Tensor([exp(-(x - window_size // 2) ** 2 / float(2 * sigma ** 2)) for x in range(window_size)])\n return gauss / gauss.sum()\n\n\...
[ [ "torch.nn.functional.conv2d" ] ]
xf1590281/ASNets
[ "5f4b29fb62a5e72004b813228442d06246c9ec33" ]
[ "asnets/asnets/state_reprs.py" ]
[ "\"\"\"Interface code for rllab. Mainly handles interaction with mdpsim & hard\nthings like action masking.\"\"\"\n\nfrom warnings import warn\n\nimport numpy as np\n\nfrom asnets.prob_dom_meta import BoundProp, BoundAction\nfrom asnets.py_utils import strip_parens\n\n\nclass CanonicalState(object):\n \"\"\"The ...
[ [ "numpy.concatenate", "numpy.allclose", "numpy.array", "numpy.zeros" ] ]