repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
PiotrowskiD/tensor2tensor
[ "2451614b930c73b2b8dd891b4fc5838d99a151a6" ]
[ "tensor2tensor/data_generators/problem.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.reshape", "tensorflow.estimator.export.ServingInputReceiver", "tensorflow.contrib.slim.parallel_reader.get_data_files", "tensorflow.logging.warning", "tensorflow.cast", "tensorflow.shape", ...
A1berttt/pytorch-original-transformer
[ "b8924f20f7e76bd15a3061193843a8b6f6205629" ]
[ "utils/data_utils.py" ]
[ "import time\nimport os\nimport enum\n\n\nimport torch\nfrom torchtext.legacy.data import Dataset, BucketIterator, Field, Example\nfrom torchtext.data.utils import interleave_keys\nfrom torchtext.legacy import datasets\nimport spacy\n\n\nfrom .constants import BOS_TOKEN, EOS_TOKEN, PAD_TOKEN, DATA_DIR_PATH\n\n\ncla...
[ [ "torch.cuda.is_available", "torch.ones" ] ]
MacHu-GWU/seedinvest_monitor-project
[ "d66b4ee474a0729a9ff4b3ffeed4bcc331296515" ]
[ "export/export.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas as pd\nfrom superjson import json\nfrom seedinvest_monitor.model import Startup\n\njson_data = list()\ndf_data = list()\ndf_columns = set()\n\ncursor = Startup.scan(attributes_to_get=[\"id\", \"details\"])\nfor startup in cursor:\n details_data = startup.details.as_dict(...
[ [ "pandas.DataFrame" ] ]
HotMaps/customized_h_fa_dm
[ "bab2961d766f7885f30c1306b7c67adbf99d88e1" ]
[ "CM/CM_TUW9/shp2csv.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on July 6 2017\n\n@author: fallahnejad@eeg.tuwien.ac.at\n\"\"\"\nimport os\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom osgeo import gdal\nfrom osgeo import ogr\nfrom osgeo import osr\nimport time\npath = os.path.dirname(os.path.dirname(os.path.dirname(os.path...
[ [ "numpy.array", "numpy.isnan", "numpy.empty", "numpy.union1d", "numpy.ones", "numpy.arange", "numpy.argwhere", "numpy.floor" ] ]
EshwarCVS/Machine_Learning_A-Z
[ "d6d186c2fde990f15c08706244dd6e91a8854038" ]
[ "Part 5 - Association Rule Learning/Section 28 - Apriori/apriori.py" ]
[ "# Apriori\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Data Preprocessing\ndataset = pd.read_csv('Market_Basket_Optimisation.csv', header = None)\ntransactions = []\nfor i in range(0, 7501):\n transactions.append([str(dataset.values[i,j]) for j in r...
[ [ "pandas.read_csv" ] ]
aliwimo/breast_cancer_detect
[ "9f474043f62939b7ab53ca1459c85fa06914e1fe" ]
[ "log_reg.py" ]
[ "import numpy as np\r\n\r\nclass Logistic_Regression:\r\n def __init__(self):\r\n self.w = []\r\n\r\n # sigmoid function\r\n def sigmoid(self, z):\r\n return 1 / (1 + np.exp(-z))\r\n\r\n # logistic function\r\n def hx(self, w, X):\r\n weights_num = X.shape[1] + 1\r\n z_arr...
[ [ "numpy.around", "numpy.array", "numpy.exp", "numpy.log" ] ]
stalhabukhari/pytorch-classification
[ "bef373c62c247633514f0bb93bad6d9260b53589" ]
[ "utils/misc.py" ]
[ "'''Some helper functions for PyTorch, including:\n - get_mean_and_std: calculate the mean and std value of dataset.\n - msr_init: net parameter initialization.\n - progress_bar: progress bar mimic xlua.progress.\n'''\nimport errno\nimport os\nimport sys\nimport time\nimport math, csv\n\nimport torch.nn as...
[ [ "torch.nn.init.normal", "torch.nn.init.kaiming_normal", "torch.nn.init.constant" ] ]
humeniuka/sGDML_dataset_generation
[ "a99f792b6aac7ff869ebcd1bd7a7226ca81f43ee" ]
[ "sgdml_dataset_generation/readers/qchem.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# # Imports\nimport numpy as np\nfrom collections import OrderedDict\nimport logging\n\n# # Logging\nlogger = logging.getLogger(__name__)\nlogging.basicConfig(format=\"[%(module)-12s] %(message)s\", level=logging.INFO)\n\nfrom sgdml_dataset_generation import units\...
[ [ "numpy.array" ] ]
HimangiM/Self-Supervised-Scene-Flow-Estimation
[ "0a3350843de1ed769e69c3be17eb70db32ca6881" ]
[ "src/model_concat_upsa_cycle.py" ]
[ "\nimport tensorflow as tf\nimport numpy as np\nimport math\nimport sys\nimport os\n\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(os.path.join(BASE_DIR, 'utils'))\nimport utils.tf_util\nfrom utils.pointnet_util import *\nfrom tf_grouping import query_ball_point, group_point, knn_point\n...
[ [ "tensorflow.abs", "tensorflow.zeros", "tensorflow.minimum", "tensorflow.assign", "tensorflow.concat", "tensorflow.summary.scalar", "tensorflow.expand_dims", "tensorflow.Graph", "tensorflow.Variable", "tensorflow.constant", "tensorflow.variable_scope", "tensorflow.sq...
JB-MS/pynumpress
[ "50aef00157033cfd1c6e61fcde5d898abfb3c667" ]
[ "setup.py" ]
[ "import os\nimport platform\nfrom setuptools import setup, Extension, find_packages\nimport pip\n\ntry:\n import numpy as np\nexcept ImportError:\n pip.main(['install', 'numpy'])\n import numpy as np\n\nextra_compile_args = []\nif platform.system().lower() == 'windows':\n # This may fail if compiled on ...
[ [ "numpy.get_include" ] ]
awublack/opticspy
[ "3049e89f89cc7d6285c45daed8d436b548b3e38d" ]
[ "zernike_rec.py" ]
[ "from __future__ import division as __division__\nimport numpy as __np__\nfrom numpy import cos as __cos__\nfrom numpy import sin as __sin__\nfrom numpy import sqrt as __sqrt__\nfrom numpy import arctan2 as __arctan2__\nimport matplotlib.pyplot as __plt__\nfrom matplotlib import cm as __cm__\nfrom matplotlib.ticker...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.pcolormesh", "numpy.angle", "numpy.sin", "numpy.zeros", "numpy.fft.fft2", "numpy.exp", "matplotlib.pyplot.figure", "numpy.sqrt", "numpy.cos", "numpy.fft.fftshift", "matplotlib.pyplot.show", "numpy.linspace", "...
ElliotMunro200/reinforcement_learning_an_introduction
[ "a0ac9e5da6eaeae14d297a560c499d1a6e579c2a" ]
[ "code/exercises/ex_5_10/run.py" ]
[ "#!/usr/bin/env python\n\"\"\"\n--------------------------------\nproject: code\ncreated: 11/06/2018 18:00\n---------------------------------\n\nI added a crash penalty of -100 to deter the agent from\nrunning into walls to end up at favourable starting positions.\n\nAlso, the algorithm doesn't seem to converge wel...
[ [ "numpy.random.RandomState" ] ]
sunchang0124/cgans
[ "99ae3d572897546a100860f9674b2c79201ec59a" ]
[ "dp_cgans/base.py" ]
[ "\"\"\"Base Class for tabular models.\"\"\"\n\nimport logging\nimport pickle\nimport uuid\nfrom warnings import warn\n\nimport numpy as np\nimport pandas as pd\n\nfrom dp_cgans.errors import ConstraintsNotMetError\nfrom dp_cgans.metadata import Table\n\nLOGGER = logging.getLogger(__name__)\nCOND_IDX = str(uuid.uuid...
[ [ "pandas.isnull", "pandas.DataFrame", "numpy.abs", "pandas.concat" ] ]
graziano-giuliani/pythoncode
[ "4e505af5be3e32519cf4e62b85c101a63c885f77" ]
[ "pyuwphysret/common/pyfiles/atmos/Stability/svpwat.py" ]
[ "#!/usr/bin/env python\n# svpwat.py\nimport numpy as num\n\ndef svpwat(t):\n \"\"\"e = svpwat(t)\nCalculates the water vapor mixing ratio\n\nInputs: (all vectors of same length)\n t = dry bulb temperature(s) (K)\n\nOutputs:\n e = saturation vapor pressure with respect to a plane surface of ice (mb)\n\nRLT, 0...
[ [ "numpy.array" ] ]
aOlmo/SRN-Deblur-test
[ "8c2ad2f54a988811987c0ad5157db2a3b0de4b3d" ]
[ "models/model.py" ]
[ "from __future__ import print_function\nimport os\nimport time\nimport random\nimport datetime\nimport scipy.misc\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom datetime import datetime\nfrom util.util import *\nfrom util.BasicConvLSTMCell import *\n\n\nclass DEBLUR(objec...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.constant_initializer", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.train.slice_input_producer", "tensorflow.train.get_checkpoint_state", "tensorflow.string_join", "tensorflow.stack", "tensorflow.global_variables_in...
hsungyang/poseidonos
[ "0f523b36ccf0d70726364395ea96ac6ae3b845c3" ]
[ "test/system/benchmark/graph/draw.py" ]
[ "import lib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport numpy as np\n\n\ndef FormatLatency(y, idx=0):\n if y >= 1e9:\n return f\"{round(y/1e9)}s\"\n elif y >= 1e6:\n return f\"{round(y/1e6)}ms\"\n elif y >= 1e3:\n return f\"{round(y/1e3)}us\"\n else:...
[ [ "matplotlib.pyplot.annotate", "matplotlib.ticker.EngFormatter", "matplotlib.pyplot.gca", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot....
openclosebrackets/scikit-learn-tests
[ "92ff5fda2e59ba40e515b89085a5357aab08d41a" ]
[ "tutorials/regression/linear/python/main_scipy.py" ]
[ "from classes import *\nfrom scipy.optimize import least_squares\n\ndef fun_lsm(w, height, weight):\n return weight - height * w[0] - w[1]\n\n \nif __name__ == '__main__':\n data_path = \"../../../../data/weight-height.csv\"\n obj = mice(data_path)\n\n x0 = [0.1, 0.1]\n res = least_squares(fun_lsm, x...
[ [ "scipy.optimize.least_squares" ] ]
mullovc/NMTGMinor
[ "b1b7b1e018eaa0d99a43449655937cc050a29987" ]
[ "train_language_model.py" ]
[ "from __future__ import division\n\nimport onmt\nimport onmt.markdown\nimport onmt.modules\nimport argparse\nimport torch\nimport torch.nn as nn\nfrom torch import cuda\nfrom torch.autograd import Variable\nimport math\nimport time, datetime\nfrom onmt.train_utils.trainer import XETrainer\nfrom onmt.modules.loss im...
[ [ "torch.manual_seed", "torch.cuda.is_available", "torch.Tensor", "torch.load" ] ]
neurips2020submission/invalid-action-masking
[ "f27065b187b8eed6316dcc4bb94322771bc89a6a" ]
[ "invalid_action_masking/ppo_no_adj_10x10.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.distributions.categorical import Categorical\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom cleanrl.common import preprocess_obs_space, preprocess_ac_space\nimport argparse\nimport numpy as np\...
[ [ "torch.nn.Linear", "numpy.mean", "torch.distributions.categorical.Categorical", "torch.cuda.is_available", "torch.where", "numpy.zeros_like", "numpy.empty", "torch.nn.MaxPool2d", "pandas.DataFrame", "torch.manual_seed", "numpy.arange", "torch.tensor", "numpy.sqr...
nathanael-fijalkow/ec
[ "c20fd84ca3944f904f5c999ed5df46eb6b6f8ef5" ]
[ "dreamcoder/grammar.py" ]
[ "from collections import defaultdict\n\nfrom dreamcoder.frontier import *\nfrom dreamcoder.program import *\nfrom dreamcoder.type import *\nfrom dreamcoder.utilities import *\n\nimport time\n\n\n\nclass GrammarFailure(Exception):\n pass\n\nclass SketchEnumerationFailure(Exception):\n pass\n\nclass NoCandidate...
[ [ "numpy.array" ] ]
ahmetustun/adapter-transformers
[ "0c914b1592a6e4553957499c118abcd1e3aa9c00" ]
[ "tests/test_adapter_training.py" ]
[ "import copy\nimport unittest\n\nimport torch\n\nfrom transformers import (\n AutoModelForSequenceClassification,\n AutoModelWithHeads,\n AutoTokenizer,\n GlueDataset,\n GlueDataTrainingArguments,\n Trainer,\n TrainingArguments,\n)\nfrom transformers.testing_utils import require_torch\n\n\ndef ...
[ [ "torch.equal" ] ]
techalchemy/airflow-postgres-plugin
[ "57b8d4c8a2d5463a226e8a720e6c84108572a056" ]
[ "src/airflow_postgres_plugin/hooks/postgres_hook.py" ]
[ "# -*- coding=utf-8 -*-\n\nimport atexit\nimport contextlib\nimport csv\nimport datetime\nimport decimal\nimport hashlib\nimport io\nimport os\nfrom functools import reduce\nfrom typing import IO, Any, Dict, Generator, Iterator, List, Optional, Type, Union\n\nimport dateutil.utils\nimport pandas\nimport postgres_co...
[ [ "pandas.read_csv" ] ]
tchewik/isanlp_rst
[ "459864b3daeeb702acf5e65543181068439ce12c" ]
[ "src/isanlp_rst/greedy_rst_parser.py" ]
[ "import numpy as np\nimport pandas as pd\nimport sys\n\nfrom isanlp.annotation_rst import DiscourseUnit\n\n\nclass GreedyRSTParser:\n def __init__(self, tree_predictor, confidence_threshold=0.05, _same_sentence_bonus=0.):\n \"\"\"\n :param RSTTreePredictor tree_predictor:\n :param float conf...
[ [ "numpy.array", "pandas.concat" ] ]
manashpratim/Classification-of-Song-Attributes-using-Lyrics
[ "801b7d45bd98f3edbb4219d7e947a1bd20ec206c" ]
[ "svm/svm.py" ]
[ "import numpy as np\nfrom sklearn.svm import SVC\nimport pickle,sys\nimport warnings\nfrom sklearn.ensemble import GradientBoostingClassifier\nwarnings.filterwarnings(\"ignore\", category=DeprecationWarning) \n\n\ndid = sys.argv[1]\ndid = str(did)\n\ngenre_list = ['R&B','Country','Rap','Folk','Blues','Reggae','Reli...
[ [ "numpy.random.rand", "sklearn.svm.SVC" ] ]
edwardhuahan/little-planet
[ "260f03cac3c1a27530ddfb41e932c91478961e16" ]
[ "main.py" ]
[ "import cv2 as cv\nimport numpy as np\nfrom scipy import interpolate\nimport math\n\ndef calcOffset (i,j):\n return i - j/2\n\ndef calcR (x,y):\n return np.sqrt(calcOffset(x,width)**2 + calcOffset(y,height)**2)\n\ndef calcRho (x,y):\n return np.divide(calcR(x,y),length)\n\ndef calcTheta (x,y):\n return ...
[ [ "numpy.zeros", "scipy.interpolate.RectBivariateSpline", "numpy.arange", "numpy.meshgrid", "numpy.mod" ] ]
LalitaSharkey/multigazeinterations
[ "059e3397850d98f2505848682c010ed267a2df38" ]
[ "image_test.py" ]
[ "import cv2\nfrom heuristic_faces import HeuristicFaceClassifier\nimport pickle\nimport pandas as pd\nimport sys\n\nclf = HeuristicFaceClassifier()\n\nhorizontal_model = pickle.load(open(\"horizontal_gaze.pkcls\", \"rb\"))\nvertical_model = pickle.load(open(\"vertical_gaze.pkcls\", \"rb\"))\n\nif len(sys.argv) >= 2...
[ [ "pandas.DataFrame" ] ]
yuanzheng625/pylmnn
[ "ca7f340b410aab20699848182107370672eb608c" ]
[ "pylmnn/embeddings/confusion_matrix_pretty_print.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nplot a pretty confusion matrix with seaborn\nCreated on Mon Jun 25 14:17:37 2018\n@author: Wagner Cipriano - wagnerbhbr - gmail - CEFETMG / MMC\nREFerences:\n https://www.mathworks.com/help/nnet/ref/plotconfusion.html\n https://stackoverflow.com/questions/28200786/how-to-plot-sci...
[ [ "sklearn.metrics.confusion_matrix", "numpy.array", "matplotlib.font_manager.FontProperties", "pandas.DataFrame", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "numpy.unique" ] ]
aminkhod/finance
[ "d9bbd7eb5cde9a754d32f014d1c72eb4fe7d44b9" ]
[ "session3.py" ]
[ "import numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import datasets\n# from sklearn import svm\n# from sklearn.model_selection import cross_val_score\nfrom sklearn.linear_model import LinearRegression\nfrom matplotlib import pyplot as plt\n\n\n\n##################################...
[ [ "numpy.array", "sklearn.model_selection.LeaveOneOut", "sklearn.linear_model.LinearRegression", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.xlabel", "sklearn.metrics.r2_score", "sklearn.model_selection.KFold", "sklearn.model_selection.cross_val_score", "matplotlib...
kencan7749/vq-vae-2-pytorch
[ "af9fbf5fab6446123274dafaaae03406ed7d5955" ]
[ "vqvae_3d_v2.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nimport distributed as dist_fn\n\n\n# Copyright 2018 The Sonnet 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...
[ [ "torch.zeros", "torch.cat", "torch.nn.functional.one_hot", "torch.nn.ConvTranspose3d", "torch.nn.Sequential", "torch.unsqueeze", "torch.nn.ReLU", "torch.squeeze", "torch.nn.Conv2d", "torch.nn.Conv3d", "torch.randn" ] ]
ChenyangTang1/bark
[ "c4215be6464c249639b8c7b390684bd13100b41e" ]
[ "modules/models/tests/py_behavior_model_test.py" ]
[ "# Copyright (c) 2019 fortiss GmbH\n#\n# This software is released under the MIT License.\n# https://opensource.org/licenses/MIT\n\n\nimport unittest\nimport os\nimport numpy as np\nfrom modules.runtime.scenario.scenario_generation.deterministic \\\n import DeterministicScenarioGeneration\nfrom modules.runtime.sce...
[ [ "numpy.array" ] ]
Yottaxx/T-LSTM
[ "92618d8c3ee2418b194a2e1592512548da955b77" ]
[ "data_utils/load_uds.py" ]
[ "from data_utils import DataStruct\nfrom tqdm import trange\nimport torch\nfrom data_utils.save_uds_utils import data_load\nimport numpy as np\n\n\ndef S_get_g_data_loader_split():\n text_list, edge_index_list, data_confidence, test_mask, dev_mask, train_mask, data_trigger_index = data_load()\n train_list = [...
[ [ "numpy.array", "numpy.stack", "torch.tensor" ] ]
lei940324/Quantile
[ "5aab668ebc022b8fa12fc90fa4a79972e975e96f" ]
[ "func.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Mar 30 20:15:06 2020\n\n@author: Administrator\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom queue import Queue\nfrom scipy import interpolate\nimport statsmodels.formula.api as smf\nimport math\nimport logging\nimport threading\nimport re\n\nEXIT = False ...
[ [ "scipy.interpolate.interp1d", "pandas.DataFrame", "pandas.read_excel", "pandas.Series", "numpy.linspace" ] ]
asascience-open/QARTOD
[ "2f940b99f64974e6c6ad450f341382b302fe790c" ]
[ "ioos_qartod/qc_tests/auxillary_checks.py" ]
[ "import numpy as np\n\n\ndef check_timestamps(times, max_time_interval=None):\n \"\"\"\n Checks that the times supplied are in monotonically increasing\n chronological order, and optionally that time intervals between\n measurements do not exceed a value `max_time_interval`. Note that this is\n not ...
[ [ "numpy.any", "numpy.array", "numpy.array_equal", "numpy.diff" ] ]
matwey/ad_examples
[ "78b01e9c9502523c5341243e1a8dca6befcefbc3" ]
[ "ad_examples/aad/test_hard_data.py" ]
[ "import os\nimport logging\nimport numpy as np\nimport numpy.random as rnd\nimport matplotlib.pyplot as plt\n\nfrom ..common.utils import get_command_args, configure_logger, dir_create\nfrom ..common.gen_samples import get_hard_samples\nfrom ..common.data_plotter import DataPlotter\n\n\n\"\"\"\npythonw -m ad_exampl...
[ [ "numpy.max", "numpy.random.seed", "numpy.min", "numpy.random.shuffle", "numpy.where", "numpy.arange", "numpy.unique" ] ]
pirakd/DeepProp
[ "e43f6e12220da38a3bda51918bd75bb7c48dec31" ]
[ "scripts/d2d_main.py" ]
[ "from os import path\nimport sys\nsys.path.append(path.dirname(path.dirname(path.realpath(__file__))))\nfrom os import path, makedirs\nimport torch\nfrom utils import read_data, get_root_path, train_test_split, get_time, \\\n gen_propagation_scores, redirect_output\nfrom D2D import eval_D2D, eval_D2D_2, generate...
[ [ "numpy.concatenate", "numpy.array", "torch.cuda.is_available", "numpy.random.RandomState" ] ]
vishalbelsare/AffineFlowCausalInf
[ "3c7e2be0ad194e4dcbb0eea35c8fe1d7e88b1b8f" ]
[ "runners/intervention_trials.py" ]
[ "# trial interventional predictions of flow models\n#\n#\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport pickle\nimport seaborn as sns\n\nfrom data.generate_synth_data import intervention_sem\nfrom models import ANM, CAREFL\n\n\ndef res_save_name(config, algo):\n if 'carefl' not in algo...
[ [ "numpy.array", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.arange", "matplotlib.pyplot.tight_layout" ] ]
wesm/zipline
[ "279e125ab8e61b8d04cc487e52f17a6e1cadeb6e" ]
[ "zipline/algorithm.py" ]
[ "#\n# Copyright 2013 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or...
[ [ "pandas.DataFrame", "numpy.datetime64" ] ]
stbalduin/memobuilder
[ "c99eb8e711d5109c1322f443441b5a07c079e2f0" ]
[ "memobuilder/mutil/schedules.py" ]
[ "import numpy\r\nimport pyDOE as doe\r\nimport random\r\n\r\n\r\nclass UniformScheduleGenerator():\r\n\r\n @staticmethod\r\n def generate_schedules(num_schedules, resolution, duration, num_slots,\r\n min, max):\r\n if num_schedules == 0:\r\n return []\r\n # c...
[ [ "numpy.repeat" ] ]
lascivaroma/PaPie
[ "0ca4311a57b2439994e5fcdc02f4d008ee268a9c" ]
[ "pie/models/highway.py" ]
[ "\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom pie import initialization\n\n\nclass Highway(nn.Module):\n \"\"\"\n Highway network\n \"\"\"\n def __init__(self, in_features, num_layers, act='relu'):\n self.in_features = in_features\n\n self.act = act\n ...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.init.constant_" ] ]
Saiprasad16/federated
[ "9c08381a172a26957d7c50f74214c74fe9a9fb1c" ]
[ "tensorflow_federated/python/core/impl/types/type_conversions_test.py" ]
[ "# Copyright 2018, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.SparseTensor", "tensorflow.TensorSpec", "numpy.array", "tensorflow.data.Dataset.range", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.Graph", "tensorflow.RaggedTensor.from_row_splits", "tensorflow.Variable", "tenso...
eternal-forces/profielwerkstuk
[ "efcd5a7b796dec66b95b99a40f4c43ea5958fb8f" ]
[ "dqn_tutorial.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport base64\nimport imageio\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport PIL.Image\n\nimport tensorflow as tf\nfrom tensorflow.python.ops.variables import Variable\n\nfrom tf_agents.agents.dqn import dqn_agent\...
[ [ "tensorflow.compat.v1.enable_v2_behavior", "tensorflow.compat.v1.train.AdamOptimizer", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "tensorflow.Variable", "matplotlib.pyplot.ylabel" ] ]
xinyu-intel/incubator-mxnet
[ "f32b58ecec6b1c4e44f77d8ede073484c89e05e9" ]
[ "tests/nightly/test_large_array.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.full", "numpy.array", "numpy.reshape", "numpy.transpose", "numpy.diag", "numpy.arange", "numpy.all", "numpy.random.random", "numpy.ravel_multi_index", "numpy.broadcast_to" ] ]
mrbeann/MultiBench
[ "7da0a493b8e2cd857a5c22c0be04748ab7487494" ]
[ "datasets/affect/get_data.py" ]
[ "import os\nimport sys\nfrom typing import *\nimport pickle\nimport h5py\nimport numpy as np\nfrom numpy.core.numeric import zeros_like\nfrom torch.nn.functional import pad\nfrom torch.nn import functional as F\n\nsys.path.append(os.path.dirname(os.path.dirname(os.getcwd())))\nimport torch\nimport torchtext as text...
[ [ "numpy.array", "numpy.delete", "numpy.asarray", "numpy.zeros", "torch.nn.utils.rnn.pad_sequence", "torch.std", "numpy.seterr", "numpy.std", "torch.tensor", "torch.nn.functional.pad" ] ]
Himydata/himydata-python
[ "6bd57fcee8e48c926d8f887a2635b4c28210e483" ]
[ "himydata/hmd/utils/datasets.py" ]
[ "import sqlalchemy as sa\nimport pandas as pd\nfrom himydata.hmd.utils.datastores import Datastore\n\n\nclass Dataset(object):\n\n def __init__(self, hmd_dataset, name):\n \"\"\"\n :param hmd_dataset: class Api of hmddataset\n :param name: dataset name\n \"\"\"\n self.hmd_datas...
[ [ "pandas.read_sql", "pandas.read_sql_query" ] ]
Kyungpyo-Kim/object_classification
[ "17bba66a119719548b2f07710c4de5e2bc726eaa" ]
[ "scripts/utils/eulerangles.py" ]
[ "# -*- coding: utf-8 -*-\n\n# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n#\n# See COPYING file distributed along with the NiBabel package for the\n# copyrig...
[ [ "numpy.finfo", "numpy.array", "numpy.asarray", "numpy.eye" ] ]
awesome-archive/snorkel
[ "d68bf18cf9ee0cec5958ab7802059a0c77c34b9e" ]
[ "test/classification/training/test_trainer.py" ]
[ "import copy\nimport tempfile\nimport unittest\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom snorkel.classification import (\n DictDataLoader,\n DictDataset,\n MultitaskClassifier,\n Operation,\n Task,\n Trainer,\n)\nfrom snorkel.classification.training.loggers import...
[ [ "torch.nn.Linear", "torch.nn.ReLU", "torch.ones" ] ]
gracetian6/mai21-learned-smartphone-isp
[ "487368d0abd860f070f3fc4f2836352857b10ad6" ]
[ "ckpt2pb.py" ]
[ "#################################################\n# Convert checkpoint to frozen graph (protobuf) #\n#################################################\n\nimport argparse\nimport tensorflow as tf\n\n\ndef freeze_graph(input_checkpoint,output_graph,output_node_names):\n \"\"\"Freeze model weights to get the pb f...
[ [ "tensorflow.compat.v1.Session", "tensorflow.compat.v1.train.import_meta_graph", "tensorflow.io.gfile.GFile" ] ]
mraspaud/pyproj
[ "57eeaf50d1ac0e24ed3a4351a896d8bbdf747430" ]
[ "test/test_transformer.py" ]
[ "from distutils.version import LooseVersion\n\nimport numpy as np\nimport pytest\nfrom numpy.testing import assert_almost_equal\n\nimport pyproj\nfrom pyproj import Proj, Transformer, itransform, transform\nfrom pyproj.enums import TransformDirection\nfrom pyproj.exceptions import ProjError\nfrom pyproj.transformer...
[ [ "numpy.testing.assert_almost_equal", "numpy.isinf" ] ]
owerbat/scikit-learn_bench
[ "972efac3779578865424515db2897c4b8c71307a" ]
[ "cuml_bench/dbscan.py" ]
[ "# ===============================================================================\r\n# Copyright 2020-2021 Intel Corporation\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at...
[ [ "sklearn.metrics.cluster.davies_bouldin_score" ] ]
Siddharth-Shrivastava7/DANNet
[ "8db10056a4e445d24fc899505923615457cae5b7" ]
[ "eval_new_val.py" ]
[ "import os\nimport torch\nimport numpy as np\n\nfrom PIL import Image\nimport torch.nn as nn\nfrom torch.utils import data\n\nfrom network import *\nfrom dataset.zurich_night_dataset import zurich_night_DataSet\nfrom dataset.acdc_dataset import acdc_dataset\nfrom configs.test_2_config import get_arguments\nfrom tqd...
[ [ "torch.device", "torch.save", "torch.no_grad", "torch.FloatTensor", "torch.std", "torch.nn.Upsample", "torch.load", "torch.mean" ] ]
cyclone923/blocks-world
[ "808127e6b4fde2a9cb499cf6934db7ff73e2f534" ]
[ "fosae/view_plot.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nfrom fosae.get_view_data import MAX_N\n\ndef dis(preds, preds_next):\n for a,b in zip(preds, preds_next):\n print(a-b)\n print(\"-\"*10)\n\ndata = np.load(\"fosae/block_data/block_data.npy\")\npreds = np.load(\"fosae/block_data/block_preds.npy\"...
[ [ "numpy.ndenumerate", "numpy.load", "matplotlib.pyplot.subplots", "numpy.transpose", "matplotlib.pyplot.pause", "numpy.abs", "matplotlib.pyplot.gca" ] ]
ajkhattak/amanzi
[ "fed8cae6af3f9dfa5984381d34b98401c3b47655" ]
[ "test_suites/benchmarking/chemistry/non_grid_aligned/non_grid_aligned.py" ]
[ "# plots calcium concentration along x at last time step \n# benchmark: compares to pflotran simulation results\n# author: S.Molins - Sept. 2013\n\nimport os\nimport sys\nimport h5py\nimport numpy as np\nimport matplotlib\nfrom matplotlib import pyplot as plt\nfrom matplotlib import cm as cm\n\n# break output array...
[ [ "numpy.array", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.subplots", "numpy.diff", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.ylabel" ] ]
ledell/StackNet
[ "c6ee1f5b7c21479be362c33f404debbbdc37aed6" ]
[ "lib/python/SklearnDecisionRegressor.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\nCopyright (c) 2017 Marios Michailidis\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...
[ [ "numpy.savetxt", "sklearn.datasets.load_svmlight_file", "sklearn.externals.joblib.dump", "sklearn.externals.joblib.load", "sklearn.tree.DecisionTreeRegressor" ] ]
RAF96/method-optimization-resit
[ "75f87067942dbd0eafe092c1831d3267c01e3c3a" ]
[ "src/main/optim_methods/adam.py" ]
[ "import numpy as np\n\nfrom src.main.optim_methods.interface_method_optim import InterfaceMethodOptim, InterfaceOptimAnswer\nfrom src.main.stop_conditions.common import NumIterStopCondition, InterfaceStopCondition\n\n\nclass Adam(InterfaceMethodOptim):\n\n def __init__(self, *args,\n beta1: float...
[ [ "numpy.sqrt", "numpy.zeros" ] ]
Coder107AI/ai
[ "7865c83472c189c1b1de73af3f8ba270b48a2418" ]
[ "train.py" ]
[ "import argparse\nimport numpy as np\nimport torch\nimport torchvision\nimport os\nimport time\n\nfrom collections import OrderedDict\nfrom torch import nn\nfrom torch import optim\nfrom torch.autograd import Variable\nfrom torchvision import datasets, models, transforms\n\ndef main():\n args = get_arguments()\n...
[ [ "torch.nn.NLLLoss", "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LogSoftmax", "torch.max", "torch.no_grad", "torch.FloatTensor", "torch.nn.ReLU", "torch.utils.data.DataLoader", "torch.exp" ] ]
saadmoumad/Sounds-Classification
[ "f8a2235804592208091d201ecf00c363e85adc2d" ]
[ "util/data_gen.py" ]
[ "from audio_preprocessing import preprocess\nimport pandas as pd\n\nclass Gen_Dataset(Dataset):\n def __init__(self, base_dir, meta_path, eval=False):\n self.eval = eval\n #self.base_dir = os.path.join(base_dir,'test') if self.test else os.path.join(base_dir,'train')\n #self.csv_path = os.pa...
[ [ "pandas.read_csv" ] ]
niteshjha08/Advanced-Lane-Lines
[ "8937183559acb7999be2b7a0684ed10beffe9797" ]
[ "src/detect_lane.py" ]
[ "import cv2\nimport numpy as np\nimport pickle\nfrom binary_tuner import mag_sobel,abs_sobel_mag, dir_sobel, get_sobel_mag, hls_thresh,color_thresh\nfrom perspective_transformations import perspective_transform, inv_perspective_transform, undistort_img, get_perspective_mtx,\\\n get_inv_perspe...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.mean", "numpy.flipud", "numpy.argmax", "numpy.polyfit", "numpy.abs", "numpy.dstack", "numpy.linspace" ] ]
huminghao16/MTMSN
[ "4f64a1d1cedab0d74e24ecf939b44c75137c4399" ]
[ "drop/drop_utils.py" ]
[ "import json\r\nimport copy\r\nimport string\r\nimport itertools\r\nimport numpy as np\r\nfrom random import choice\r\nfrom decimal import Decimal\r\nfrom typing import Any, Dict, List, Tuple, Callable\r\nimport collections\r\nfrom collections import defaultdict\r\n\r\nfrom allennlp.common.file_utils import cached_...
[ [ "numpy.array", "torch.tensor", "numpy.argmax", "numpy.random.shuffle" ] ]
archon159/elsa
[ "b9e680bd972bcf9630bc8465e33abe42d3824c85" ]
[ "pretrain/datasets/datasets.py" ]
[ "import os\n\nimport numpy as np\nimport torch\nfrom torch.utils.data.dataset import Subset\nfrom torchvision import datasets, transforms\nimport json\nfrom utils.utils import set_random_seed\n\nDATA_PATH = '~/data/'\nIMAGENET_PATH = '~/data/ImageNet'\n\n\nCIFAR10_SUPERCLASS = list(range(10)) # one class\nIMAGENET...
[ [ "numpy.array", "numpy.zeros", "numpy.random.permutation", "numpy.ones", "numpy.random.shuffle", "torch.from_numpy", "numpy.arange", "numpy.linalg.solve", "torch.utils.data.dataset.Subset", "numpy.isin" ] ]
JIABI/GhostShiftAddNet
[ "870c38248fa1df23ec1262b6690e20c437d1d5d4" ]
[ "adder/check.py" ]
[ "import torch as tt\nfrom torch import nn\nfrom torch.utils.cpp_extension import load\nimport torch.nn.functional as F\n\n#adder_cuda = load(\n# 'adder_cuda', ['adder_cuda.cpp', 'adder_cuda_kernel.cu'], verbose=True)\n\nimport adder, quantize\n#from .adder import Adder2D\n#from .adder_slow import adder2d, adder...
[ [ "torch.randn" ] ]
hangpy/tacotron
[ "35c8873d088a11b624add9ad65ffb108ee4e4a0f" ]
[ "train.py" ]
[ "import argparse\nfrom datetime import datetime\nimport math\nimport os\nimport subprocess\nimport time\nimport tensorflow as tf\nimport traceback\n\nfrom datasets.datafeeder import DataFeeder\nfrom hparams import hparams, hparams_debug_string\nfrom models import create_model\nfrom text import sequence_to_text\nfro...
[ [ "tensorflow.train.Coordinator", "tensorflow.summary.scalar", "tensorflow.summary.histogram", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.Variable", "tensorflow.norm", "tensorflow.variable_scope", "tensorflow.reduce_max", "tensorflow.summary.merge_all", "...
vshulyak/simd-structts
[ "c06972fc2395fffb559376b1d198135ad551eba5" ]
[ "src/simd_structts/base/model.py" ]
[ "import numpy as np\nfrom statsmodels.tsa.statespace.tools import companion_matrix\n\n\nclass BaseModel:\n \"\"\"A base for all models which takes care of all initialization\n procedures.\"\"\"\n\n def __init__(\n self,\n endog,\n level=False,\n trend=False,\n seasonal=No...
[ [ "numpy.array", "numpy.isnan", "numpy.sin", "numpy.zeros", "numpy.eye", "numpy.std", "numpy.cos", "numpy.repeat", "numpy.var", "numpy.floor" ] ]
taimir/pixel-rnn-lasagne
[ "98ad36800b0d6865f97c236db6dc51101d8b96e1" ]
[ "layers/diag_lstm.py" ]
[ "import theano\nimport theano.tensor as T\nimport lasagne\nfrom layers.skew import skew, unskew\n\n\nclass DiagLSTMLayer(lasagne.layers.Layer):\n def __init__(self, incoming, K_ss=lasagne.init.GlorotUniform(), backwards=False, **kwargs):\n super(DiagLSTMLayer, self).__init__(incoming, **kwargs)\n\n ...
[ [ "numpy.array", "numpy.ones" ] ]
stimsonc/Unit2_thermal_predictor
[ "390ad2c72ce469bf7e484c6c431fcbb1367f7636" ]
[ "pages/data.py" ]
[ "# Imports from 3rd party libraries\nimport dash\nimport dash_bootstrap_components as dbc\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output, State\n# My imports\nimport pandas as pd\nimport numpy as np\nimport plotly.express as px\nfrom joblib impo...
[ [ "pandas.read_csv" ] ]
Mdlglobal-atlassian-net/federated
[ "7797df103bf965a9d0cd70e20ae61066650382d9" ]
[ "tensorflow_federated/python/research/utils/checkpoint_utils.py" ]
[ "# Copyright 2019, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.nest.pack_sequence_as", "tensorflow.io.gfile.rename", "tensorflow.io.gfile.rmtree", "tensorflow.function", "tensorflow.io.gfile.makedirs", "tensorflow.nest.flatten", "tensorflow.io.gfile.exists", "tensorflow.saved_model.save", "tensorflow.compat.v2.saved_model.load"...
zhiru-liu/microbiome_evolution
[ "5a08fbf41357d845236e3ff46c31315929d2b649" ]
[ "utils/hmm.py" ]
[ "import numpy as np\nfrom hmmlearn.base import _BaseHMM\nfrom scipy.stats import poisson, bernoulli\nimport os\nimport config\n\n\nclass PoissonHMM(_BaseHMM):\n def __init__(self,\n init_means=None, n_components=1,\n startprob_prior=1.0, transmat_prior=1.0,\n algor...
[ [ "numpy.concatenate", "numpy.divide", "numpy.array", "numpy.diag_indices", "numpy.zeros", "numpy.sum", "numpy.ones", "scipy.stats.poisson.logpmf", "numpy.loadtxt", "numpy.transpose", "numpy.power", "numpy.outer" ] ]
ByrdOfAFeather/Catawba-County-ArcGis
[ "8688918c00218a0a283bbdd7ed9d252e9a91a885" ]
[ "Accountability Report/data_classes.py" ]
[ "import xlrd\nfrom data_transformation_functions import setup_nc_dataframe, setup_dicts, remove_section\nfrom sklearn.preprocessing import LabelEncoder, PolynomialFeatures, StandardScaler\nfrom sklearn.model_selection import train_test_split\n\n\nclass NCDatabase:\n\tdef __init__(self):\n\t\tself.report = xlrd.open...
[ [ "sklearn.model_selection.train_test_split", "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.PolynomialFeatures", "sklearn.preprocessing.StandardScaler" ] ]
aishifugi/generating-sound-with-neural-networks
[ "4e71d22683edb9bd56aa46de3f022f4e1dec1cf1" ]
[ "11 Implementing VAE/code/analysis.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom autoencoder import VAE\nfrom train import load_mnist\n\n\ndef select_images(images, labels, num_images=10):\n sample_images_index = np.random.choice(range(len(images)), num_images)\n sample_images = images[sample_images_index]\n sample_labels = l...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.scatter", "matplotlib.pyplot.figure" ] ]
kamalkraj/TAPAS-TF2
[ "d4ecc09d418d8de5481220b44548e437c77af9bc" ]
[ "tapas/models/segmented_tensor.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.convert_to_tensor", "tensorflow.range", "tensorflow.shape", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.tile", "tensorflow.ones_like", "tensorflow.reshape", "tensorflow.math.floordiv", "tensorflow.gather", "tensorflow.math.floormod" ] ]
jacke121/X-Detector
[ "a24e370a5acb6f5c29cd5db81fa4270f2697b8c1" ]
[ "dataset/pascal_voc.py" ]
[ "# --------------------------------------------------------\n# RON\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Kong Tao\n# date Nov.18, 2016\n# --------------------------------------------------------\nfrom voc_eval import voc_eval\nimport datasets\nimport datasets.pascal_voc\nimport o...
[ [ "numpy.mean", "numpy.zeros" ] ]
markop159/plugin.video.flixtor
[ "b5aedf559772e2e50ed28be576e6962080d03c93" ]
[ "resources/lib/js2py/base.py" ]
[ "'''Most important file in Js2Py implementation: PyJs class - father of all PyJs objects'''\nfrom copy import copy\nimport re\n\nfrom .translators.friendly_nodes import REGEXP_CONVERTER\nfrom .utils.injector import fix_js_args\nfrom types import FunctionType, ModuleType, GeneratorType, BuiltinFunctionType, MethodTy...
[ [ "numpy.uint8" ] ]
yuishihara/chainer-bear
[ "e22a009dd1f6a1dcef5bf18d0849b6fa3e7df0db" ]
[ "models/torch_uniform_init.py" ]
[ "from chainer.initializers.uniform import Uniform\nfrom chainer import initializer\n\nimport numpy as np\n\n\nclass HeUniformTorch(initializer.Initializer):\n \"\"\"\n Compute initial parameters with He initialization.\n \"\"\"\n\n def __init__(self, a=np.sqrt(5), dtype=None, **kwargs):\n super(H...
[ [ "numpy.sqrt" ] ]
CelineQiQi/lingvo
[ "4c6405a3c8b29764918dbfb599212dd7620ccf9c" ]
[ "lingvo/core/predictor_runner_base.py" ]
[ "# Lint as: python2, python3\n# 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/...
[ [ "tensorflow.gfile.IsDirectory", "tensorflow.train.latest_checkpoint", "tensorflow.logging.log_first_n", "tensorflow.gfile.Exists", "tensorflow.logging.info", "tensorflow.gfile.MakeDirs" ] ]
manuel-rdz/SGL-Retinal-Vessel-Segmentation
[ "7897d977e77aa0b5d3acb86e0aa74c6829d67415" ]
[ "sgl_labeling/data/common_chase.py" ]
[ "import random\nimport cv2\nimport numpy as np\nimport skimage.color as sc\nfrom PIL import Image, ImageDraw\nimport torch\nimport math\nimport pandas as pd\nfrom scipy.ndimage.interpolation import map_coordinates\nfrom scipy.ndimage.filters import gaussian_filter\n\ndef augment_brightness_camera_images(image):\n ...
[ [ "numpy.random.rand", "numpy.tile", "numpy.exp", "numpy.concatenate", "numpy.random.normal", "numpy.zeros_like", "numpy.log", "numpy.logical_and", "numpy.arange", "numpy.transpose", "numpy.random.randint", "numpy.expand_dims", "numpy.array", "numpy.reshape", ...
atn832/model-analysis
[ "a96a9665e57a12cb4d3ad1f366dc347347e3a96e" ]
[ "tensorflow_model_analysis/evaluators/aggregate_test.py" ]
[ "# Lint as: python3\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.test.main" ] ]
nomad-coe/electronic-parsers
[ "defb47be6ac22b2e48d4fb9204c85390a3c2f328" ]
[ "electronicparsers/cp2k/parser.py" ]
[ "#\n# Copyright The NOMAD Authors.\n#\n# This file is part of NOMAD.\n# See https://nomad-lab.eu for further info.\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://w...
[ [ "numpy.hstack", "numpy.array", "numpy.dot" ] ]
ronitd/gtn_applications
[ "98d85643ef6c3ccf95fc122158dd4e8cc307d92e" ]
[ "datasets/audioset.py" ]
[ "\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n\"\"\"\n\nimport itertools\nimport json\nimport os\nimport re\nimport torch\nimport torchaudio\nimport torchvision\n\n\ndef log_norma...
[ [ "torch.LongTensor" ] ]
varunshiva/t20-mining
[ "3d1b44e3cccd77d7231c215735668b53f7799cd3" ]
[ "src/data/test/test_make_dataset.py" ]
[ "#!/usr/bin/env python\n\nfrom src.data import make_dataset\nfrom pathlib import Path\nimport pandas as pd\n\ndef test_cricsheet_to_dataframe():\n \"\"\"\n docstring\n \"\"\"\n \n test_path = Path(__file__).parent.resolve()\n test_file = test_path / 'data' / 'test.csv'\n make_dataset.cricsheet_...
[ [ "pandas.read_csv" ] ]
Larofeticus/balsam
[ "6d646ebe87a21bca5934bbd0b5fdc68a1baea09b" ]
[ "balsam/core/models.py" ]
[ "from collections import defaultdict, Counter\nfrom itertools import combinations\nimport os\nimport json\nimport logging\nimport re\nimport numpy as np\nimport socket\nimport sys\nimport threading\nfrom datetime import datetime, timedelta\nfrom django.utils import timezone\nimport uuid\nfrom getpass import getuser...
[ [ "numpy.histogram", "numpy.fromiter", "numpy.arange", "numpy.cumsum" ] ]
MichaelStevan/xmenu-keras-retinanet
[ "e2b843dcb7f40e96926d0b02d1036add47e69421" ]
[ "setup.py" ]
[ "import setuptools\nfrom setuptools.extension import Extension\nfrom distutils.command.build_ext import build_ext as DistUtilsBuildExt\n\n\nclass BuildExtension(setuptools.Command):\n description = DistUtilsBuildExt.description\n user_options = DistUtilsBuildExt.user_options\n boolean_options = Dist...
[ [ "numpy.get_include" ] ]
franzigeiger/brain-score-1
[ "6749e55544e4e60cee7b9a7b4bc3f60f66dcbce2" ]
[ "tests/test_benchmarks/test_trials.py" ]
[ "import numpy as np\n\nfrom brainio_base.assemblies import NeuroidAssembly\nfrom brainio_base.stimuli import StimulusSet\nfrom brainscore.benchmarks.trials import repeat_trials, average_trials\n\n\ndef _dummy_stimulus_set():\n stimulus_set = StimulusSet([\n {'image_id': 'a'},\n {'image_id': 'b'},\n...
[ [ "numpy.testing.assert_array_equal" ] ]
wangjksjtu/autoassist-exp
[ "7c4599fb250c2041ab007965b083750875dd6ac9" ]
[ "machine_translation/fairseq/modules/sinusoidal_positional_embedding_new.py" ]
[ "import math\n\nimport torch\nimport torch.nn as nn\nimport torch.onnx.operators\n\nfrom fairseq import utils\n\n\nclass SinusoidalPositionalEmbedding(nn.Module):\n \"\"\"This module produces sinusoidal positional embeddings of any length.\n Padding symbols are ignored.\n \"\"\"\n\n def __init__(self, e...
[ [ "torch.zeros", "torch.cos", "torch.onnx.operators.reshape_from_tensor_shape", "torch.arange", "torch.sin", "torch.FloatTensor", "torch.onnx.operators.shape_as_tensor", "torch.LongTensor" ] ]
TheBonheurs/neural-processes
[ "5834bc65f406456e53c363ade1cb0f2a5f23a033" ]
[ "training.py" ]
[ "import torch\nfrom random import randint\nfrom neural_process import NeuralProcessImg\nfrom torch.distributions.kl import kl_divergence\nfrom utils import (context_target_split, batch_context_target_mask,\n img_mask_to_np_input)\n\n\nclass NeuralProcessTrainer:\n \"\"\"\n Class to handle tr...
[ [ "torch.distributions.kl.kl_divergence" ] ]
reinforcementdriving/nuscenes-devkit
[ "00b8f9082d84b32fb7dcf2356d39b6c7af83e1a1" ]
[ "python-sdk/nuscenes/eval/lidarseg/evaluate.py" ]
[ "import argparse\nimport json\nimport os\nfrom typing import Dict\n\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom nuscenes import NuScenes\nfrom nuscenes.eval.lidarseg.utils import LidarsegClassMapper, ConfusionMatrix, get_samples_in_eval_set\n\n\nclass LidarSegEval:\n \"\"\"\n This is the official nuSce...
[ [ "numpy.fromfile" ] ]
Linlin15963/msds501
[ "0bcfa7f59a4e9b2d71db2c5973eb04c1ae60e72f" ]
[ "save_np.py" ]
[ "import sys\nimport os\nimport numpy as np\n\nscript_path = sys.argv[1]\ndirname = os.path.dirname(script_path)\ndirname = \".\" if dirname.strip() == \"\" else dirname\n\nret_vocab_path = \"{dir}/{f}\".format(dir = dirname, f = \"glove.42B.300d.vocab.txt\")\nret_vectr_path = \"{dir}/{f}\".format(dir = dirname, f =...
[ [ "numpy.array" ] ]
B0Qi/hualubei2020-callingsmoking
[ "73d1049d95554b5d669afa93132a0fce37461ff4" ]
[ "train.py" ]
[ "# from __future__ import print_function\n\nimport os,argparse\nimport random\nimport gc\nimport numpy as np\nimport cv2\nfrom PIL import Image\nimport time\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom torch....
[ [ "torch.device", "numpy.array", "torch.optim.lr_scheduler.StepLR", "torch.nn.Softmax", "torch.no_grad", "torch.optim.lr_scheduler.CosineAnnealingWarmRestarts", "torch.cuda.empty_cache", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "torch.nn.CrossEntropyLoss" ...
zhengjxu/mlflow
[ "004ef1f091881ac6379182055763a82607a4a669" ]
[ "mlflow/pytorch/__init__.py" ]
[ "\"\"\"\nThe ``mlflow.pytorch`` module provides an API for logging and loading PyTorch models. This module\nexports PyTorch models with the following flavors:\n\nPyTorch (native) format\n This is the main flavor that can be loaded back into PyTorch.\n:py:mod:`mlflow.pyfunc`\n Produced for use by generic pyfun...
[ [ "torch.jit.ScriptModule.save", "torch.save", "torch.no_grad", "torch.from_numpy", "torch.jit.load", "torch.load" ] ]
samsartor/score_sde
[ "d25c8d092a68d643c796d771c55f80075aa041d1" ]
[ "models/ddpm.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "torch.nn.Linear", "torch.nn.init.zeros_", "torch.nn.GroupNorm", "torch.nn.ModuleList" ] ]
Eddy-zheng/ImageDT
[ "78c9e671526422f28bd564cad9879ef95f12b454" ]
[ "imagedt/tools/metrics/roc_curve.py" ]
[ "# coding: utf-8\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport imagedt\n\n\ndef roc(test_file, show_fig=False):\n lines = imagedt.file.readlines(test_file)\n\n # line: Image_name,True_class_name,Label_id,Predict_id,Confidence,Match\n try:\n int(lines[0].split(',')[-1])\n ...
[ [ "numpy.array", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.finfo", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
chicolucio/estatisticas-oiq-2019
[ "017da73f3bef6a6f40d7dd1214621cad7c14be2e" ]
[ "resultados/input_data.py" ]
[ "# coding: utf-8\n\nimport pandas as pd\nimport numpy as np\n\n\ndef input_data(file_path):\n \"\"\"Gera um Pandas DF a partir de um arquivo csv.\n\n Parameters\n ----------\n file_path : type string\n Caminho do arquivo.\n\n Returns\n -------\n type\n Pandas DataFrame. NaN substi...
[ [ "numpy.where", "pandas.read_csv", "pandas.pivot_table", "numpy.arange" ] ]
leejw51/BumblebeeNet
[ "fd9bedbfaad9bb94bcb4f1dc44eec8125bb9c690" ]
[ "Test/DrawGraph2.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nx = np.arange(0,6, 0.1)\ny1 = np.sin(x)\ny2 = np.cos(x)\n\nplt.plot(x,y1, label=\"sin\")\nplt.plot(x,y2,linestyle=\"--\", label=\"cos\")\nplt.xlabel(\"x\")\nplt.ylabel(\"y\")\nplt.title('sin & cos')\nplt.legend()\nplt.show()\n" ]
[ [ "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.arange", "numpy.cos", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
johan-kallstrom/bayesian-learning-course
[ "4d9a41a540821bd7f6791919471659c5b7643f4b" ]
[ "experiments/run_experiment_02.py" ]
[ "# Run experiment 2\n\nfrom bayesian_learning.bandits import NonStationaryBernoulliBandit\nfrom bayesian_learning.thompson_sampling import ThompsonSampling, SlidingWindowThompsonSampling\nfrom bayesian_learning.bayes_ucb import BayesUcb, SlidingWindowBayesUcb\nfrom bayesian_learning.ucb import Ucb\nfrom bayesian_le...
[ [ "numpy.array", "numpy.zeros", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "numpy.mean", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotl...
China-chenzhibo/GuessByHistory-Model
[ "5e520bd9b8c7415a05c09741a2d6796c0e5f470e" ]
[ "GBH_testCase.py" ]
[ "# test\r\nimport check_day\r\nimport datetime\r\nfrom dateutil.relativedelta import relativedelta\r\nimport pandas as pd\r\nimport os\r\nimport baostock as bs\r\nimport time\r\n\r\ntest_group = [\r\n datetime.date(2021, 11, 22), # 周一/交易日\r\n datetime.date(2021, 11, 21), # 周末\r\n datetime.date(2021, 10, ...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
TalonCB/ReChorus
[ "e5ba2bb853f1a554954be747c3a5fb11c96c1c95" ]
[ "src/models/general/BPRMF.py" ]
[ "# -*- coding: UTF-8 -*-\n# @Author : Chenyang Wang\n# @Email : THUwangcy@gmail.com\n\n\"\"\" BPRMF\nReference:\n \"Bayesian personalized ranking from implicit feedback\"\n Rendle et al., UAI'2009.\nCMD example:\n python main.py --model_name BPRMF --emb_size 64 --lr 1e-3 --l2 1e-6 --dataset 'Grocery_and...
[ [ "torch.nn.Embedding" ] ]
david-zwicker/py-utils
[ "dae98cb3125f8160b59a1721e01640f344c9dc64" ]
[ "utils/data_structures/cache.py" ]
[ "'''\nCreated on Sep 11, 2014\n\n@author: David Zwicker <dzwicker@seas.harvard.edu>\n\nThis module contains functions that can be used to manage cache structures\n'''\n\nfrom __future__ import division\n\nimport collections\nfrom hashlib import sha1\nimport functools\nimport logging\nimport numbers\nimport os\nimpo...
[ [ "numpy.full", "numpy.empty", "numpy.zeros" ] ]
MiloszGrabski/deepchem
[ "1af203724db0ecebedf87967d1009fd8973da2d6" ]
[ "deepchem/models/tests/test_molgan_layers.py" ]
[ "import unittest\n\nfrom tensorflow import keras\nfrom tensorflow.keras.layers import Input\nfrom tensorflow.keras import activations\nfrom deepchem.models.layers import MolGANConvolutionLayer, MolGANMultiConvolutionLayer, MolGANAggregationLayer, MolGANEncoderLayer\n\n\nclass test_molgan_layers(unittest.TestCase):\...
[ [ "tensorflow.keras.Model", "tensorflow.keras.layers.Input" ] ]
abdisa1Fekadu/basic-of-self-driving-car
[ "b14e798d8523d04ada37a6328bcc3b41b48c6f8f" ]
[ "Autopilot_V2/AutopilotApp_V2.py" ]
[ "import numpy as np\nimport cv2\nfrom keras.models import load_model\n\nmodel = load_model('Autopilot.h5')\n\ndef keras_predict(model, image):\n processed = keras_process_image(image)\n steering_angle = float(model.predict(processed, batch_size=1))\n steering_angle = steering_angle * 60\n return steerin...
[ [ "numpy.array", "numpy.reshape" ] ]
louis-she/ignite
[ "d05a8939139e056e5c5daf842c81af0ab5b0caaf" ]
[ "examples/gan/dcgan.py" ]
[ "import argparse\nimport os\nimport random\nimport warnings\nfrom pathlib import Path\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data as data\n\nfrom ignite.contrib.handlers import ProgressBar\nfrom ignite.engine import Engine, Events\nfrom ignite.handlers import ModelCh...
[ [ "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.ones", "torch.cuda.is_available", "matplotlib.pyplot.gcf", "torch.load", "pandas.read_csv", "torch.nn.ConvTranspose2d", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "torch.zeros", "m...
AndreiDavydov/Poisson_Denoiser
[ "a0b8f3dce8282b8e50d44cacb7bdc4fc6d4abc22" ]
[ "wavelet_transform.py" ]
[ "import pywt\nimport numpy as np\n\n\nclass WaveletTransform():\n '''\n Class for using the particular wavelet transformation. After doing first transformation, it will save shapes of the image. \n So, to work with the images of different size you should make another instance of this class.\n '''\n d...
[ [ "numpy.zeros_like", "numpy.random.rand", "numpy.random.seed", "numpy.block", "numpy.abs" ] ]
jmnyman/vq-vae-2-pytorch
[ "48502ebf9120677f3b493d33261177951eebce99" ]
[ "vqvae.py" ]
[ "import torch\r\nfrom torch import nn\r\nfrom torch.nn import functional as F\r\n\r\n\r\n# Copyright 2018 The Sonnet Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a c...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.nn.functional.one_hot", "torch.nn.MSELoss", "torch.nn.Sequential", "torch.nn.CrossEntropyLoss", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.randn" ] ]