repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ecly/ai_experiments
[ "94b5b063345761cd1668132610ddc59749b84a47" ]
[ "dql_course/exercises/random_policy.py" ]
[ "import gym\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef main():\n env = gym.make(\"FrozenLake-v1\")\n env.reset()\n running_win_perc = []\n scores = []\n for i in range(1000):\n score = 0\n while True:\n action = env.action_space.sample()\n _observa...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.mean" ] ]
scottwedge/spyder
[ "e1afd4c78a4572a0ac1992dc2d134dfaf4b4d804" ]
[ "spyder/widgets/collectionseditor.py" ]
[ "# -*- coding: utf-8 -*-\r\n# -----------------------------------------------------------------------------\r\n# Copyright © Spyder Project Contributors\r\n#\r\n# Licensed under the terms of the MIT License\r\n# (see spyder/__init__.py for details)\r\n# --------------------------------------------------------------...
[ [ "numpy.int8", "numpy.float16", "numpy.random.rand", "pandas.Timestamp", "numpy.int16", "pandas.Timedelta", "pandas.DataFrame", "numpy.save", "numpy.random.randint", "numpy.bool", "numpy.int32", "matplotlib.use", "numpy.array", "numpy.zeros", "numpy.compl...
tsyet12/ClassCode
[ "db1db97f71a6f31769d58739c6687863bc6b88c4" ]
[ "ClassCode/P7/create_ndarray.py" ]
[ "import numpy as np\n\nx_zero= np.zeros((2,3))\n\nprint(x_zero)\n\nx_arange=np.arange(100)\n\nprint(x_arange)\n\n\nx_linspace=np.linspace(1,10,100)\nprint(x_linspace)\n\nx_indices=np.indices((5,5))\nprint(x_indices)\n\n\n" ]
[ [ "numpy.indices", "numpy.linspace", "numpy.arange", "numpy.zeros" ] ]
Ceciliawangwang/image_segmentation_deeplabv3
[ "32b2c9a272a903023d78ebc3a2523147522346b4" ]
[ "predict.py" ]
[ "from torch.utils.data import dataset\nfrom tqdm import tqdm\nimport network\nimport utils\nimport os\nimport random\nimport argparse\nimport numpy as np\nimport time\n\nfrom torch.utils import data\nfrom datasets import VOCSegmentation, Cityscapes, cityscapes\nfrom torchvision import transforms as T\nfrom metrics ...
[ [ "torch.device", "torch.no_grad", "torch.cuda.is_available", "torch.nn.DataParallel" ] ]
deka1105/Playbooks
[ "c1f2157681ca5371688ff8a457f097962f81beff" ]
[ "adjMatrix.py" ]
[ "import pandas as pd\nallCol = ['0A','1B','2C','3D','4E','5F','6G','7H','8I','9J','10K','12L','12M','13N']\nsol = {\n 0:[11,],\n 1:[2,6,7,8,9,10,11],\n 3:[6,7,8,9,10,11],\n 4:[4,], 5:[11,], 7:[6,9],\n 10:[11,], 12:[2,9,10,11]}\nadj_matrix = pd.DataFrame()\nadj_matrix['Row Names'] = allCol\ndef create...
[ [ "pandas.DataFrame" ] ]
hlzhang109/TransTEE
[ "00e6977147a6dcb3e83f1fe70cd1f4cbef7321a4", "00e6977147a6dcb3e83f1fe70cd1f4cbef7321a4" ]
[ "Structured/models/building_blocks/transformers.py", "Structured/models/cat.py" ]
[ "import copy\nfrom typing import Optional, Any\nimport numpy as np\nimport torch\nfrom torch import Tensor, nn\nfrom torch.nn.parameter import Parameter\nimport torch.nn.functional as F\nfrom torch.nn.modules.module import Module\nfrom torch.nn.modules.container import ModuleList\nfrom torch.nn.modules.batchnorm im...
[ [ "torch.nn.modules.linear.Linear", "torch.nn.Linear", "torch.nn.init.constant_", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.modules.batchnorm.BatchNorm1d", "torch.nn.init.xavier_uniform_", "torch.ones", "torch.nn.ReLU", "torch.nn.functional.multi_head_attention_forward",...
acvander/kaggle_real_or_not
[ "737d949b1f8446e734ed5113b84b5b199a7aee3c" ]
[ "nets/components/bidir_text_net.py" ]
[ "from typing import Dict\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import layers\n\n\ndef _add_multiple_lstms(input_layer, num_lstms: int, size: int):\n lstm_layers = []\n # initial layer\n lstm_layers.append(\n layers.Bidirectional(layers.LSTM(size,\n ...
[ [ "numpy.array", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.concatenate" ] ]
BioShock38/Parser
[ "ef1a2503a36e66148effe88bad6c178c8dc8d5a2" ]
[ "python-package/polymnie/vcf.py" ]
[ "import numpy as np\n\nimport vcfnp\n\ndef vcf2snp(filename, missing=3, cache=True):\n \"\"\"\n Return a SNP matrix based on a VCF file.\n\n This take a VCF file and create a SNP matrix. It will keep only the SNP with 2\n variants. This function is based on the vcfnp package.\n\n :param filename: The...
[ [ "numpy.sum", "numpy.logical_and.reduce", "numpy.logical_and" ] ]
christsa/hide-rl
[ "47dc3dfd93b817831473c07137a6a6e7f2eda549" ]
[ "vpn_critic.py" ]
[ "from torch.nn import functional as F\nfrom torch import nn\nimport torch\nimport numpy as np\nfrom utils import layer\nfrom radam import RAdam\nfrom vpn import MVProp\nimport utils\nfrom torch_critic import Critic as ClassicCritic\n\nclass CriticModel(nn.Module):\n def __init__(self, env, layer_number, FLAGS):\...
[ [ "torch.mul", "torch.min", "numpy.log", "torch.max", "torch.no_grad", "torch.clamp", "torch.abs", "torch.ones_like", "torch.mean" ] ]
mostlyuseful/devernaysubpix
[ "cfd0bfe3308e70a66d758988259bb2f176bea12b" ]
[ "devernaysubpix/edge_detector.py" ]
[ "import numpy as np\nfrom scipy.ndimage import filters\nfrom bidict import bidict\n\n\ndef image_gradient(image, sigma):\n image = np.asfarray(image)\n gx = filters.gaussian_filter(image, sigma, order=[0, 1])\n gy = filters.gaussian_filter(image, sigma, order=[1, 0])\n return gx, gy\n\n\nclass CurvePoin...
[ [ "numpy.asfarray", "numpy.asarray", "numpy.zeros", "scipy.ndimage.filters.gaussian_filter", "numpy.subtract", "numpy.hypot", "numpy.asanyarray" ] ]
XpressAI/frovedis
[ "bda0f2c688fb832671c5b542dd8df1c9657642ff" ]
[ "src/foreign_if/python/UT/src/eigen/test_015.py" ]
[ "#!/usr/bin/env python\n\nimport sys\nimport numpy as np\nfrom frovedis.exrpc.server import FrovedisServer\nfrom frovedis.linalg import eigsh\n\ndesc = \"Testing eigsh() for which = 'LM': \"\n\n# initializing the Frovedis server\nargvs = sys.argv\nargc = len(argvs)\nif argc < 2:\n print ('Please give frovedis_se...
[ [ "numpy.asarray" ] ]
xfdywy/fairseq
[ "a914bb46c9ba4cca8eb9d32bef2a1ae770954d97" ]
[ "fairseq/models/transformer.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 math\n\nimport ...
[ [ "torch.nn.Linear", "torch.nn.LayerNorm", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.nn.init.normal_", "torch.nn.functional.linear", "torch.Tensor", "torch.nn.Embedding" ...
NickKaparinos/OpenAI-Gym-Projects
[ "84d02d3b268bbc6017f98c0948c603cfd416f5c2" ]
[ "MuJoCo/Walker2d/utilities.py" ]
[ "\"\"\"\nOpen AI Gym Walker2d-v2\nNick Kaparinos\n2021\n\"\"\"\n\nimport time\nimport warnings\nfrom os import listdir, makedirs\nfrom typing import Any, Dict, Optional\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport torch\nfrom stable_baselines...
[ [ "numpy.array", "numpy.isclose", "numpy.ones_like", "pandas.DataFrame", "torch.no_grad", "matplotlib.pyplot.figure", "numpy.any", "numpy.where", "numpy.arange", "pandas.concat", "pandas.read_csv", "tensorflow.python.summary.summary_iterator.summary_iterator" ] ]
ibanmarco/aws-data-wrangler
[ "e99937296075c671e5f8a0998b430879c808687d" ]
[ "tests/test_athena_csv.py" ]
[ "import logging\nimport time\n\nimport boto3\nimport pandas as pd\nimport pytest\n\nimport awswrangler as wr\n\nfrom ._utils import ensure_data_types_csv, get_df_csv\n\nlogging.getLogger(\"awswrangler\").setLevel(logging.DEBUG)\n\n\n@pytest.mark.parametrize(\"use_threads\", [True, False])\n@pytest.mark.parametrize(...
[ [ "pandas.DataFrame" ] ]
miaoliu/pymatgen
[ "fe3c48ce3334924e6693f857aebc64b9714d1af2" ]
[ "pymatgen/optimization/linear_assignment.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nThis module contains an algorithm to solve the Linear Assignment Problem\n\"\"\"\n\nfrom __future__ import division\n\n__author__ = \"Will Richards\"\n__copyright__ = \"Copyright 2011, The Materials Project\"\n__version__ = \"1.0\"\n__maintainer__ = \"Will Richards\"\n__email__ = \...
[ [ "numpy.max", "numpy.array", "numpy.argmin", "numpy.zeros", "numpy.min", "numpy.where", "numpy.allclose", "numpy.argmax", "numpy.argwhere", "numpy.diag" ] ]
petehellyer/BayesianOptimization
[ "b79d5f174b930e94d12a480e936f2029d9468ca7" ]
[ "examples/sklearn_example.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\n\nfrom sklearn.datasets import make_classification\nfrom sklearn.cross_validation import cross_val_score\nfrom sklearn.ensemble import RandomForestClassifier as RFC\nfrom sklearn.svm import SVC\n\nfrom bayes_opt import BayesianOptimization\n\n...
[ [ "sklearn.svm.SVC", "sklearn.datasets.make_classification" ] ]
boricles/scikit-learn
[ "896d4fad106c8f1d745923d544b44a0707103aa2" ]
[ "sklearn/utils/estimator_checks.py" ]
[ "import types\nimport warnings\nimport sys\nimport traceback\nimport pickle\nimport re\nfrom copy import deepcopy\nfrom functools import partial, wraps\nfrom inspect import signature\n\nimport numpy as np\nfrom scipy import sparse\nfrom scipy.stats import rankdata\nimport joblib\n\nfrom . import IS_PYPY\nfrom .. im...
[ [ "numpy.mean", "numpy.where", "numpy.finfo", "numpy.sort", "scipy.stats.rankdata", "numpy.issubdtype", "numpy.dtype", "numpy.full", "numpy.empty", "numpy.log", "pandas.DataFrame", "numpy.core.numerictypes.allTypes.values", "numpy.take", "numpy.arange", "n...
pavanvidem/galaxytools
[ "339363f6c9d817bc2c35997b4dfdd3ca99a37055" ]
[ "chemicaltoolbox/mordred/mordred_descriptors.py" ]
[ "import argparse\n\nimport numpy as np\nfrom mordred import Calculator, descriptors\nfrom rdkit import Chem\nfrom rdkit.Chem.rdmolfiles import SDMolSupplier\n\n\ndef convert_errors_to_nan(el):\n \"\"\"\n Remove elements from the Mordred dataframe which are not\n in float or int format\n \"\"\"\n if t...
[ [ "numpy.array" ] ]
AaltoML/t-SVGP
[ "bfa6119ad071ca191d7a413e09b33811c18be533" ]
[ "src/models/tsvgp_sites.py" ]
[ "\"\"\"\nModule for the t-SVGP models with individual sites per data point.\n\"\"\"\nfrom typing import Optional\n\nimport numpy as np\nimport tensorflow as tf\nfrom gpflow import default_jitter, kullback_leiblers\nfrom gpflow.conditionals import conditional\nfrom gpflow.covariances import Kuf, Kuu\nfrom gpflow.mod...
[ [ "tensorflow.shape", "tensorflow.GradientTape", "numpy.zeros", "tensorflow.ones_like", "numpy.ones", "tensorflow.reduce_sum", "tensorflow.cast" ] ]
lene/haeqs_ml
[ "572a69e6e93f262a1708d6c72ac64bec4af6f791" ]
[ "tests/util.py" ]
[ "from data_sets.images_labels_data_set import DataSetBase\nfrom data_sets.data_sets import DataSets\n\nimport numpy\n\n__author__ = 'Lene Preuss <lene.preuss@gmail.com>'\n\nMINIMAL_INPUT_SIZE = 2\nMINIMAL_LAYER_GEOMETRY = (2, 2)\nMINIMAL_OUTPUT_SIZE = 2\nMINIMAL_BATCH_SIZE = 2\n\n\ndef create_minimal_input_placehol...
[ [ "numpy.dtype" ] ]
farhad200013/machine_learning
[ "9ce27650f677246783e04299b1565d6f2106c3e6" ]
[ "exer1/task4.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 12 15:25:14 2017\n\n@author: aliTakin\n\"\"\"\n\n# this is task 4 \n\nfrom scipy.io import loadmat\nimport matplotlib.pyplot as plt\nimport numpy as np\n \nmat = loadmat(r\"C:\\Users\\aliTakin\\Desktop\\4.92\\sgn_41007\\twoClassData.mat\")\n\nprint(mat.keys()) # ...
[ [ "scipy.io.loadmat", "matplotlib.pyplot.plot", "numpy.mean", "numpy.std", "matplotlib.pyplot.show" ] ]
admixVIE/sstar
[ "58db7647612cd6801a3570681e1f5a240d9c7050" ]
[ "sstar/cal_pvalue.py" ]
[ "# Apache License Version 2.0\n# Copyright 2022 Xin Huang\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 b...
[ [ "numpy.equal", "numpy.array", "numpy.sum", "numpy.where", "numpy.in1d", "pandas.read_csv" ] ]
dvaidhyn/PyDSS
[ "0d220d00900da4945e2ab6e7774de5edb58b36a9" ]
[ "PyDSS/pyPlots/Plots/Table.py" ]
[ "from PyDSS.pyPlots.pyPlotAbstract import PlotAbstract\nfrom bokeh.plotting import figure, curdoc\nfrom bokeh.io import output_file\nfrom bokeh.models import ColumnDataSource, ColorBar, \\\n LinearColorMapper, HoverTool, BoxSelectTool, BoxZoomTool, \\\n PanTool, WheelZoomTool, ResetTool, SaveTool, Label\nfro...
[ [ "numpy.arange", "numpy.transpose", "pandas.cut" ] ]
jakec888/tutorials
[ "e0791cff1502df01719fb6cb29e817021c877d0e" ]
[ "beginner_source/transfer_learning_tutorial.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTransfer Learning Tutorial\n==========================\n**Author**: `Sasank Chilamkurthy <https://chsasank.github.io>`_\n\nIn this tutorial, you will learn how to train your network using\ntransfer learning. You can read more about the transfer learning at `cs231n\nnotes <https://c...
[ [ "torch.nn.Linear", "torch.optim.lr_scheduler.StepLR", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "torch.sum", "torch.utils.data.DataLoader", "matplotlib.pyplot.subplot", "numpy.array", "torch.max", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", ...
kshannon/intracranial-hemorrhage-detection
[ "fd65c44c487ab07faaed5d39cc238f70b95891bc" ]
[ "src/train.py" ]
[ "from datetime import datetime\nfrom model import MyDeepModel, create_submission\nfrom data_loader import read_testset, read_trainset, DataGenerator\n\nimport keras as K\n\nfrom sklearn.model_selection import ShuffleSplit\n\n\n# from K_applications.resnet import ResNet50\nfrom keras.applications.inception_v3 import...
[ [ "sklearn.model_selection.ShuffleSplit" ] ]
cyckun/mpyc
[ "ed8546ab20d77b9d612528e82cb1501b85c2b673" ]
[ "demos/cnnmnist_plain.py" ]
[ "\"\"\" Demo Convolutional Neural Network (CNN) MNIST classifier.\n\nThe MNIST dataset of handwritten digits consists of a training set of\n60,000 images of a test set of 10,000 images. The training images have been\nused in the clear to obtain a highly reliable CNN classifier. The demo\nfeeds the classifier with r...
[ [ "numpy.array", "numpy.vectorize" ] ]
souradeepta/Neural-Programmer-Interpreter
[ "98bfbb5bf867834fa772f47c2866e3f683930b03" ]
[ "tasks/addition/eval.py" ]
[ "\"\"\"\neval.py\n\nLoads in an Addition NPI, and starts a REPL for interactive addition.\n\"\"\"\nfrom model.npi import NPI\nfrom tasks.addition.addition import AdditionCore\nfrom tasks.addition.env.config import CONFIG, get_args, PROGRAM_SET, ScratchPad\nimport numpy as np\nimport pickle\nimport tensorflow as tf\...
[ [ "tensorflow.Session", "tensorflow.train.Saver", "numpy.argmax" ] ]
LudovicoL/PaDiM
[ "d60da5218eeed01e6b7f1e386389446b4ebb2300" ]
[ "backbone/CustomDataset.py" ]
[ "import os\nfrom PIL import Image\nfrom scipy.ndimage.filters import gaussian_filter\nimport cv2\nimport shutil # To copy the file\nimport sys\nimport numpy as np\nimport torch\nfrom torchvision import transforms\nfrom torch.utils.data import Dataset\nimport torch.nn.functional as F\nimport torchvision\n\nimp...
[ [ "torch.zeros", "torch.sum", "numpy.uint8", "numpy.floor" ] ]
AIKICo/Steganalysis-By-Frame
[ "c2e1a20664056eb723c694949119a26f7fb6cfbc" ]
[ "MLP.py" ]
[ "import csv\nimport numpy as np\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.metrics.classification import accuracy_score\nfrom sklearn.metrics import classification_report\nfrom sklearn.metrics import roc_curve\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import roc_auc_score\n\n\ndef ...
[ [ "numpy.array", "numpy.asarray", "numpy.random.seed", "numpy.random.permutation", "sklearn.neural_network.MLPClassifier", "sklearn.metrics.classification_report", "sklearn.metrics.classification.accuracy_score" ] ]
shelpuk/AWS_simulator_for_reinforcement_learning
[ "7d43c22be8a89379b9f882f060502410f9bac9dc" ]
[ "simulator/interfaceSimulator.py" ]
[ "import json\nimport csv\nimport random\nimport os\nimport re\nimport numpy as np\nimport gc\nimport copy\n\nclass server(object):\n def __init__(self,\n startTime,\n setupTime,\n requestCanHandle = 50,\n failureProbability = 0.,\n t...
[ [ "numpy.random.uniform", "numpy.mean", "numpy.floor" ] ]
bbrzycki/setigen_development
[ "37e2c83e70ec8b693be08ecc3957a9a735b2ce5a" ]
[ "raw_voltage_dev/gen_snr_actual_5min.py" ]
[ "import numpy as np\nimport blimpy as bl\nimport pandas as pd\nfrom astropy import units as u\n\ntry:\n import cupy as xp\nexcept ImportError:\n import numpy as xp\n \n\nimport sys, os, glob, errno\nimport csv\nimport json\nimport h5py\nimport time\nfrom astropy.stats import sigma_clip\n\n\nfrom scipy.sign...
[ [ "numpy.sinc", "numpy.log10", "numpy.sqrt" ] ]
h2rlet/transformers
[ "6f8a01a2ad709aca8e385108e7f946577c1df6bc" ]
[ "src/transformers/modeling_bert.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, 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...
[ [ "torch.nn.Linear", "torch.cat", "torch.ones", "torch.nn.CrossEntropyLoss", "torch.nn.Softmax", "tensorflow.train.list_variables", "numpy.transpose", "torch.tensor", "torch.zeros", "torch.nn.functional.softplus", "tensorflow.train.load_variable", "torch.nn.Tanh", ...
yellowshippo/femio
[ "dde277136a8a1b2513afa85ae2fb8707858aa04a" ]
[ "femio/formats/ucd/write_ucd.py" ]
[ "\nimport numpy as np\nimport pandas as pd\n\n\nclass UCDWriter():\n\n def __init__(self, fem_data):\n self.fem_data = fem_data\n\n def write(self, file_name=None, *, overwrite=False):\n \"\"\"Write FEM data in inp format.\n\n Args:\n fem_data: FEMData object to be output.\n ...
[ [ "numpy.array", "numpy.reshape", "pandas.DataFrame", "numpy.sum", "numpy.ones", "numpy.ravel", "numpy.dtype" ] ]
adityakuppa26/issue_163_documentation
[ "b040d9b12fadda64c0feba9e229c80a0e6bd4599" ]
[ "tests/test_tables.py" ]
[ "import doctest\nimport re\nimport pytest\nimport warnings\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nfrom datascience import *\nimport pandas as pd\n\n\n#########\n# Utils #\n#########\n\n\n@pytest.fixture(scope='function')\ndef table():\n \"\"\"Setup Scrabble table\"\"\"\n return Tab...
[ [ "numpy.array", "numpy.ones", "numpy.float64", "numpy.allclose", "numpy.arange" ] ]
jc-bao/off-policy
[ "15c44f126e506b3f455c60dddd424d2290dddf8d" ]
[ "offpolicy/envs/mpe/scenarios/formation.py" ]
[ "import numpy as np\nfrom offpolicy.envs.mpe.core import World, Agent, Landmark\nfrom offpolicy.envs.mpe.scenario import BaseScenario\nfrom scipy.spatial.distance import directed_hausdorff\n\n\nclass Scenario(BaseScenario):\n def make_world(self, args):\n world = World()\n world.world_length = args...
[ [ "numpy.concatenate", "numpy.square", "scipy.spatial.distance.directed_hausdorff", "numpy.zeros", "numpy.mean", "numpy.random.uniform" ] ]
Dokholyan/catalyst
[ "de8e681676d76741fdb722d4cd77274ba616915d" ]
[ "catalyst/runners/runner.py" ]
[ "from typing import Any, Dict, Generator, Iterable, List, Mapping, Union\nfrom collections import OrderedDict\nimport os\n\nimport torch\nfrom torch import nn, optim\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.data import DataLoader\n\nfrom catalyst.callbacks.batch_overfit import Batch...
[ [ "torch.no_grad" ] ]
dyf/nnxt
[ "caa28635ec6a804bcad545abdd667749cab52048" ]
[ "hm_classifier_prep.py" ]
[ "import pandas as pd\nimport numpy as np\n\nreads = pd.read_csv('classifier_all_reads.csv')\n\nreads = reads.pivot_table(index='sample_id', columns='human_gene_symbol', values='CPM Reads', aggfunc=np.mean, fill_value=0.0)\n\nreads.to_hdf('all_reads_matrix.h5', key='matrix')" ]
[ [ "pandas.read_csv" ] ]
JRF-2018/simbd
[ "7a453562331cf5b41187a8c69e18ec3378004dc1", "7a453562331cf5b41187a8c69e18ec3378004dc1" ]
[ "simbdp3/domination.py", "simbdp2/init.py" ]
[ "#!/usr/bin/python3\r\n__version__ = '0.0.11' # Time-stamp: <2021-10-26T08:05:38Z>\r\n## Language: Japanese/UTF-8\r\n\r\n\"\"\"Simulation Buddhism Prototype No.3 - Domination\r\n\r\n支配関連\r\n\"\"\"\r\n\r\n##\r\n## Author:\r\n##\r\n## JRF ( http://jrf.cocolog-nifty.com/statuses/ (in Japanese))\r\n##\r\n## License:\...
[ [ "numpy.random.beta", "numpy.mean" ], [ "numpy.random.geometric" ] ]
woutdenolf/spectrocrunch
[ "fde4b6e0f462f464ce7af6a942b355d3d8f39f77" ]
[ "spectrocrunch/sources/tests/test_polarization.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport unittest\nimport cmath\nimport numpy as np\nfrom scipy import integrate\n\nfrom .. import polarization\nfrom ...utils import instance\nfrom ...patch import jsonpickle\n\n\nclass test_polarization(unittest.TestCase):\n def _equal_params(self, params1, params2):\n for k, v...
[ [ "numpy.testing.assert_allclose", "numpy.sin", "numpy.degrees", "numpy.random.uniform", "scipy.integrate.dblquad" ] ]
pascal-pfeiffer/kaggle-birdclef2021-2nd-place
[ "fe3862d15a619184d58d5180b90181228687556d" ]
[ "models/ps_model_3_inf2.py" ]
[ "import timm\nfrom torch import nn\nimport torch\nimport torchaudio as ta\nfrom torch.cuda.amp import autocast\nfrom model_utils import GeM, Mixup\n\n\nclass Net(nn.Module):\n def __init__(self, cfg):\n super(Net, self).__init__()\n\n self.cfg = cfg\n\n self.n_classes = cfg.n_classes\n\n ...
[ [ "torch.nn.Linear", "torch.stack", "torch.cuda.amp.autocast", "torch.nn.Sequential", "torch.nn.BCEWithLogitsLoss", "torch.load", "torch.mean" ] ]
serizba/multi-obj-baselines
[ "b5c97b8009ed32f0eb9a08454cf0d4c6620a2286" ]
[ "baselines/problems/hw_nas_bench.py" ]
[ "\nfrom baselines.problems.nas_bench_201 import NasBench201NPY\nfrom ax.core import search_space\nfrom baselines.problems.nas_bench_search_space import NASSearchSpace\nimport torch\nimport numpy as np\nimport time\n#from nas_201_api import NASBench201API as API\nimport sys\n\n\nfrom ax import Metric\nfrom ax.core.s...
[ [ "numpy.ravel_multi_index" ] ]
2021rahul/Restricted_Boltzmann_Machine
[ "a37b4d83caf8b50793ff13c972a503c5cfb29a79" ]
[ "Python_Code/RBM.py" ]
[ "from __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport sys\nfrom .util import tf_xavier_init\n\n\nclass RBM:\n\n def __init__(self, n_visible, n_hidden, learning_rate=0.01, momentum=0.95, xavier_const=1.0, err_function='mse', use_tqdm=False, tqdm=None):\n if not 0.0 ...
[ [ "tensorflow.zeros", "tensorflow.acos", "numpy.zeros", "tensorflow.Session", "tensorflow.train.Saver", "numpy.random.shuffle", "tensorflow.mul", "tensorflow.constant", "tensorflow.placeholder", "numpy.arange", "numpy.hstack", "tensorflow.global_variables_initializer"...
nypzxy/detection_transformer
[ "5ac3c6249cebea6173ad52727cf1656af2e2e633" ]
[ "models/transformer.py" ]
[ "\"\"\"\nDETR Transformer class.\n\nCopy-paste from torch.nn.Transformer with modifications:\n * positional encodings are passed in MHattention\n * extra LN at the end of encoder is removed\n * decoder returns a stack of activations from all decoding layers\n\"\"\"\nimport copy\nfrom typing import Optional...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.stack", "torch.nn.init.xavier_uniform_", "torch.nn.MultiheadAttention", "torch.zeros_like" ] ]
Yixuan-Lee/yixuan-lee.github.io
[ "139dd141544302ca1802a6104f7db7aeb1ace825" ]
[ "assets/2020-08-31-simple_encoder_decoder/code/encoder_decoder_bahdanau_attention/Decoder.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass Decoder(nn.Module):\n \"\"\"A conditional RNN decoder with attention.\"\"\"\n\n def __init__(self, emb_size, hidden_size, attention, num_layers=1,\n dropout=0.5,\n bridge=True):\n super(Decoder, self).__init__()\n\n self.hidden_...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.GRU" ] ]
probprog/pyprob
[ "0713ff6d25e5db475a5b97d8d5e87bf70e977599" ]
[ "tests/test_nn.py" ]
[ "import unittest\nimport torch\n\nimport pyprob\nfrom pyprob import util\nfrom pyprob.nn import EmbeddingFeedForward, EmbeddingCNN2D5C, EmbeddingCNN3D5C\n\n\nclass NNTestCase(unittest.TestCase):\n def test_nn_EmbeddingFeedForward(self):\n batch_size = 32\n input_shape = [100, 100]\n output_s...
[ [ "torch.zeros", "torch.Size" ] ]
forkbabu/automatic-video-colorization
[ "e301d95fe84c8736abd4c7e47bd6169b1a6122ab" ]
[ "test_div_video.py" ]
[ "#tensorflow 1.2.0 is needed\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os,time,scipy.io\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\nimport utils as utils\nimport imageio \nimport subprocess\nimpor...
[ [ "tensorflow.contrib.slim.max_pool2d", "numpy.minimum", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.train.get_checkpoint_state", "tensorflow.tile", "tensorflow.global_variables_initializer", "numpy.concatenate", "tensorflow.trainable_variables", "tensorflow.shape...
ThinkSono/pytorch_flownet2
[ "d524a8e957517c8a59e796330481b0204c265622" ]
[ "FlowNet2_src/models/flownet2.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.init as nn_init\n\nfrom .components import FlowNetC, FlowNetS, FlowNetSD, FlowNetFusion\n# (Yuliang) Change directory structure\nfrom .components import tofp16, tofp32, save_grad\nfrom .components import ChannelNorm, Resample2d\n\n\nclass FlowNet2(nn.Module):\n\...
[ [ "torch.nn.Upsample", "torch.cat", "torch.nn.init.uniform", "torch.nn.init.xavier_uniform" ] ]
tkanngiesser/deltaframe
[ "3311bef620a4142a6557eea16594926fa95f7ef6" ]
[ "deltaframe/core.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).\n\n__all__ = ['get_added', 'get_deleted', 'get_modified', 'get_delta', 'log_delta', 'build_latest']\n\n# Cell\nimport pandas as pd\nimport numpy as np\n\n# Cell\ndef get_added(df_old, df_new, unique_id, trans_col=\"transaction\...
[ [ "pandas.merge" ] ]
zhaottcrystal/bnpy
[ "0195a0228e9e698799e52a6dfa1d051e82b43fd0" ]
[ "bnpy/viz/ProposalViz.py" ]
[ "import numpy as np\nimport os\nimport sys\nimport glob\n\nfrom birthmove import BLogger\nfrom viz.PlotUtil import pylab\n\nCELL_WIDTH = 200\nSQIMG_WIDTH = 200\nWIDEIMG_WIDTH = 600\nhtmlstart = \"\"\"\n <html>\n <style>\n td.comment {\n border: 0px;\n width: %dpx;\n text-align: center;...
[ [ "numpy.zeros_like", "numpy.arange", "numpy.asarray", "numpy.maximum" ] ]
gizemsogancioglu/elderly-emotion-SC
[ "b8f371e0df6e4aa8b680d59995cd18d52f591466" ]
[ "valence/scripts/feature_extraction/tfidf_extractor.py" ]
[ "from sklearn.feature_extraction.text import TfidfVectorizer\nimport pandas as pd\nimport nltk\nfrom nltk.stem.porter import PorterStemmer\nnltk.download('punkt')\n\ndef set_vectorizer(text_f):\n vectorizer = get_tfidf_vector(text_f)\n return vectorizer\n\ndef get_tfidf_vector(X_all):\n vectorizer = TfidfV...
[ [ "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
naivete5656/BFP
[ "74c5604a9ba4eaa3ec3e2c76ef5e1282d7d10f18" ]
[ "guided_model/guided_parts.py" ]
[ "import torch\nfrom torch.autograd import Function\nimport numpy as np\n\n\nclass GuidedBackpropReLU(Function):\n @staticmethod\n def forward(ctx, input):\n positive_mask = (input > 0).type_as(input)\n output = torch.addcmul(\n torch.zeros(input.size()).type_as(input), input, positive...
[ [ "numpy.load", "torch.load" ] ]
prashantlv/mltoolkit
[ "acc192bafc66b7661d541ef4f604b5e5ab7df5ca" ]
[ "mldp/tests/transformers/test_chunk_sorter.py" ]
[ "import unittest\nfrom mldp.steps.transformers.general import ChunkSorter\nfrom mldp.utils.tools import DataChunk\nimport numpy as np\n\n\nclass TestChunkSorter(unittest.TestCase):\n def setUp(self):\n self.ints_fn = \"ints\"\n self.strings_fn = \"strings\"\n self.floats_fn = \"floats\"\n\n ...
[ [ "numpy.array" ] ]
cw-jang/adv_finance
[ "240ce03e53fc6eead469a1ce7a220510a78c437e", "240ce03e53fc6eead469a1ce7a220510a78c437e" ]
[ "examples/Ch02/ex_triple_barrier.py", "adv_finance/sampling/co_events.py" ]
[ "import pandas as pd\nimport numpy as np\n\nfrom datetime import datetime\nfrom adv_finance import stats, labeling\n\n\nif __name__ == \"__main__\":\n print(\"main started\")\n\n df = pd.read_csv(\"..\\\\TRADE_A233740_2019_DV.csv\")\n df.timestamp = df.timestamp.apply(lambda x: datetime.strptime(x, '%Y-%m-...
[ [ "pandas.read_csv" ], [ "pandas.Series" ] ]
kevin-xuan/Traffic-Benchmark
[ "b9f8e40b4df9b58f5ad88432dc070cbbbcdc0228", "b9f8e40b4df9b58f5ad88432dc070cbbbcdc0228" ]
[ "methods/GMAN/METR/model.py", "methods/STGCN/model/pytorch/utils.py" ]
[ "import tf_utils\n# import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior() \n\ndef placeholder(P, Q, N):\n X = tf.placeholder(\n shape = (None, P, N), dtype = tf.float32, name = 'X')\n TE = tf.placeholder(\n shape = (None, P + Q, 2), dtype = tf.int32, name = 'TE')\n...
[ [ "tensorflow.compat.v1.transpose", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.tile", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.ones", "tensorflow.compat.v1.linalg.LinearOperatorLowerTriangular", "tensorflow.compat.v1.pl...
BhasherBEL/ComposIm
[ "719424862bb92682b9d5c3ff22aa92f4c0b1f28f" ]
[ "model/Gradients.py" ]
[ "#!/usr/local/bin/python\n# coding: utf-8\n\nimport numpy as np\nimport operator\nfrom PIL import Image\nimport scipy\nimport scipy.cluster\nimport random\n\ncolors = {'black': np.array([0, 0, 0]),\n 'white': np.array([255, 255, 255]),\n 'red': np.array([255, 0, 0]),\n 'green': np.array([...
[ [ "numpy.array", "numpy.asarray", "scipy.cluster.vq.kmeans", "scipy.product", "scipy.argmax", "scipy.cluster.vq.vq", "numpy.abs" ] ]
pawelgalka/AGH_Operational_Research
[ "f1962f1bf93099b4ded734533a297c92e4f28283" ]
[ "lab7/l7z1.py" ]
[ "#Zadanie 1 Paweł Gałka\nfrom scipy.optimize import linprog\nimport numpy as np\nnp.set_printoptions(precision=3)\n\n#f(x) = 2*x_1 + x_2 + 3*x_3 -> max więc -f(x) -> min\n# A*x <= b\n\ngoal_function_coeff = [-2,-1,-3]\nconstraints_matrix = [[1,1,1],[-1,-1,-1],[-1,-2,-1],[0,2,1]]\nconstraints_values = [30, -30,-10,2...
[ [ "numpy.set_printoptions", "scipy.optimize.linprog" ] ]
ssbuild/Multi-Label-Text-Classification
[ "65c67e7a3b69cc3f015c7c3822cbb89ae887c6fb" ]
[ "FastText/train_fast.py" ]
[ "# -*- coding:utf-8 -*-\n__author__ = 'Randolph'\n\nimport os\nimport sys\nimport time\nimport logging\n\nsys.path.append('../')\nlogging.getLogger('tensorflow').disabled = True\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorboard.plugins import projector\nfrom text_fast import TextFAST\nfrom utils impo...
[ [ "tensorflow.local_variables_initializer", "tensorflow.summary.merge", "tensorflow.train.AdamOptimizer", "tensorflow.train.latest_checkpoint", "numpy.array", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.Session", "tensorflow.train.global_step", "tensorflow.gl...
gourav287/Gender-Emotion-Recognition
[ "d6f19310270fd5d107db333439a0b942c8b41d66" ]
[ "src/utils/data_augmentation.py" ]
[ "import numpy as np\nfrom random import shuffle\nfrom .preprocessor import preprocess_input\nfrom .preprocessor import _imread as imread\nfrom .preprocessor import _imresize as imresize\nfrom .preprocessor import to_categorical\nimport scipy.ndimage as ndi\nimport cv2\n\n\nclass ImageGenerator(object):\n \"\"\" ...
[ [ "numpy.array", "numpy.ones_like", "scipy.ndimage.interpolation.affine_transform", "numpy.asarray", "numpy.rollaxis", "numpy.linalg.eigh", "numpy.random.randn", "numpy.random.uniform", "numpy.stack", "numpy.clip", "numpy.random.random", "numpy.expand_dims" ] ]
MikeFlanigan/CSCI-5922_Final_Proj
[ "9f4b8dc87ac2db46c02ee8a9409aea7deb477021" ]
[ "pose_recorder.py" ]
[ "\nimport numpy as np\nfrom numpy import pi\nfrom math import sin, cos\nimport rospy \nfrom sensor_msgs.msg import LaserScan\nfrom std_msgs.msg import Float32MultiArray\nimport matplotlib.pyplot as plt\nimport tf\nimport time\n\nRunningOdroid = False\n\nnumReadings = 100\nlastScan = [0]*numReadings\n\ndef scan_cb...
[ [ "numpy.concatenate", "numpy.asarray", "numpy.save", "numpy.shape", "numpy.mod" ] ]
anirbansen3027/UdacityOpenSource
[ "c032f610a7861c234e189841f996bff877c94e34" ]
[ "Maria/federated_segmentation_unet_pneumo/model.py" ]
[ "# https://github.com/usuyama/pytorch-unet\n\nimport torch\nfrom torch import nn\n\n\ndef double_conv(in_channels, out_channels):\n return nn.Sequential(\n nn.Conv2d(in_channels, out_channels, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(out_channels, out_channels, 3, padding=1),\n ...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Upsample", "torch.nn.Conv2d" ] ]
balcilar/cnn_graph
[ "9516e7c11d418b7873f9ac232faf678200dfcf7f" ]
[ "lib/graph.py" ]
[ "import sklearn.metrics\nimport sklearn.neighbors\nimport matplotlib.pyplot as plt\nimport scipy.sparse\nimport scipy.sparse.linalg\nimport scipy.spatial.distance\nimport numpy as np\n\n\ndef grid(m, dtype=np.float32):\n \"\"\"Return the embedding of a grid graph.\"\"\"\n M = m**2\n x = np.linspace(0, 1, m...
[ [ "matplotlib.pyplot.xlim", "numpy.exp", "numpy.mean", "numpy.linalg.norm", "numpy.empty", "numpy.linalg.eigh", "numpy.swapaxes", "numpy.random.randint", "numpy.arange", "numpy.sqrt", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.argsort", ...
gulyas/network_games_analysis
[ "2e6bdd2a2275702495af1c18043758193d94377b", "2e6bdd2a2275702495af1c18043758193d94377b" ]
[ "python_scripts/user_scaffold_analysis_mysql.py", "python_scripts/user_scaffold_analysis_mysql_labels.py" ]
[ "\"\"\"\nExamines scaffold hypothesis on a particular user.\nUses data from the MySQL Database.\n\"\"\"\nimport csv\nimport json\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport igraph\n\nPATH = \"D:\\\\network_games\\\\\"\nSAVE_PATH = \"D:\\\\network_games\\\\scaffold\\\\\"\nFILENAME = \"scaffold_data_...
[ [ "numpy.bincount", "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "numpy.percentile", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "numpy.clip...
DSoftse/Pluralsight
[ "44bfb372a52815b7c86c1daefaf74542551c21a0" ]
[ "ai-engineer-deploying-solutions/module-iot/solution/modules/ImageClassifierService/app/predict.py" ]
[ "\nfrom urllib.request import urlopen\n\nimport tensorflow.compat.v1 as tf\n\nfrom PIL import Image\nimport numpy as np\n# import scipy\n# from scipy import misc\nimport sys\nimport os \n\nfilename = 'model.pb'\nlabels_filename = 'labels.txt'\n\nmean_values_b_g_r = (0,0,0)\n\nsize = (256, 256)\noutput_layer = 'los...
[ [ "tensorflow.compat.v1.gfile.FastGFile", "numpy.asarray", "tensorflow.compat.v1.concat", "tensorflow.compat.v1.split", "tensorflow.compat.v1.GraphDef", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.reset_default_graph", "tensorflow.compat.v1.import_graph_def", "numpy.exp...
YisenLiu-Intelligent-Sensing/SSC_AE
[ "9aaed69808cd136cc443d8e7005ca2cf2aecfac4" ]
[ "test.py" ]
[ "\"\"\"\r\n @file test.py\r\n @brief Script for test\r\n @author Yisen Liu\r\n Copyright (C) 2021 Institute of Intelligent Manufacturing, Guangdong Academy of Sciences. All right reserved.\r\n\"\"\"\r\n\r\nimport csv\r\nimport glob\r\nimport os\r\nimport sys\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r...
[ [ "sklearn.metrics.confusion_matrix", "numpy.dot", "numpy.load", "numpy.mean", "numpy.concatenate", "tensorflow.trainable_variables", "numpy.linalg.norm", "tensorflow.train.Saver", "numpy.square", "numpy.array", "numpy.zeros", "tensorflow.Session", "numpy.random.s...
chemshi/chainer
[ "ff322e0a87b0a9e3dc3d49f62ce2f3cb6dc19cc9" ]
[ "chainer/functions/array/resize_images.py" ]
[ "import numpy\n\nfrom chainer import backend\nfrom chainer.backends import cuda\nfrom chainer import function_node\nfrom chainer.utils import type_check\n\n\ndef _infer_lines(B, C, H, W, out_H, out_W, kH, kW):\n target_size = 2 ** 17\n line_size = B * C * (H * W // out_H + kH * kW * out_W)\n target_lines =...
[ [ "numpy.add", "numpy.empty", "numpy.minimum", "numpy.multiply", "numpy.subtract", "numpy.arange", "numpy.einsum" ] ]
NceBoy/mmd_nce
[ "47223e88661701a87413136d572f1a56d05d0f03" ]
[ "mmdet/models/dense_heads/ttf_head.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import normal_init, kaiming_init\nimport numpy as np\n\n\nfrom mmcv.ops import ModulatedDeformConv2dPack as ModulatedDeformConvPack\nfrom mmdet.core import multi_apply, calc_region\nfrom mmcv.runner import force_fp32\nfrom mmdet.mo...
[ [ "torch.nn.functional.sigmoid", "torch.cat", "torch.stack", "torch.nn.ModuleList", "torch.nn.UpsamplingBilinear2d", "torch.nn.Sequential", "torch.max", "torch.no_grad", "torch.arange", "torch.nn.init.constant_", "numpy.exp", "torch.clamp", "torch.nn.ReLU", "n...
farhan3a/3D-HumanPoseEstimation
[ "906b972749371c8fb16cb851e9a069df1cf76053", "906b972749371c8fb16cb851e9a069df1cf76053" ]
[ "GASTNet-pipeline/common/skeleton.py", "GASTNet-pipeline/data/data_utils.py" ]
[ "import numpy as np\n\n\nclass Skeleton:\n def __init__(self, parents, joints_left, joints_right):\n assert len(joints_left) == len(joints_right)\n\n self._parents = parents\n self._joints_left = joints_left\n self._joints_right = joints_right\n\n def num_joints(self):\n ret...
[ [ "numpy.array" ], [ "numpy.array", "numpy.load", "numpy.argmax" ] ]
Aerex/GamestonkTerminal
[ "680e0cd278f0d8e45031cdc9d51f247e9aa90ce1" ]
[ "gamestonk_terminal/cryptocurrency/discovery/pycoingecko_model.py" ]
[ "\"\"\"CoinGecko model\"\"\"\n__docformat__ = \"numpy\"\n\nimport pandas as pd\nfrom pycoingecko import CoinGeckoAPI\nfrom gamestonk_terminal.cryptocurrency.dataframe_helpers import (\n percent_to_float,\n create_df_index,\n wrap_text_in_df,\n)\nfrom gamestonk_terminal.cryptocurrency.pycoingecko_helpers im...
[ [ "pandas.DataFrame" ] ]
abdelq/gym-duckietown
[ "189392eab698b26db5e253b2a7fbe063b6e5e410" ]
[ "gym_duckietown/objects.py" ]
[ "import numpy as np\nfrom .collision import *\n\nimport pyglet\nfrom pyglet.gl import *\n\n\nclass WorldObj:\n def __init__(self, obj, domain_rand, safety_radius_mult):\n \"\"\"\n Initializes the object and its properties\n \"\"\"\n self.process_obj_dict(obj, safety_radius_mult)\n\n ...
[ [ "numpy.random.normal", "numpy.linalg.norm", "numpy.random.choice", "numpy.copy", "numpy.sign", "numpy.random.randint" ] ]
parker84/north-dash
[ "2a726075df46c931715548fb203b3ac909199587" ]
[ "src/data/sql_pipeline/0.8 prices_monthly_snapshot/test_prices_monthly_snapshot.py" ]
[ "import pytest\nfrom settings import ENGINE_PATH\nfrom sqlalchemy import create_engine\nfrom pandas_profiling import ProfileReport\nimport pandas as pd\nimport datetime\nfrom src.utils.testing_suite import TestSuite\nengine = create_engine(ENGINE_PATH)\nconn = engine.connect()\n\nprepped_test_suite = TestSuite(\n ...
[ [ "pandas.read_sql" ] ]
nSamsow/CSNLN
[ "309c7451828c8878b85577ee78d4ecd465c045f0" ]
[ "model/attention.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils import spectral_norm as spectral_norm_fn\nfrom torch.nn.utils import weight_norm as weight_norm_fn\nfrom PIL import Image\nfrom torchvision import transforms\nfrom torchvision import utils as vutils\nfrom model import common\...
[ [ "torch.cat", "torch.nn.functional.conv_transpose2d", "torch.FloatTensor", "torch.nn.functional.interpolate", "torch.split", "torch.nn.PReLU", "torch.nn.functional.softmax", "torch.matmul", "torch.nn.functional.conv2d", "torch.pow" ] ]
yhwang/tf-utility
[ "728f42fa7b3e1b8bbcaf5e9514267f7b8b298e16" ]
[ "import_savedmodel_to_tfb.py" ]
[ "import sys\nimport argparse\nimport tensorflow as tf\n\nfrom tensorflow.python.platform import app\nfrom tensorflow.python.summary import summary\n\ndef import_to_tensorboard(savedmodel_dir, tag, log_dir):\n \"\"\"Load a SavedModel and export it to tensorbloard log dir\n\n Args:\n savedmodel_dir: The location...
[ [ "tensorflow.python.summary.summary.FileWriter", "tensorflow.Graph", "tensorflow.saved_model.loader.load" ] ]
haddomou/COVID-CXNet
[ "1baa9f7b8f4af86aab42dd05e44a3357813662d6" ]
[ "BEASF.py" ]
[ "import numpy as np\nimport copy\n\n\ndef subhist(image_pdf, minimum, maximum, normalize):\n \"\"\"\n Compute the subhistogram between [minimum, maximum] of a given histogram image_pdf\n :param image_pdf: numpy.array\n :param minimum: int\n :param maximum: int\n :param normalize: boolean\n :ret...
[ [ "numpy.histogram", "numpy.zeros", "numpy.exp", "numpy.mean", "numpy.arange", "numpy.int32" ] ]
ryok/deep-symbolic-optimization
[ "9dc2086f5d219fdfab5aaae2485e11b693da4d4a" ]
[ "dso/dso/task/regression/dataset.py" ]
[ "\"\"\"Class for deterministically generating a benchmark dataset from benchmark specifications.\"\"\"\n\nimport os\nimport ast\nimport itertools\nfrom pkg_resources import resource_filename\nimport zlib\n\nimport click\nimport pandas as pd\nimport numpy as np\n\nfrom dso.functions import function_map\n\n\nclass Be...
[ [ "numpy.column_stack", "numpy.random.RandomState", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.hstack", "matplotlib.pyplot.close", "numpy.linspace", "numpy.mean", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
tungnd1705/PC3-pytorch
[ "e1ed5f475da387cb92dd1e3830e7d195562b4b64" ]
[ "ilqr_utils.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nfrom matplotlib.animation import FuncAnimation, writers\n\n\nnp.random.seed(0)\n\n\ndef cost_dz(R_z, z, z_goal):\n # compute the first-order deravative of latent cost w.r.t z\n z_diff = np.expand_dims(z - z_goal, axis=-1)\n return np.squee...
[ [ "matplotlib.animation.FuncAnimation", "torch.eye", "matplotlib.pyplot.subplots", "numpy.eye", "torch.autograd.grad", "numpy.prod", "numpy.linalg.inv", "numpy.vstack", "numpy.expand_dims", "torch.zeros", "numpy.array", "numpy.matmul", "numpy.zeros", "matplotl...
rhambach/TEMimage
[ "436c9d8912db481185d09d9d70c4827c87cbd8a5" ]
[ "AtomPos/tifffile.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# tifffile.py\n#\n# Slightly modified version of original tifffile from Chritoph Gohlke.\n#\n# Copyright (c) 2013, rhambach. \n# This file is part of the FitAtomPos package and released\n# under the MIT-Licence. See LICENCE file for details.\n#\n# Copyright (...
[ [ "numpy.min", "numpy.finfo", "numpy.rec.fromfile", "numpy.cumsum", "numpy.fromstring", "numpy.dtype", "numpy.max", "matplotlib.pyplot.colorbar", "numpy.empty", "numpy.unpackbits", "numpy.take", "numpy.prod", "numpy.swapaxes", "matplotlib.pyplot.gca", "mat...
TheSimoms/hovden-2022-demo
[ "051d98b4fb1b3a6d5a9325d472894183711d4532" ]
[ "cifar100.py" ]
[ "import argparse\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nfrom tensorflow.keras.datasets import cifar100\nfrom tensorflow.keras.models import Sequential, load_model\nfrom tensorflow.keras.layers import Dense, Flatten, Dropout, Conv2D, MaxPooling2D, Activation\nfrom tensorflow.ker...
[ [ "tensorflow.keras.utils.to_categorical", "numpy.asarray", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Activation", "matplotlib.pyplot.subplots", "tensorflow.keras.datasets.cifar100.load_data", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.models.load_model", ...
duytq99/traffic-signs-detection
[ "99bae2fb76dee4f783d9bd2e8cfd9f11084a2c3c" ]
[ "src/hog_svm/hog.py" ]
[ "import cv2\nimport time\nimport argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport PIL.Image as Image\nfrom skimage.feature import hog\nfrom skimage.draw import draw\n\ndef _hog_normalize_block(block, method, eps=1e-5):\n\tif method == 'L1':\n\t\tout = block / (np.sum(np.abs(block)) + eps)\n\tel...
[ [ "numpy.histogram", "numpy.sin", "numpy.zeros", "numpy.minimum", "matplotlib.pyplot.savefig", "numpy.sum", "matplotlib.pyplot.subplots", "numpy.diff", "numpy.stack", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "numpy.arctan2", "numpy.cos",...
e-koch/VLA_Lband
[ "8fca7b2de0b88ce5c5011b34bf3936c69338d0b0", "8fca7b2de0b88ce5c5011b34bf3936c69338d0b0" ]
[ "14B-088/new_vs_archival_mom0.py", "14B-088/HI/imaging/sd_regridding/gbt_feather_beamsize.py" ]
[ "\nfrom aplpy import FITSFigure\nimport os\nimport matplotlib.pyplot as mpl\n\n'''\nShow the moment 0 of the archival against the moment 0 from 14B-088\n'''\n\nfig = mpl.figure(figsize=(15, 7))\n\nmom0_file = \"/media/eric/MyRAID/M33/14B-088/HI/full_imaging/M33_14B-088_HI.clean.image.pbcov_gt_0.3_masked.mom0.fits\"...
[ [ "matplotlib.pyplot.figure" ], [ "scipy.ndimage.binary_erosion", "numpy.isfinite" ] ]
SteNicholas/analytics-zoo
[ "2967e74427855cb0f3d60b5c298343976bb0d23e", "2967e74427855cb0f3d60b5c298343976bb0d23e" ]
[ "pyzoo/zoo/examples/ray/rl_pong/rl_pong.py", "pyzoo/zoo/examples/tensorflow/tfpark/tf_optimizer/evaluate_mnist_keras.py" ]
[ "# This file is adapted from https://github.com/ray-project/ray/blob/master\n# /examples/rl_pong/driver.py\n#\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 ...
[ [ "numpy.zeros_like", "numpy.dot", "numpy.zeros", "numpy.random.randn", "numpy.exp", "numpy.mean", "numpy.std", "numpy.random.uniform", "numpy.sqrt", "numpy.outer", "numpy.vstack" ], [ "numpy.argmax", "tensorflow.keras.models.Model" ] ]
yobeatz/mosaic
[ "21488d78c2239f0a1ee51c2b4f660066ece213f6" ]
[ "edges.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport skimage as sk\nfrom skimage.io import imread\nfrom skimage import filters\nfrom skimage import transform\nimport plotting\nfrom pathlib import Path\n\n\ndef load_image(fname, width=900, plot=[]):\n \n if fname:\n img0 = imre...
[ [ "numpy.ones", "numpy.amax" ] ]
HT-MD/mdgo
[ "bd06b226c6015fb083c099508bc81f521a4329c4" ]
[ "mdgo/core.py" ]
[ "# coding: utf-8\n# Copyright (c) Tingzheng Hou.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module implements two core class MdRun and MdJob\nfor molecular dynamics simulation analysis and job setup.\n\"\"\"\nfrom __future__ import annotations\nfrom typing import Union, Dict, Tuple, List, Op...
[ [ "numpy.concatenate", "numpy.array", "pandas.DataFrame", "numpy.mean", "matplotlib.pyplot.figure", "numpy.nanmean", "numpy.abs", "numpy.vstack" ] ]
RobinSmits/Dutch-NLP-Experiments
[ "e7d48cc77650a7600341095ee236ac3760074cfc" ]
[ "dataset.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom tqdm import tqdm\nfrom transformers import AutoTokenizer\nfrom typing import Tuple\nfrom urllib.request import urlopen\n\ndef download_articles_by_publisher(cache_dir: str)->None:\n # URLs taken from: https://github.com/dpgmedia/p...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "numpy.zeros" ] ]
trisct/ldif
[ "3dfa33c88b15178eebac3c7d93e5de1ca2682d23" ]
[ "ldif/datasets/process_element.py" ]
[ "# Copyright 2020 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 ...
[ [ "tensorflow.py_func", "tensorflow.train.BytesList", "tensorflow.io.FixedLenFeature", "tensorflow.train.Features" ] ]
sap9433/sound-classification-with-tf-keras
[ "fcc83db86ae46e4b6204f5a55663540d17a67ab9" ]
[ "core/datautils.py" ]
[ "'''\ndatautils.py: Just some routines that we use for moving data around\n'''\nfrom __future__ import print_function\nimport numpy as np\nimport librosa\nimport os\nfrom os.path import isfile, splitext\nfrom imageio import imread, imwrite\nimport glob\n\ndef listdir_nohidden(path,subdirs_only=False, skip_csv=True...
[ [ "numpy.reshape", "numpy.zeros", "numpy.copy", "numpy.load", "numpy.tile", "numpy.random.shuffle", "numpy.save", "numpy.resize", "numpy.argmax", "numpy.savez_compressed", "numpy.append", "numpy.moveaxis", "numpy.flip" ] ]
ahsen1402/pySUMMA
[ "1b82237be5dc33af57b5c2e2c16aee4d568ddb77" ]
[ "pySUMMA/simulate/binary.py" ]
[ "\"\"\"Generate synthetic binary data [-1, 1].\n\nGenerate random samples of synthetic base classifier predictions. User\ncan provide either:\n 1) both the the true positive (tpr) and true negative rates (tnr), the \n corresponding balanced accuracy (ba) is then computed by \n\n ba = 0.5 * (tpr + tnr)\n\n 2)...
[ [ "numpy.max", "numpy.random.rand", "numpy.zeros", "numpy.ones", "numpy.min" ] ]
Mihir-Mavalankar/DeepRL_SymmetricAntGait
[ "6f1e14f53b2b1369dbc218ac888dfbd2ecbe9ffa", "6f1e14f53b2b1369dbc218ac888dfbd2ecbe9ffa" ]
[ "baselines/common/distributions.py", "agent_zoo/RoboschoolInvertedPendulum_v0_2017may.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport baselines.common.tf_util as U\nfrom baselines.a2c.utils import fc, fc_wshare,fc_double, quad_mirror_action_layer\nfrom tensorflow.python.ops import math_ops\n\nclass Pd(object):\n \"\"\"\n A particular probability distribution\n \"\"\"\n def flatparam...
[ [ "tensorflow.exp", "tensorflow.get_default_session", "tensorflow.python.ops.math_ops.less", "tensorflow.to_float", "tensorflow.nn.softmax", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.shape", "tensorflow.concat", "numpy.log", "tensorflow.sigmoid", "...
maxim-lian/pandas
[ "17a6bc56e5ab6ad3dab12d3a8b20ed69a5830b6f" ]
[ "pandas/core/indexes/multi.py" ]
[ "# pylint: disable=E1101,E1103,W0232\nfrom collections import OrderedDict\nimport datetime\nfrom sys import getsizeof\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import (\n Timestamp, algos as libalgos, index as libindex, lib, tslibs)\nimport pandas.compat as compat\nfrom pandas.compat import lra...
[ [ "pandas.core.algorithms.factorize", "pandas.core.missing.clean_reindex_fill_method", "pandas.compat.lzip", "numpy.bincount", "pandas._libs.lib.infer_dtype", "pandas._libs.index.get_value_at", "numpy.empty", "pandas.core.dtypes.common.pandas_dtype", "pandas.core.util.hashing.has...
sapphireh/HOPE
[ "72d697f8d96a7aa0e29898c66f5654e79cff410d" ]
[ "graphsage0/supervised_models.py" ]
[ "import tensorflow as tf\n\nimport graphsage0.models as models\nimport graphsage0.layers as layers\nfrom graphsage0.aggregators import MeanAggregator, MaxPoolingAggregator, MeanPoolingAggregator, SeqAggregator, GCNAggregator, MLPAggregator\n\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\nclass SupervisedGraphsage(mo...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.train.AdamOptimizer", "tensorflow.concat", "tensorflow.summary.scalar", "tensorflow.nn.l2_loss", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.clip_by_value", "tensorflow.nn.s...
mzegla/open_model_zoo
[ "092576b4c598c1e301ebc38ad74b323972e54f3e", "092576b4c598c1e301ebc38ad74b323972e54f3e" ]
[ "demos/face_recognition_demo/python/utils.py", "demos/face_detection_mtcnn_demo/python/face_detection_mtcnn_demo.py" ]
[ "\"\"\"\n Copyright (c) 2018-2021 Intel Corporation\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...
[ [ "numpy.clip" ], [ "numpy.expand_dims" ] ]
sparkingdark/PySyft
[ "8fec86803dd20ca9ad58590ff0d16559991f1b08", "8fec86803dd20ca9ad58590ff0d16559991f1b08" ]
[ "test/generic/frameworks/test_attributes.py", "syft/frameworks/torch/he/fv/util/rlwe.py" ]
[ "import pytest\nimport torch as th\n\nfrom syft.test import my_awesome_computation\nfrom syft.generic.utils import remote\n\n\n@pytest.mark.parametrize(\"return_value\", [True, False])\ndef test_remote(workers, return_value):\n alice = workers[\"alice\"]\n\n x = th.tensor([1.0])\n expected = my_awesome_com...
[ [ "torch.tensor" ], [ "torch.tensor" ] ]
jbonifield3/Climate-Visualization
[ "629ec3a67cf56efc09298eb99f2867b399213b35" ]
[ "combined/load_CO2_data.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCO2 load class for CSE \r\nproject\r\nBy: D. CARVALLO\r\n\"\"\"\r\nimport pandas as pd\r\nstates = {\r\n 'Alabama': 'AL',\r\n 'Alaska': 'AK',\r\n 'Arizona': 'AZ',\r\n 'Arkansas': 'AR',\r\n 'California': 'CA',\r\n 'Colorado': 'CO',\r\n 'Connecticut': 'CT',\r...
[ [ "pandas.read_csv" ] ]
vinitra-zz/keras-onnx
[ "8cd5d3ec5ed6f35dc9d964555a89c4722304e9e0" ]
[ "keras2onnx/subgraph.py" ]
[ "###############################################################################\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n##########################################################################...
[ [ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.core.framework.attr_value_pb2.AttrValue", "tensorflow.python.framework.tensor_util.make_tensor_proto", "tensorflow.core.framework.graph_pb2.GraphDef", "tensorflow.core.framework.node_def_pb2.NodeDef", "tensorflow.graph_util...
roytseng-tw/px2graph_lab
[ "ab7d799d38ae32aa342b3aebce9edc246b140fa5" ]
[ "main.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport h5py\nfrom tqdm import tqdm\n\nfrom px2graph_lab.util import setup\nfrom px2graph_lab.opts import parse_command_line\n\ndef main():\n\n # Initial setup\n opt = parse_command_line()\n train_flag = tf.placeholder(tf.bool, [])\n task, loader, inp, label,...
[ [ "numpy.zeros", "tensorflow.train.Saver", "numpy.exp", "tensorflow.ConfigProto", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "tensorflow.global_variables_initializer", "tensorflow.get_collection" ] ]
rsachetto/MonoAlg3D_C
[ "4a9ad99a94c7aa047427bbd36cce1a7d8b17d195" ]
[ "scripts/plot_comparison_potential.py" ]
[ "import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef read_transmembrane_potential(input_file, dt, print_rate):\n data = np.genfromtxt(input_file)\n n = len(data)\n ms_each_step = dt*print_rate\n\n end_simulation = n / ms_each_step\n\n timesteps = np.arange(0,n)*ms_each_step\n ...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.genfromtxt", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "numpy.arange", "matplotlib.pyplot.ylabel" ] ]
parrt/stratx
[ "c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22", "c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22" ]
[ "testing/test_strat.py", "articles/imp/genfigs/weight_pdp.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2019 Terence Parr\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify...
[ [ "pandas.DataFrame", "numpy.array" ], [ "numpy.random.seed" ] ]
JohnGoertz/Gumbi
[ "7a7df9bf97bf10cdf5dc8af36026dba578e161c9" ]
[ "gumbi/utils/gp_utils.py" ]
[ "import numpy as np\r\nfrom scipy.spatial.distance import pdist\r\nfrom scipy.stats import ncx2\r\n\r\n\r\ndef get_ℓ_prior(points):\r\n distances = pdist(points[:, None])\r\n distinct = distances != 0\r\n ℓ_l = distances[distinct].min() if sum(distinct) > 0 else 0.1\r\n ℓ_u = distances[distinct].max() i...
[ [ "scipy.spatial.distance.pdist" ] ]
silvioedu/HackerRank-Python-Practice
[ "e31ebe49d431c0a23fed0cd67a6984e2b0b7a260" ]
[ "numpy/shapeAndReshape.py" ]
[ "import numpy\n\n\nif __name__ == '__main__':\n arr = numpy.array(input().strip().split(' '), int)\n print(numpy.reshape(arr, (3, 3)))" ]
[ [ "numpy.reshape" ] ]
saint1729/cs6140_final_project
[ "da529aaadfb82a67a21ace436a02536d9c712bc0" ]
[ "code/experimentation.py" ]
[ "import numpy as np\n\nif __name__ == '__main__':\n l = np.load(\"./old/class8_313.npy\")\n print(l.shape)\n l = np.load(\"./old/resources/pts_in_hull.npy\")\n print(l[:, 0].shape)\n l = np.load(\"./old/resources/prior_lab_distribution_train.npz\", allow_pickle=True)\n lst = l.files\n\n print(l...
[ [ "numpy.array", "numpy.load" ] ]
raphaelsty/ckb
[ "325b170e64ea10280d5f08f7417b5d1bdc94a466" ]
[ "ckb/scoring/transe.py" ]
[ "from .base import Scoring\n\nimport torch\n\n__all__ = [\"TransE\"]\n\n\nclass TransE(Scoring):\n \"\"\"TransE scoring function.\n\n Examples\n --------\n\n >>> from ckb import scoring\n\n >>> scoring.TransE()\n TransE scoring\n\n \"\"\"\n\n def __init__(self):\n super().__init__()\n...
[ [ "torch.norm" ] ]