repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
elie-atia/keras
[ "ef9fa5530da980316fc42943f226d7eab2c3a7e1" ]
[ "keras/layers/preprocessing/normalization_test.py" ]
[ "# Copyright 2019 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.array", "numpy.random.rand", "numpy.zeros", "tensorflow.compat.v2.saved_model.save", "tensorflow.compat.v2.data.Dataset.from_tensor_slices", "tensorflow.compat.v2.executing_eagerly", "tensorflow.compat.v2.Variable", "tensorflow.compat.v2.constant", "tensorflow.compat.v2....
ottogin/inferno
[ "4f4a49a0b4439d12694200e2cc757a4d0d0dff2b" ]
[ "inferno/io/volumetric/lazy_volume_loader.py" ]
[ "import numpy as np\nimport os\n\n# try to load io libraries (h5py and z5py)\ntry:\n import h5py\n WITH_H5PY = True\nexcept ImportError:\n WITH_H5PY = False\n\ntry:\n import z5py\n WITH_Z5PY = True\nexcept ImportError:\n WITH_Z5PY = False\n\nfrom ..core.base import SyncableDataset\nfrom ..core.bas...
[ [ "numpy.pad" ] ]
erikglee/discovery_imaging_utils
[ "bf2cfa70178ceb603932a62cfcbe57550bcc1078" ]
[ "discovery_imaging_utils/signal_proc_utils.py" ]
[ "from scipy.fft import fft\nimport numpy as np\n\n\n\ndef estimate_broadband_noise(signal, TR, low_freq_cutoff = 0.2):\n '''Function that estimates broadband noise of 1/f like BOLD data\n\n This function calculates the fourier transform of the input signals,\n and then estimates the average broadband power...
[ [ "numpy.zeros", "numpy.median", "numpy.mean", "numpy.where", "numpy.std", "numpy.linspace", "scipy.fft.fft" ] ]
jonaskulhanek/mdp-python
[ "885ea5fbfb4039977f2454518d8a43cd77647cae" ]
[ "codes/test_ZUI_MDP.py" ]
[ "# -*- coding: UTF-8 -*-\n\nfrom ZUI_MDP_solution import *\nfrom unittest import TestCase\nimport itertools as it\nimport numpy as np\nimport numpy.testing as nptest\n\n\n# Taken from http://www.neuraldump.net/2017/06/how-to-suppress-python-unittest-warnings/.\ndef ignore_warnings(test_func):\n def do_test(self,...
[ [ "numpy.max", "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.load" ] ]
peyman-sabouri/pascal-voc-writer
[ "636451603f19d19d71f6a1bdd5cc518fb635748a" ]
[ "draw_poly2rect.py" ]
[ "import os\n# import matplotlib.pyplot as plt\nimport numpy as np\nfrom pascal_voc_writer import Writer\nimport json\nimport cv2\n#%% src path\n\nsrc_json_path = '/home/peyman/mnt/data/DATA/ouster_data/create_dataset/PixelAnnotationTool/data/anns/'\nimg_folder = '/home/peyman/mnt/data/DATA/ouster_data/create_datase...
[ [ "numpy.array" ] ]
shenlong95/chinese_sentiment-master
[ "1a84c6869ed80cdb59c9d1b6f2ca19292b469acd" ]
[ "data/hotel_comment/build_embedings.py" ]
[ "from pathlib import Path\nimport numpy as np\n\nif __name__ == '__main__':\n with Path('vocab.words.txt').open(encoding='utf-8') as f:\n word_to_idx = {line.strip(): idx for idx, line in enumerate(f)}\n with Path('vocab.words.txt').open(encoding='utf-8') as f:\n word_to_found = {line.strip(): F...
[ [ "numpy.savez_compressed", "numpy.zeros" ] ]
mlej8/kaolin
[ "19fd610fff68c4d9ad9035386b76e6fd51b0b67c" ]
[ "tests/python/kaolin/metrics/test_render.py" ]
[ "# Copyright (c) 2019-2020, NVIDIA CORPORATION. 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...
[ [ "torch.tensor" ] ]
narendasan/irl-maxent
[ "031d497de45e31e7cf2e6e873140c855152383d1", "031d497de45e31e7cf2e6e873140c855152383d1" ]
[ "src/compute_weights.py", "src/plot_subjective_results.py" ]
[ "# import python libraries\nimport os\nimport pdb\nimport numpy as np\nfrom copy import deepcopy\nimport pandas as pd\nimport pickle\n\n# import functions\nimport optimizer as O # stochastic gradient descent optimizer\nfrom vi import value_iteration\nfrom maxent_irl import *\nfrom assembly_tasks import *\nfrom imp...
[ [ "pandas.read_csv", "numpy.linalg.norm" ], [ "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.figure" ] ]
AMA-AC/datacube-core
[ "81bed714f2e5cb30a2492f1b0cf3397b79141c3a" ]
[ "tests/test_utils_cog.py" ]
[ "import pytest\nfrom pathlib import Path\nimport numpy as np\nfrom types import SimpleNamespace\nfrom dask.delayed import Delayed\nimport dask\n\nfrom datacube.testutils import (\n mk_test_image,\n gen_tiff_dataset,\n)\nfrom datacube.testutils.io import native_load, rio_slurp_xarray, rio_slurp\nfrom datacube....
[ [ "numpy.testing.assert_array_equal", "numpy.stack" ] ]
prodipta/zipline
[ "d9755f51293792eef84e4da164e31f99e7806f04" ]
[ "zipline/pipeline/factors/technical.py" ]
[ "\"\"\"\nTechnical Analysis Factors\n--------------------------\n\"\"\"\nfrom __future__ import division\n\nfrom numpy import (\n abs,\n average,\n clip,\n diff,\n dstack,\n inf,\n)\nfrom numexpr import evaluate\n\nfrom zipline.pipeline.data import USEquityPricing, EquityPricing\nfrom zipline.pipe...
[ [ "numpy.dstack", "numpy.clip", "numpy.abs", "numpy.diff" ] ]
RUAN0007/nusthesis
[ "932367195171da2d1c82870cc5b96c0e760b4ca8" ]
[ "chart/txn/script/blksize_abort.py" ]
[ "import sys\nfrom common import *\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import figure\nimport matplotlib as mpl\n\nseries_labels = [kOriginalLabel, kFppLabel, kFsharpLabel,kFoccStandardLabel, kFoccLatestLabel]\n\ndef main():\n if 1 < len(sys.argv) :\n diagram_path = sys.argv[1]\n els...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
andreruas/TensorFlow-ENet
[ "50383e6b90bc1230169e3413dc3d6205de6a73ac" ]
[ "train_enet.py" ]
[ "import tensorflow as tf\nfrom tensorflow.contrib.framework.python.ops.variables import get_or_create_global_step\nfrom tensorflow.python.platform import tf_logging as logging\nfrom enet import ENet, ENet_arg_scope\nfrom preprocessing import preprocess\nfrom get_class_weights import ENet_weighing, median_frequency_...
[ [ "tensorflow.group", "tensorflow.train.slice_input_producer", "tensorflow.reshape", "tensorflow.contrib.metrics.streaming_accuracy", "tensorflow.one_hot", "tensorflow.image.decode_jpeg", "tensorflow.cast", "tensorflow.read_file", "tensorflow.argmax", "tensorflow.contrib.metr...
Marshzero/PCT_Pytorch
[ "8a63536cffddc54c6f87921c8991e3a2be5f4e35" ]
[ "model/pct_cls.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom util import sample_and_group\nfrom model.pct_module import *\n\n\"\"\"\n pct分割网络完整版,本文件的pct是分割版pct\n\"\"\"\n\nclass Pct(nn.Module):\n \"\"\"Pct网络\n\n 网络结构(从上到下,从左到右):\n Input Embedding module: Neighborhood Embedding i.e. LBR...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "torch.nn.functional.adaptive_max_pool1d", "torch.nn.Conv1d", "torch.nn.LeakyReLU", "torch.nn.BatchNorm1d" ] ]
georghess/probdet
[ "d44aa3115cf6c0b31a2570f9593d6fcd1adb09a4" ]
[ "src/apply_net.py" ]
[ "\"\"\"\nProbabilistic Detectron Inference Script\n\"\"\"\nimport json\nimport os\nimport sys\nfrom shutil import copyfile\n\nimport torch\nimport tqdm\n\nimport core\n\n# This is very ugly. Essential for now but should be fixed.\nsys.path.append(os.path.join(core.top_dir(), \"src\", \"detr\"))\n\nfrom detectron2.d...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.set_num_threads" ] ]
shankarpandala/CarND-Behavior-Cloning
[ "25479e2361f5c594d342ea023b01a7c776e0ce5d" ]
[ "model.py" ]
[ "import os\nimport csv\n\nsamples = []\nwith open('data/driving_log.csv') as csvfile:\n reader = csv.reader(csvfile)\n for line in reader:\n samples.append(line)\nsamples.pop(0) #Removing row names of csv file\nfrom sklearn.model_selection import train_test_split\ntrain_samples, validation_samples = tr...
[ [ "sklearn.model_selection.train_test_split", "numpy.array", "sklearn.utils.shuffle" ] ]
john-james-sf/Ames
[ "11c1f501057f041d826c4f82e199c28068390f64" ]
[ "src/pipeline_v5.py" ]
[ "# -*- coding:utf-8 -*-\n# =========================================================================== #\n# Project : Data Mining #\n# File : \\mymain.py #\n# Python : 3.9.1 ...
[ [ "sklearn.linear_model.LinearRegression", "numpy.where", "pandas.concat", "sklearn.tree.DecisionTreeRegressor", "sklearn.impute.SimpleImputer", "pandas.set_option", "pandas.merge", "numpy.log", "pandas.DataFrame", "numpy.arange", "numpy.sqrt", "sklearn.metrics.make_s...
Evergreen2020/zvt
[ "446a2512d716a38a12164b6d4468a6c9de01b986" ]
[ "zvt/factors/algorithm.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas as pd\n\nfrom zvdata.utils.pd_utils import normal_index_df\nfrom zvt.api.computing import macd\nfrom zvt.factors.factor import Scorer, Transformer\n\n\nclass MaTransformer(Transformer):\n def __init__(self, windows=[5, 10]) -> None:\n self.windows = windows\n\n ...
[ [ "pandas.concat" ] ]
charlesxu90/DeepSequence-torch
[ "640db39769a93ef3d5bc11d6ad05aa7f5d761972" ]
[ "model.py" ]
[ "\"\"\"\nAdapted from: https://github.com/debbiemarkslab/DeepSequence/blob/master/DeepSequence/model.py\nVAE Reference: https://github.com/AntixK/PyTorch-VAE/blob/master/models/vanilla_vae.py\n\"\"\"\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\nfrom torch.nn import functional as F\nimport numpy a...
[ [ "torch.nn.LogSoftmax", "torch.nn.Softmax", "numpy.log", "torch.nn.Sigmoid", "torch.tile", "torch.max", "torch.square", "torch.ones", "torch.nn.ReLU", "torch.randn_like", "scipy.special.erfinv", "torch.load", "numpy.sqrt", "torch.empty", "torch.exp", ...
mnrozhkov/MLOps-demo-project
[ "42d6fd1546345c9bf03b7882fe8e34639a62f686", "42d6fd1546345c9bf03b7882fe8e34639a62f686" ]
[ "src/data/process.py", "src/data/load.py" ]
[ "import pandas as pd\n\n\ndef process_features(features_df, target_df):\n \"\"\"Join features with labels\n\n \"\"\"\n features_df = features_df.loc[features_df.user_id.isin(target_df.user_id)]\n features_df['month'] = pd.to_datetime(features_df['month'])\n\n return features_df\n\n\ndef process_data(...
[ [ "pandas.to_datetime", "pandas.merge" ], [ "pandas.read_feather" ] ]
sagacitysite/pelene
[ "e8d4112264acb44954c52053b4e3f9d63b46bdd6" ]
[ "pelenet/plots/spikes.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import colors\nimport warnings\n\n\"\"\"\n@desc: Plot spike train of neurons in reservoir\n\"\"\"\ndef reservoirSpikeTrain(self, fr=0, to=None, figsize=None, colorEx=None, colorIn=None):\n # Set 'to' to total times steps if not defined\n if...
[ [ "matplotlib.pyplot.xlim", "numpy.mean", "numpy.concatenate", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.savefig", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.sqrt", "numpy.vstack", "numpy.array", "numpy.zeros", "matpl...
kharyal/cogment-verse
[ "12bcb855bc742e3ec4ed11c40a1b475e95a32515" ]
[ "torch_agents/cogment_verse_torch_agents/muzero/trial_worker.py" ]
[ "# Copyright 2021 AI Redefined Inc. <dev+cogment@ai-r.com>\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 ...
[ [ "torch.tensor", "torch.multiprocessing.Queue" ] ]
lwneal/tfasts
[ "26528a1e84089f60f31cc51e79bf4c4bf6886937" ]
[ "theano/convnet.py" ]
[ "import numpy\nimport theano\nimport theano.tensor as T\nfrom theano.tensor.nnet import conv\nfrom theano.tensor.signal import downsample\n\n\nclass LeNetConvPoolLayer(object):\n \"\"\"Pool Layer of a convolutional network \"\"\"\n\n def __init__(self, rng, input, filter_shape, image_shape, poolsize=(2, 2)):\...
[ [ "numpy.prod", "numpy.zeros", "numpy.sqrt" ] ]
matrig/genrl
[ "25eb018f18a9a1d0865c16e5233a2a7ccddbfd78" ]
[ "genrl/utils/data_bandits/census_bandit.py" ]
[ "from typing import Tuple\n\nimport pandas as pd\nimport torch\n\nfrom genrl.utils.data_bandits.base import DataBasedBandit\nfrom genrl.utils.data_bandits.utils import download_data, fetch_data_with_header\n\nURL = \"https://archive.ics.uci.edu/ml/machine-learning-databases/census1990-mld/USCensus1990.data.txt\"\n\...
[ [ "pandas.read_csv", "torch.tensor" ] ]
hallo-worldya/models
[ "ab993a21241709398d7cdd1a0b8d7209eec726b4" ]
[ "research/object_detection/core/preprocessor_test.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.array_equal", "tensorflow.zeros_like", "tensorflow.to_float", "tensorflow.image.rgb_to_grayscale", "tensorflow.rank", "tensorflow.set_random_seed", "tensorflow.shape", "tensorflow.concat", "tensorflow.random_uniform", "tensorflow.constant", "tensorflow.split", ...
ashutosh1919/neuro-symbolic-sudoku-solver
[ "ecb4274ff66d3b6a86f64584e0a767bf785f107f" ]
[ "difflogic/envs/sudoku/backtrack_inference.py" ]
[ "import time\nimport copy\nimport numpy as np\nimport pandas as pd\n\nimport jacinle.random as random\nfrom jacinle.utils.meta import notnone_property\nfrom jaclearn.rl.env import SimpleRLEnvBase\nfrom .grid import get_random_grid_generator\nfrom .grid import get_solved_grid\n\n__all__ = ['Grid', 'randomly_generate...
[ [ "pandas.read_csv" ] ]
nakhodnov17/portrait-demo
[ "37f9d98bf18116c369120f746bb3fc393c114355" ]
[ "back/api.py" ]
[ "import torch\n\nimport numpy as np\n\nimport albumentations as alb\n\nfrom src.bicanet import BiCADenseNet\n\n\nclass Segmentator:\n PORTRAIT_MEAN, PORTRAIT_STD = (0.5107, 0.4506, 0.4192), (0.3020, 0.2839, 0.2802)\n\n _image_transform = alb.Compose([\n alb.Normalize(mean=PORTRAIT_MEAN, std=PORTRAIT_ST...
[ [ "torch.device", "torch.no_grad", "numpy.array", "torch.tensor" ] ]
chuanfuye/object_detection
[ "405085810875f6cb4097e43d90924089c1e3aef8" ]
[ "ssd/my_dataset.py" ]
[ "from torch.utils.data import Dataset\nimport os\nimport torch\nimport json\nfrom PIL import Image\nfrom lxml import etree\n\n\nclass VOC2012DataSet(Dataset):\n \"\"\"读取解析PASCAL VOC2012数据集\"\"\"\n\n def __init__(self, voc_root, transforms, year='VOC2012', train_set='train.txt'):\n self.root = os.path.j...
[ [ "torch.as_tensor", "torch.tensor" ] ]
zuds-survey/zuds-pipeline
[ "16a8f034983c194f9fed53659b926f733b738069" ]
[ "zuds/photometry.py" ]
[ "import numpy as np\n\nimport sqlalchemy as sa\nfrom sqlalchemy.dialects import postgresql as psql\nfrom sqlalchemy.orm import relationship\nfrom sqlalchemy.ext.hybrid import hybrid_property\nfrom sqlalchemy.schema import UniqueConstraint\n\nfrom .core import Base\nfrom .constants import APER_KEY, APERTURE_RADIUS\n...
[ [ "numpy.ceil", "numpy.bitwise_or.reduce", "numpy.atleast_1d", "numpy.log10", "numpy.floor" ] ]
jaminalder/hummingbot
[ "eb26d49f6fd1aa65d84a1d19182ed9068405f68a" ]
[ "setup.py" ]
[ "import numpy as np\nimport os\nimport subprocess\nimport sys\n\nfrom setuptools import find_packages, setup\nfrom setuptools.command.build_ext import build_ext\n\nfrom Cython.Build import cythonize\n\nis_posix = (os.name == \"posix\")\n\nif is_posix:\n os_name = subprocess.check_output(\"uname\").decode(\"utf8\...
[ [ "numpy.get_include" ] ]
cwitkowitz/sporco
[ "7b0eefea8b6c720ab9a4998a7c55237445765738" ]
[ "examples/scripts/csc/parcbpdn_md_gry.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# This file is part of the SPORCO package. Details of the copyright\n# and user license can be found in the 'LICENSE.txt' file distributed\n# with the package.\n\n\"\"\"\nParallel CSC with a Spatial Mask\n================================\n\nThis example compares the ...
[ [ "numpy.random.seed", "numpy.pad", "numpy.random.randn", "numpy.abs" ] ]
keurfonluu/FTeikPy
[ "60ffeed603d04753d8d67ea8ba39f3c0aa40c336" ]
[ "fteikpy/_grid.py" ]
[ "import numpy as np\n\nfrom ._base import BaseGrid2D, BaseGrid3D, BaseTraveltime\nfrom ._fteik import ray2d, ray3d\nfrom ._interp import vinterp2d, vinterp3d\n\n\nclass Grid2D(BaseGrid2D):\n def __init__(self, *args, **kwargs):\n \"\"\"\n 2D grid class.\n\n Parameters\n ----------\n ...
[ [ "numpy.min", "numpy.asarray" ] ]
samn33/qlazy
[ "b215febfec0a3b8192e57a20ec85f14576745a89" ]
[ "example/py/ErrorCorrection/hamming_code.py" ]
[ "import numpy as np\n\ndef decimal_to_binlist(decimal, digits): # ex) 6,3 --> [1,1,0]\n\n bin_str = \"{:0{digits}b}\".format(decimal, digits=digits)\n return [int(s) for s in list(bin_str)]\n \ndef binlist_to_decimal(bin_list): # ex) [0,1,1] --> 3\n\n return int(\"\".join([str(i) for i in bin_list]), 2...
[ [ "numpy.concatenate", "numpy.array", "numpy.random.randint", "numpy.eye" ] ]
AlucardNosferatu/CycleGAN-Music-Style-Transfer
[ "9a1d112aeeb14b40c0826e80fd6e0fae7bbf98f8" ]
[ "model.py" ]
[ "from __future__ import division\nimport os\nimport time\nfrom shutil import copyfile\nfrom glob import glob\nimport tensorflow as tf\nimport numpy as np\nimport config\nfrom collections import namedtuple\nfrom module import *\nfrom utils import *\nfrom ops import *\nfrom metrics import *\nos.environ[\"CUDA_VISIBLE...
[ [ "tensorflow.trainable_variables", "numpy.array", "tensorflow.summary.merge", "tensorflow.train.AdamOptimizer", "numpy.random.normal", "tensorflow.summary.scalar", "tensorflow.ones_like", "tensorflow.train.Saver", "tensorflow.train.get_checkpoint_state", "numpy.load", "n...
eugli/news-engagement-prediction
[ "192eb166397e1576577a97babfeebae353344123" ]
[ "src/preprocess.py" ]
[ "import os\nimport json\nimport html\nimport re\nfrom collections import OrderedDict\nfrom collections import Counter\nfrom string import punctuation\n\nimport numpy as np\nimport pandas as pd\n\nimport torch\nfrom torch.utils.data import TensorDataset, DataLoader\n\nfrom hparams import hps_data\n\ndef read_data(da...
[ [ "numpy.concatenate", "numpy.array", "numpy.mean", "torch.from_numpy", "numpy.std", "torch.utils.data.DataLoader" ] ]
abhiwonder/ga-learner-dsmp-repo
[ "c1cf42bf35f7b59d7fb0fe62b2387cb25e0c47ab" ]
[ "Data-PreProcessing/code.py" ]
[ "# --------------\n#Importing header files\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n#Code starts here\ndata = pd.read_csv(path)\ndata.Rating.plot(kind='hist')\ndata = data[data.Rating<=5]\ndata.Rating.plot(kind='hist')\n\n#Code ends here\n\n\n# --------------\n# code starts he...
[ [ "pandas.to_datetime", "sklearn.preprocessing.LabelEncoder", "pandas.read_csv", "pandas.concat" ] ]
oeway/keras
[ "833aa73b4959a7c14096083a03fc035595842cc7" ]
[ "keras/engine/training.py" ]
[ "from __future__ import print_function\nfrom __future__ import absolute_import\n\nimport warnings\nimport copy\nimport time\nimport numpy as np\nimport multiprocessing\nimport threading\ntry:\n import queue\nexcept ImportError:\n import Queue as queue\n\nfrom .topology import Container\nfrom .. import backend...
[ [ "numpy.asarray", "numpy.reshape", "numpy.random.seed", "numpy.random.shuffle", "numpy.arange", "numpy.append", "numpy.average", "numpy.expand_dims" ] ]
saeed-anwar/drln
[ "e43027910551fe989630a36c84f090efd6e08ad0" ]
[ "TestCode/code/model/drln.py" ]
[ "import torch\nimport torch.nn as nn\nimport model.ops as ops\nimport torch.nn.functional as F\n\ndef make_model(args, parent=False):\n return DRLN(args)\n\nclass CALayer(nn.Module):\n def __init__(self, channel, reduction=16):\n super(CALayer, self).__init__()\n\n self.avg_pool = nn.AdaptiveAvg...
[ [ "torch.nn.AdaptiveAvgPool2d", "torch.cat", "torch.nn.Conv2d" ] ]
MoAmrYehia/ivy
[ "84c5fb82ec43c5c7d0154d5110973805e524831c" ]
[ "ivy/functional/backends/tensorflow/manipulation.py" ]
[ "# global\nimport math\nimport tensorflow as tf\nfrom numbers import Number\nfrom typing import Union, Tuple, Optional, List\nfrom tensorflow.python.types.core import Tensor\n\n\ndef flip(x: Tensor,\n axis: Optional[Union[int, Tuple[int], List[int]]] = None)\\\n -> Tensor:\n num_dims = len(x.shap...
[ [ "tensorflow.shape", "tensorflow.expand_dims", "tensorflow.reshape", "tensorflow.reverse", "tensorflow.tile", "tensorflow.split" ] ]
duytnguyendtn/cubeviz
[ "f6a60fc78370fcb8d4d026a92f806c0d60c2bf9e" ]
[ "cubeviz/tests/test_image_viewer.py" ]
[ "import pytest\nimport numpy as np\nfrom glue.core import roi\n\nfrom cubeviz.utils.contour import ContourSettings\nfrom cubeviz.tools.moment_maps import MomentMapsGUI\n\n\n@pytest.fixture(scope='module')\ndef moment_maps_gui(cubeviz_layout):\n cl = cubeviz_layout\n\n mm = MomentMapsGUI(cl._data, cl.session.d...
[ [ "numpy.median", "numpy.nanmax", "numpy.nanmin" ] ]
pmontalb/MonopolyMarkovChain
[ "042fa62a8e481b81925f69d7c5241aad277bbf4b" ]
[ "GameEngine/GameUtility/Dice.py" ]
[ "import numpy as np\n\n\nclass Dice:\n def __init__(self, min_value=1, max_value=6):\n self.min_value = min_value\n self.max_value = max_value\n\n def launch(self):\n return np.random.randint(self.min_value, self.max_value + 1)" ]
[ [ "numpy.random.randint" ] ]
zeynepartun/IAcomputing40
[ "1ea3ea02df4580338c3529bed00f4db88e786f04" ]
[ "floodsystem/analysis.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\n\ndef polyfit(dates, levels, p):\n\n x = matplotlib.dates.date2num(dates)\n y = levels\n# new edit below\n p_coeff = np.polyfit(x-x[0], y, p)\n\n poly = np.poly1d(p_coeff)\n \n return poly, x[0]\n\n\n" ]
[ [ "matplotlib.dates.date2num", "numpy.polyfit", "numpy.poly1d" ] ]
xxaxtt/TwoTowers
[ "206c6b38a2f72486906d391c5176e4508036aac0" ]
[ "deem/pytorch/losses/softmax_crossentropy_loss.py" ]
[ "import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass SoftmaxCrossEntropyLoss(nn.Module):\n def __init__(self):\n \"\"\"\n :param num_negs: number of negative instances in bpr loss.\n \"\"\"\n super(SoftmaxCrossEntropyLoss, self).__init__...
[ [ "torch.log", "torch.nn.functional.softmax" ] ]
AllenXuuu/DCR
[ "2240b78ea7e03c43be8ba0a8649e6ab07db36fbd" ]
[ "dataset/egtea_gaze.py" ]
[ "from collections import defaultdict\nimport json\nfrom pandas.core import frame\nimport torch\nimport pandas as pd\nimport os\nimport pickle as pkl\nimport numpy as np\nimport cv2\nimport h5py\nimport tqdm\nimport functools\nimport lmdb\n\n\nclass EGTEA_GAZE_DATASET(torch.utils.data.Dataset):\n def __init__(sel...
[ [ "numpy.zeros", "numpy.stack", "numpy.arange", "numpy.frombuffer", "pandas.read_csv" ] ]
newbiesitl/DRL
[ "799211933f27400f34c32b4ab136d8b3c06b1f28" ]
[ "agents/lstm_agent.py" ]
[ "'''\nPlan:\n1. Build a LSTM classifier to predict the action from historical env, rewards and actions\n2. Implement the rollout to collect simulation data\n3. Use rewards to update the weights using sample_weights\n'''\n\nfrom keras.models import Sequential, model_from_json\nfrom keras.losses import binary_crossen...
[ [ "numpy.concatenate", "numpy.array", "numpy.delete", "numpy.random.uniform", "numpy.argmax", "numpy.append" ] ]
zmatlik117/iap
[ "107d0dddf8beccf01a3f02069b704ce5fd9f5df7" ]
[ "semestr_01/IAP/interpolace.py" ]
[ "from scipy import interpolate\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# z kolika vyorku udelam orezanou funkci\nsamples = 6\n# jakeho radu chci interpolacni polynom\norder = 4\ninter_functions = []\n# orezana osa x\nx_axis = np.linspace(0, 2 * np.pi, samples)\n# poctiva osa x se spoustou vzorku\nx_...
[ [ "numpy.sin", "scipy.interpolate.interp1d", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.linspace" ] ]
yulkang/numpy-groupies
[ "7fd58f8a488cf586af5150b2a9b96ce9bd703cad" ]
[ "numpy_groupies/utils_numpy.py" ]
[ "\"\"\"Common helper functions for typing and general numpy tools.\"\"\"\nimport numpy as np\n\nfrom .utils import get_aliasing, check_boolean\n\n_alias_numpy = {\n np.add: 'sum',\n np.sum: 'sum',\n np.any: 'any',\n np.all: 'all',\n np.multiply: 'prod',\n np.prod: 'prod',\n np.amin: 'min',\n ...
[ [ "numpy.max", "numpy.count_nonzero", "numpy.isnan", "numpy.ravel_multi_index", "numpy.zeros", "numpy.ones", "numpy.min", "numpy.any", "numpy.prod", "numpy.isscalar", "numpy.arange", "numpy.ndim", "numpy.cumsum", "numpy.issubdtype", "numpy.iinfo", "num...
GodspeedYouBlackEmperor/pyalcs
[ "9811bc5cde935e04e0fd87fb5930bd1b9170e73a" ]
[ "lcs/strategies/action_selection/RandomAction.py" ]
[ "import numpy as np\n\n\nclass RandomAction:\n\n def __init__(self, all_actions: int):\n self.all_actions = all_actions\n\n def __call__(self, population):\n return np.random.randint(self.all_actions)\n" ]
[ [ "numpy.random.randint" ] ]
nocolour/Tensorflow-examples
[ "b88cccc17e58281b8881feb0b9fb0385b8017e24" ]
[ "lite/examples/reinforcement_learning/ml/training_tf.py" ]
[ "# Lint as: python3\n# Copyright 2021 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/licens...
[ [ "tensorflow.keras.optimizers.SGD", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.lite.TFLiteConverter.from_keras_model", "tensorflow.summary.create_file_writer", "tensorflow.keras.utils.Progbar" ] ]
weishengtoh/computervision_assignment
[ "98964e765527956b15ac2cf075914956ea4e7ec4" ]
[ "deep_sort/iou_matching.py" ]
[ "# vim: expandtab:ts=4:sw=4\nfrom __future__ import absolute_import\nimport numpy as np\nfrom . import linear_assignment\n\n\ndef iou(bbox, candidates):\n \"\"\"Computer intersection over union.\n\n Parameters\n ----------\n bbox : ndarray\n A bounding box in format `(top left x, top left y, widt...
[ [ "numpy.minimum", "numpy.asarray", "numpy.maximum" ] ]
aguinane/energy-report
[ "0e4b5b3922bc0293bb45dd8a7b92cdc950cff760" ]
[ "report.py" ]
[ "import logging\nfrom datetime import datetime\nfrom typing import Optional, Generator, Tuple\nimport shutil\nfrom dateutil.parser import isoparse\nfrom pathlib import Path\nimport pandas as pd\nfrom collections import defaultdict\nimport calplot\nfrom sqlite_utils import Database\nfrom summary import update_daily_...
[ [ "pandas.DataFrame", "pandas.Series" ] ]
roger-tseng/Conditioned-U-Net-pytorch
[ "8d1b4f9ab8732fed73eb05cba1a9aadbd4d6f796" ]
[ "models/separation_framework_old.py" ]
[ "from abc import ABCMeta\nfrom argparse import ArgumentParser\nfrom warnings import warn\n\nimport numpy as np\nimport pydub\nimport pytorch_lightning as pl\nimport soundfile\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as f\nimport wandb\nfrom pytorch_lightning.loggers import WandbLogger\nimpor...
[ [ "torch.nn.functional.mse_loss", "torch.cat", "torch.nn.init.kaiming_normal_", "torch.zeros" ] ]
mengdong/compression
[ "4d79569ff2854be8866022f96336e1d321f1ed85" ]
[ "models/hific/hific_test.py" ]
[ "# Copyright 2020 Google LLC. 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 appl...
[ [ "numpy.zeros", "tensorflow.compat.v1.data.Dataset.from_tensor_slices", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.test.main", "tensorflow.compat.v1.data.make_initializable_iterator" ] ]
matinmoezzi/neurodiffeq
[ "eeb1fa848c14a4e3d9a833fb142371f7dec0a0bb" ]
[ "neurodiffeq/conditions.py" ]
[ "import numpy as np\nimport torch\nimport warnings\nfrom .neurodiffeq import safe_diff as diff\nfrom ._version_utils import deprecated_alias\n\n\nclass BaseCondition:\n r\"\"\"Base class for all conditions.\n\n A condition is a tool to `re-parameterize` the output(s) of a neural network.\n such that the re...
[ [ "torch.cat", "numpy.ones_like", "torch.abs", "torch.ones_like", "torch.tanh", "torch.exp" ] ]
lclichen/openl3
[ "07ac537ff0ed2bac4c09fa1f5a7371e2b9299cba" ]
[ "tests/test_cli.py" ]
[ "import pytest\nimport os\nfrom openl3.cli import positive_int, positive_float, get_file_list, parse_args,\\\n run, main\nfrom argparse import ArgumentTypeError\nfrom openl3.openl3_exceptions import OpenL3Error\nimport tempfile\nimport numpy as np\nfrom unittest.mock import patch\n\n\nTEST_DIR...
[ [ "numpy.isnan", "numpy.asarray", "numpy.load", "numpy.mean", "numpy.allclose", "numpy.abs" ] ]
nijatmursali/SapienzaMachineLearning3Credits
[ "999e4e2712d323c583eee7f8463ea122e1c9bddf" ]
[ "CapobiancoHW-master/grid_world.py" ]
[ "import os \ncurr_path = os.path.dirname(os.path.realpath(__file__))\nos.chdir(curr_path)\nfrom models import DeepDoubleSarsa, Double_Sarsa, Expected_Double_Sarsa, ReplayBuffer\nimport numpy as np \nimport matplotlib.pyplot as plt\nimport random\nimport operator as op \nimport torch\nfrom torch.autograd import Vari...
[ [ "numpy.concatenate", "numpy.random.normal", "numpy.array", "numpy.random.rand", "numpy.reshape", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "numpy.save", "numpy.mean", "torch.from_...
Sakib1263/ResNet-ResNeXt-1D-2D-Tensorflow-Keras
[ "13c36344018f97342dc0357f3d87baa71eff0a0a" ]
[ "Codes/ResNet_v2_1DCNN.py" ]
[ "import tensorflow as tf\n\n\ndef Conv_1D_Block(x, model_width, kernel, strides):\n # 1D Convolutional Block with BatchNormalization\n x = tf.keras.layers.BatchNormalization()(x)\n x = tf.keras.layers.Activation('relu')(x)\n x = tf.keras.layers.Conv1D(model_width, kernel, strides=strides, padding=\"same...
[ [ "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.GlobalMaxPooling1D", "tensorflow.keras.layers.Add", "tensorflow.keras.layers.GlobalAveragePooling1D", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Activation", "tensorflow.keras.losses.MeanAbsoluteError", "te...
hyperion-ml/hyperion
[ "c4c9eee0acab1ba572843373245da12d00dfffaa", "c4c9eee0acab1ba572843373245da12d00dfffaa" ]
[ "hyperion/bin/plot-vector-tsne.py", "hyperion/bin/torch-train-transformer-xvec-v1.py" ]
[ "#!/usr/bin/env python\n\"\"\"\n Copyright 2018 Johns Hopkins University (Author: Jesus Villalba)\n Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\"\"\"\n\nimport sys\nimport os\nimport argparse\nimport time\nimport logging\n\nimport numpy as np\nimport matplotlib\n\nmatplotlib.use(\"Agg\")\nimport mat...
[ [ "matplotlib.use", "matplotlib.pyplot.clf", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "sklearn.manifold.TSNE", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show", "numpy.unique" ], [ "torch.manua...
marco-digio/Twitter4SSE
[ "724b3f5d638b17a0e46353a1ea1a409da17ab8bd" ]
[ "code/test_PIT_bechmark.py" ]
[ "import pandas as pd\nimport sys\nfrom sentence_transformers import SentenceTransformer, InputExample\nfrom sentence_transformers.evaluation import EmbeddingSimilarityEvaluator, BinaryClassificationEvaluator\n\n# Get the label as the value in the second place of the string (e.g., '(0, 5)' returns 0)\ndef get_lab(x)...
[ [ "pandas.read_csv" ] ]
zbarry/holoviews
[ "25505a4470c56a0d62ba5813c1fe9af59f568bcf" ]
[ "holoviews/core/data/multipath.py" ]
[ "import numpy as np\n\nfrom ..util import max_range\nfrom .interface import Interface, DataError\n\n\nclass MultiInterface(Interface):\n \"\"\"\n MultiInterface allows wrapping around a list of tabular datasets\n including dataframes, the columnar dictionary format or 2D tabular\n NumPy arrays. Using th...
[ [ "numpy.concatenate", "numpy.array", "numpy.isscalar" ] ]
leoprover/ltb
[ "e9550c596d36003eb6809d227f99604557c35b6a" ]
[ "leo3ltb/scheduler/profiler.py" ]
[ "import pandas as pd\nimport matplotlib.cm as cm\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef plot(problemVariants, *, zero, outfile, numThreads):\n columns = ['Problem', 'NotTriedYet', 'Scheduled', 'Success', 'Timeout', 'Stopped', 'Ended']\n colors = ['w', 'tab:purple', 'tab:green', 'tab:orang...
[ [ "pandas.DataFrame", "numpy.arange", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplot" ] ]
tushushu/Imilu
[ "121c79574d3e6ca35b569dd58661175e5c3668e2" ]
[ "imylu/utils/utils.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@Author: tushushu\n@Date: 2018-11-14 11:11:35\n@Last Modified by: tushushu\n@Last Modified time: 2018-11-14 11:11:35\n\"\"\"\n\nfrom copy import copy\nfrom itertools import tee\nfrom numpy import exp, ndarray\nfrom random import randint\nfrom statistics import median\nfrom time i...
[ [ "numpy.exp" ] ]
paulwong16/CloserLook3D
[ "f640be8e7ec9fb99a563034616b7ef413f5bf58e" ]
[ "pytorch/datasets/data_utils.py" ]
[ "import os\nimport sys\nimport torch\nimport numpy as np\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(BASE_DIR)\nsys.path.append(os.path.join(ROOT_DIR, 'ops'))\nimport cpp_wrappers.cpp_subsampling.grid_subsampling as cpp_subsampling\n\n\ndef grid_subsampling(points, features=...
[ [ "numpy.random.normal", "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.random.randn", "torch.from_numpy", "numpy.eye", "numpy.random.uniform", "numpy.cos", "numpy.outer", "numpy.random.random", "torch.matmul" ] ]
hfung4/kPOD
[ "a0cc3d764593191315a4ada60705ca624a323812" ]
[ "kPOD/utils/utils.py" ]
[ "# imports for mathematical functions\nimport numpy as np\nfrom numpy import nanmean, nan\nimport sys\nfrom scipy.spatial import distance\nimport pandas as pd\n\ndef __cluster_assignment(data, cluster_centers, N, K):\n \"\"\" Assign each point in the dataset to a cluster based on its distance from cluster center...
[ [ "numpy.array", "numpy.isnan", "scipy.spatial.distance.euclidean", "numpy.zeros", "numpy.argmin" ] ]
taimurhassan/tensorpooling
[ "1f9e4e957ec116830b3ced7481f849109e0bbb5b" ]
[ "anisotropicDiffusionFilter.py" ]
[ "# Acknowledgement: The implementation of Anisotropic Diffusion Filtering is borrowed from Alistair Muldal's code (https://pastebin.com/sBsPX4Y7). We thank them for this\r\nimport numpy as np\r\nimport warnings\r\n \r\ndef anisodiff(img,niter=1,kappa=50,gamma=0.1,step=(1.,1.),option=1,ploton=False):\r\n \"\"\"\r...
[ [ "numpy.zeros_like", "numpy.ones_like", "numpy.exp", "numpy.diff" ] ]
anooptp/aesara
[ "e476ebcdd4222758cddd4523cd19248c88fb4dd2" ]
[ "aesara/compile/function/types.py" ]
[ "\"\"\"\nDriver of graph construction, optimization, and linking.\n\n\"\"\"\n\nimport copy\nimport copyreg\nimport logging\nimport os\nimport pickle\nimport time\nimport warnings\nfrom itertools import chain\nfrom typing import List\n\nimport numpy as np\n\nimport aesara\nimport aesara.compile.profiling\nfrom aesar...
[ [ "numpy.may_share_memory" ] ]
ariffyasri/lale
[ "326012c3c3dd884fae0093fe0c45596e4f9c0d72", "326012c3c3dd884fae0093fe0c45596e4f9c0d72" ]
[ "lale/lib/autogen/function_transformer.py", "lale/lib/imblearn/adasyn.py" ]
[ "\nfrom sklearn.preprocessing._function_transformer import FunctionTransformer as Op\nimport lale.helpers\nimport lale.operators\nimport lale.docstrings\nfrom numpy import nan, inf\n\nclass FunctionTransformerImpl():\n\n def __init__(self, func=None, inverse_func=None, validate=None, accept_sparse=False, pass_y=...
[ [ "sklearn.preprocessing._function_transformer.FunctionTransformer" ], [ "numpy.array" ] ]
berkeleyapplied/seaborn
[ "1b087a3a574922220d77b6219af99280905718f8" ]
[ "seaborn/distributions.py" ]
[ "\"\"\"Plotting functions for visualizing distributions.\"\"\"\nfrom __future__ import division\nimport numpy as np\nfrom scipy import stats\nimport pandas as pd\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.transforms as tx\nfrom matplotlib.collections import LineCollection\nimport ...
[ [ "numpy.max", "numpy.repeat", "numpy.array", "numpy.zeros_like", "numpy.asarray", "matplotlib.cm.get_cmap", "scipy.stats.gaussian_kde", "numpy.std", "matplotlib.collections.LineCollection", "numpy.isscalar", "numpy.sqrt", "matplotlib.transforms.blended_transform_fact...
EmFord/q2-demux
[ "d5dbcb3591d92fb6beff2d2ee7ba77c081907b71" ]
[ "q2_demux/_demux.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2019, QIIME 2 development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------...
[ [ "pandas.DataFrame" ] ]
chenrui17/cudf
[ "a0045bd15981d8a2ef165c3a5e4306474eda958e" ]
[ "python/cudf/cudf/core/dataframe.py" ]
[ "# Copyright (c) 2018-2020, NVIDIA CORPORATION.\nfrom __future__ import division\n\nimport inspect\nimport itertools\nimport numbers\nimport pickle\nimport sys\nimport warnings\nfrom collections import OrderedDict, defaultdict\nfrom collections.abc import Iterable, Mapping, Sequence\n\nimport cupy\nimport numpy as ...
[ [ "numpy.result_type", "pandas.Index", "numpy.array", "pandas.io.formats.console.get_console_size", "pandas.api.types.is_list_like", "pandas.DataFrame", "pandas.io.formats.printing.pprint_thing", "pandas._config.get_option", "numpy.issubdtype", "pandas.api.types.is_bool_dtype...
khuranalab/DeepMILO
[ "2fdec3da614167b67303e54a9c8019ee51361bf8" ]
[ "program/common_function.py" ]
[ "from constant import *\nfrom common_object import Variant, Boundary, Loop\nimport vcf\nimport sys\nimport random\nimport re\nimport numpy as np\nimport warnings\n\n\ndef extract_variants(input_file, sample, vt=None, svtype=None, notgt=None, qual=30, all_variant=False):\n '''\n In pyVCF, start and end are 0-b...
[ [ "numpy.log10" ] ]
Octaves0911/sunpy
[ "d3dff03fe6cc404e40f22da90200ffbb3d38c1a7", "d3dff03fe6cc404e40f22da90200ffbb3d38c1a7" ]
[ "sunpy/image/resample.py", "sunpy/map/tests/test_plotting.py" ]
[ "\"\"\"\nImage resampling methods.\n\"\"\"\nimport numpy as np\nimport scipy.interpolate\nimport scipy.ndimage\n\nfrom sunpy.util.exceptions import warn_deprecated\n\n__all__ = ['resample', 'reshape_image_to_4d_superpixel']\n\n\ndef resample(orig, dimensions, method='linear', center=False, minusone=False):\n \"\...
[ [ "numpy.array", "numpy.asarray", "numpy.float64", "numpy.arange", "numpy.indices", "numpy.meshgrid", "numpy.floor" ], [ "numpy.zeros_like", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.ma.array", "matplotlib.colors.Normalize", "numpy.arange"...
caesarcai/SCOBO
[ "32a98ac82561f5f8a407fc12c06a4646aaea1f9e" ]
[ "scobo.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport gurobipy as gp \nfrom gurobipy import GRB, quicksum\n\"\"\"\nThe user MUST install Gurobi to use this program.\nCheck https://www.gurobi.com/ for installation details.\n\"\"\"\n\ndef Solve1BitCS(y,Z,m,d,s):\n '''\n This function creates a quadratic ...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.copy", "numpy.random.randn", "numpy.arange", "numpy.sqrt", "numpy.cumsum", "numpy.squeeze" ] ]
bio2bel/phosphosite
[ "2bc3a17f8a45058f772eb71f2a772e0c534c66f7" ]
[ "src/bio2bel_phosphosite/parsers/regulatory_sites.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas as pd\n\nfrom bio2bel import make_downloader\nfrom ..constants import REGULATORY_SITES_PATH, REGULATORY_SITES_URL\n\n__all__ = [\n 'download_regulatory_sites'\n]\n\ndownload_regulatory_sites = make_downloader(REGULATORY_SITES_URL, REGULATORY_SITES_PATH)\n\n\ndef get_regu...
[ [ "pandas.read_csv" ] ]
jaymwong/transformation_conversions
[ "cbd269c651aa92ccc56c90129d0c29df09bb2e46" ]
[ "src/transform_conversions/transformations.py" ]
[ "# Copyright (c) 2006-2017, Christoph Gohlke\n# Copyright (c) 2006-2017, The Regents of the University of California\n# Produced at the Laboratory for Fluorescence Dynamics\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that t...
[ [ "numpy.dot", "numpy.random.rand", "numpy.set_printoptions", "numpy.negative", "numpy.mean", "numpy.radians", "numpy.finfo", "numpy.cos", "numpy.outer", "numpy.random.random", "numpy.concatenate", "numpy.sin", "numpy.empty", "numpy.linalg.eigh", "numpy.fa...
sarweshshah/gait_analysis
[ "2fb14f903b3db50a4e3a584117805be9697304bf" ]
[ "poseAndObjectDetectVideo.py" ]
[ "# import the necessary packages\nimport time\n\nimport cv2\nimport imutils\nimport numpy as np\nfrom imutils.video import FileVideoStream\n\nfvs = FileVideoStream('data/sarwesh.mp4', queue_size=1024).start() # with bag\ntime.sleep(1.0)\n\nkernelSize = 7\nbackgroundHistory = 15\n\nopenposeProtoFile = \"dnn_models/...
[ [ "numpy.array", "numpy.uint8", "numpy.linalg.norm", "numpy.dot", "numpy.zeros", "numpy.ones", "numpy.where", "numpy.subtract", "numpy.arange", "numpy.append", "numpy.linspace", "numpy.vstack" ] ]
manniru/pifuhd
[ "0b8810e26861e281e24531a9cbfad0cbfac2e318" ]
[ "lib/net_util.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n'''\nMIT License\n\nCopyright (c) 2019 Shunsuke Saito, Zeng Huang, and Ryota Natsume\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to d...
[ [ "torch.nn.Linear", "torch.nn.SELU", "torch.nn.LeakyReLU", "torch.nn.init.kaiming_normal_", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.nn.init.constant_", "torch.nn.init.normal_", "torch.nn.init.orthogonal_", "torch.nn.init.xavier_normal_", "torch.nn.Tanh...
libertatis/PaddleViT
[ "422b7fa4dda68c158fc9bd95e00aba01d4671916" ]
[ "image_classification/ConvMixer/main_single_gpu.py" ]
[ "\n# Copyright (c) 2021 PPViT 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 requi...
[ [ "numpy.random.seed" ] ]
cmb87/FluidMechanics
[ "fc31a4c535c8388002a38352e2c448189017643f" ]
[ "application/models/simulation/digitaltwin.py" ]
[ "import sys\nimport os\nimport shutil\nimport time\nimport numpy as np\nimport uuid\nimport datetime\n\n\nfrom ...common.database import Database\nfrom .joukowski import JoukowskiAirfoil\nfrom ..optimizer.swarm import Swarm\n\n\nSIMCOLLECTION = \"simulations\"\nLOGCOLLECTION = \"logs\"\nDESIGNSCOLLECTION = \"design...
[ [ "numpy.around", "numpy.asarray" ] ]
ScSteffen/neuralEntropyComparison
[ "b54a823db595cc84717954fa84a9fb0d2f52e7b1" ]
[ "ext/willsCode/LGWT.py" ]
[ "\n\n\"\"\"\nThis script is for computing the definite integrals usingLegendre-Guass Quadrature.\nComputes the Legendre-Gauss nodes and weights on interval [a,b] with truncation order N.\n\nIf f is a continuous function on [a,b], with a descritization induced by a vector x\nof points in [a,b], evalute the definite ...
[ [ "numpy.divide", "numpy.sin", "numpy.zeros", "numpy.flipud", "numpy.finfo", "numpy.multiply", "numpy.cos", "numpy.linspace" ] ]
Menelau/leo
[ "1f18044192af7d8eab7c17d22563f97534edc9fd" ]
[ "runner.py" ]
[ "# Copyright 2018 DeepMind Technologies Limited\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 applic...
[ [ "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.summary.histogram", "tensorflow.logging.info", "tensorflow.map_fn", "tensorflow.is_nan", "tensorflow.clip_by_norm", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.train.get_or_creat...
felipe-salinas/PyBaMM
[ "49a490c189d1896a7e845d585529c52c3e377554" ]
[ "tests/unit/test_expression_tree/test_unary_operators.py" ]
[ "#\n# Tests for the Unary Operator classes\n#\nimport pybamm\n\nimport unittest\nimport numpy as np\nfrom scipy.sparse import diags\n\n\nclass TestUnaryOperators(unittest.TestCase):\n def test_unary_operator(self):\n a = pybamm.Symbol(\"a\", domain=[\"test\"])\n un = pybamm.UnaryOperator(\"unary te...
[ [ "numpy.array", "numpy.linspace", "numpy.log" ] ]
mldiego/Platooning-F1Tenth
[ "ec5eadb137da8428642b3ffd1b8ca31fde4f6dff" ]
[ "src/computer_vision/input_output/hdf5datasetgenerator.py" ]
[ "# import the neccessary package\nfrom keras.utils import np_utils\nimport numpy as np \nimport h5py \n\nclass HDF5DatasetGenerator:\n\n def __init__(self,dbPath,batchSize,preprocessors=None,\n aug=None,binarize=True, classes=2):\n # store the batch size, preprocessors, and data aug...
[ [ "numpy.array" ] ]
HubBucket-Team/io
[ "de05464e53672389119a6215fea9ceacf7f77203" ]
[ "tests/test_image_eager.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ [ "tensorflow.image.decode_png", "tensorflow.version.VERSION.startswith", "tensorflow.compat.v1.enable_eager_execution" ] ]
sylvain2002/CBM101
[ "4d9dc4264ce81cc2af58ceaff96fd0ed7a570af5" ]
[ "J_Mathematical_Modeling/Section 2/solutionPythonCodeExercise12.py" ]
[ "# Importing the needed python packages\nimport numpy as np \nimport matplotlib.pyplot as plt\nfrom scipy.integrate import odeint\nimport time \nimport sys\nfrom pylab import *\nfrom matplotlib.patches import Rectangle\n# Defining the right hand side of the ODEs (rate of changes of predator and prey)\n\ndef Negativ...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.quiver", "numpy.meshgrid" ] ]
aiyasin/PaddleViT
[ "54d976a7fd1d306ed286cf82bfb13cb1249eddd8" ]
[ "image_classification/T2T_ViT/t2t_vit.py" ]
[ "# Copyright (c) 2021 PPViT 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 required ...
[ [ "numpy.sqrt" ] ]
jirikuncar/trackintel
[ "380a9a9c580f8e7e6d4bc669dd257f5d8b4b3022" ]
[ "trackintel/visualization/positionfixes.py" ]
[ "import matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\n\nfrom trackintel.visualization.util import regular_figure, save_fig\nfrom trackintel.visualization.osm import plot_osm_streets\n\n\ndef plot_positionfixes(positionfixes, out_filename=None, plot_osm=False):\n \"\"\"Plots positionfixes (opti...
[ [ "matplotlib.pyplot.show" ] ]
geosharma/liquepy
[ "d567f6a7eb93eb76218f718375f2d34355d7edd4" ]
[ "liquepy/element/models.py" ]
[ "import numpy as np\nfrom liquepy import functions\nimport eqsig\n\n\nclass ShearTest(object):\n _stress = None\n _strain = None\n _pp = None\n _esig_v0 = None\n _i_liq = None\n _i_liq_strain = None\n _i_liq_pp = None\n _n_points = 0\n _n_cycles = None\n _ru_limit = None\n _da_strai...
[ [ "numpy.array", "numpy.diff", "numpy.sign", "numpy.where", "numpy.insert" ] ]
tylerni7/missile-tid
[ "252232d5989d267c2794d9d55fb38fe0249f605f" ]
[ "tid/get_data.py" ]
[ "\"\"\"\nFunctions to help with download and basic processing of GPS data\n\"\"\"\nfrom datetime import datetime, timedelta\nimport io\nimport json\nimport logging\nimport multiprocessing\nimport os\nimport re\nfrom typing import cast, Dict, Iterable, Optional, Sequence, Tuple\nimport zipfile\n\nimport numpy\nimpor...
[ [ "numpy.array", "numpy.isnan", "numpy.linalg.norm", "numpy.zeros", "numpy.load", "numpy.where", "numpy.timedelta64", "numpy.append" ] ]
kunosato-mado/ttslearn
[ "1230ce8d5256a7438c485a337968ce086620a88e", "1230ce8d5256a7438c485a337968ce086620a88e", "1230ce8d5256a7438c485a337968ce086620a88e" ]
[ "ttslearn/notebook.py", "recipes/dnntts/train_dnntts.py", "recipes/common/fit_scaler.py" ]
[ "import os\n\n\ndef get_cmap():\n \"\"\"Gets the colormap (default: ``viridis``)\n\n The colormap can be set by the environment variable ``TTSLEARN_CMAP``\n for convenience.\n\n Returns:\n str: The name of the current colormap.\n\n\n Examples:\n\n .. ipython::\n\n In [1]: from ttslea...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.style.use" ], [ "torch.finfo", "torch.sort", "torch.cuda.is_available", "torch.nn.MSELoss" ], [ "sklearn.preprocessing.StandardScaler" ] ]
penghao1990/ASCNet
[ "8b0d8b44e559ead644fc4bcf35e53975cf40f3a6" ]
[ "pcdet/models/backbones_3d/vfe/pillar_vfe.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .vfe_template import VFETemplate\n\n\nclass PFNLayer(nn.Module):\n def __init__(self,\n in_channels,\n out_channels,\n use_norm=True,\n last_layer=False):\n super()...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.max", "torch.arange", "torch.norm", "torch.unsqueeze", "torch.nn.BatchNorm1d", "torch.zeros_like", "torch.nn.functional.relu" ] ]
ks-korovina/chemistry_experiments
[ "54fca4839d7db1a02e2205e428b674da8adc0da0" ]
[ "chemist_opt/domains.py" ]
[ "\"\"\"\n Harness to manage optimisation domains.\n -- kandasamy@cs.cmu.edu,\n kkorovin@cs.cmu.edu\n\"\"\"\n\n# pylint: disable=no-member\n# pylint: disable=invalid-name\n# pylint: disable=arguments-differ\n# pylint: disable=abstract-class-not-used\n\nimport numpy as np\n# Local\nfrom explore.explorer i...
[ [ "numpy.array", "numpy.sqrt" ] ]
grtzsohalf/Audio-Phonetic-and-Semantic-Embedding
[ "1207cb61ec4587f38817b030a1e92cb315ebd178" ]
[ "stage_1_disentangle/src_unis/get_feat.py" ]
[ "import sys\nimport re\nimport os \nimport argparse\nfrom collections import deque\n\nFLAG = None\ndef read_classify_list(filename):\n classify_dic = {}\n with open(filename,'r') as f:\n for line in f:\n l_sp = line.rstrip().split(' ')\n ID = l_sp[0]\n start_frame = l_s...
[ [ "numpy.array", "numpy.append" ] ]
navid5792/Tree-Transformer
[ "714aac69553f808549d55a580a7d113d3d283df1" ]
[ "transformer/sublayers.py" ]
[ "\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\n\nfrom transformer.modules import Linear\nfrom transformer.modules import ScaledDotProductAttention\nfrom transformer.modules import LayerNormalization\n\n\nclass _MultiHeadAttention(nn.Module):\n def __init__(self, d_k, d_v, d_model, n_heads,...
[ [ "torch.rand", "torch.nn.Dropout", "torch.cat", "torch.nn.init.xavier_normal", "torch.nn.Conv1d", "torch.split", "torch.FloatTensor", "torch.bmm", "torch.nn.ReLU", "torch.sum" ] ]
vanderschaarlab/Dynamask
[ "b3b190b2ee79c4ecf6c1302b6a3efe6250f094b8" ]
[ "experiments/rare_time.py" ]
[ "import argparse\nimport os\nimport pickle as pkl\n\nimport numpy as np\nimport torch\nfrom statsmodels.tsa.arima_process import ArmaProcess\n\nfrom attribution.mask_group import MaskGroup\nfrom attribution.perturbation import GaussianBlur\nfrom baselines.explainers import FO, FP, IG, SVS\nfrom utils.losses import ...
[ [ "torch.zeros", "numpy.array", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.tensor", "numpy.random.randint", "numpy.arange" ] ]
shellshock1911/allennlp
[ "79e2cf7b677f84daefaf63acc2a8e3833782de23" ]
[ "allennlp/nn/util.py" ]
[ "\"\"\"\nAssorted utilities for working with neural networks in AllenNLP.\n\"\"\"\n# pylint: disable=too-many-lines\nfrom collections import defaultdict\nfrom typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar\nimport logging\nimport copy\nimport math\n\nimport torch\n\nfrom allennlp.common.checks im...
[ [ "torch.zeros", "torch.cos", "torch.cat", "torch.stack", "torch.arange", "torch.max", "torch.gather", "torch.nn.utils.rnn.pad_sequence", "torch.sin", "torch.cuda.LongTensor", "torch.nn.functional.log_softmax", "torch.nn.functional.softmax", "torch.zeros_like", ...
sixteni/keras-frcnn
[ "81bc15df9ae329a4baf24c19eb7b18b5ddec77d2" ]
[ "measure_map.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport sys\nimport pickle\nfrom optparse import OptionParser\nimport time\nfrom keras_frcnn import config\nimport keras_frcnn.resnet as nn\nfrom keras import backend as K\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras_frcnn import roi_helpers\...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.random.randint", "numpy.transpose", "numpy.argsort", "sklearn.metrics.average_precision_score", "numpy.argmax", "numpy.expand_dims" ] ]
galaxy-fangfang/deconv.pytorch
[ "1415638d39c380d6d4567735965e87416b31f73b" ]
[ "lib/model/rpn/anchor_target_layer_deconv.py" ]
[ "# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\n# -------------------------------------------...
[ [ "torch.nonzero", "numpy.array", "torch.arange", "torch.max", "torch.Tensor", "torch.sum" ] ]
rsyamil/latent-space-data-assimilation-lsda
[ "85702a6b76d8c5d055724fbff6b505d171499c15" ]
[ "2d-fluvial/util.py" ]
[ "import matplotlib.gridspec as gridspec\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom matplotlib.colors import Normalize\nimport numpy as np\n\nimport keras\nfrom IPython.display import clear_output\nimport matplotlib as mpl\n\n#plot function for sample images\ndef plot_tile(samples):\n \n ...
[ [ "numpy.min", "numpy.max", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.subplots", "numpy.sqrt", "matplotlib.pyplot.axis", "numpy.expand_dims", "matplotlib.pyplot.subplot", "numpy.array", "matplotlib.cm.get_cmap", "matplotlib.pyplot.figure", "matplotlib.pyplot.sh...
ElliottYan/self-att
[ "a35e80fbff075460a355694e9bde8dc62bb545ea" ]
[ "fairseq/data/noising.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport torch\nimport n...
[ [ "numpy.array", "numpy.random.rand", "torch.from_numpy", "torch.LongTensor", "torch.t", "numpy.transpose", "numpy.append", "numpy.arange" ] ]
deneb2016/WSDDN.pytorch
[ "8b7e8dd8c8b1f20af03863e571bef9e7dfc26565" ]
[ "utils/box_utils.py" ]
[ "# --------------------------------------------------------\n# PyTorch WSDDN\n# Copyright 2018. Seungkwan Lee\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Seungkwan Lee\n# Some parts of this implementation are based on code from Ross Girshick, Jiasen Lu, and Jianwei Yang\n# ------------...
[ [ "torch.stack", "torch.min", "torch.max", "torch.clamp", "torch.exp" ] ]