repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
cankocagil/TT-SRN
[ "83eb03a9393442e6b09aa736862b3a2d5bdcf5b6" ]
[ "models/spn.py" ]
[ "import torch\r\nfrom torch import nn, einsum\r\nimport torch.nn.functional as F\r\nimport math\r\nfrom einops import rearrange, repeat\r\nfrom einops.layers.torch import Rearrange\r\nfrom siren.init import siren_uniform_\r\n\r\ndef sine_init(x):\r\n siren_uniform_(x, mode='fan_in', c=6)\r\n\r\n\r\nclass Sine(nn...
[ [ "torch.nn.Linear", "torch.nn.functional.linear", "torch.nn.Parameter", "torch.nn.GELU", "torch.sin", "torch.zeros", "torch.nn.Dropout" ] ]
gf712/shogun
[ "ca2afb8f092288455701539aa58952dbf6743378" ]
[ "examples/undocumented/python/converter_factoranalysis.py" ]
[ "#!/usr/bin/env python\ndata = '../data/fm_train_real.dat'\nparameter_list = [[data]]\n\ndef converter_factoranalysis(data_fname):\n\ttry:\n\t\timport numpy\n\t\tfrom shogun import FactorAnalysis, EuclideanDistance, CSVFile\n\n\t\tfeatures = sg.create_features(CSVFile(data_fname))\n\n\t\tconverter = FactorAnalysis(...
[ [ "numpy.dot" ] ]
ondrejba/discrete_abstractions
[ "444def53ae2ca6c8a5b5b453448f7c4bbaba07e1" ]
[ "runners/bisim/lehnert_gridworld/LehnertGridworldExactPartition.py" ]
[ "import copy as cp\nimport numpy as np\nfrom envs.lehnert_gridworld import LehnertGridworld\nfrom model.LehnertGridworldModel import LehnertGridworldModel\nfrom runners.runner import Runner\nimport config_constants as cc\nimport vis_utils\nfrom model.cluster import Cluster\nfrom utils.dataset import ArrayDataset\n...
[ [ "numpy.sum", "numpy.zeros", "numpy.argmax", "numpy.array", "numpy.concatenate", "numpy.round" ] ]
MaxGhenis/taxcalc-helpers
[ "85d2739d1c96882424cb51ef1806c9e51f88c085" ]
[ "microdf/tests/test_inequality.py" ]
[ "import microdf as mdf\n\nimport pandas as pd\n\n\ndef test_top_pct():\n x = list(range(1, 11)) # 1 to 10. Sum = 10 * 11 / 2 = 55.\n df = pd.DataFrame({\"x\": x})\n ms = mdf.MicroSeries(x)\n RES = 10 / 55\n assert mdf.top_10_pct_share(df, \"x\") == RES\n assert ms.top_10_pct_share() == RES\n x...
[ [ "pandas.DataFrame" ] ]
vincentlui/unsupervised-goal-conditioned-rl
[ "4f2e6938e072cb52f8ee779a939fe7bf6a980d45" ]
[ "rlkit/torch/sac/diayn/diayn_cont.py" ]
[ "from collections import OrderedDict\n\nimport math\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch import nn as nn\nimport torch.nn.functional as F\n\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.core.eval_util import create_stats_ordered_dict\nfrom rlkit.torch.torch_rl_algorithm i...
[ [ "torch.cat", "torch.nn.MSELoss", "torch.nn.CrossEntropyLoss", "numpy.prod" ] ]
coszero/My-Solutions-to-CS224n
[ "98c58c42b55f6a6b3dd984baa8a994ea42f24952" ]
[ "a2/word2vec.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport random\n\nfrom utils.gradcheck import gradcheck_naive\nfrom utils.utils import normalizeRows, softmax\n\n\ndef sigmoid(x):\n \"\"\"\n Compute the sigmoid function for the input here.\n Arguments:\n x -- A scalar or numpy array.\n Return:\n s -- ...
[ [ "numpy.sum", "numpy.bincount", "numpy.zeros", "numpy.random.seed", "numpy.random.randn", "numpy.exp", "numpy.log", "numpy.unique" ] ]
Peter9192/ESMValCore
[ "febd96a39480cc837afbf4e1f5b0ef61571af76a" ]
[ "esmvalcore/preprocessor/_multimodel.py" ]
[ "\"\"\"multimodel statistics.\n\nFunctions for multi-model operations\nsupports a multitude of multimodel statistics\ncomputations; the only requisite is the ingested\ncubes have (TIME-LAT-LON) or (TIME-PLEV-LAT-LON)\ndimensions; and obviously consistent units.\n\nIt operates on different (time) spans:\n- full: com...
[ [ "numpy.zeros_like", "numpy.ma.is_masked", "numpy.dtype", "numpy.ma.zeros", "numpy.ma.array", "numpy.ma.fix_invalid", "numpy.all", "numpy.ma.empty" ] ]
TaiCZ/deepchem
[ "66de10d4f862e0077a82fd7460eea2b11b9472aa" ]
[ "deepchem/metrics/score_function.py" ]
[ "\"\"\"Evaluation metrics.\"\"\"\n\nimport numpy as np\nimport scipy.stats\nfrom sklearn.metrics import matthews_corrcoef # noqa\nfrom sklearn.metrics import recall_score # noqa\nfrom sklearn.metrics import cohen_kappa_score\nfrom sklearn.metrics import r2_score # noqa\nfrom sklearn.metrics import mean_squared_e...
[ [ "sklearn.metrics.mean_squared_error", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.auc", "numpy.argsort", "numpy.asarray", "sklearn.metrics.f1_score", "sklearn.metrics.precision_recall_curve", "numpy.unique", "sklearn.metrics.jaccard_score" ] ]
BioroboticsLab/deeppipeline
[ "7e60e410b3a1f4d8a65924033f13dbf0ecdd3e94" ]
[ "pipeline/scripts/bb_pipeline_api.py" ]
[ "#!/usr/bin/env python3\n\"\"\"This script provides a RESTful remote endpoint to the detection pipeline.\nAn image is sent to the server, which sends back the requested results.\n\"\"\"\n\nimport inspect\nimport io\nimport json\nfrom tempfile import NamedTemporaryFile\nfrom urllib import parse\n\nimport cachetools\...
[ [ "scipy.misc.imsave", "scipy.misc.imread", "numpy.zeros" ] ]
datitran/image-super-resolution
[ "dfa0f2cc429a3f4767a66c7842b7ef663a478875" ]
[ "src/utils/generator.py" ]
[ "import os\nimport numpy as np\nimport keras.backend as K\nfrom imageio import imread\nfrom keras.utils import Sequence\n\n\nclass Generator(Sequence):\n \"\"\"Keras Sequence object to train a model on larger-than-memory data.\n Creates list of LR input and HR label files (images) locations.\n Lists are fi...
[ [ "numpy.random.shuffle", "numpy.arange", "numpy.random.RandomState", "numpy.all", "numpy.rot90", "numpy.flip", "numpy.sort", "numpy.random.randint" ] ]
ale8193/reinforcement-learning-openai-gym
[ "0b918701ab190f22c5973bd798961b389d43a2d1" ]
[ "algorithms/q_learning.py" ]
[ "import numpy as np\nimport sys\nimport math\n\nfrom utils.plotting import EpisodeStats\nfrom algorithms.discretization_functions import default_discretization\n\n\nclass QLearning:\n\n def __init__(self,\n env,\n buckets=(1, ),\n discount_factor=1.0,\n ...
[ [ "numpy.ones", "numpy.argmax", "numpy.zeros" ] ]
Hieronymus98/Distributed-Batteryless-Microphone
[ "9924582a46d23cf580f9b8acc998f650cb022bc6" ]
[ "scripts/plottingScripts/sysAvailabilityTimeline.py" ]
[ "from inspect import currentframe, getframeinfo\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport json\nplt.style.use('seaborn-ticks')\n\n# To disable debugging set it to False\n# To print all debugging info set the second entry to 0\n# To print a specific message set its id\nDEBUG = [False, 0]\n\ndef pr...
[ [ "matplotlib.pyplot.style.use", "matplotlib.pyplot.legend", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gca", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.array", ...
MillionIntegrals/ddpg-tensorflow
[ "7a61b14ed47766e8cdf70121570e5a0a5a241f02" ]
[ "ddpg/action_noise.py" ]
[ "import numpy as np\n\n\nclass OrnsteinUhlenbeckNoiseProcess:\n \"\"\"\n Taken from https://github.com/openai/baselines/blob/master/baselines/ddpg/noise.py\n \"\"\"\n def __init__(self, mu, sigma, theta=.15, dt=1e-2, x0=None):\n self.theta = theta\n self.mu = mu\n self.sigma = sigma...
[ [ "numpy.random.normal", "numpy.zeros_like", "numpy.sqrt" ] ]
Ze-Yang/SDR
[ "623bcb6b4fd6775c10ffd6ed72a59c23a0b1fd8a" ]
[ "net/resnet_atrous.py" ]
[ "import torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom net.sync_batchnorm import SynchronizedBatchNorm2d\n\nbn_mom = 0.0003\nmodel_urls = {\n 'resnet18': 'http://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'http://download.pytorch.org/models/resnet34-333f7ec...
[ [ "torch.nn.MaxPool2d", "torch.nn.init.kaiming_normal_", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.utils.model_zoo.load_url", "torch.nn.ReLU" ] ]
thaiph99/facenet
[ "8d9c8acdae076383e3354b293a1be47ab1f96a63" ]
[ "src/train_tripletloss.py" ]
[ "\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom datetime import datetime\nimport os.path\nimport time\nimport sys\nimport tensorflow.compat.v1 as tf\nimport numpy as np\nimport importlib\nimport itertools\nimport argparse\nimport facenet\ni...
[ [ "tensorflow.compat.v1.train.batch_join", "tensorflow.compat.v1.Graph", "numpy.random.seed", "tensorflow.compat.v1.train.start_queue_runners", "tensorflow.compat.v1.image.resize_image_with_crop_or_pad", "tensorflow.compat.v1.image.per_image_standardization", "tensorflow.compat.v1.train....
uoguelph-mlrg/LDG
[ "203695748fb6d12cef40a801e634fbdab5e23692" ]
[ "dyrep.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom encoder import *\nfrom utils import *\n\n\nclass DyRep(nn.Module):\n def __init__(self,\n node_embeddings,\n # n_event_types,\n N_nodes,\n A_initial=None...
[ [ "torch.min", "torch.stack", "torch.nonzero", "torch.nn.functional.softmax", "torch.no_grad", "torch.mm", "numpy.stack", "torch.eye", "torch.cat", "torch.nn.init.xavier_normal_", "numpy.abs", "torch.arange", "torch.nn.Bilinear", "torch.tanh", "torch.from_...
takumihonda/AIP_realtime
[ "03d6cf3e1405c21b73bf2923cb6914aeb6f3634d" ]
[ "realtime_20200825/plot_monit.py" ]
[ "import numpy as np\nimport sys\nimport os\nfrom netCDF4 import Dataset\n\nfrom datetime import datetime, timedelta\n\n\nquick = True\nquick = False\n\n#theight = 3000.0\ntheight = 2000.0\n\n# UTC\n \nstime = datetime( 2020, 8, 24, 7, 0 )\netime = datetime( 2020, 9, 7, 0, 0 )\n\n# Figure x range\nstime_ = datet...
[ [ "numpy.load", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.savez", "matplotlib.dates.DateFormatter", "matplotlib.dates.MinuteLocator", "matplotlib.pyplot.subplots", "matplotlib.pyplot.clf", "numpy.arange", "matplotlib.pyplot.show", "numpy.shape", "matplotlib.p...
Sniel/icml18-jtnn
[ "eb35c73458dff160b2319b73a5aa8fdc1a8b3783" ]
[ "jtnn/datautils.py" ]
[ "from torch.utils.data import Dataset\nfrom jtnn.mol_tree import MolTree\nimport numpy as np\n\nclass MoleculeDataset(Dataset):\n\n def __init__(self, data_file):\n with open(data_file) as f:\n self.data = [line.strip(\"\\r\\n \").split()[0] for line in f]\n\n def __len__(self):\n ret...
[ [ "numpy.loadtxt" ] ]
Data-Science-in-Mechanical-Engineering/furuta-pixel-to-torque-control
[ "41da2099c8a913f77b3b557dcc8f08b44d282cbb" ]
[ "package/statetoinput/state_estimator_wrapper.py" ]
[ "\"\"\"\nOpenAI Gym environments with predicted state vector of specified VisionToState model (data_id, model_name) as state\n\n@Author: Steffen Bleher\n\"\"\"\nfrom gym import spaces\nfrom gym_brt.data.config.configuration import FREQUENCY\n\nimport numpy as np\n\nfrom gym_brt.envs.reinforcementlearning_extensions...
[ [ "numpy.asarray" ] ]
steven-lang/e2cnn
[ "48f49760766ec958b52d0dd7b02483886dfa2096" ]
[ "e2cnn/nn/modules/nonlinearities/gated1.py" ]
[ "\n\nfrom typing import List, Tuple, Any\n\nimport numpy as np\n\nfrom collections import defaultdict\n\nfrom e2cnn.gspaces import *\nfrom e2cnn.nn import FieldType\nfrom e2cnn.nn import GeometricTensor\n\nfrom ..equivariant_module import EquivariantModule\n\nimport torch\n\nfrom torch.nn import Parameter\n\n\n__al...
[ [ "torch.empty", "torch.randn", "numpy.abs", "torch.sigmoid", "torch.LongTensor", "torch.allclose" ] ]
carbonscott/pyrotein
[ "4c41eade0d014e70aadf9f9c475cbc4255a0a32e" ]
[ "examples/xfam-loop.plot_u.box.seq.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pyrotein as pr\nimport givens as gv\nfrom display import plot_dmat, plot_singular, plot_left_singular, plot_coeff\nimport multiprocessing as mp\nfrom loaddata import load_gpcrdb_xlsx\nimport colorsimple as cs\n\n\ndef reverse_sign(u, vh,...
[ [ "numpy.sqrt", "numpy.load", "numpy.diag" ] ]
Xiejiu/second_age_estimation
[ "89e9ef371a07aba0bbba496697176381e4e9432c" ]
[ "comparisons_among_different_model_formulations/on_AgeDB/DOEL_3groups_resnet18/train_1_4.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 27 10:09:57 2019\n\n@author: xjc\n\"\"\"\n\n\n\n\nimport math\nimport numpy as np\nimport fire\nimport os\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models, transforms\nfrom ...
[ [ "torch.sum", "torch.nn.functional.log_softmax", "torch.cuda.manual_seed_all", "torch.load", "torch.argmax", "torch.manual_seed", "torch.no_grad", "torch.tensor", "torch.nn.KLDivLoss", "torch.cuda.device_count", "torch.cuda.is_available", "torch.optim.lr_scheduler.Mu...
rexzheng324-c/tensorbay-python-sdk
[ "764c28f34069229daa41474e2f104786dbfa973f" ]
[ "tensorbay/opendataset/SegTrack2/loader.py" ]
[ "#!/usr/bin/env python3\n#\n# Copytright 2021 Graviti. Licensed under MIT License.\n#\n# pylint: disable=invalid-name\n# pylint: disable=missing-module-docstring\n\nimport os\nfrom typing import Callable, Dict\n\nimport numpy as np\n\nfrom tensorbay.dataset import Data, Dataset\nfrom tensorbay.label import Instance...
[ [ "numpy.logical_and" ] ]
gfabbris/pypressruby
[ "ce5b89821b0bd829c0aac85f1b364a6f0202716e" ]
[ "pypressruby/widgets_logic.py" ]
[ "\"\"\"\n Copyright (c) 2018-2021, UChicago Argonne, LLC\n See LICENSE file.\n\"\"\"\n\nimport seabreeze.spectrometers as sb\nfrom PyQt5.QtCore import QObject\nimport numpy as np\nfrom time import sleep\nimport _thread as thread\nfrom pypressruby.logic import make_dummy, fit_data, calculate_pressure\n\n\nclass Logi...
[ [ "numpy.linspace", "numpy.random.rand" ] ]
danielgis/invest
[ "b9687d249361556b874750368e856ef049447b5a" ]
[ "src/natcap/invest/ndr/ndr.py" ]
[ "\"\"\"InVEST Nutrient Delivery Ratio (NDR) module.\"\"\"\nfrom __future__ import absolute_import\nimport pickle\nimport itertools\nimport logging\nimport os\n\nfrom osgeo import gdal\nfrom osgeo import ogr\nimport numpy\nimport taskgraph\nimport pygeoprocessing\nimport pygeoprocessing.routing\n\nfrom .. import val...
[ [ "numpy.sqrt", "numpy.sum", "numpy.empty", "numpy.finfo", "numpy.isclose", "numpy.exp", "numpy.log10", "numpy.prod", "numpy.array", "numpy.where", "numpy.unique" ] ]
slowglow/pyAudioAnalysis
[ "67587e5b24eb1430641823a6add085a65c8affe5" ]
[ "pyAudioAnalysis/MidTermFeatures.py" ]
[ "from __future__ import print_function\nimport os\nimport time\nimport glob\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sys\nsys.path.insert(0, os.path.join(\n os.path.dirname(os.path.realpath(__file__)), \"../\"))\nfrom pyAudioAnalysis import utilities\nfrom pyAudioAnalysis import audioBasicIO\...
[ [ "numpy.save", "numpy.ones", "numpy.savetxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "numpy.nan_to_num", "numpy.vstack", "numpy.transpose", "numpy.append", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "numpy.abs", "numpy.isnan", "numpy....
t-arae/empirical-JTK_CYCLE-with-asymmetry
[ "f2a5fd76b8ff902443ea9e1824c49f9e66a5e217" ]
[ "bin/mpfit.py" ]
[ "\"\"\"\r\nPerform Levenberg-Marquardt least-squares minimization, based on MINPACK-1.\r\n\r\n AUTHORS\r\n The original version of this software, called LMFIT, was written in FORTRAN\r\n as part of the MINPACK-1 package by XXX.\r\n\r\n Craig Markwardt converted the FORTRAN code ...
[ [ "numpy.sum", "numpy.rank", "numpy.zeros", "numpy.take", "numpy.put", "numpy.asarray", "numpy.repeat", "numpy.arange", "numpy.log", "numpy.shape", "numpy.sqrt", "numpy.diagonal", "numpy.nonzero", "numpy.tanh", "numpy.choose" ] ]
natteruw/worms
[ "6530505d4fca3229bb93738a0bae0463a17229b8" ]
[ "worms/search.py" ]
[ "'search stuff'\n\nimport sys\nimport os\nimport pickle\nimport itertools as it\nimport numpy as np\nfrom collections import defaultdict\nfrom xbin import XformBinner\nfrom homog import hinv, hrot\nfrom concurrent.futures import ProcessPoolExecutor\nfrom .worms import Segment, Segments, Worms\nfrom .criteria import...
[ [ "numpy.sqrt", "numpy.eye", "numpy.allclose", "numpy.zeros_like", "numpy.transpose", "numpy.ones", "numpy.linalg.inv", "numpy.argsort", "numpy.where", "numpy.all", "numpy.clip", "numpy.min", "numpy.stack", "numpy.concatenate", "numpy.array" ] ]
barbagroup/pygbe_lspr
[ "8653771cac5d650dc85b6ecb4a8d9bbe52402b05" ]
[ "paper/convergence_analysis/convergence_helper.py" ]
[ "'''This file contains functions that help to analyze and plot data related\nto the convergence analysis.\n'''\n\nimport numpy\nimport pickle\nfrom matplotlib import pyplot, rcParams\n\ndef pickleload(pickle_file):\n '''Loads a pickle file and assins it to a variable.\n '''\n with open(pickle_file, 'rb') a...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.grid", "matplotlib.pyplot.switch_backend", "matplotlib.pyplot.figure", "matplotlib.pyplot.xlim", "numpy.log", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.text", "matplotlib.pyplot.ylim", ...
SeitaBV/flexmeasures
[ "f715012c9c35d38d3382bd88d36ef86ce9728d10" ]
[ "flexmeasures/data/models/planning/solver.py" ]
[ "from typing import List, Tuple, Union\n\nfrom flask import current_app\nimport pandas as pd\nimport numpy as np\nfrom pandas.tseries.frequencies import to_offset\nfrom pyomo.core import (\n ConcreteModel,\n Var,\n RangeSet,\n Param,\n Reals,\n Constraint,\n Objective,\n minimize,\n)\nfrom p...
[ [ "numpy.nanmax", "pandas.tseries.frequencies.to_offset", "numpy.nanmin", "numpy.isnan", "pandas.to_timedelta" ] ]
16umm001/pandas
[ "a2e599499667b256bc5b8b13a75f0601eccfd432" ]
[ "pandas/tests/extension/base/methods.py" ]
[ "import numpy as np\nimport pytest\n\nimport pandas as pd\nimport pandas.util.testing as tm\n\nfrom .base import BaseExtensionTests\n\n\nclass BaseMethodsTests(BaseExtensionTests):\n \"\"\"Various Series and DataFrame methods.\"\"\"\n\n @pytest.mark.parametrize('dropna', [True, False])\n def test_value_cou...
[ [ "pandas.util.hash_pandas_object", "pandas.Series", "pandas.util.testing.assert_numpy_array_equal", "pandas.DataFrame", "numpy.errstate", "numpy.array", "pandas.factorize" ] ]
Tommy-Liu/MovieQA_Contest
[ "4281bf4a731aa14a0d19f18adda31d59a4a297cb", "4281bf4a731aa14a0d19f18adda31d59a4a297cb" ]
[ "model/model_se_spec/6.py", "model/model_se_spec/basic.py" ]
[ "import tensorflow as tf\nfrom tensorflow.contrib import layers\n\nfrom config import MovieQAPath\nfrom raw_input import Input\n\n_mp = MovieQAPath()\nhp = {'emb_dim': 300, 'feat_dim': 512, 'dropout_rate': 0.1}\n\n\ndef dropout(x, training):\n return tf.layers.dropout(x, hp['dropout_rate'], training=training)\n\...
[ [ "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.name_scope", "tensorflow.convert_to_tensor", "tensorflow.split", "tensorflow.reduce_sum", "tensorflow.global_variables_initializer", "tensorflow.multiply", "tensorflow.contrib.layers.unit_no...
michaelyeah7/magics_sim
[ "3e5b7116769ebd175b170c92caff6e3c079b6382" ]
[ "examples/quadrupedal_NN.py" ]
[ "import jax.numpy as jnp\nimport matplotlib.pyplot as plt\nimport jax\nfrom jax import lax\nfrom envs import Qaudrupedal\nfrom agents import Deep_Qaudrupedal\nimport copy\nimport pickle\nfrom time import gmtime, strftime \nfrom jaxRBDL.Dynamics.ForwardDynamics import ForwardDynamics, ForwardDynamicsCore\nimport num...
[ [ "matplotlib.pyplot.plot", "numpy.linalg.norm" ] ]
suliuzh/transformers
[ "f34372a9ff99f6bc8619ac83dc07f7afe6b92141", "f34372a9ff99f6bc8619ac83dc07f7afe6b92141" ]
[ "src/transformers/convert_pegasus_tf_to_pytorch.py", "src/transformers/modeling_mmbt.py" ]
[ "# coding=utf-8\n# Copyright 2020 Google and The HuggingFace Inc. team.\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# Un...
[ [ "tensorflow.train.list_variables", "torch.zeros_like", "torch.tensor", "tensorflow.train.load_variable" ], [ "torch.ones", "torch.nn.Linear", "torch.nn.MSELoss", "torch.nn.CrossEntropyLoss", "torch.arange", "torch.cat", "torch.nn.Dropout" ] ]
smressle/yt
[ "29869405f139d9341101793a6e849497bd85f5ea" ]
[ "yt/frontends/boxlib/tests/test_outputs.py" ]
[ "\"\"\"\nBoxlib frontend tests\n\n\n\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2017, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software....
[ [ "numpy.logical_and", "numpy.all" ] ]
xianjian-xie/pose-generation
[ "ad0495e80c6fe1e7690fa8691f1eb11b4e9bca32" ]
[ "models/Global-Flow-Local-Attention/util/task.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport torchvision.transforms as transforms\nfrom random import randint\nimport numpy as np\nimport cv2\nfrom PIL import Image\nimport random\n\n###################################################################\n# random mask generation\n############################...
[ [ "torch.ones_like", "torch.nn.functional.interpolate", "numpy.zeros" ] ]
milankl/misc
[ "40c74d927e6d18b44a6edb51bffda85cafb347e1" ]
[ "num/wave.py" ]
[ "## WAVE EQUATION\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pylan as pn\n\n## constants and grid\nH = 10\nL = 1e5\ng = 9.8\nF = 0.01/1e3/H #tau/rho0/H\n\ndx = 5e3\ndt = 300\n\ncfl = np.sqrt(g*H)*dt/dx\nprint('cfl = %1.3f' % cfl)\n\nT = 48*3600\nN = int(T/dt)+1\n\n## staggered grid\nxu = np.aran...
[ [ "numpy.ones", "numpy.zeros", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show", "numpy.sqrt", "matplotlib.pyplot.colorbar", "numpy.meshgrid" ] ]
GiorgosNikitopoulos/Mine_Vulnerable_Code
[ "e8770698b501a3681b1cf1a978a4cc409d359b3c" ]
[ "models/cnn_model.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCNN model for text classification implemented in TensorFlow 2.\nThis implementation is based on the original paper of Yoon Kim [1] for classification using words.\nBesides I add charachter level input [2].\n\n# References\n- [1] [Convolutional Neural Networks for Sentence Classific...
[ [ "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.GlobalAveragePooling1D", "tensorflow.keras.layers.concatenate", "tensorflow.keras.Model", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers...
dczifra/TWIST
[ "3b5461c33e7c3a83ae1028e0c4ba71b74be787f6" ]
[ "detection/convert-pretrain-to-detectron2.py" ]
[ "#!/usr/bin/env python\n\nimport pickle as pkl\nimport sys\nimport torch\nfrom lars import *\n\nif __name__ == \"__main__\":\n input = sys.argv[1]\n\n obj = torch.load(input, map_location=\"cpu\")\n if 'backbone' in obj:\n obj = obj[\"backbone\"]\n elif 'state_dict' in obj:\n obj = obj[\"s...
[ [ "torch.load" ] ]
mehrdad-shokri/cs375
[ "00554ac497b4a2608ae475099f94ab9635d67b9e" ]
[ "2018/tutorials/neural_data.py" ]
[ "\"\"\"\nProvide a dataset_func which builds a tensorflow dataset object for neural data\nSee below for an example about how to use this function\n\"\"\"\nimport tensorflow as tf\nfrom tfutils.imagenet_data import color_normalize\n\nimport os, sys\nimport numpy as np\nimport pdb\nimport h5py\n\n\nclass Generator(ob...
[ [ "tensorflow.contrib.data.batch_and_drop_remainder", "tensorflow.expand_dims", "tensorflow.image.resize_bilinear", "tensorflow.Session", "tensorflow.data.Dataset.from_generator" ] ]
neurips2021vat/Variance-Aware-Training
[ "2dcd017ef06e81e299448bdd9da65fa682835127" ]
[ "models/segmentation/adv_unet_train_val_late/structure.py" ]
[ "import torch\nimport torch.nn as nn\nfrom time import time\nimport numpy as np\nfrom models.pytorch_revgrad import RevGrad\n\n\nclass DoubleConvBN(nn.Module):\n \"\"\"(convolution => [BN] => ReLU) * 2\"\"\"\n\n def __init__(self, in_channels, out_channels, kernel_size, dropout):\n super().__init__()\n...
[ [ "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.functional.softmax", "torch.nn.functional.pad", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.cat", "torch.nn.Dropout", "torch.nn.ConvTranspose2d" ] ]
jaymessina3/model-analysis
[ "1617375dd35e72447653e54330484c3a2950e4c6" ]
[ "tensorflow_model_analysis/extractors/extractor_test.py" ]
[ "# Lint as: python3\n# Copyright 2018 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.test.main" ] ]
thangvubk/SoftGroup
[ "737123a7ee5a6b994c2ba82927677a800b87e242" ]
[ "softgroup/evaluation/instance_eval_util.py" ]
[ "import json\nimport os\n\nimport numpy as np\nfrom plyfile import PlyData\n\n\n# matrix: 4x4 np array\n# points Nx3 np array\ndef transform_points(matrix, points):\n assert len(points.shape) == 2 and points.shape[1] == 3\n num_points = points.shape[0]\n p = np.concatenate([points, np.ones((num_points, 1))...
[ [ "numpy.ones", "numpy.transpose", "numpy.zeros", "numpy.copy", "numpy.array", "numpy.where", "numpy.unique" ] ]
Muetdhiver-lab/KerbolNavigator
[ "6b62cd0feb02390b393cfd96a16e0ff0162820e2" ]
[ "CaveManJool5.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Aug 26 22:12:16 2019\r\n\r\n@author: vince\r\n\"\"\"\r\n\r\nfrom pykep import planet, DEG2RAD, epoch, AU\r\nfrom Math import sqrt, PI\r\n\r\n\r\nfrom _Kerbol_System import Moho, Eve, Kerbin, Duna, Jool\r\n\r\nKAU = 13599840256 #m\r\n\r\n\r\ndef plot_innerKerbol(e...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ] ]
lumbric/cvxpy
[ "bd6f5142effa8cf883d1a0d7fd46c0d906b2fb93" ]
[ "cvxpy/interface/numpy_interface/sparse_matrix_interface.py" ]
[ "\"\"\"\nCopyright 2013 Steven Diamond\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 http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to i...
[ [ "scipy.sparse.csc_matrix", "scipy.sparse.eye" ] ]
ElfoLiNk/CCrush-Bot
[ "4647ee2a8ac27fc68a36549f3097a35322288921" ]
[ "main.py" ]
[ "from PIL import Image\nfrom PIL import ImageGrab\nimport numpy as np\nfrom sklearn_decoder import ImgRecognizer\nimport win32api, win32con\nimport time\nimport debug_utils as dbg\nimport simple_solver\nimport cProfile\nimport pstats\n\n# excelent hardcoded values :)\n#board_box = (102, 90, 389, 650)\n#board_size_x...
[ [ "numpy.zeros" ] ]
remaindere/p4-ocr-hansarang
[ "9ae7e64e10bd15f373f8540729588361f0a692f1" ]
[ "demo/dataset.py" ]
[ "import csv\nimport os\nimport random\nimport torch\nfrom PIL import Image, ImageOps\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader\nimport cv2\nimport numpy as np\n\nSTART = \"<SOS>\"\nEND = \"<EOS>\"\nPAD = \"<PAD>\"\nSPECIAL_TOKENS = [START, END, PAD]\n\n\n\n# Rather ignorant way ...
[ [ "torch.utils.data.DataLoader", "torch.stack", "torch.tensor", "numpy.random.rand", "numpy.array" ] ]
dweiss044/multiclass_tissue_segmentation
[ "6d71cf12adae96bbce87d14e8423acb5866c2766" ]
[ "unet3d/augment.py" ]
[ "import numpy as np\nimport nibabel as nib\nfrom nilearn.image import new_img_like, resample_to_img\nimport random\nimport itertools\n\nfrom scipy.ndimage import affine_transform\nfrom math import pi\nfrom transforms3d import affines, euler\n\ndef scale_image(image, scale_factor):\n scale_factor = np.asarray(sca...
[ [ "numpy.random.uniform", "numpy.sum", "numpy.ones", "numpy.squeeze", "numpy.diag", "scipy.ndimage.affine_transform", "numpy.asarray", "numpy.copy", "numpy.random.choice", "numpy.random.random", "numpy.rot90", "numpy.flip", "numpy.random.normal", "numpy.array"...
eherr/mg_server
[ "e18537f7d170d53a1960fe9ed79ea88f4049e53f" ]
[ "mg_server/simple_navigation_agent.py" ]
[ "import numpy as np\nfrom vis_utils.scene.components import ComponentBase\n\n\nclass SimpleNavigationAgent(ComponentBase):\n def __init__(self, scene_object):\n ComponentBase.__init__(self, scene_object)\n self.controller = scene_object._components[\"morphablegraph_state_machine\"]\n self.wa...
[ [ "numpy.linalg.norm" ] ]
shgoren/viewmaker
[ "d9a7d4b05ac5126fe348c8c5217877ebcff7e2d7" ]
[ "scripts/run_audio.py" ]
[ "import os\nimport wandb\nfrom copy import deepcopy\nfrom src.systems import audio_systems\nfrom src.utils.utils import load_json\nfrom src.utils.setup import process_config\nimport random, torch, numpy\n\nimport pytorch_lightning as pl\n\nSYSTEM = {\n 'PretrainExpertInstDiscSystem': audio_systems.PretrainExpert...
[ [ "torch.manual_seed", "torch.cuda.manual_seed_all", "numpy.random.seed" ] ]
Shaswat2001/Drowsiness-Detector
[ "dd09a9a9806b1113975e227c148edcf050a1670b" ]
[ "model.py" ]
[ "import h5py\r\nimport numpy as np\r\nfrom keras import layers\r\nfrom keras.layers import Input, Add, Dense, Activation, Flatten, Conv2D,MaxPooling2D, Dropout\r\nfrom keras.models import Model, load_model\r\nfrom keras.preprocessing import image\r\nfrom sklearn.metrics import confusion_matrix as cf\r\n\r\ndef load...
[ [ "sklearn.metrics.confusion_matrix" ] ]
mononitogoswami/Snuba
[ "5aa63e6f00de0f761155df7c4f9c99e36181b394" ]
[ "program_synthesis/heuristic_generator.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.metrics import f1_score\n\nfrom program_synthesis.synthesizer import Synthesizer\nfrom program_synthesis.verifier import Verifier\n\nclass HeuristicGenerator(object):\n \"\"\"\n A class to go through the synthesizer-verifier loop\n \"\"\"\n\n def __...
[ [ "numpy.sum", "numpy.sign", "numpy.append", "numpy.maximum", "pandas.DataFrame", "numpy.abs", "numpy.argsort", "sklearn.metrics.f1_score", "numpy.where", "numpy.shape", "numpy.array", "numpy.concatenate", "numpy.nan_to_num", "numpy.minimum" ] ]
onlytailei/carla_cil_pytorch
[ "25f5fddd58e74b81e2c53d2b86e0de40e75fd880" ]
[ "carla_loader.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n'''\nAuthor:Tai Lei\nDate:Thu Nov 22 12:09:27 2018\nInfo:\n'''\n\nimport glob\n\nimport numpy as np\nimport h5py\nimport torch\nfrom torchvision import transforms\nfrom torch.utils.data import Dataset\n\nfrom imgaug import augmenters as iaa\nfrom helper import RandomTransWrap...
[ [ "numpy.array", "numpy.zeros" ] ]
visr/RRMPG
[ "255224f00d2bdde53666f6bf3f3bf8566de15bb5" ]
[ "rrmpg/models/gr4j_model.py" ]
[ "# -*- coding: utf-8 -*-\n# This file is part of RRMPG.\n#\n# RRMPG is free software with the aim to provide a playground for experiments\n# with hydrological rainfall-runoff-models while achieving competitive\n# performance results.\n#\n# You should have received a copy of the MIT License along with RRMPG. If not,...
[ [ "numpy.ceil", "numpy.zeros", "numpy.tanh" ] ]
SpikeKing/GazeEstimation
[ "2f44db8869a69bbefcd39a98a75703a31733bd5a" ]
[ "src/datasources/frames.py" ]
[ "\"\"\"Data source of stream of frames.\"\"\"\nimport bz2\nimport dlib\nimport queue\nimport shutil\nimport threading\nimport time\nfrom typing import Tuple\nimport os\nfrom urllib.request import urlopen\n\nimport cv2 as cv\nimport numpy as np\nimport tensorflow as tf\n\nfrom core import BaseDataSource\n\n\nclass F...
[ [ "numpy.sum", "numpy.eye", "numpy.arctan", "numpy.any", "numpy.fliplr", "numpy.asarray", "numpy.cos", "numpy.int64", "numpy.amin", "numpy.expand_dims", "numpy.all", "numpy.amax", "numpy.sin", "numpy.linalg.norm", "numpy.uint8" ] ]
isabella232/uis-rnn
[ "91764ceaad832be651f3d64a809a183e133154d6" ]
[ "tests/utils_test.py" ]
[ "# Copyright 2018 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.array", "numpy.ones", "numpy.log", "numpy.zeros" ] ]
satheeshxolo/tensorflow
[ "93082af9e866067d5383ec36c8d840b21d91a9f8" ]
[ "tensorflow/python/distribute/parameter_server_strategy.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\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 requ...
[ [ "tensorflow.python.distribute.values.ReplicaDeviceMap", "tensorflow.python.framework.ops.colocate_with", "tensorflow.python.distribute.multi_worker_util.worker_count", "tensorflow.python.distribute.multi_worker_util.is_chief", "tensorflow.python.distribute.input_lib.InputFunctionIterator", ...
YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3
[ "a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f" ]
[ "semi_final/noahsark/merge.py" ]
[ "# coding: utf-8\nimport pandas as pd\nimport numpy as np\n\n\ndef main():\n nezha_result = pd.read_csv('./result_nezha.csv', header=None)\n nezha_result.columns = ['report_ID', 'label']\n\n dl_result = pd.read_csv('./result_dl.csv', header=None)\n dl_result.columns = ['report_ID', 'label']\n\n new_l...
[ [ "pandas.read_csv", "numpy.zeros" ] ]
vishalraj-95/ktrain
[ "26de7fb42f9e576e768a22f9e5984d7d134b6bf0" ]
[ "ktrain/core.py" ]
[ "from .imports import *\n\nfrom .lroptimize.sgdr import *\nfrom .lroptimize.triangular import *\nfrom .lroptimize.lrfinder import *\nfrom .lroptimize.optimization import AdamWeightDecay\nfrom . import utils as U\n\nfrom .vision.preprocessor import ImagePreprocessor\nfrom .vision.predictor import ImagePredictor\nfro...
[ [ "sklearn.metrics.mean_absolute_error", "sklearn.metrics.mean_squared_error" ] ]
xzlmark/webspider
[ "133c620c65aa45abea1718b0dada09618c2115bf", "133c620c65aa45abea1718b0dada09618c2115bf" ]
[ "matplotlib_examples/examples_src/style_sheets/plot_fivethirtyeight.py", "matplotlib_examples/examples_src/mplot3d/tricontour3d_demo.py" ]
[ "\"\"\"\n===========================\nFiveThirtyEight style sheet\n===========================\n\nThis shows an example of the \"fivethirtyeight\" styling, which\ntries to replicate the styles from FiveThirtyEight.com.\n\"\"\"\n\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\n\nplt.style.use('fivethirt...
[ [ "matplotlib.pyplot.style.use", "numpy.random.seed", "numpy.random.randn", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.sin", "numpy.linspace" ], [ "matplotlib.pyplot.figure", "numpy.repeat", "numpy.cos", "matplotlib.tri.Triangulation", "matplot...
uvipen/pytorch-ImageNet-CIFAR-COCO-VOC-training
[ "87549fd4bff3b17b1716a248a115112ee8d05e4d" ]
[ "public/detection/models/loss.py" ]
[ "import math\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass RetinaLoss(nn.Module):\n def __init__(self,\n image_w,\n image_h,\n alpha=0.25,\n gamma=2,\n beta=1.0 / 9.0,\n ...
[ [ "torch.min", "torch.frac", "torch.trunc", "torch.sqrt", "torch.eq", "torch.log", "torch.max", "torch.cat", "torch.randn", "torch.linspace", "torch.sigmoid", "torch.ones_like", "torch.ceil", "torch.ones", "torch.ge", "torch.tensor", "numpy.finfo",...
bandang0/astro_reduce
[ "d499daa071ab9e20086522e81f7d7f049e9e9268" ]
[ "helpers.py" ]
[ "'''helpers module for astro_reduce -- UI constants and handy functions.'''\n\nfrom hashlib import md5\nfrom json import dump\nfrom os.path import basename\nfrom re import sub\n\nimport click\nimport matplotlib.colors as colors\nimport numpy as np\nfrom astropy.io import fits\nfrom astropy.visualization import Imag...
[ [ "numpy.max", "numpy.min" ] ]
sjfreed21/DataAnalysis
[ "b4b852e2faca6633161513ecbfc4295068a6cd78" ]
[ "Class Files/Lab 5/pca_sst.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Nov 15 11:01:01 2020\n\nIn this notebook I give a very simple (and rather uncommented) example of\n how to use scikit-learn to perform an Empirical Orthogonal Function \n decomposition (EOF analysis, often referred to as well as Principal \n C...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.subplots", "numpy.ndarray", "matplotlib.pyplot.show", "numpy.isnan", "sklearn.preprocessing.StandardScaler", "numpy.meshgrid", "sklearn.decomposition.PCA" ] ]
patchloc/VulnLoc
[ "c7a7d4dac092e3b6302aa8a954518a3348d51d3e" ]
[ "code/utils.py" ]
[ "import pickle\nimport string\nimport numpy as np\nimport multiprocessing\n\n# system setup\nProcessNum=np.min((10, multiprocessing.cpu_count()))\n\n# Used for generating the random filename\nFileNameChars = list(string.letters + string.digits)\nFileNameLen = 30\n\n'''\nProcess the binary file\n'''\ndef read_bin(pa...
[ [ "numpy.random.choice" ] ]
StefHerregods/ConfidenceBounds
[ "5399647aecf46bf4adee047cbee2b883ac5f14a2" ]
[ "Experiment_2/Exp2_DotMotion.py" ]
[ "# november 2021\n# Internship project: Confidence bounds\n\n# RANDOM DOT MOTION TASK (variant with 6 confidence options)\n# (Does the majority of dots move left or right? How confident are you about your choice?)\n# Participants complete multiple blocks of consecutive dot motion trials\n# 3 training blocks with in...
[ [ "numpy.repeat" ] ]
gmggroup/omf
[ "022cb6f84e3b1504555eb0964a37f60281efb03c" ]
[ "notebooks/cbi.py" ]
[ "import numpy as np\nimport properties\nimport z_order_utils\n\n\nclass BaseMetadata(properties.HasProperties):\n name = properties.String(\"Name of the block model\", default=\"\")\n description = properties.String(\"Description of the block model\", default=\"\")\n # Other named metadata?\n\n\nclass Base...
[ [ "numpy.zeros", "numpy.ravel_multi_index", "numpy.arange", "numpy.prod", "numpy.array" ] ]
mgelbart/ray
[ "4cec2286572e368a4bd64aae467751a384eff62d" ]
[ "rllib/agents/es/es.py" ]
[ "# Code in this file is copied and adapted from\n# https://github.com/openai/evolution-strategies-starter.\n\nfrom collections import namedtuple\nimport logging\nimport numpy as np\nimport random\nimport time\nfrom typing import Optional\n\nimport ray\nfrom ray.rllib.agents import Trainer, TrainerConfig\nfrom ray.r...
[ [ "numpy.random.uniform", "numpy.sign", "numpy.random.seed", "numpy.random.RandomState", "numpy.array", "numpy.square", "numpy.mean" ] ]
AnimeshSinha1309/qaoa-optimizer
[ "2a93a46bacc99f22f49e7b5121eb3aa9f12c0163" ]
[ "qleet/simulators/pqc_trainer.py" ]
[ "\"\"\"The module which houses the Parametrized Quantum Circuit trainer class.\n\nIt generates the TensorFlow Quantum model, and allows Keras like API to\ntrain and evaluate a model.\n\"\"\"\n\nimport typing\n\nimport cirq\nimport tqdm.auto as tqdm\n\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nimport t...
[ [ "tensorflow.keras.optimizers.Adam", "tensorflow.GradientTape", "tensorflow.keras.layers.Input" ] ]
Adel-Moumen/speechbrain
[ "1837bbdab24d40b73f3eb354db00fbb063e5aca4" ]
[ "recipes/IEMOCAP/emotion_recognition/iemocap_prepare.py" ]
[ "\"\"\"\nDownloads and creates data manifest files for IEMOCAP\n(https://paperswithcode.com/dataset/iemocap).\n\nAuthors:\n * Mirco Ravanelli, 2021\n * Modified by Pierre-Yves Yanni, 2021\n * Abdel Heba, 2021\n\"\"\"\n\nimport os\nimport sys\nimport re\nimport json\nimport random\nimport logging\nimport glob\nfrom ...
[ [ "scipy.io.wavfile.write", "scipy.io.wavfile.read" ] ]
13488151126/mobilenet-yolov4-lite-tf2-main
[ "3f80aaa73d3dd305abc55fc65e26c309b19d9467" ]
[ "nets/mobilenet_v2.py" ]
[ "#-------------------------------------------------------------#\n# MobileNetV2的网络部分\n#-------------------------------------------------------------#\nimport math\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import backend\nfrom tensorflow.keras.layers import (Activation, Add, BatchNormal...
[ [ "tensorflow.keras.backend.int_shape", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.DepthwiseConv2D", "tensorflow.keras.backend.relu", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Add", "tensorflow.keras.layers.Conv2D" ] ]
OObasuyi/evidential-deep-learning
[ "995764dd3a1923ec3b0f35392d2e25e8a6831bd9" ]
[ "neurips2020/models/depth/bbbp.py" ]
[ "import tensorflow as tf\nimport tensorflow_probability as tfp\nfrom tensorflow.keras.layers import Conv2D, MaxPooling2D, \\\n UpSampling2D, Cropping2D, concatenate, ZeroPadding2D, SpatialDropout2D\n\nimport functools\n\ndef create(input_shape, num_class=1, activation=tf.nn.relu):\n opts = locals().copy()\n\n...
[ [ "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.layers.Cropping2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.concatenate", "tensorflow.keras.layers.ZeroPadding2D", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Conv2D", "tensorflow.keras...
OlivierGarciaDev/fanalysis
[ "9aa2cc8b1e5cc5600a05813144973b77143cfe42" ]
[ "fanalysis/mca.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\" mca module\n\"\"\"\n\n# Author: Olivier Garcia <o.garcia.dev@gmail.com>\n# License: BSD 3 clause\n\nimport numpy as np\nfrom sklearn.preprocessing import LabelBinarizer\n\nfrom fanalysis.base import Base\n\n\nclass MCA(Base):\n \"\"\" Multiple Correspondence Analysis (MCA)\n ...
[ [ "sklearn.preprocessing.LabelBinarizer", "numpy.sum", "numpy.append", "numpy.empty", "numpy.zeros", "numpy.arange" ] ]
MarinusHeindl/chesscog
[ "9022e19b1ad125481b561c765a886285abc16eb0" ]
[ "tests/core/test_coordinates.py" ]
[ "import numpy as np\n\nfrom chesscog.core.coordinates import from_homogenous_coordinates, to_homogenous_coordinates\n\n\ndef test_from_homogenous_coordinates():\n coords = np.array([2., 4., 2.])\n expected = np.array([1., 2.])\n assert np.allclose(from_homogenous_coordinates(coords), expected)\n\n\ndef tes...
[ [ "numpy.array" ] ]
cse-bristol/smeter-ml
[ "db97902eec77c555c1dd030a676e7ebf5da40314" ]
[ "src/ml/model/ensemble.py" ]
[ "\"\"\"Module for generating an ensemble model from a given config file.\n\nExports a single class, Ensemble, which provides methods for training the ensemble,\nsaving the individual model files to disk and making predictions.\n\"\"\"\n\nimport os\nimport sys\nimport numpy as np\nimport tensorflow as tf\nimport ten...
[ [ "numpy.random.default_rng", "tensorflow.keras.backend.clear_session", "tensorflow.set_random_seed", "tensorflow.keras.callbacks.EarlyStopping", "numpy.array", "numpy.concatenate", "tensorflow.keras.models.model_from_json", "numpy.mean" ] ]
katetolstaya/graph_rl
[ "f48dcfd4b9b0872de49dc5e91b8950fe825d0f0d" ]
[ "eval_exp_field.py" ]
[ "import numpy as np\nimport gym\nimport gym_flock\nimport glob\nimport sys\nimport rl_comm.gnn_fwd as gnn_fwd\nfrom rl_comm.ppo2 import PPO2\nfrom stable_baselines.common.vec_env import SubprocVecEnv\nfrom stable_baselines.common.base_class import BaseRLModel\nimport matplotlib.pyplot as plt\n\nplt.rcParams['font.f...
[ [ "numpy.random.uniform", "matplotlib.pyplot.legend", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.std", "matplotlib.pyplot.xlabel", "numpy.mean" ] ]
a7532ariel/grid-feats-vqa
[ "907828898457cfbd099dff347b58488c1642986b" ]
[ "grid_feats/roi_heads.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom detectron2.layers import ShapeSpec\nfrom detectron2.modeling.roi_heads import (\n build_box_head,\n build_mask_head,\n select_foreground_proposals,\n ...
[ [ "torch.nn.Linear", "torch.nn.init.constant_", "torch.argmax", "torch.no_grad", "torch.nn.Embedding", "torch.nn.init.normal_", "torch.nn.ReLU", "torch.nn.functional.cross_entropy", "torch.cat" ] ]
Stevanus-Christian/tensorflow
[ "d44afcf5ca16c5d704c66f891b99eac804e7cd14" ]
[ "tensorflow/compiler/xla/python/xla_client.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\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 requ...
[ [ "numpy.dtype", "numpy.shape", "numpy.true_divide" ] ]
simran2905/pytorch-lightning
[ "024cf23c67fb92fabb2d238bd33d73b24aafa7a9" ]
[ "pytorch_lightning/trainer/training_loop.py" ]
[ "# Copyright The PyTorch Lightning team.\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...
[ [ "torch.isfinite", "numpy.cumsum", "numpy.argmax" ] ]
vutuanhai237/QuantumTomography
[ "52916096482d7e7cd29782c049478bbba901d9bd" ]
[ "codes/tomography/shadow_tomography251.py" ]
[ "\nimport sys\nfrom itertools import combinations\nimport qiskit\nimport numpy as np\nimport tqix\n\n\nsys.path.insert(1, '../')\nimport qtm.base\nimport qtm.nqubit\nimport qtm.fubini_study\n\ndef self_tensor(matrix, n):\n product = matrix\n for i in range(1, n):\n product = np.kron(product, matrix)\n ...
[ [ "numpy.ones", "numpy.kron", "numpy.transpose", "numpy.zeros" ] ]
Hakan-er/utma
[ "f7cd6253ec894047b460d4df9b43eeb9b109bae2" ]
[ "src/ml/Univariate_Time_Series/Exponenial_Univariate_Forecasting.py" ]
[ "from Load_And_Visualize_Time_Data import Load_and_Visualize_Time_Data\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom sktime.forecasting.model_selection import temporal_train_test_split\nfrom sktime.forecasting.exp_smoothing import ExponentialSmoothing\nfrom sktime.utils.plotting import plot_series\nfro...
[ [ "pandas.PeriodIndex" ] ]
lokinou/mne-python
[ "f4aa12bc9118d0739ca05c5ed5a4fba7ae71138b" ]
[ "tutorials/stats-sensor-space/75_cluster_ftest_spatiotemporal.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n.. _tut-cluster-spatiotemporal-sensor:\n\n=====================================================\nSpatiotemporal permutation F-test on full sensor data\n=====================================================\n\nTests for differential evoked responses in at least\none condition using ...
[ [ "numpy.transpose", "numpy.squeeze", "numpy.zeros", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.colorbar", "numpy.where", "numpy.meshgrid", "numpy.unique" ] ]
issca/inferbeddings
[ "80492a7aebcdcac21e758514c8af403d77e8594a" ]
[ "tests/inferbeddings/adversarial/closedform/test_lifted_simple_transe_unit_sphere.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom inferbeddings.models import base as models\nfrom inferbeddings.models import similarities\nfrom inferbeddings.knowledgebase import Fact, KnowledgeBaseParser\nfrom inferbeddings.parse import parse_clause\nfrom inferbeddings.models.traini...
[ [ "tensorflow.global_variables_initializer", "numpy.random.seed", "tensorflow.train.AdagradOptimizer", "tensorflow.set_random_seed", "tensorflow.Session", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.reset_default_graph", "numpy.random.randint" ] ]
nicolas-lair/DiscourseOverrule
[ "48c64db5d84b3fbc72f59a1a7ebe416fdc7f9ac1" ]
[ "Exp3C-metusalem2012_Reservoir50.py" ]
[ "from wikipedia2vec import Wikipedia2Vec\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport nltk\r\nnltk.download('stopwords')\r\nfrom nltk.corpus import stopwords\r\nimport csv\r\n\r\nimport scipy\r\nfrom scipy import stats\r\n\r\nfrom easyesn.optimizers import GradientOptimizer\r\nfrom easyesn imp...
[ [ "numpy.load", "numpy.empty", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "scipy.stats.ttest_ind", "numpy.random.seed", "matplotlib.pyplot.subplots", "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.mean" ] ]
owen633/caw-quant-training
[ "e333d38cf05483434300f55740b541f57e707d4e" ]
[ "section1/task1/task1.py" ]
[ "# Task1 Get hourly candle data from CryptoCompare\n## 1. Explore CryptoCompare Data API\n### Required\n#### 1. **Write a function** to download histohour data, parameters:\n# fsym: BTC, tsym: USDT, start_time=\"2017-04-01\", end_time=\"2020-04-01\", e='binance'\n\n# import libraries\nimport requests\nimport pandas...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
pernambucano/myo_libras
[ "8909a43f8d455cc63215843ece7128704fab13b3" ]
[ "libras_myo/plotpandas.py" ]
[ "#!/usr/local/bin/python\n# -*- coding: utf-8 -*-\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, BaggingClassifier\n\n\ndef plotSensores():\n ### Letra A\n df_a = pd.read_csv(\"data/bernardo/bernardo-A-3-emg...
[ [ "pandas.Series", "pandas.read_csv", "matplotlib.pyplot.figure", "pandas.DataFrame", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.genfromtxt" ] ]
fercook/alone_chat
[ "2e9fd992acabeb41163ed7c1917e0a380ebeaf2e" ]
[ "chatbot/botui.py" ]
[ "# Copyright 2017 Bo Shao. All Rights Reserved.\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 applica...
[ [ "tensorflow.Session" ] ]
slyviacassell/Multi-taks-UNITE
[ "a010a92c94c0ee0f1ffed27df6d89da58d6d34c5" ]
[ "modules/Stage.py" ]
[ "# coding=utf-8\n\n'''\nCreated: 2021/3/12\n@author: Slyviacassell@github.com\n'''\n\nimport torch\nimport torch.nn as nn\n\nfrom memonger import SublinearSequential\n\n\nclass Stage(nn.Module):\n def __init__(self, out_channels, layers):\n super(Stage, self).__init__()\n if isinstance(layers, (nn....
[ [ "torch.nn.Sequential" ] ]
Suhwan-Dev/torch-kalman
[ "f310c42e264d1642819e4c49a8b0212209a18a85" ]
[ "torch_kalman/state_belief/utils.py" ]
[ "from typing import Tuple, Optional\n\nfrom torch import Tensor\nfrom torch.distributions import MultivariateNormal\n\nimport numpy as np\nfrom torch.distributions.multivariate_normal import _batch_mv\nfrom torch.distributions.utils import _standard_normal\n\n\ndef bmat_idx(*args) -> Tuple:\n \"\"\"\n Create ...
[ [ "numpy.ix_", "torch.distributions.utils._standard_normal", "torch.distributions.multivariate_normal._batch_mv" ] ]
iamjli/AnswerALS_QTL
[ "0adf7bb8747730dd23d8669b6cd5d27e20a4743f" ]
[ "dev/src/load/external_data.py" ]
[ "#!/usr/bin/env python3\n\nfrom pathlib import Path\n\nimport pandas as pd\n\nfrom src import base_dir, logger\n\n\n_external_data_paths = {\n\t# \"rsid\": base_dir / \"tensorqtl_runs/genomes_210409/snp_list.biallelic_known_snps.harmonized.VQSR_filtered_99.rsID.GT_only.pkl\",\n\t\"rsid\": base_dir / \"tensorqtl_run...
[ [ "pandas.read_csv", "pandas.read_pickle", "pandas.DataFrame.from_dict", "pandas.read_parquet" ] ]
sdss/lvmspec
[ "befd6991537c4947fdf63ca262937f2bb845148f" ]
[ "py/desispec/scripts/mergebundles.py" ]
[ "\n\"\"\"\nexspec extracts individual bundles of spectra with one bundle per output file.\nThis script merges them back together into a single file combining all\nbundles.\n\nThis workflow is hacky. Release early, release often, but also refactor often.\n\nStephen Bailey, LBL\nMarch 2014\n\"\"\"\n\nfrom __future__...
[ [ "numpy.arange", "numpy.zeros" ] ]
thisisgopalmandal/opencv
[ "4e2ef8c8f57644ccb8e762a37f70a61007c6be1c" ]
[ "samples/python/tutorial_code/video/meanshift/meanshift.py" ]
[ "import numpy as np\nimport cv2 as cv\nimport argparse\n\nparser = argparse.ArgumentParser(description='This sample demonstrates the meanshift algorithm. \\\n The example file can be downloaded from: \\\n https://www.bogotobog...
[ [ "numpy.array" ] ]
cabuliwallah/analytics-zoo
[ "5e662bd01c5fc7eed412973119594cf2ecea8b11" ]
[ "pyzoo/zoo/examples/orca/learn/tf2/yolov3/yoloV3.py" ]
[ "#\n# Copyright 2018 Analytics Zoo 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 ...
[ [ "tensorflow.keras.optimizers.Adam", "tensorflow.reduce_max", "tensorflow.reshape", "tensorflow.broadcast_to", "tensorflow.keras.layers.Concatenate", "tensorflow.sigmoid", "tensorflow.squeeze", "tensorflow.keras.layers.ZeroPadding2D", "tensorflow.keras.layers.Add", "tensorfl...
ThatFrankGuy/qiskit-aqua
[ "daf58fa9aabecca82982bf612be0cc4f7d7bdc66" ]
[ "test/aqua/test_qgan.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\...
[ [ "numpy.random.lognormal" ] ]
shiqitao/AutoGraph
[ "41f5956c859ff0fb6f87109d5f8731276bdcc2ef" ]
[ "ModelGCN4.py" ]
[ "import torch\nfrom sklearn.metrics import accuracy_score\nfrom torch.nn import Linear\nfrom torch.nn.functional import relu, dropout, log_softmax, nll_loss, leaky_relu\nfrom torch_geometric.nn import GCNConv, JumpingKnowledge\nfrom torch_geometric.utils.num_nodes import maybe_num_nodes\nfrom torch_sparse import co...
[ [ "torch.sum", "torch.nn.functional.log_softmax", "torch.stack", "torch.nn.Linear", "torch.nn.functional.dropout", "torch.nn.functional.nll_loss", "torch.no_grad", "torch.cuda.is_available", "torch.nn.ModuleList", "torch.cat", "torch.bernoulli" ] ]
jake3991/sonar-SLAM
[ "995bfa61e61d99667bec7a7f70bea4d6d486c312" ]
[ "bruce_slam/src/bruce_slam/sonar.py" ]
[ "import numpy as np\nfrom scipy.interpolate import interp1d\nimport cv2\nimport rospy\n\nfrom .utils.topics import *\nfrom .utils.conversions import r2n\n\n\nclass OculusFireMsg(object):\n \"\"\"Oculus Fire Message\n\n uint8_t masterMode; // mode 0 is flexi mode, needs full fire message (not availab...
[ [ "numpy.degrees", "numpy.zeros_like", "numpy.roll", "numpy.arctan2", "numpy.sqrt", "numpy.ceil", "numpy.rad2deg", "matplotlib.pyplot.gca", "numpy.float32", "numpy.cos", "numpy.arange", "numpy.max", "numpy.array", "numpy.sin", "numpy.round", "numpy.rad...
sbrass/madminer
[ "df664344d1a43551ee9ecd91fe2dc0bccb4d529f" ]
[ "madminer/ml/base.py" ]
[ "import json\nimport logging\nimport numpy as np\nimport os\nimport torch\n\nfrom ..utils.various import create_missing_folders, load_and_check\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass Estimator:\n \"\"\"\n Abstract class for any ML estimator. Subclassed by ParameterizedRatioEstimator, DoubleParam...
[ [ "numpy.sum", "numpy.save", "numpy.load", "numpy.ones", "torch.load", "numpy.zeros", "numpy.einsum", "torch.save", "torch.tensor", "numpy.array", "numpy.std", "numpy.mean" ] ]
ZongSingHuang/BPSOGWO-with-GA
[ "4b6968d8946ea5b4456c0fdec1f0c4dd062e4436" ]
[ "main_9010.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 23 21:29:10 2020\n\n@author: ZongSing_NB\n\"\"\"\n\nfrom BHPSOGWO import BHPSOGWO\nimport numpy as np\nimport pandas as pd\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.model_selection impor...
[ [ "numpy.ones", "numpy.sum", "sklearn.model_selection.StratifiedKFold", "numpy.zeros", "pandas.read_csv", "pandas.DataFrame", "numpy.random.seed", "sklearn.neighbors.KNeighborsClassifier", "numpy.std" ] ]
quanhua92/maskrcnn-pytorch
[ "d5dff68735ab175cba5604230141874aa6bd59b8" ]
[ "tests/data/test_processing.py" ]
[ "import os\nimport numpy as np\nfrom maskrcnn.lib.data.preprocessing import mold_inputs\nfrom maskrcnn.lib.config import cfg\n\nfrom maskrcnn.lib.utils import io_utils\n\n\ndef test_mold_inputs_ones():\n image = np.ones((cfg.IMAGE.MAX_DIM, cfg.IMAGE.MAX_DIM, 3), dtype=np.uint8) * 255\n \n molded_images, im...
[ [ "numpy.ones" ] ]
Lhior/TXPipe
[ "58fd7612326779d4c1b0e499157dddc9e3b524c0" ]
[ "txpipe/theory.py" ]
[ "from .base_stage import PipelineStage\nfrom .data_types import FiducialCosmology, SACCFile\nimport numpy as np\n\n\nclass TXTwoPointTheoryReal(PipelineStage):\n \"\"\"\n Compute theory in CCL in real space and save to a sacc file.\n \"\"\"\n\n name = \"TXTwoPointTheoryReal\"\n inputs = [\n (\...
[ [ "numpy.log10", "numpy.ones_like" ] ]
MenuaB/deep_utils
[ "b1b936f4780ea7dc52224f53f5116288c5b0a804" ]
[ "deep_utils/callbacks/torch/model_checkpoint.py" ]
[ "import os\n\nfrom deep_utils.utils.os_utils.os_path import split_extension\n\n\nclass ModelCheckPoint:\n def __init__(self,\n model_path,\n model,\n monitor='min',\n save_best_only=True,\n overwrite=True,\n verbose=T...
[ [ "torch.save" ] ]