repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
iamharsha1999/theganbibliotheca | [
"c764af367e850555d04d6760b6bca756737670d3"
] | [
"ChromaGAN/train.py"
] | [
"import torch \nfrom torch.autograd import grad \nfrom tqdm import tqdm\nfrom torch.optim import Adam\nimport torch.nn as nn\nimport pretrainedmodels\nimport cv2\n\nclass Trainer():\n\n def __init__(self, gen , dis,data, fixed_gray_images,device = 'cuda'):\n\n self.device = device \n self.generator... | [
[
"torch.mean",
"torch.nn.KLDivLoss",
"torch.cat",
"torch.sum",
"torch.no_grad",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.cuda.get_device_name",
"torch.device",
"torch.nn.MSELoss"
]
] |
Ericbrod10/Deep-Learning | [
"5b0a01597ce19f2da5bf45b76023b898c494f46a"
] | [
"Assignment09/test.py"
] | [
"import sys\nimport keras\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.utils import normalize\nfrom keras.models import *\n\n\n#load in model\nmodel = sys.argv[1]\ngen = load_model(model)\n\n#load noise parameters \nnoise = np.random.normal(loc=0, scale=1, size=[100, 100])\ngenImages = gen.predi... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"numpy.random.normal",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
n-fallahinia/finger-detection | [
"ebc3a5165b34156fa8f2abb44fde5d48b5405f95"
] | [
"tfrecords_converter.py"
] | [
"\"\"\" Simple script to convert TensorFlow XML-to-TFRecord \n\nNavid Fallahinia - 21/11/2020\nBioRobotics Lab\n\nusage: generate_tfrecord.py [-h] [-x XML_DIR] [-l LABELS_PATH] [-o OUTPUT_PATH] [-i IMAGE_DIR] [-c CSV_PATH]\n\noptional arguments:\n -h, --help show this help message and exit\n -x XML_DIR... | [
[
"tensorflow.compat.v1.python_io.TFRecordWriter",
"pandas.DataFrame",
"tensorflow.compat.v1.app.run"
]
] |
kwang-12/basalt-mirror | [
"9dd7b2c8031283ec033211bc90ad70aa70323eaa"
] | [
"python/basalt/latex/util.py"
] | [
"#\n# BSD 3-Clause License\n#\n# This file is part of the Basalt project.\n# https://gitlab.com/VladyslavUsenko/basalt.git\n#\n# Copyright (c) 2019-2021, Vladyslav Usenko and Nikolaus Demmel.\n# All rights reserved.\n#\nimport math\nimport numpy as np\n\n\ndef best_two_non_repeating(array, reverse=False):\n if r... | [
[
"numpy.radians",
"numpy.cos",
"numpy.sin"
]
] |
Jonahowns/oxTorch_prototype | [
"e6c7c393b1100bc8604bd9ffc7a70c9c77e9e531"
] | [
"cgdms/cgdms.py"
] | [
"# Differentiable molecular simulation of proteins with a coarse-grained potential\n# Author: Joe G Greener\n\n# biopython, PeptideBuilder and colorama are also imported in functions\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom torch.nn.functional import normalize\n\nfrom itertools ... | [
[
"torch.nn.functional.normalize",
"torch.svd",
"torch.nn.Parameter",
"torch.ones",
"numpy.sqrt",
"torch.zeros",
"torch.randn",
"numpy.median",
"torch.sum",
"numpy.linalg.norm",
"torch.tensor",
"torch.matmul",
"torch.no_grad",
"torch.log",
"numpy.array",
... |
marciojustino/data-arrays-lib | [
"d2495eb9d00d5ee3a885d6f215d9c28eba9fab66"
] | [
"main.py"
] | [
"import random\nimport numpy as np\nfrom src.data_arrays import DataArrays\nimport datetime\n\na = np.random.randint(1, 10000, 1000000)\n\ndataArrays = DataArrays()\nstart_at = datetime.datetime.now()\nb = dataArrays.sort(a)\nends_at = datetime.datetime.now()\nprint(\"Duration: {}\".format(ends_at-start_at))\n"
] | [
[
"numpy.random.randint"
]
] |
jurasofish/pandapower | [
"630e3278ca012535f78282ae73f1b86f3fe932fc"
] | [
"pandapower/test/opf/test_basic.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n\n\nimport numpy as np\nimport pytest\n\nimport pandapower as pp\nfrom pandapower.convert_format import convert_format\nfro... | [
[
"numpy.array",
"numpy.allclose",
"numpy.isclose"
]
] |
mwilliammyers/dcnn | [
"ab5e30fc2fdb80781459608a6c452334414756d0"
] | [
"dcnn.py"
] | [
"import time\nimport timeit\nimport numpy as np\nimport dataloader\nimport models\nimport torch\nimport tqdm\nfrom tensorboardX import SummaryWriter\n\n\ndef get_arguments():\n import argparse\n\n model_choices = ['dcnn', 'mlp']\n non_linearity_choices = ['tanh', 'relu', 'leaky-relu']\n optim_choices = ... | [
[
"torch.optim.Adam",
"torch.nn.CrossEntropyLoss",
"torch.optim.Adagrad",
"torch.sum",
"torch.optim.Adadelta",
"torch.nn.LeakyReLU",
"torch.cuda.is_available",
"torch.nn.ReLU",
"numpy.zeros"
]
] |
robotic-vision-lab/Attention-With-Varying-Receptive-Fields-Network | [
"e151216ca029dc72ab93e03d6bcacd69161d1c25"
] | [
"SRcode/InceptionModules.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport tensorflow.keras as keras\nfrom tensorflow.keras import datasets, layers, models, regularizers\nimport pdb\nclass inception_module(layers.Layer):\n \"\"\"\n Inception Module\n This module is made for image super-resolution where max pooling l... | [
[
"tensorflow.keras.layers.Conv2D",
"tensorflow.concat",
"tensorflow.keras.layers.MaxPool2D"
]
] |
Victorwz/awesome_NLP_projects | [
"d16ca80b1b5bcc0536380599a01af173507961ad",
"d16ca80b1b5bcc0536380599a01af173507961ad"
] | [
"attention/main.py",
"ngram/code_for_figures_plot/plt_frac.py"
] | [
"import argparse\nimport control\nimport data\nimport datetime\nimport mylogger\nimport math\nimport model\nimport os\nimport random\nimport sys\nimport time\nimport torch\nimport torch.nn as nn\n\n\ndef make_model_path(args):\n if not os.path.exists('scratch'):\n os.makedirs('scratch')\n model_path = ... | [
[
"torch.device",
"torch.manual_seed"
],
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
PokeLegoCuber/BigRedHackVProject | [
"14e68152cc4e1441ddacb3a909d81b9c688e47ab"
] | [
"PythonDataProcessing/main.py"
] | [
"\"\"\"\r\nReading inputs from a file and outputs corresponding result in a file\r\n\r\nTakes in state abbreviation and county name and outputs house fire risk (int)\r\nBased on data from Red Cross Smoke Alarm Map\r\n\r\nAuthor: Haoxuan Chen\r\nDate: 2019/9/22\r\n\"\"\"\r\nimport pandas as pd\r\n\r\ndf = pd.read_c... | [
[
"pandas.read_csv"
]
] |
efurlanm/tama21 | [
"5849f2b730a99ca7cca2d1cb27442d321f12419b"
] | [
"2021-11-08/ng2.py"
] | [
"import numpy as np, math\nfrom time import time\nfrom mpi4py import MPI\nfrom numba import cuda, njit, prange, config\n\n# parameters\nn = 4800 # n x n grid\nenergy = 1.0 # energy to be injected per iteration\nniters = 500 # number of iterations\n# initialize three heat sources\nn... | [
[
"numpy.zeros",
"numpy.sum",
"numpy.empty"
]
] |
nxbrnt/spotify_data_project | [
"37b1c98e3c032f1751ee91b873ecc7b2890595a2"
] | [
"violin_midcurve.py"
] | [
"#Imports here for writefile magic only. Not Pythonic.\nimport seaborn as sns\nimport numpy as np\nfrom scipy.interpolate import interp1d\nred = (1,0,0)\nblue = (0,.475,1) #Same relative luminance as primary red (approx)\n\n#can remove a lot of these params for ordering. just wanna be able to flip \n#which goes to ... | [
[
"numpy.concatenate",
"scipy.interpolate.interp1d"
]
] |
pmclSF/DeepCompress | [
"6fc51aa0e9b34fb89f97877ad56da6345f93b929"
] | [
"src/model_opt.py"
] | [
"import numpy as np\nimport logging\nfrom scipy.spatial.ckdtree import cKDTree\nfrom utils.pc_metric import validate_opt_metrics, compute_metrics\n\nlogger = logging.getLogger(__name__)\n\n\ndef build_points_threshold(x_hat, thresholds, len_block, max_delta=np.inf):\n pa_list = []\n for i, t in enumerate(thre... | [
[
"numpy.mean",
"scipy.spatial.ckdtree.cKDTree",
"numpy.argmin",
"numpy.argwhere"
]
] |
Floozutter/silly | [
"8273b4a33e2001c0a530e859c12dbc30b9590a94"
] | [
"python/randmoodplot.py"
] | [
"\"\"\"\nA plotting companion to randmood.py.\n\"\"\"\n\nimport matplotlib.pyplot as plt\nfrom itertools import islice\nfrom typing import Callable, Iterator\n\n\ndef plot_generator(\n\ttitle: str,\n\tgenf: Callable[[float], Iterator[float]],\n\tn: int,\n\tp: float\n) -> None:\n\tplot(\n\t\ttitle,\n\t\trange(n+1),\... | [
[
"matplotlib.pyplot.figure"
]
] |
nisarahamedk/detr-tensorflow | [
"aa6f283a6b79796804eaef10f3fb1e417fafd2b3"
] | [
"detr_tf/networks/transformer.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.layers import Dropout, Activation, LayerNormalization\n\nfrom .custom_layers import Linear\n\n\nclass Transformer(tf.keras.Model):\n def __init__(self, model_dim=256, num_heads=8, num_encoder_layers=6,\n num_decoder_layers=6, dim_feedforward=2048, d... | [
[
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.matmul",
"tensorflow.nn.softmax",
"tensorflow.transpose",
"tensorflow.keras.layers.Activation",
"tensorflow.shape",
"tensorflow.reduce_mean",
"tensorflow.stack",
"tensorflow.reshape",
"tensorflow.expand_dims",
"t... |
zhangkunliang/BayesOptimization | [
"6d78c9e9f96239b0dbb85650a0d878e9410158ec"
] | [
"examples/grain_bound/bayesOptimization/interactive/bo_mao_interactive.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\nfrom __future__ import print_function\n\nimport numpy as np\nimport pickle as pickle\nimport scipy\nimport combo\nimport os\nimport urllib\nimport matplotlib.pyplot as plt\n\nnum = 0\n\n\ndef load_data():\n A = np.loadtxt('descriptor.dat')\n print(A.shape)\n X = A\n ... | [
[
"numpy.savetxt",
"numpy.zeros",
"numpy.loadtxt"
]
] |
xzy256/tensorflow-mips | [
"f45787d2f30e8109a67f7fa5a586167a71489d21"
] | [
"tensorflow/tensorboard/backend/application_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.core.protobuf.meta_graph_pb2.MetaGraphDef",
"tensorflow.tensorboard.backend.event_processing.event_multiplexer.EventMultiplexer",
"tensorflow.Summary.Audio",
"tensorflow.summary.FileWriter",
"tensorflow.tensorboard.backend.application.get_tensorboard_tag",
"tensorflow.tensorboa... |
iabhibits/QANet_SQUAD_2.0 | [
"760f1147038411beb205401ae902d6ec3ac4468d"
] | [
"Baseline/train.py"
] | [
"\"\"\"Train a model on SQuAD.\n\nAuthor:\n Chris Chute (chute@stanford.edu)\n\"\"\"\n\nimport numpy as np\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as sched\nimport torch.utils.data as data\nimport util\n\nf... | [
[
"torch.optim.lr_scheduler.LambdaLR",
"torch.enable_grad",
"numpy.random.seed",
"torch.nn.functional.nll_loss",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.manual_seed_all",
"torch.nn.DataParallel"
]
] |
phrenico/cmfsapy | [
"9eb0b335a3e1f2c4a02fd7edf7b22b78d4ea9931"
] | [
"src/cmfsapy/dimension/fsa.py"
] | [
"import numpy as np\nfrom scipy.spatial import cKDTree\nfrom multiprocessing import cpu_count\nfrom scipy.stats import hmean\n\n\ndef get_dists_inds_ck(X, k, boxsize):\n \"\"\"computes the kNN distances and indices\n\n :param numpy.ndarray X: 2D array with data shape: (ndata, n_vars)\n :param int k: neigh... | [
[
"numpy.log",
"numpy.arange",
"scipy.stats.hmean",
"numpy.ceil",
"scipy.spatial.cKDTree"
]
] |
sanderisbestok/ExtremeNet | [
"02c0126581bfdf95885ba55aa12f23de4cf2c12e"
] | [
"nnet/py_factory.py"
] | [
"import os\nimport torch\nimport importlib\nimport torch.nn as nn\nimport json\n\n\nfrom config import system_configs\nfrom models.py_utils.data_parallel import DataParallel\nfrom db.datasets import datasets\n\ntorch.manual_seed(317)\n\nclass Network(nn.Module):\n def __init__(self, model, loss):\n super(... | [
[
"torch.manual_seed",
"torch.save",
"torch.no_grad",
"torch.load"
]
] |
KevinXie86/AutowareArchitectureProposal.iv | [
"28c8c367652bcc5c2548abdab732e0fea7302653"
] | [
"planning/scenario_planning/common/motion_velocity_optimizer/scripts/trajectory_visualizer.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright 2020 Tier IV, 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 ... | [
[
"numpy.sqrt",
"numpy.min",
"numpy.max",
"matplotlib.pyplot.subplot",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
lopez-lab/PyRAI2MD | [
"43e27fbc9bc5b6ab6a8f170791951f316fcd0964"
] | [
"PyRAI2MD/Machine_Learning/pyNNsMD/nn_pes_src/training/training_mlp_g2.py"
] | [
"\"\"\"\nThe main training script for energy gradient model. Called with ArgumentParse.\n\"\"\"\n# from sklearn.utils import shuffle\n# import time\nimport matplotlib as mpl\nimport numpy as np\nimport tensorflow as tf\n\nmpl.use('Agg')\nimport os\nimport json\nimport pickle\nimport sys\nsys.path.append('%s/PyRAI2M... | [
[
"tensorflow.config.experimental.list_logical_devices",
"numpy.abs",
"matplotlib.use",
"tensorflow.keras.callbacks.LearningRateScheduler",
"numpy.finfo",
"tensorflow.keras.optimizers.Adam",
"numpy.array"
]
] |
ljh4697/reinforcement-learning-kr-v2 | [
"f7c4ae038796db252b172136f0ca895dc6183cb8"
] | [
"1-grid-world/2-value-iteration/environment.py"
] | [
"import tkinter as tk\nimport time\nimport numpy as np\nimport random\nfrom PIL import ImageTk, Image\n\nPhotoImage = ImageTk.PhotoImage\nUNIT = 100 # 픽셀 수\nHEIGHT = 5 # 그리드월드 세로\nWIDTH = 5 # 그리드월드 가로\nTRANSITION_PROB = 1\nPOSSIBLE_ACTIONS = [0, 1, 2, 3] # 상, 하, 좌, 우\nACTIONS = [(-1, 0), (1, 0), (0, -1), (0, 1)... | [
[
"numpy.array"
]
] |
cpuimage/segan | [
"f4db80ef50de0490aea8f3526073a2a45ddc6d9d"
] | [
"data_loader.py"
] | [
"from __future__ import print_function\nimport tensorflow as tf\nfrom ops import *\nimport numpy as np\n\n\ndef pre_emph(x, coeff=0.95):\n x0 = tf.reshape(x[0], [1,])\n diff = x[1:] - coeff * x[:-1]\n concat = tf.concat([x0, diff], 0)\n return concat\n\ndef de_emph(y, coeff=0.95):\n if coeff <= 0:\n ... | [
[
"tensorflow.concat",
"tensorflow.FixedLenFeature",
"tensorflow.decode_raw",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.TFRecordReader",
"numpy.zeros"
]
] |
ischlag/Fast-Weight-Memory-public | [
"64c077f02ec320ec535cb66db3600453e1ef445f"
] | [
"catbAbI/trainers/catbAbI_trainer.py"
] | [
"\"\"\"\nImplements the trainer class that keeps track of the training state with some features:\n- saves best and last model after every evaluation\n- uses the log function to log terminal/text file\n- can restore the state of a training run and continue seamlessly\n- early stopping\n- saves last model whenever it... | [
[
"torch.mean",
"torch.ones",
"torch.isnan",
"torch.load",
"torch.cat",
"torch.zeros",
"torch.argmax",
"torch.zeros_like",
"torch.tensor",
"numpy.mean",
"torch.sort",
"torch.no_grad",
"torch.stack",
"numpy.sum",
"torch.save"
]
] |
CPrescher/fabio | [
"9f3e8ec347d75d27dd5e11087555810a01864fae"
] | [
"fabio/test/testnumpyimage.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Project: Fable Input Output\n# https://github.com/silx-kit/fabio\n#\n# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)\n#\n# This program is fre... | [
[
"numpy.random.random",
"numpy.allclose",
"numpy.save",
"numpy.random.randint"
]
] |
Jack12xl/taichi | [
"80eba2ee9f0a471f86f1786625ebda04bf3c7236"
] | [
"tests/python/test_static.py"
] | [
"import numpy as np\nimport pytest\n\nimport taichi as ti\n\n\n@pytest.mark.parametrize('val', [0, 1])\n@ti.test(ti.cpu)\ndef test_static_if(val):\n x = ti.field(ti.i32)\n\n ti.root.dense(ti.i, 1).place(x)\n\n @ti.kernel\n def static():\n if ti.static(val > 0.5):\n x[0] = 1\n el... | [
[
"numpy.array"
]
] |
Jacobjeevan/Reddit-Gild-Predictor | [
"4ef1ba76a51b48a4f37df04ddc059119a2ab5034"
] | [
"src/data/preprocess.py"
] | [
"import pandas as pd\nimport argparse\nfrom CommentData import CommentData\nfrom AuthorData import AuthorData\nfrom GildData import GildData\nfrom ThreadData import ThreadData\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.model_selection import StratifiedShuffleSplit\nfrom pathlib import P... | [
[
"sklearn.model_selection.StratifiedShuffleSplit"
]
] |
xingmimfl/pytorch_LSGAN | [
"a744cd05c925111e807613f7fb4ed42cd99589c6"
] | [
"models/lsgan.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.parallel\n\nclass LSGAN_D(nn.Module):\n def __init__(self):\n super(LSGAN_D, self).__init__()\n layers = [\n nn.Conv2d(in_channels=3, out_channels=64, kernel_size=5, stride=2,bias=False),\n nn.BatchNorm2d(64),\n ... | [
[
"torch.nn.Sequential",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
BkyuChoi/HpicFlatland | [
"bdbba7ce451eb72dc760993b96cec4772a08983c"
] | [
"Test6multi.py"
] | [
"import os\nimport random\nimport sys\nfrom argparse import ArgumentParser, Namespace\nfrom pathlib import Path\nfrom pprint import pprint\n\nfrom flatland.utils.rendertools import RenderTool\nfrom torch.utils.tensorboard import SummaryWriter\nimport numpy as np\nimport torch\n\nfrom flatland.envs.rail_env import R... | [
[
"numpy.random.seed",
"numpy.power",
"numpy.min",
"numpy.round",
"numpy.max",
"numpy.std",
"numpy.mean",
"torch.utils.tensorboard.SummaryWriter",
"numpy.array",
"numpy.sum"
]
] |
s0phia-/ipse | [
"a2113762c63086d8d1614abb10ed9f898aef35f0",
"a2113762c63086d8d1614abb10ed9f898aef35f0"
] | [
"agents/NN_EW.py",
"agents/LSPI.py"
] | [
"import numpy as np\nimport random\nimport math\nfrom agents.stew.utils import create_diff_matrix\n\n\nclass EwDefaultDict(dict):\n\n def __missing__(self, key):\n return create_diff_matrix(key)\n\n\nclass NeuralNetwork:\n def __init__(self, x_size, y_size):\n self.x = x # input\n self.y... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.random.rand"
],
[
"numpy.linalg.inv",
"numpy.eye",
"numpy.matmul",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
daaltces/pydaal-tutorials | [
"ed47e8eef30f63421968232713552c0afad5cfae"
] | [
"2-pre-built-helper-classes/DecisionForest/DF-classification-usage-example.py"
] | [
"import sys,os\r\nsys.path.append(os.path.join(os.path.dirname(sys.executable),'share','pydaal_examples','examples','python','source'))\r\nimport numpy as np\r\nfrom DecisionForest import Classification\r\nfrom daal.data_management import HomogenNumericTable\r\nfrom utils import printNumericTables,printNumericTable... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_digits",
"numpy.unique"
]
] |
yiqings/autogluon | [
"d41a1ab6a6c440b82f06a25835c719fb9d9e9ebf"
] | [
"text/src/autogluon/text/automm/models/categorical_transformer.py"
] | [
"import torch\nfrom torch import nn\nfrom torch import Tensor\nfrom typing import Any, Dict, List, Optional, Union, cast\nfrom ..constants import CATEGORICAL, LABEL, LOGITS, FEATURES\nfrom .ft_transformer import _TokenInitialization, CLSToken, FT_Transformer\n\n\nclass CategoricalFeatureTokenizer(nn.Module):\n \... | [
[
"torch.stack",
"torch.nn.Identity",
"torch.tensor"
]
] |
gilad-rubin/hypster | [
"e8a15b9023a1bbffad4e5cdd756aed33e2682931"
] | [
"tests/test_preprocessing.py"
] | [
"import sklearn\nimport scipy\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.datasets import make_classification\n\nfrom hypster import HyPSTERClassifier\n\nSEED = 50\n\ndef test_flow():\n X, y = make_classification(n_samples=300, n_features=40, n_inf... | [
[
"sklearn.metrics.roc_auc_score",
"sklearn.datasets.make_classification",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"numpy.random.randint"
]
] |
212726320/BEBO-1 | [
"2909b3a00161b2e29fad667add30392abc11a968"
] | [
"src/systems/synthetic.py"
] | [
"# File: synthetic.py\n# File Created: Sunday, 3rd November 2019 11:38:53 am\n# Author: Steven Atkinson (212726320@ge.com)\n\n\"\"\"\nAnother synthetic function\n\"\"\"\n\nimport numpy as np\n\nfrom .base import WithFunction\n\n\nclass Synthetic(WithFunction):\n \"\"\"\n Domain: [0, 1]\n \"\"\"\n def __... | [
[
"numpy.random.get_state",
"numpy.random.seed",
"numpy.sin",
"numpy.random.set_state",
"numpy.random.rand"
]
] |
yukiar/phrase_alignment_cted | [
"7706ca1b8be849f2413d813ea1f3c77919b635ee"
] | [
"src/bertwrapper.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pytorch_pretrained_bert.modeling import BertModel\nfrom cnn import CNN\nfrom multihead_attention import MultiheadAttention\nfrom position_wise_ffnn import Position_wise_FFNN\n\nMAXPOOLING = 0\nMEANPOOLING = 1\n\n\"\"\"\nInitialize BERT\n\"\... | [
[
"torch.mean",
"torch.norm",
"torch.ones",
"torch.max",
"torch.full",
"torch.cat",
"torch.load",
"torch.zeros",
"torch.sqrt",
"torch.nn.Sigmoid",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.tensor",
"torch.no_grad",
"torch.stack"
]
] |
kim0n0/rlberry | [
"6f0a68a0ea5ba7cd10c4787fbbdf1ed296d4810c"
] | [
"rlberry/envs/bandits/corrupted_bandits.py"
] | [
"import numpy as np\nfrom scipy import stats\n\nfrom rlberry.envs.bandits import Bandit\n\n\nclass CorruptedLaws:\n \"\"\"\n Class for corrupted laws.\n\n Parameters\n ----------\n\n law: law\n Can either be a frozen scipy law or any class that\n has a method .rvs() to sample according ... | [
[
"scipy.stats.norm",
"numpy.array"
]
] |
cavalleria/humanseg.pytorch | [
"77663504b32d777ae22345e660f8bc2132c1c817"
] | [
"models/pspnet.py"
] | [
"#------------------------------------------------------------------------------\n# Libraries\n#------------------------------------------------------------------------------\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\nfrom base.base_model import Ba... | [
[
"torch.nn.Dropout2d",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.functional.relu",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d"
]
] |
arita37/models | [
"659895bff24589829b317f5180d60329906dc13c"
] | [
"models/object_detection/tensorflow/ssd-resnet34/inference/fp32/coco_metric.py"
] | [
"# Copyright 2018 Google. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicab... | [
[
"numpy.split",
"numpy.minimum",
"numpy.maximum",
"tensorflow.gfile.Copy",
"numpy.squeeze",
"numpy.tile",
"numpy.ones",
"numpy.concatenate",
"tensorflow.logging.info",
"tensorflow.gfile.Remove",
"numpy.any",
"numpy.argsort",
"numpy.array",
"numpy.zeros"
]
] |
CameronBeebe/GamestonkTerminal | [
"e235f09290fbc188566643e5a7be46298d33ac35",
"e235f09290fbc188566643e5a7be46298d33ac35"
] | [
"gamestonk_terminal/etf/financedatabase_view.py",
"discordbot/stocks/technical_analysis/kc.py"
] | [
"\"\"\"Finance Database view\"\"\"\n__docformat__ = \"numpy\"\n\nimport financedatabase as fd\nimport pandas as pd\nfrom tabulate import tabulate\nfrom gamestonk_terminal import feature_flags as gtff\n\n\ndef show_etfs(\n category: str,\n name: str,\n description: str,\n include_exchanges: bool,\n am... | [
[
"pandas.DataFrame"
],
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf"
]
] |
xypan1232/ToxDL | [
"751cf1cd1352f4b300d68e520b8fdf9edc768c19"
] | [
"Evaluation.py"
] | [
"__author__ = 'jasper.zuallaert, Xiaoyong.Pan'\nfrom sklearn.metrics import roc_curve, auc\nfrom sklearn.metrics import average_precision_score, roc_auc_score\nfrom sklearn.metrics import f1_score, precision_recall_curve, matthews_corrcoef\n# Evaluates the predictions as written to the a file. The evaluation is don... | [
[
"sklearn.metrics.roc_auc_score",
"numpy.ones_like",
"sklearn.metrics.matthews_corrcoef",
"numpy.nan_to_num",
"sklearn.metrics.precision_recall_curve",
"sklearn.metrics.auc",
"sklearn.metrics.f1_score",
"numpy.zeros",
"numpy.sum"
]
] |
bakwc/catboost | [
"28acd0d36dbdf2759890f54a775383912ccfb65c"
] | [
"catboost/pytest/test.py"
] | [
"from itertools import permutations\nimport yatest.common\nfrom yatest.common import ExecutionTimeoutError, ExecutionError\nimport pytest\nimport os\nimport filecmp\nimport numpy as np\nimport pandas as pd\nimport timeit\nimport json\n\nimport catboost\n\nfrom catboost_pytest_lib import (\n apply_catboost,\n ... | [
[
"numpy.dot",
"numpy.hstack",
"pandas.read_csv",
"numpy.log",
"numpy.allclose",
"numpy.random.seed",
"numpy.random.random",
"numpy.arange",
"numpy.genfromtxt",
"numpy.all",
"numpy.concatenate",
"numpy.random.randn",
"numpy.mean",
"numpy.float32",
"numpy.s... |
dimdamop/single-neuron | [
"fa649bcd2c7cc68b46c87e63e3c5869f772fecdf"
] | [
"tests/test_neuron.py"
] | [
"# Author: Dimitrios Damopoulos\n# MIT license (see LICENCE.txt in the top-level folder)\n\nimport unittest \n\nimport os\nfrom tempfile import mkstemp \nfrom os.path import exists\n\nimport numpy as np\nfrom numpy import random\nimport string\nfrom random import choice as std_choice\n\nfrom single_neuron import ne... | [
[
"numpy.random.rand",
"numpy.random.randint"
]
] |
chiro2001/zynqs | [
"a9340a7d0e1376c991a7c21680e93c31a2acab1e"
] | [
"zynq-old/test/test_data.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ndat = [\r\n 16384, 8612, -1337, 2582, 10328, 4163, -8996, -9664, -540, -1274, -12721, -15195, -3892, 2413, -4918, -9055, \r\n 1598, 12103, 7531, -477, 4968, 15313, 11... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
NAM-IL/DeepLearningResearch | [
"b4f35520df7ef7980132758c407356fca20c59f2"
] | [
"ToDO/mnist_loader.py"
] | [
"\"\"\"\r\nmnist_loader\r\n~~~~~~~~~~~~\r\n\r\nA library to load the MNIST image data. For details of the data\r\nstructures that are returned, see the doc strings for ``load_data``\r\nand ``load_data_wrapper``. In practice, ``load_data_wrapper`` is the\r\nfunction usually called by our neural network code.\r\n\"... | [
[
"numpy.reshape",
"numpy.zeros"
]
] |
kanekomasahiro/context-debias | [
"2161b38efcb03dd894690f54805686ed8b75939a"
] | [
"src/run_debias_mlm.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.mean",
"torch.load",
"torch.cat",
"torch.nn.utils.rnn.pad_sequence",
"torch.sum",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.manual_seed_all",
"torch.cuda.is_available",
"torch.device",
"torch.distributed.init_process_group",
"torch.distribut... |
renyigan-lkgan/RenyiGAN | [
"c4bbb86e6037e0b95ee4c00c18729a8a8a3d2946"
] | [
"renyigan_static_alpha.py"
] | [
"import os\nimport time\nimport tensorflow as tf\nfrom tensorflow.keras.initializers import RandomNormal\nfrom tensorflow.keras import Sequential\nfrom tensorflow.keras.layers import Dense, BatchNormalization, \\\n LeakyReLU, Conv2DTranspose, Conv2D, Dropout, Flatten, Reshape\nimport utils\nimport numpy as np\n\... | [
[
"tensorflow.keras.Sequential",
"tensorflow.train.AdamOptimizer",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.name_scope",
"tensorflow.Session",
"tensorflow.square",
"tensorflow.train.Saver",
"tensorflow.keras.layers.Flatten",
"tensorflow.global_variables_initializer",
... |
AeroXi/CPM-Generate-Pytorch | [
"22bd2d7d59aa4907348f4b4b994b537c957e8eb4"
] | [
"GPT2/model.py"
] | [
"import math\r\nimport torch\r\nimport torch.nn as nn\r\n\r\nclass MLP(nn.Module):\r\n def __init__(self, embedding_size):\r\n super(MLP, self).__init__()\r\n self.dense_h_to_4h = nn.Linear(embedding_size, embedding_size*4)\r\n self.dense_4h_to_h = nn.Linear(embedding_size*4, embedding_size)... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.ones",
"torch.cat",
"torch.reshape",
"torch.arange",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.matmul",
"torch.split",
"torch.stack"
]
] |
yanqiuxia/Doc2EDAG | [
"db6256cff47e647f53cdaf3fb43b4adb8559b95b",
"db6256cff47e647f53cdaf3fb43b4adb8559b95b"
] | [
"dee/dee_model.py",
"dee/dee_task.py"
] | [
"# -*- coding: utf-8 -*-\n# AUTHOR: Shun Zheng\n# DATE: 19-9-19\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport math\nfrom collections import OrderedDict, namedtuple, defaultdict\nimport random\n\nfrom . import transformer\nfrom .ner_model import NERModel\n\n\nDocSpanInfo = namedtuple... | [
[
"torch.nn.Dropout",
"torch.nn.functional.nll_loss",
"torch.zeros",
"torch.cat",
"torch.Tensor",
"torch.nn.functional.log_softmax",
"torch.nn.functional.cross_entropy",
"torch.nn.Embedding",
"torch.tensor",
"torch.nn.Linear",
"torch.arange",
"torch.stack"
],
[
... |
jensmcatanho/data-driven_astronomy | [
"46c32361378421079a7114e96c3c0fe8451748bb"
] | [
"week1/1b/2_mean_of_a_set_of_signals/program.py"
] | [
"import numpy as np\n\ndef mean_datasets(files):\n datasets = []\n\n for file in files:\n datasets.append(np.loadtxt(file, delimiter=','))\n\n result = np.mean(datasets, axis=0)\n return np.round(result, decimals=1)\n\nif __name__ == '__main__':\n # Test Case 1\n print(mean_datasets(['data1... | [
[
"numpy.round",
"numpy.mean",
"numpy.loadtxt"
]
] |
kkkkeeee/MinkowskiEngineM | [
"456a8f12aa89449d75369760d9f0398a5a2e14cd"
] | [
"MinkowskiEngine/SparseTensor.py"
] | [
"# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu).\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to\n# use, co... | [
[
"torch.Size",
"torch.floor",
"torch.zeros",
"torch.cat",
"torch.sparse.DoubleTensor",
"torch.IntTensor",
"torch.sparse.FloatTensor"
]
] |
Windact/cloud_detection | [
"9fa24a957105efe87d32ad5b05c088fa6d743000"
] | [
"cloudnet-package/trainer/utils.py"
] | [
"from tensorflow.keras import backend as K\nfrom tensorflow import keras\n\nsmooth = 0.0000001\n\n\ndef jacc_coef(y_true, y_pred):\n y_true_f = K.flatten(y_true)\n y_pred_f = K.flatten(y_pred)\n intersection = K.sum(y_true_f * y_pred_f)\n return 1 - ((intersection + smooth) / (K.sum(y_true_f) + K.sum(y_... | [
[
"tensorflow.keras.backend.eval",
"tensorflow.keras.backend.sum",
"tensorflow.keras.backend.flatten"
]
] |
WarrenWeckesser/heatmapcluster | [
"534db493ec13b37e1c0c97d8d9f6a2f8670a89fc"
] | [
"demo/heatmapcluster_example2.py"
] | [
"\nimport numpy as np\nfrom scipy.cluster.hierarchy import linkage\nimport matplotlib.pyplot as plt\nfrom heatmapcluster import heatmapcluster\n\n\ndef make_data(size, seed=None):\n if seed is not None:\n np.random.seed(seed)\n\n s = np.random.gamma([7, 6, 5], [6, 8, 6], size=(size[1], 3)).T\n i = n... | [
[
"numpy.random.seed",
"numpy.random.randn",
"numpy.random.gamma",
"scipy.cluster.hierarchy.linkage",
"matplotlib.pyplot.show"
]
] |
whigy/chair-gan | [
"8144b34919a7c61487edc559738801b341a70331"
] | [
"tools/process.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n\nimport argparse\nimport os\nimport tensorflow as tf\nimport numpy as np\nimport tfimage as im\nimport threading\nimport time\nimport cv2\nfrom skimage.morphology import thin\n\nedge_pool = None\n\n\n... | [
[
"tensorflow.local_variables_initializer",
"tensorflow.io.gfile.exists",
"numpy.asarray",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"tensorflow.io.gfile.makedirs",
"numpy.ones",
"numpy.concatenate",
"numpy.float32",
"tensorflow.Session"
]
] |
xadrianzetx/msitrees | [
"8050ec247adb090ca6112fab05f23dcaba3bc23c"
] | [
"msitrees/_node.py"
] | [
"# MIT License\n\n# Copyright (c) 2020 xadrianzetx\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, mod... | [
[
"numpy.isscalar"
]
] |
sheikheddy/aus-files | [
"0c38d15d560ccbb8231c8ef210916ea94a0f004b"
] | [
"Data/Lab7/test.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\ndef graph_results(file_name):\n data = np.genfromtxt(file_name, delimiter=',', names=['size','time'])\n plt.plot(data['size'], data['time'])\n plt.xlabel('Size of input N')\n plt.ylabel('Time taken t')\n return "
] | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"numpy.genfromtxt"
]
] |
jorisvandenbossche/kartothek | [
"18b11e7b060bb778668ffc4e2f468910120e6385"
] | [
"kartothek/io/dask/_shuffle.py"
] | [
"from functools import partial\nfrom typing import List, Optional, Sequence, Union\n\nimport dask.array as da\nimport dask.dataframe as dd\nimport numpy as np\nimport pandas as pd\n\nfrom kartothek.core.typing import StoreFactory\nfrom kartothek.io.dask.compression import pack_payload, unpack_payload_pandas\nfrom k... | [
[
"numpy.log2",
"numpy.array",
"pandas.util.hash_pandas_object",
"numpy.uint64"
]
] |
codediaz/Opencv-image-filters | [
"98afae9fe50da2212cccb7bc9d48db7c41d8df05"
] | [
"Filters/init.py"
] | [
"import numpy as np\nimport cv2\nimport random\nfrom utils import CFEVideoConf, image_resize\nimport glob\nimport math\n\ncap = cv2.VideoCapture(0)\n\nframes_per_seconds = 20\nsave_path='saved-media/filter.mp4'\nconfig = CFEVideoConf(cap, filepath=save_path, res='480p')\n#out = cv2.VideoWriter(save_path, config.vid... | [
[
"numpy.zeros",
"numpy.full"
]
] |
nikhiljain-413/Hacktoberfest2021_beginner | [
"56b008c9ed294c3fc23b44fa13faced99948236d"
] | [
"Python3-Learn/TIC_TAC_TOE game.py"
] | [
"\n# AUTHOR: Hitesh Vishnoi\n# Python3 Concept: Tic Tac Toe Game !!\n# GITHUB: https://github.com/hiteshv01\n\n\nimport numpy as np \nimport random \nfrom time import sleep \n\n# Creates an empty board \ndef create_board(): \n return(np.array([[0, 0, 0], \n [0, 0, 0], \n [... | [
[
"numpy.all",
"numpy.array"
]
] |
johnnygreco/pymfit | [
"4af480771c8b9a463a3c1cf0abde1ac416649bbe"
] | [
"pymfit/erwin_utils/imfit.py"
] | [
"\"\"\"\nPython helper functions for imfit written by Peter Erwin.\nModified by Johnny Greco to be compatible with python 3.\n\"\"\"\nfrom __future__ import division, print_function\n\n# Code for reading in and analyzing output of imfit\n\nimport glob\nimport numpy as np\n\nfrom . import imfit_funcs as imfuncs\n\n\... | [
[
"numpy.concatenate",
"numpy.floor",
"numpy.loadtxt"
]
] |
faresbs/sign-language-tutor | [
"d4091d6cd582a80a5ad38759e973357b02731fc8"
] | [
"cnn_architectures.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\nfrom torchvision import models\n\nimport torch.utils.model_zoo as model_zoo\n\n\nmodel_urls = {\n 'inception_v3_google': 'https://download.pytorch.org/models/inception_v3_google-1a9a5a14.pth',\n}\n\n... | [
[
"torch.nn.Dropout",
"torch.nn.functional.dropout",
"torch.cat",
"torch.utils.model_zoo.load_url",
"torch.nn.ModuleList",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"scipy.stats.truncnorm",
"torch.nn.init.constant_",
"torch.nn.Linear",
"torch.nn.functional.relu... |
IvanPy96/Imagewoof-classification-PyTorch | [
"0055fcad8cc98d034331c7a72be43bee28fff37d"
] | [
"inference.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models, transforms\n\nfrom sys import argv\nimport shutil\nimport requests\n\nfrom PIL import Image\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nscript, file_link = argv \n\nr... | [
[
"torch.nn.functional.softmax",
"torch.max",
"torch.load",
"torch.nn.Linear",
"torch.no_grad",
"torch.device"
]
] |
imocanu/jagerml | [
"b0e953b9fefe4a21935a763d53015f6d85160c9f"
] | [
"otherpy/distribute/simpleMNISTmodel.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nimport time\n\n\ndef mnist_dataset(batch_size):\n (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()\n x_train = x_train / np.float32(255)\n y_train = y_train / np.float32(255)\n\n train_dat... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.models.load_model",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Sequential",
... |
MrLIVB/BMSTU_Computational_Algorithms | [
"c893a5015dbbecd97ed63c848d67cbc9d1a249dc"
] | [
"lab_05/integral.py"
] | [
"from legendre import legendre\nimport seidel\nimport matrix\nimport numpy as np\nfrom math import sqrt, pi, e\n\n\ndef quadrature(k):\n if k % 2:\n return 0\n else:\n return 2 / (k + 1)\n\ndef integrate(a, b, n, f):\n l = legendre(n)\n\n A = np.zeros((n, n))\n B = np.zeros((n, 1))\n ... | [
[
"numpy.zeros"
]
] |
obadao/multi-view-pose-estimation | [
"2d5ff2975180edc66628d1ba0fe0806ec177ef0c"
] | [
"linear.py"
] | [
"# Rahil Mehrizi, Oct 2018\n\"\"\"Creating Model to Predict 3D Poses from Multi-view 2D Joints\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom collections import OrderedDict\n\nclass LinearModel(nn.Module):\n def __init__(self, linear_size, num_joints):\... | [
[
"torch.nn.Dropout",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d"
]
] |
billsioros/RoughML | [
"b4a4a94f49b568c32e232187566698c1d216207a"
] | [
"src/roughml/data/generators.py"
] | [
"from abc import ABC, abstractmethod\n\nimport numpy as np\nimport sympy\nfrom scipy import stats\n\nfrom roughml.plot import as_grayscale_image\n\n\nclass SurfaceGenerator(ABC):\n def __init__(\n self, n_points, rms, skewness, kurtosis, corlength_x, corlength_y, alpha\n ):\n self.n_points = n_p... | [
[
"numpy.fft.fft2",
"numpy.fft.ifft2",
"numpy.sqrt",
"numpy.sort",
"numpy.real",
"scipy.stats.pearson3.rvs",
"numpy.zeros_like",
"numpy.random.rand",
"numpy.mean",
"numpy.argsort",
"numpy.zeros"
]
] |
JelleAalbers/hypney | [
"3e38e21743fc9babe0ed47af299d08242a9b6d32",
"3e38e21743fc9babe0ed47af299d08242a9b6d32"
] | [
"tests/models/test_combinations.py",
"hypney/basics.py"
] | [
"import hypney\n\nimport numpy as np\nfrom scipy import stats\n\n\ndef test_mixture():\n m1 = hypney.models.uniform(rate=40)\n m2_free = hypney.models.uniform(rate=20)\n m2_frozen = m2_free.freeze()\n m3 = hypney.models.uniform(rate=30)\n\n for m2 in m2_free, m2_frozen:\n mix = hypney.models.m... | [
[
"numpy.array",
"scipy.stats.uniform",
"numpy.linspace"
],
[
"numpy.arange"
]
] |
MetaMain/BARZ | [
"458466e42ada076c4fb448098768b32356df0259"
] | [
"BarrierZoneTrainer/BarrierZoneTrainer/BarrierZoneDefenseRandomized.py"
] | [
"#This is the randomized version of the BARZ defense \r\nimport numpy\r\nimport DataManagerPytorch as DMP\r\n\r\nclass BarrierZoneDefenseRandomized():\r\n #Default constructor \r\n def __init__(self , modelPlusList, classNum, modelsPerEval):\r\n self.ModelPlusList=modelPlusList\r\n self.ClassNum... | [
[
"numpy.zeros"
]
] |
agemagician/NeMo | [
"5839aee402f314aa413b28e9042b1e1cac10a114"
] | [
"nemo/collections/nlp/models/machine_translation/mt_enc_dec_model.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"torch.LongTensor",
"torch.utils.data.SequentialSampler",
"torch.utils.data.RandomSampler",
"torch.FloatTensor",
"torch.no_grad",
"numpy.mean",
"numpy.not_equal"
]
] |
SHMingLiu/Deep-Supervised-Learning-in-Metal-Forming | [
"42cb3f29bf64d6e9225541943f117099c37c88f6"
] | [
"Theory-guided_Deep_Learning/utils.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri May 1 14:37:12 2020\r\n\r\n@author: sl7516\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport json\r\nimport os\r\n\r\nRESULTS_DIR = 'results/'\r\n\r\n\r\ndef print_json(result):\r\n # print result in a jsonable structure\r\n print (json.dumps(\r\n r... | [
[
"numpy.std",
"numpy.mean"
]
] |
alaniwi/cf-python | [
"16525ea97df9a3f5e8146b1386e1732fb8f7c0e5"
] | [
"cf/domain.py"
] | [
"import logging\nfrom functools import reduce\nfrom operator import mul as operator_mul\n\nimport cfdm\nimport numpy as np\n\nfrom . import mixin\nfrom .constructs import Constructs\nfrom .data import Data\nfrom .decorators import _inplace_enabled, _inplace_enabled_define_and_cleanup\nfrom .functions import _DEPREC... | [
[
"numpy.size"
]
] |
swipswaps/Object-Detection-API | [
"995f7d4cb41d3976f9264cbabcffd167a06dfa2a"
] | [
"yolov3_tf2/models.py"
] | [
"from absl import flags\r\nfrom absl.flags import FLAGS\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom tensorflow.keras import Model\r\nfrom tensorflow.keras.layers import (\r\n Add,\r\n Concatenate,\r\n Conv2D,\r\n Input,\r\n Lambda,\r\n LeakyReLU,\r\n MaxPool2D,\r\n UpSampling2D,... | [
[
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.layers.UpSampling2D",
... |
phaustin/planck_lib | [
"01564ebf8bb0a028a5d26ff338a3652eb4c93f94"
] | [
"src/planck_lib/planck.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# cell_metadata_filter: -all\n# formats: ipynb,py:light\n# notebook_metadata_filter: all,-language_info,-toc,-latex_envs\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.3.1\n# ... | [
[
"numpy.log",
"numpy.asarray",
"numpy.testing.assert_almost_equal",
"scipy.integrate.quad",
"numpy.array",
"numpy.exp",
"numpy.fabs",
"numpy.testing.assert_array_almost_equal"
]
] |
ShichengChen/ChenPyLib | [
"758054279fac0d8bc103dc1dcf9e799f3b940da5"
] | [
"cscPy/Nets/dVAEnet.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport torch.distributions.normal\nimport numpy as np\nimport math\nimport torchvision.models as models\nimport torch.nn.functional as F\nPOINT_SIZE = 256\nDecPointSize = 256\nDecUVSize = np.sqrt(DecPointSize)\nimport torch\nfrom torch import... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Softplus",
"numpy.sqrt",
"torch.cat",
"torch.zeros_like",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.ones_like"
]
] |
liruilong940607/NSVF | [
"6733c8f3805c7febfe78c39710beafc5d33ccbcd"
] | [
"fairnr/models/nsvf.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nimport cv2, math, time\nimport numpy as np\nfrom collections import defaultd... | [
[
"torch.no_grad",
"torch.cuda.empty_cache"
]
] |
aaronscherzinger/connectfour_reinforcementlearning | [
"084993edb4c1de44f14cf4e1b4ceced953bf688a"
] | [
"test_trained_model.py"
] | [
"import tensorflow as tf\n\nimport numpy as np \nimport connect_four\n\ndef board_to_column_vector(board):\n '''converts a playing board (i.e., 2D numpy array with shape [7,6]) to a column vector with shape [1, 42]'''\n assert(board.shape == (7,6)), \"board does not have shape (7,6)\"\n return np.reshape(b... | [
[
"tensorflow.reset_default_graph",
"numpy.argmax",
"tensorflow.Session",
"tensorflow.get_default_graph",
"tensorflow.saved_model.loader.load"
]
] |
kopecmartin/grains-recognition | [
"72eade0f60800a6d3c9361bb74ff35e3445a9baf"
] | [
"AABBlib/detection.py"
] | [
"#!/usr/bin/env python3\nfrom fractions import Fraction\nfrom scipy import ndimage\nimport math\n\n\nclass Detector(object):\n \"\"\"Class Detector\n Detect bounded boxes\n \"\"\"\n def __init__(self, img):\n self.img = img\n\n def get_bounded_boxes(self):\n \"\"\"Get bounded boxes from... | [
[
"scipy.ndimage.label",
"scipy.ndimage.generate_binary_structure",
"scipy.ndimage.find_objects"
]
] |
theoway/raster-vision | [
"fc181a6f31f085affa1ee12f0204bdbc5a6bf85a"
] | [
"rastervision_core/rastervision/core/data/raster_source/rasterized_source.py"
] | [
"import logging\n\nfrom rasterio.features import rasterize\nimport numpy as np\nfrom shapely.geometry import shape\nfrom shapely.strtree import STRtree\nfrom shapely.ops import transform\n\nfrom rastervision.core.data import (ActivateMixin, ActivationError)\nfrom rastervision.core.data.raster_source import RasterSo... | [
[
"numpy.expand_dims",
"numpy.full"
]
] |
deepskies/DeeplyUncertain-Public | [
"04f94da29939b2d7dfef70d40dee8dc752e0da48"
] | [
"models/mlp_tf.py"
] | [
"import tensorflow as tf\nimport tensorflow_probability as tfp\nfrom tensorflow_probability.python.internal import tensorshape_util\n\ntfk = tf.keras\ntfkl = tf.keras.layers\ntfpl = tfp.layers\ntfd = tfp.distributions\n\nn_train = 90000\n\n\nclass MeanMetricWrapper(tfk.metrics.Mean):\n # code by @mcourteaux from... | [
[
"tensorflow.math.sqrt",
"tensorflow.cast",
"tensorflow.math.squared_difference",
"tensorflow.math.softplus",
"tensorflow.square",
"tensorflow.optimizers.Adam"
]
] |
adrienatallah/autogluon | [
"014faf7e98bd0e349d0900f713442536b0f69b1e"
] | [
"text/src/autogluon/text/text_prediction/dataset.py"
] | [
"import collections\nimport collections.abc\nimport numpy as np\nimport pandas as pd\nimport json\nfrom autogluon.core.utils.loaders import load_pd\nfrom . import constants as _C\nfrom .column_property import CategoricalColumnProperty, TextColumnProperty, NumericalColumnProperty,\\\n get_column_properties_from_m... | [
[
"numpy.arange",
"numpy.random.RandomState",
"pandas.to_numeric",
"numpy.ceil"
]
] |
epn-ml/IWF-ICMEs | [
"85390a3990462cb8aa9639956acc353134a224ce"
] | [
"event.py"
] | [
"import pandas as pds\nimport datetime\nimport numpy as np\nimport time\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport seaborn as sns\n\n\nclass Event:\n\n def __init__(self, begin, end, param=None):\n self.begin = begin\n self.end = end\n self.proba = None\n ... | [
[
"numpy.nanmax",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"pandas.to_datetime",
"pandas.Series",
"matplotlib.pyplot.figure",
"numpy.nanmin",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
sarang-apps/darshan_browser | [
"173649bb8a7c656dc60784d19e7bb73e07c20daa"
] | [
"tools/android/native_lib_memory/process_residency.py"
] | [
"#!/usr/bin/python\n# Copyright 2017 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n\"\"\"From a native code residency dump created by log_residency.cc, generate a\nvisual timeline, and serialize the parsed data t... | [
[
"matplotlib.pylab.xlim",
"matplotlib.collections.LineCollection",
"matplotlib.pylab.text",
"matplotlib.pylab.title",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.subplots",
"matplotlib.pylab.ylim",
"matplotlib.pylab.savefig",
"matplotlib.pylab.axv... |
mbkumar/numpy | [
"0645461254a2110438b6df63ef193c1138c306ec"
] | [
"numpy/typing/tests/data/pass/array_constructors.py"
] | [
"from typing import List, Any\nimport numpy as np\n\nclass Index:\n def __index__(self) -> int:\n return 0\n\nclass SubClass(np.ndarray): ...\n\ni8 = np.int64(1)\n\nA = np.array([1])\nB = A.view(SubClass).copy()\nC = [1]\n\ndef func(i: int, j: int, **kwargs: Any) -> SubClass:\n return B\n\nnp.array(1, ... | [
[
"numpy.linspace",
"numpy.asarray",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.empty_like",
"numpy.full",
"numpy.asanyarray",
"numpy.fromfunction",
"numpy.ascontiguousarray",
"numpy.logspace",
"numpy.asfortranarray",
"numpy.full_like",
"numpy.int64",
"nump... |
Whatsoever/SurfComp | [
"4887162fef765d0c84e2bb72f0c26974aef30aec"
] | [
"src/Sorption_PB_functions/PB_coup_four_layer_2try_2v.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 3 12:42:20 2019\n\n@author: DaniJ\n\"\"\"\n\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Aug 22 15:58:31 2019\n@author: DaniJ\n\"\"\"\n\nimport numpy as np\nimport scipy as sp\nfrom bvp import solve_bvp\nfrom scipy import linalg\n#from four_layer_model_2try_... | [
[
"numpy.amax",
"numpy.log",
"numpy.multiply",
"numpy.matmul",
"scipy.linalg.solve",
"numpy.log10",
"scipy.linalg.norm",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
FizzerYu/CollaborativeVAE | [
"4714cce49acba258600b1b5bbcd3a1a4762385e6"
] | [
"lib/test.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nfrom torch.utils.data import DataLoader, Dataset\nfrom torch.autograd import Variable\n\n\nallowed_activations = ['sigmoid', 'tanh', 'softmax', 'relu', 'linear']\nallowed_noises = [None, 'gaussian', 'mask']\nallowed_losses = ['rmse', 'cross-entropy']\n\n\ncl... | [
[
"torch.randn_like",
"torch.nn.functional.softmax",
"torch.nn.Parameter",
"torch.exp",
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
lnies/lEval | [
"da9ce344a713c7fb46d53417e44a2f56956a1b60"
] | [
"piicr-analysis/python_plotter_functions.py"
] | [
"# ---------------------------------------------------------------------------\n# Written by Jonas Karthein in 2016/2017. Questions to jonas.karthein@cern.ch\n# ---------------------------------------------------------------------------\n\nimport matplotlib as mpl\nmpl.use('Qt5Agg')\n\nimport matplotlib.pyplot as p... | [
[
"numpy.diag",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"numpy.mean",
"numpy.exp",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"numpy.sin",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"matplotlib.pypl... |
pauleckhardt/obsdata | [
"f65168694b76a7e70c56d50ef515d7d5a64f581d"
] | [
"obsdata/indaaf_config.py"
] | [
"import os\nimport pandas as pd\nfrom collections import namedtuple\n\n\nDATADIR = os.path.join(\n os.path.dirname(os.path.dirname(os.path.abspath(__file__))),\n \"data\"\n)\n\n\nDATASETS = [\n {\n \"name\": \"Precipitation\",\n \"href\": \"/catalog/dataset/1\",\n \"id\": 1,\n \... | [
[
"pandas.read_csv"
]
] |
TrietChau/asd | [
"49d08b49246f1720cb1ac1134d5f34391a5c74f2"
] | [
"pyxel/gl_wrapper.py"
] | [
"import ctypes\n\nimport numpy as np\nimport OpenGL.GL as gl\nfrom OpenGL.GL import shaders\n\n\nclass GLShader:\n def __init__(self, vertex_shader, fragment_shader):\n self._program = shaders.compileProgram(\n shaders.compileShader(vertex_shader, gl.GL_VERTEX_SHADER),\n shaders.comp... | [
[
"numpy.zeros"
]
] |
mortazavilab/PyWGCNA | [
"f61bf9a71c39d1b58c787b36ffd271d68de663b4"
] | [
"PyWGCNA/comparison.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom scipy.stats import fisher_exact\nimport matplotlib.pyplot as plt\nimport pickle\n\n\n# bcolors\nHEADER = '\\033[95m'\nOKBLUE = '\\033[94m'\nOKCYAN = '\\033[96m'\nOKGREEN = '\\033[92m'\nWARNING = '\\033[93m'\nFAIL = '\\033[91m'\nENDC = '\\033[0m'\nBOLD = '\\033[1m'\nUND... | [
[
"numpy.array",
"numpy.isfinite",
"numpy.unique",
"numpy.min",
"pandas.Categorical",
"matplotlib.pyplot.savefig",
"numpy.intersect1d",
"numpy.max",
"scipy.stats.fisher_exact",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"nump... |
mnagaku/ParaMol | [
"13529f584e2d50076e038388ecbdd57af23c73b9"
] | [
"ParaMol/MM_engines/openmm.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nDescription\n-----------\nThis module defines the :obj:`ParaMol.MM_engines.openmm.OpenMMEngine` class which is the ParaMol wrapper for OpenMM.\n\"\"\"\n\nimport logging\nimport numpy as np\nimport simtk.unit as unit\nimport simtk.openmm as openmm\nimport simtk.openmm.app as app\n\n... | [
[
"numpy.sign",
"numpy.random.standard_normal",
"numpy.zeros",
"numpy.sqrt"
]
] |
m090009/Advanced_Lane_line_detection | [
"2967e7156e178eea305c205474d5a00887655840"
] | [
"datasetclasses.py"
] | [
"import utils\nfrom collections import Counter\nfrom sklearn.utils import shuffle\nfrom sklearn.model_selection import train_test_split\n\n\nclass Dataset:\n def __init__(self,\n features,\n labels):\n # Splitting the data to 80% training and 20% validation\n if feat... | [
[
"sklearn.utils.shuffle",
"sklearn.model_selection.train_test_split"
]
] |
hsvgbkhgbv/ConvLab | [
"aab9e3f91605015d0d6a52e85a53d1d3a92ab137"
] | [
"convlab/agent/algorithm/ddq.py"
] | [
"# Modified by Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom convlab.agent import memory\nfrom convlab.agent import net\nfrom convlab.agent.algorithm.dqn import DQN\nfrom convlab.agent.net import net_util\nfrom convlab.lib impo... | [
[
"torch.sigmoid",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.MSELoss",
"torch.tensor"
]
] |
jim22k/grblas | [
"7c96ddd3cb485f2c98637e7fb96070ff6c48d219"
] | [
"graphblas/monoid/numpy.py"
] | [
"\"\"\" Create UDFs of numpy functions supported by numba.\n\nSee list of numpy ufuncs supported by numpy here:\n\nhttps://numba.readthedocs.io/en/stable/reference/numpysupported.html#math-operations\n\n\"\"\"\nimport numpy as _np\n\nfrom .. import _STANDARD_OPERATOR_NAMES\nfrom .. import binary as _binary\nfrom ..... | [
[
"numpy.iinfo"
]
] |
axelande/scikit-fuzzy | [
"d9bac7a53d8e64f69f71b0fb4da2c8921b6aa7d0"
] | [
"docs/tools/plot_pr.py"
] | [
"import urllib\nimport json\nimport copy\nfrom collections import OrderedDict\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import FuncFormatter\n\nimport dateutil.parser\nfrom dateutil.relativedelta import relativedelta\nfrom datetime import datetime, timedelta\n\ncache = '_pr_cache.txt'\n\n# Obtain r... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.xlabel",
"matplotlib.ticker.FuncFormatter",
"matplot... |
dluvizon/3d-pose-consensus | [
"7a829d5713d2c45c6b265c9886add0b69e0050a8"
] | [
"people/datasets/human36m.py"
] | [
"import os\n\nimport json\nimport numpy as np\nimport scipy.io as sio\nfrom PIL import Image\n\nfrom .generic import GenericDataset\nfrom .generic import project_gt_poses_to_anchors\nfrom .generic import compute_anchors_reference\nfrom .generic import compute_window_reference\nfrom ..utils import *\n\nACTION_LABELS... | [
[
"numpy.nanmax",
"numpy.nanmin",
"scipy.io.loadmat",
"numpy.concatenate",
"numpy.mean",
"numpy.nanmean",
"numpy.load",
"numpy.array",
"numpy.empty"
]
] |
Plan-Bee/planbee_yolov5 | [
"9f77823284a8df3f3bc975552c00593b7079e7ef"
] | [
"yolov5/utils/general.py"
] | [
"# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nGeneral utils\n\"\"\"\n\nimport contextlib\nimport glob\nimport logging\nimport math\nimport os\nimport platform\nimport random\nimport re\nimport shutil\nimport signal\nimport time\nimport urllib\nfrom datetime import datetime\nfrom itertools import repeat\nfro... | [
[
"torch.zeros",
"torch.cat",
"numpy.concatenate",
"torch.device",
"torch.save",
"pandas.read_csv",
"torch.mm",
"torch.from_numpy",
"torch.tensor",
"numpy.copy",
"numpy.interp",
"numpy.zeros",
"numpy.ascontiguousarray",
"torch.set_printoptions",
"torch.hub... |
ErasmusMC-Bioinformatics/tools-iuc | [
"2efdef3fbd1ee73c61547ff07a7da6a2b8269f6d"
] | [
"tools/vsnp/vsnp_build_tables.py"
] | [
"#!/usr/bin/env python\n\nimport argparse\nimport multiprocessing\nimport os\nimport queue\nimport re\n\nimport pandas\nimport pandas.io.formats.excel\nfrom Bio import SeqIO\n\n# Maximum columns allowed in a LibreOffice\n# spreadsheet is 1024. Excel allows for\n# 16,384 columns, but we'll set the lower\n# number a... | [
[
"pandas.IntervalIndex.from_arrays",
"pandas.concat",
"pandas.read_csv",
"pandas.Series",
"pandas.read_json",
"pandas.ExcelWriter"
]
] |
Living-with-machines/AtypicalAnimacy | [
"a5ba418d61fb2a3ad43d45dffe522324adaede7e"
] | [
"code/tools/wordnet_utils.py"
] | [
"from sentence_transformers import SentenceTransformer\nimport torch,scipy\nfrom nltk.corpus import wordnet as wn\nfrom tools import wemb_utils\nfrom gensim.models.wrappers import FastText\nfrom pathlib import Path\n\n# sent_sim_model = SentenceTransformer('models/bert-base-nli-mean-tokens')\n\n# wemb_model = FastT... | [
[
"scipy.spatial.distance.cdist"
]
] |
shamanez/BERT-like-is-All-You-Need | [
"a6ba1f656da40103b3b5398961d18e5fc78e1efb"
] | [
"fairseq/data/raw_audio_text_dataset.py"
] | [
"#change the line 331\n\nimport os\nimport numpy as np\nimport sys\nimport torch\n\nfrom .import FairseqDataset\nimport random\n\nimport cv2\nfrom PIL import Image\nfrom torchvision.transforms import CenterCrop, Resize, Compose, ToTensor\n\nimport time\n\nclass RawAudioTextDataset(FairseqDataset):\n\n def __init... | [
[
"torch.LongTensor",
"numpy.lexsort",
"torch.tensor",
"torch.rand",
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.