repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
lc0/datasets | [
"87c1a6132b1ae38f7c5dfd81209b3206ed20924e"
] | [
"tensorflow_datasets/core/lazy_imports_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TensorFlow Datasets 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 ... | [
[
"tensorflow.test.main"
]
] |
mohitankoliya/EMO_PLAYER | [
"5876c92dcf830905662ab54846db9fcaeae0f411"
] | [
"Update_Model.py"
] | [
"import numpy as np\nimport glob\nimport random\nimport cv2\n\nfishface=cv2.face.FisherFaceRecognizer_create()\ndata={}\n\ndef update(emotions):\n run_recognizer(emotions)\n print(\"Saving model...\")\n fishface.save(\"model.xml\")\n print(\"Model saved!!\")\n\ndef make_sets(emotions):\n training_dat... | [
[
"numpy.asarray"
]
] |
zh272/AIGOGO | [
"0255cf8c4776358b73ee6b1792325a151a0cfa78"
] | [
"src/features/build_features_archive.py"
] | [
"import numpy as np\nimport os\nimport pandas as pd\nfrom catboost import CatBoostRegressor\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.decomposition import NMF\nfrom helpers import MultiColumnLabelEncoder\nimport lightgbm as lgb\nimport itertools\n\n'''\nSteps to add a new feature:\n\n (1) ad... | [
[
"pandas.isnull",
"pandas.concat",
"pandas.DataFrame",
"numpy.random.seed",
"numpy.where",
"sklearn.metrics.mean_absolute_error",
"numpy.nanmean",
"sklearn.decomposition.NMF",
"pandas.Series",
"pandas.read_csv"
]
] |
scrasmussen/coarray_icar | [
"6cdae6b0cd9003ea30e898b26c191c63e10f96af"
] | [
"data/random_plot.py"
] | [
"from mpl_toolkits import mplot3d\nfrom matplotlib.ticker import MaxNLocator\nimport matplotlib.pyplot as plt\nimport matplotlib.colors\nimport matplotlib.animation as animation\nimport numpy as np\nimport pandas as pd\nimport sys\n\nfrom tools.my_setup import *\n# from pubplot import Document\n# from pubplot.docum... | [
[
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figaspect"
]
] |
hlthu/PyTorch-Learn | [
"0dc598b3e9a499c44fafc9b8792c4512485d48a7"
] | [
"self-con/self-con.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nTraining an image classifier\nWe will do the following steps in order:\n1. Load and normalizing the CIFAR10 training and test datasets using\n ``torchvision``\n2. Define a Convolution Neural Network\n3. Define a loss function\n4. Train the network on the training data\n5. Test th... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.max",
"torch.autograd.Variable",
"torch.nn.Conv2d",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
sokunmin/deep_learning_practices | [
"49e1a08adbfcd2054adb1c08236d57405fad14d3"
] | [
"tensorflow_practice/handson-ml/chpt9-up and running/3_life_cycle_of_node.py"
] | [
"import tensorflow as tf\n\nimport time\n\"\"\"\nIn single-process TensorFlow, multiple sessions do not share any state, \neven if they reuse the same graph (each session would have its own copy \nof every variable). \n\nIn distributed TensorFlow, variable state is stored on the servers, \nnot in the sessions, so m... | [
[
"tensorflow.constant",
"tensorflow.Session"
]
] |
JBHilton/covid-19-in-households-public | [
"42fb31a3c581a3d5b6b6959078a5f6bf4f25212e"
] | [
"examples/temp_bubbles/common.py"
] | [
"''' Common utilities for transient bubble calculation.\n'''\nfrom numpy import (\n append, arange, array, copy, hstack, ix_, ones, prod, shape, sum, unique,\n where, zeros)\nfrom numpy import int64 as my_int\nfrom scipy.sparse import csc_matrix as sparse\nfrom scipy.special import factorial\nfrom scipy.stats... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.where",
"scipy.stats.multinomial.pmf",
"numpy.prod",
"numpy.arange",
"scipy.special.factorial",
"numpy.unique"
]
] |
abhineet123/river_ice_segmentation | [
"24f0aa60b164fb21c00c269b2309172dbe7d22f4"
] | [
"auto_deeplab_/cocoapi/PythonAPI/setup.py"
] | [
"from distutils.core import setup\nfrom Cython.Build import cythonize\nfrom distutils.extension import Extension\nimport numpy as np\n\n# To install and compile to your anaconda/python site-packages, simply run:\n# $ pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI\n# Note that the... | [
[
"numpy.get_include"
]
] |
sheride/axion_pheno | [
"7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5"
] | [
"optimization/second_sdEta_mjj_optimization/lumi_and_kin_plots/four_cuts_lum150/Output/Histos/MadAnalysis5job_0/selection_5.py"
] | [
"def selection_5():\n\n # Library import\n import numpy\n import matplotlib\n import matplotlib.pyplot as plt\n import matplotlib.gridspec as gridspec\n\n # Library version\n matplotlib_version = matplotlib.__version__\n numpy_version = numpy.__version__\n\n # Histo binning\n xB... | [
[
"numpy.array",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.linspace",
"matplotlib.gridspec.GridSpec"
]
] |
joostbarten/ascat | [
"d9709e6d22a2766cb8f7eff818b63db0d1f70de5"
] | [
"src/ascat/read_native/nc.py"
] | [
"# Copyright (c) 2021, TU Wien, Department of Geodesy and Geoinformation\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redistributions of source code must retain the above copyrig... | [
[
"numpy.array",
"numpy.zeros",
"numpy.arange",
"numpy.iinfo",
"numpy.dtype",
"numpy.datetime64"
]
] |
vermouth1992/rlutils | [
"a326373b9e39dbf147c6c4261b82a688d4dc3e78"
] | [
"rlutils/pytorch/nn/layers.py"
] | [
"import math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom rlutils.np.functional import inverse_softplus\n\n\nclass EnsembleDense(nn.Module):\n __constants__ = ['num_ensembles', 'in_features', 'out_features']\n in_features: int\n out_features: int\n weight: torch.Tensor\n... | [
[
"torch.nn.functional.softplus",
"torch.no_grad",
"torch.bmm",
"torch.squeeze",
"torch.nn.init.uniform_",
"torch.Tensor"
]
] |
rootstrap/NWPU-Crowd-Sample-Code | [
"a19c4edab06a841bfe3b8eacdc12104dbddf4d7d"
] | [
"models/counters/Res101_SFCN.py"
] | [
"import torch.nn as nn\nimport torch\nfrom torchvision import models\n\nfrom misc.layer import convDU,convLR\n\nimport torch.nn.functional as F\nfrom misc.utils import *\n\nimport pdb\n\n# model_path = '../PyTorch_Pretrained/resnet101-5d3b4d8f.pth'\n\nclass Res101_SFCN(nn.Module):\n def __init__(self, pretrained... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
S1moFara/stochastic-gene-choice | [
"bd9344db94854f8249b9a22f0d6f141f2c6cf5fd",
"bd9344db94854f8249b9a22f0d6f141f2c6cf5fd"
] | [
"bin/calculate_family_IC.py",
"bin/calculate_IC.py"
] | [
"#!/bin/env python3\n#%%\n#%% Code so the same scripts can be used as notebooks and as part of a pipeline\ntry:\n if __IPYTHON__:\n import sys\n sys.path.insert(0,'./bin')\nexcept:\n pass\n\nfrom pipeline_utils.ic_utils import get_IC, get_observed_variance, get_pb_variance\nimport pandas as pd\n... | [
[
"pandas.read_csv",
"pandas.Series"
],
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
Mondrik/atseo | [
"05883e68f2f33c5a1a85135dad63fe83b8374770"
] | [
"inspect_bias_frames.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport astropy.io.fits as pft\nimport ats_image as atsi\nimport ats_helpers as atsh\nfrom scipy.signal import convolve\nimport itertools\n\n\nNUM_AMPS = 16\nBIN_ROW = 1\nBIN_COL = 1\nROI = [None, None, None, None] \n\n\n#fnums = np.arange(348, 453, 1)\n#fnums = ... | [
[
"numpy.zeros_like",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.cm.get_cmap"
]
] |
alexander-malafeev/sleep-scoring | [
"2d429c9eabee5af16912e9df220aa7579dcee758"
] | [
"main/predict_split.py"
] | [
"#from __future__ import print_function\nimport os\n#os.environ[\"THEANO_FLAGS\"] = \"mode=FAST_RUN,device=gpu,floatX=float32\"\n\nfrom keras import backend as K\n\nfrom keras.layers import concatenate\n\n\nfrom keras import optimizers\n\nimport numpy as np\nimport scipy.io \n#import sklearn\nfrom sklearn.metrics i... | [
[
"numpy.argmax",
"numpy.zeros",
"numpy.expand_dims"
]
] |
ZebinYang/SeqUD | [
"ed5105d2536fdc1c06158a4aaa98647d9874c446"
] | [
"sequd/pysequd/sequd.py"
] | [
"import time\nimport numpy as np\nimport pandas as pd\nfrom joblib import Parallel\nfrom joblib import delayed\nfrom matplotlib import pylab as plt\nfrom sklearn.model_selection import cross_val_score\n\nimport pyunidoe as pydoe\n\nEPS = 10**(-8)\n\n\nclass SeqUD(object):\n\n \"\"\"\n Implementation of sequen... | [
[
"numpy.random.choice",
"matplotlib.pylab.ylabel",
"numpy.mean",
"matplotlib.pylab.show",
"pandas.concat",
"sklearn.model_selection.cross_val_score",
"pandas.DataFrame",
"numpy.argmax",
"matplotlib.pylab.title",
"matplotlib.pylab.plot",
"numpy.array",
"numpy.zeros",
... |
AvAkanksh/google-research | [
"8357ea956d0341cbc86d22fdaf944d64832e30e7"
] | [
"non_semantic_speech_benchmark/data_prep/audio_to_embeddings_beam_utils.py"
] | [
"# coding=utf-8\n# Copyright 2021 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... | [
[
"numpy.max",
"numpy.array",
"tensorflow.io.gfile.GFile",
"numpy.array_equal",
"numpy.reshape",
"tensorflow.lite.Interpreter",
"numpy.min",
"numpy.mean",
"numpy.logical_and",
"tensorflow.io.gfile.exists",
"numpy.iinfo",
"numpy.expand_dims"
]
] |
johnbensnyder/resnet-sagemaker | [
"9993418edd1af9bc97a8bb6cf18ec0dd22a4ea36"
] | [
"pytorch/resnet_sagemaker/models.py"
] | [
"import os\nimport torch\nimport torchvision as tv\nimport pytorch_lightning as pl\nimport pl_bolts\nimport webdataset as wds\nimport torch.distributed as dist\nfrom apex.parallel import DistributedDataParallel as DDP\nfrom resnet_sagemaker.utils import mixup_data, mixup_criterion\nfrom .utils import train_preproc,... | [
[
"torch.nn.Linear",
"torch.argmax",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader"
]
] |
guanjianyu/pytorch_hand_written_recognition | [
"b9804ee1213fa744430ee7c25a52b04ab295747a"
] | [
"dataset.py"
] | [
"import os\nimport cv2\nimport glob\nimport numpy as np\nfrom PIL import Image\nimport torch\nimport torchvision\nfrom torch.utils import data\nfrom torchvision import transforms\nimport torch\nfrom torch import nn\nimport torchvision\nimport torch.nn.functional as F\n\n\ndef get_char_dict():\n char_dict = {}\n ... | [
[
"numpy.random.seed",
"numpy.random.permutation",
"numpy.ones",
"torch.from_numpy",
"torch.tensor"
]
] |
Arun-Singh-Chauhan-09/Supply-demand-forecasting | [
"193e8756e2bb19935730997db6e33b229e9e2348"
] | [
"preprocess/preparegapcsv.py"
] | [
"from datetime import datetime\nfrom datetime import timedelta\nimport pandas as pd\nfrom utility.datafilepath import g_singletonDataFilePath\nfrom exploredata.timeslot import singletonTimeslot\nimport os.path\n\nclass prepareGapCsvForPrediction:\n def __init__(self):\n return\n \n def run(self):\n ... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
kel85uk/quantuminspire | [
"f377ecaf3b55a89c4a6e42954733c3ae469ab5ca"
] | [
"docs/classifier_example/data_plotter.py"
] | [
"from sklearn.datasets import load_iris\nfrom sklearn import preprocessing\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom random import sample\n\nplt.style.use('seaborn-whitegrid')\n\n\ndef get_bin(x, n):\n return format(int(x), 'b').zfill(n)\n\n\nclass DataPlotter:\n\n @staticmethod\n def plot... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks",
"sklearn.preprocessing.scale",
"matplotlib.pyplot.show",
"matplotlib.pyplot.Circle",
"matplo... |
so5462/tensorflow | [
"0f9acc15ba56ecf01a79889d29295310559c681a"
] | [
"tensorflow/python/keras/layers/normalization_test.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras.keras_parameterized.run_all_keras_modes",
"tensorflow.python.ops.array_ops.ones",
"tensorflow.python.keras.layers.normalization.BatchNormalization",
"numpy.mean",
"tensorflow.python.keras.layers.normalization_v2.BatchNormalization",
"numpy.random.random",
"tens... |
drwalton/pyrtools | [
"00c055639d2dc887c94bf5adddb7adaa8960fb5f"
] | [
"pyrtools/pyramids/steer.py"
] | [
"import numpy as np\nimport warnings\n\n\ndef steer_to_harmonics_mtx(harmonics, angles=None, even_phase=True):\n '''Compute a steering matrix\n\n This maps a directional basis set onto the angular Fourier harmonics.\n\n Parameters\n ----------\n harmonics: `array_like`\n array specifying the a... | [
[
"numpy.count_nonzero",
"numpy.dot",
"numpy.linalg.matrix_rank",
"numpy.array",
"numpy.zeros",
"numpy.sin",
"numpy.linalg.pinv",
"numpy.ones",
"numpy.min",
"numpy.nonzero",
"numpy.arange",
"numpy.cos"
]
] |
floutt/PloidPy | [
"cfaa75176be6070bc39314a510049774defb4d2c"
] | [
"PloidPy/nbinom.py"
] | [
"import numpy as np\nimport statsmodels.discrete.discrete_model as dm\n\n\n# fits data onto a negative binomial distribution by approximately maximizing\n# the parameters\ndef fit_nbinom(x):\n print(\"Fitting total read count to negative binomial distribution...\")\n params = dm.NegativeBinomial(x, np.ones_li... | [
[
"numpy.ones_like",
"numpy.exp"
]
] |
erooke/Simsam | [
"e89e9a6c6d87ca77d764e84f8c381b52ee0e504d"
] | [
"simsam/simsam.py"
] | [
"\"\"\"Algorithms for sampling from the unit simplex.\"\"\"\n\nimport numpy as np\nimport sys\n\n\ndef naive_sampling(n, N=1):\n \"\"\"Sample from an n-dimensional simplex using a naive algorithm.\n\n This is a naive sampling procedure that will not result in\n samples being drawn uniformly from the n-simp... | [
[
"numpy.asarray",
"numpy.sum",
"numpy.random.default_rng",
"numpy.diff",
"numpy.prod",
"numpy.random.uniform"
]
] |
qihongl/free-recall | [
"507b9195432dcb0bc76fa469c637451407f5631a"
] | [
"src/models/CRPLSTM.py"
] | [
"\"\"\"\na lstm-a2c with context\ncontext input is added to the linear layer of A2C\n\"\"\"\nimport torch\nimport torch.nn as nn\nfrom models.A2C import A2C_linear\nfrom models._rl_helpers import pick_action\n\n# constants\nN_GATES = 3\n# output format is either discrete (e.g. action selection) or continuous\nOUTPU... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.mul",
"torch.nn.init.constant_",
"torch.no_grad",
"torch.nn.init.orthogonal_",
"torch.randn"
]
] |
PacktPublishing/Boosting-Machine-Learning-Models-in-Python | [
"8995190d6be04c0103dde31dea14ca793edd9045"
] | [
"Section 5/source/bp/section5_video3_classification_using_xgboost.py"
] | [
"\"\"\"\nSimple classification with XGBoost.\n\"\"\"\nfrom section1_video5_data import get_data\n\nfrom sklearn import model_selection\nfrom xgboost import XGBClassifier\nimport numpy as np\n\nseed=123\n\n# Load prepared data\nX, Y = get_data('../data/video1_diabetes.csv')\n# Build our single model\nc = XGBClassifi... | [
[
"numpy.array",
"sklearn.model_selection.cross_val_score"
]
] |
yangxue0827/TF_Deformable_Net | [
"00c86380fd2725ebe7ae22f41d460ffc0bca378d"
] | [
"lib/gt_data_layer/roidb.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Transform a roidb into a trainable roidb by adding a ... | [
[
"numpy.log",
"numpy.zeros",
"numpy.where",
"numpy.sqrt",
"numpy.vstack"
]
] |
upul/Aurora | [
"415a80ac5f7083475baca4a2d187cd102ba7a6c5"
] | [
"aurora/autodiff/numerical_gradient.py"
] | [
"import numpy as np\nfrom .executor import Executor\n\n\ndef eval_numerical_grad(f, feed_dict, wrt, h=1e-5):\n wrt_val = feed_dict[wrt]\n grad = np.zeros_like(wrt_val)\n\n it = np.nditer(wrt_val, flags=['multi_index'], op_flags=['readwrite'])\n while not it.finished:\n ix = it.multi_index\n ... | [
[
"numpy.sum",
"numpy.zeros_like",
"numpy.nditer"
]
] |
dertilo/knowledge-graph-reasoning | [
"e36d57ee34aa2b532f4dfa98a1e1d222037337cc"
] | [
"kgr/conv_e.py"
] | [
"from dataclasses import dataclass\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n@dataclass\nclass Config:\n entity_dim:int=200\n relation_dim:int=200\n emb_dropout_rate:float=0.3\n hidden_dropout_rate:float=0.3\n feat_dropout_rate:float=0.2\n emb_2D_d1:int=10\n emb... | [
[
"torch.nn.Linear",
"torch.nn.functional.sigmoid",
"torch.nn.Dropout",
"torch.cat",
"torch.zeros",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.functional.relu",
"torch.nn.init.xavier_normal_",
"torch.nn.Embedding"
]
] |
rs9899/Parsing-R-CNN | [
"8c4d940dcd322bf7a8671f8b0faaabb3259bd384"
] | [
"utils/data/samplers/repeat_factor.py"
] | [
"import math\nimport torch\nimport torch.distributed as dist\nfrom torch.utils.data.sampler import Sampler\nfrom collections import defaultdict\nfrom utils.misc import logging_rank\n\n\nclass RepeatFactorTrainingSampler(Sampler):\n \"\"\"\n Similar to DistributedSampler, but suitable for training on class imb... | [
[
"torch.distributed.get_world_size",
"torch.trunc",
"torch.distributed.is_available",
"torch.Generator",
"torch.tensor",
"torch.distributed.get_rank"
]
] |
gpasquev/mlognormfit | [
"c65e6f091b98147adaa6edfb3300887d4f72fa3e"
] | [
"fit2.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Este es un módulo que tiene herramientas para ajustar un ciclo M vs H con \n una distribución lognormal de Langevins. \n\n ======================\n How to use it\n ======================\n\n The module provide a function :func:`new` to load da... | [
[
"numpy.exp",
"numpy.log",
"matplotlib.pyplot.savefig",
"numpy.tanh",
"numpy.sqrt",
"numpy.append",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplot",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.close",
"numpy.shape",
"matplotlib.pyplot.figure... |
KIT-HYD/model-evaluation | [
"0a37147dace75e353048e2ae87b87a9954c67451"
] | [
"strace/scripts/p_ebni_int_in.py"
] | [
"import numpy as np\nimport pandas as pd\np_ebni_int = pd.read_csv('data/p_ebni_int.csv', header=None, names=['input'], dtype=np.int8)\n"
] | [
[
"pandas.read_csv"
]
] |
guy477/Poker | [
"d10e5af396509cd425aedc27198bb30c0709f43b"
] | [
"Version2/ivan/mcst/Policy/PPO/PPOPolicy.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport time\nimport os\n\n# from Env.AtariEnv.atari_wrappers import LazyFrames\n\n\ndef ortho_weights(shape, scale=1.):\n \"\"\" PyTorch port of ortho_init ... | [
[
"torch.nn.Linear",
"numpy.random.normal",
"torch.device",
"numpy.array",
"torch.nn.MSELoss",
"torch.from_numpy",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"numpy.prod",
"numpy.linalg.svd",
"torch.load",
"numpy.sqrt"
]
] |
erictleung/pandas | [
"ca52e3968058dce48c20070b3e9efc2ec42d7cf4"
] | [
"pandas/core/arrays/datetimelike.py"
] | [
"from __future__ import annotations\n\nfrom datetime import datetime, timedelta\nimport operator\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Optional,\n Sequence,\n Tuple,\n Type,\n TypeVar,\n Union,\n cast,\n)\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs... | [
[
"pandas.core.dtypes.common.is_string_dtype",
"numpy.array_equal",
"pandas.core.dtypes.common.is_unsigned_integer_dtype",
"pandas.core.algorithms.value_counts",
"pandas.core.ops.common.unpack_zerodim_and_defer",
"pandas.core.ops.invalid.invalid_comparison",
"pandas.compat.numpy.function... |
glimix/limix-ext | [
"7cf7a3b2b02f6a73cbba90f1945a06b9295b7357"
] | [
"limix_ext/macau/heritability.py"
] | [
"from __future__ import absolute_import\n\nimport logging\n\nimport numpy as np\nfrom numpy import asarray\n\nfrom ..util import gower_normalization\nfrom .core import run_heritability\n\n\ndef binomial_estimate(nsuccesses, ntrials, covariate, K, NP=10):\n logger = logging.getLogger(__name__)\n logger.info('G... | [
[
"numpy.asarray",
"numpy.random.RandomState"
]
] |
credo-ai/credoai_lens | [
"fac0d21b69fa86fc7ab8c2a748c0631ec15fdccc"
] | [
"credoai/modules/dataset_modules/dataset_fairness.py"
] | [
"from dis import dis\nimport numpy as np\nimport pandas as pd\nimport warnings\nfrom credoai.modules.credo_module import CredoModule\nfrom credoai.utils.constants import MULTICLASS_THRESH\nfrom credoai.utils.common import NotRunError, is_categorical\nfrom credoai.utils.dataset_utils import ColumnTransformerUtil\nfr... | [
[
"numpy.max",
"sklearn.model_selection.StratifiedKFold",
"sklearn.feature_selection.mutual_info_regression",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"sklearn.feature_selection.mutual_info_classif",
"numpy.min",
"sklearn.compose.ColumnTransformer",
"pandas.con... |
nperraud/3DcosmoGAN | [
"0d566bca495f764c1287c5e216e20601fa975cda"
] | [
"cosmotools/data/load.py"
] | [
"import numpy as np\nimport os\nfrom gantools import utils\nfrom . import path\nfrom . import fmap\nfrom gantools.data import transformation\nfrom gantools.data import *\nfrom functools import partial\nfrom gantools import blocks\n\n\n\ndef load_samples_raw(ncubes=None, resolution=256, Mpch=70):\n ''' Load 2D or... | [
[
"numpy.array"
]
] |
VincentLefevre/3D-parallax | [
"8eab905fcc591e1bd7ddbbb01ad21427286c02e3",
"8eab905fcc591e1bd7ddbbb01ad21427286c02e3"
] | [
"PyMesh/python/pymesh/Boundary.py",
"PyMesh/python/pymesh/tests/test_curvature.py"
] | [
"import numpy as np\r\nfrom numpy.linalg import norm\r\n\r\nimport PyMeshUtils\r\n\r\nclass Boundary(object):\r\n def __init__(self, mesh):\r\n self.__mesh = mesh\r\n if mesh.num_voxels == 0:\r\n self.__init_surface_boundaries()\r\n else:\r\n self.__init_volume_boundari... | [
[
"numpy.divide",
"numpy.zeros_like",
"numpy.linalg.norm",
"numpy.zeros"
],
[
"numpy.amin"
]
] |
IsaacSheidlower/Robot_Learning_Enviornments | [
"3f2dcf0678dfc719d0346b8455448b7e7dd5ea95"
] | [
"sphero_push_env/src/main_color_reacher.py"
] | [
"#!/usr/bin/env python\n\nimport rospy\nimport numpy as np\nimport time\nfrom hlpr_manipulation_utils.msg import RLTransitionPlusReward\nfrom hlpr_manipulation_utils.srv import GetActionFromObs\nfrom color_reacher import ColorReacher\nfrom kinova_msgs.srv import ClearTrajectories\n\nfrom continuous_cartesian import... | [
[
"numpy.array",
"numpy.mean",
"numpy.save"
]
] |
kkadali/Qcodes | [
"74527ae6faf7ec914ae414c6a776307abf158675"
] | [
"qcodes/tests/test_helpers.py"
] | [
"import asyncio\nimport json\nimport time\n\nfrom collections import OrderedDict\nfrom datetime import datetime\nfrom unittest import TestCase\n\n\nimport numpy as np\n\nfrom qcodes.utils.helpers import (is_sequence, permissive_range, wait_secs,\n make_unique, DelegateAttributes,\n ... | [
[
"numpy.array",
"numpy.int8",
"numpy.complex",
"numpy.arange",
"numpy.bool_",
"numpy.linspace",
"numpy.meshgrid"
]
] |
zergey/pytorch-lifestream | [
"0c48f8cedf4a695e135da68aacad4f5eaa16c626"
] | [
"experiments/scenario_bowl2019/make_dataset.py"
] | [
"from make_datasets_spark import DatasetConverter\n\nfrom pyspark.sql import SparkSession\nimport pyspark.sql.functions as F\nfrom pyspark.sql.functions import udf\nfrom pyspark.sql.types import ArrayType, DoubleType, StringType, IntegerType\nfrom pyspark.sql.window import Window\nfrom pyspark.sql.functions import ... | [
[
"numpy.array"
]
] |
purist180/SSRN | [
"23ddfcef20d52cb20ee56710273855169eacb095"
] | [
"SSRN_UP.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.io as sio\nfrom keras.models import Sequential, Model\nfrom keras.layers import Convolution2D, MaxPooling2D, Conv3D, MaxPooling3D, ZeroPadding3D\nfrom keras.layers import Activation, Dropout, Flatten, Dense, BatchNormalizati... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"scipy.io.loadmat",
"numpy.random.shuffle",
"sklearn.metrics.accuracy_score",
"sklearn.preprocessing.scale",
"numpy.prod",
"sklearn.metrics.cohen_kappa_score"
]
] |
junqi-jiang/mmf | [
"c8f47a23b85a87d14616c2f53e81693a25ea929a"
] | [
"mmf/models/vilbert.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport math\nimport os\nfrom copy import deepcopy\nfrom typing import Dict, List, Optional, Tuple\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom mmf.common.registry import registry\nfrom mmf.models import BaseModel\nfrom mmf.modules.... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.ones",
"torch.jit.is_scripting",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"torch.tensor",
"torch.nn.KLDivLoss",
"torch.zeros_like",
"torch.zeros",
"numpy.array",
"torch.nn.functional.log_softmax",
"torch.nn.ReLU",... |
PAmcconnell/nipype | [
"39fbd5411a844ce7c023964d3295eb7643b95af5",
"39fbd5411a844ce7c023964d3295eb7643b95af5"
] | [
"nipype/algorithms/tests/test_icc_anova.py",
"nipype/interfaces/dipy/preprocess.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nfrom nipype.algorithms.icc import ICC_rep_anova\n\n\ndef test_ICC_rep_anova():\n # see table 2 in P. E. Shrout & Joseph L. Fleiss (1979). \"Intraclass\n # Correlations: Uses in Assessing Rater Reliability\". Psychological\n # Bulletin 86 (2): 420-428\n Y = n... | [
[
"numpy.array",
"numpy.isclose"
],
[
"numpy.zeros_like",
"numpy.ones_like",
"numpy.nan_to_num",
"numpy.array",
"scipy.ndimage.label",
"numpy.percentile",
"numpy.ones",
"numpy.mean",
"numpy.std",
"numpy.argmax",
"numpy.all",
"numpy.squeeze",
"scipy.ndi... |
brainthemind/mne-phase | [
"438a20761252e231f3ed3a7968adf038cd17e257"
] | [
"mne_phase/utils.py"
] | [
"import numpy as np\n\ndef rayleigh_test(phases):\n \"\"\"test distrib uniforme.\"\"\"\n ph = phases.reshape(-1)\n n = len(ph)\n w = np.ones(n)\n r = np.sum(w*np.exp(1j*ph))\n r = abs(r)/np.sum(w)\n R = n*r\n z = R**2 / n\n pval = np.exp(np.sqrt(1+4*n+4*(n**2-R**2))-(1+2*n))\n return p... | [
[
"numpy.sum",
"numpy.ones",
"numpy.exp",
"numpy.sqrt"
]
] |
wwilliamcook/floop | [
"80a52171bae038aa3d8a00de59f623a95c47e4c7"
] | [
"im_tools.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport cv2 as cv\nimport imutils\nimport fitz\nimport os\n\n\ndef rotate_crop(image, angle):\n \"\"\"Rotate the given image counterclockwise by the specified angle (degrees), removing whitespace.\"\"\"\n # Based on Adrian Rosebrock's imutils (https://www.pyimagese... | [
[
"numpy.random.random",
"numpy.random.randint",
"numpy.abs"
]
] |
GuillaumeFavelier/pyvista | [
"dd2cb22464d0e96d8c92d91106283ee59b8b5041"
] | [
"tests/test_examples.py"
] | [
"import os\nfrom subprocess import PIPE, Popen\n\nimport numpy as np\nimport pytest\nimport vtk\n\nimport vtki\nfrom vtki import examples\nfrom vtki.plotting import running_xserver\n\nTEST_DOWNLOADS = False\ntry:\n if os.environ['TEST_DOWNLOADS'] == 'True':\n TEST_DOWNLOADS = True\nexcept KeyError:\n p... | [
[
"numpy.sin",
"numpy.empty",
"numpy.any",
"numpy.arange",
"numpy.sqrt",
"numpy.linspace",
"numpy.meshgrid"
]
] |
BeCuriousS/ippg-toolbox | [
"74b58459d038e2a77f0b51b33de372f3f9afd2a6"
] | [
"ippgtoolbox/detection/skin/deeplab/SkinDetector1/models-master/research_custom/deeplab/vis.py"
] | [
"# Lint as: python2, python3\r\n# Copyright 2018 The TensorFlow 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 copy of the License at\r\n#\r\n# http://www.apache.... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.Graph",
"tensorflow.train.ChiefSessionCreator",
"tensorflow.math.scalar_mul",
"tensorflow.logging.info",
"tensorflow.global_variables_initializer",
"tensorflow.gfile.MakeDirs",
"te... |
christsa/baselines | [
"93c013dffc09b8ac8133b3a6c04a9e23aef05952"
] | [
"baselines/her/actor_critic.py"
] | [
"import tensorflow as tf\nfrom baselines.her.util import store_args, nn\n\n\nclass ActorCritic:\n @store_args\n def __init__(self, inputs_tf, dimo, dimg, dimu, max_u, o_stats, g_stats, hidden, layers,\n **kwargs):\n \"\"\"The actor-critic network and related training code.\n\n Ar... | [
[
"tensorflow.variable_scope",
"tensorflow.concat"
]
] |
Murayu0225/youtube-live-chat-client | [
"ef5e3d9a0c31445578dabd7f19760548744b08ef"
] | [
"notification.py"
] | [
"import pandas as pd\nfrom apiclient.discovery import build\nfrom apiclient.errors import HttpError\nfrom twitter import Twitter, OAuth\nimport settings\nimport sys\n\ntry:\n print('NiziU YouTube Notification System. Created by Murayu0225.')\nexcept Exception as e:\n print(\"Can't start program.\")\n print(e)\n ... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
MPT-Quant/research | [
"522cf53da9ba42b0b8fd79a8760ee0c39e6e2715"
] | [
"Chapter19/mlfinlab/data_structures/run_data_structures.py"
] | [
"\"\"\"\nAdvances in Financial Machine Learning, Marcos Lopez de Prado\nChapter 2: Financial Data Structures\n\nThis module contains the functions to help users create structured financial data from raw unstructured data,\nin the form of tick, volume, and dollar run bars.\n\nThese bars are used throughout the text ... | [
[
"numpy.array",
"numpy.isnan",
"numpy.float"
]
] |
dingyif/DeepForest | [
"f077edbcb7c1ccec03ea6bd6c0e49b2068cec8c2"
] | [
"setup.py"
] | [
"from setuptools import setup, find_packages\nimport setuptools\nfrom setuptools.extension import Extension\nfrom distutils.command.build_ext import build_ext as DistUtilsBuildExt\n\nNAME ='deepforest'\nVERSION = '0.3.4'\nDESCRIPTION = 'Tree crown prediction using deep learning retinanets'\nURL = 'https://github.co... | [
[
"numpy.get_include"
]
] |
tgrel/models | [
"d739ec6c13a920f3e9d325bb3c8faeb8dfe8583f"
] | [
"official/bert/run_squad.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.keras.mixed_precision.experimental.set_policy",
"tensorflow.io.gfile.GFile",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.train.latest_checkpoint",
"tensorflow.distribute.experimental.MultiWorkerMirroredStrategy",
"tensorflow.nest.map_structure",
"tensorflow.keras.... |
sbuse/wimprates | [
"fa7699a99765cdc6531f0b621e9769122f9db6dd"
] | [
"wimprates/elastic_nr.py"
] | [
"\"\"\"Elastic nuclear recoil rates, spin-independent and spin-dependent\n\"\"\"\n\nimport numpy as np\nimport numericalunits as nu\nfrom scipy.interpolate import interp1d\nfrom scipy.integrate import quad\n\nimport wimprates as wr\n\nexport, __all__ = wr.exporter()\n__all__ += ['ATOMIC_WEIGHT']\n\nATOMIC_WEIGHT = ... | [
[
"scipy.interpolate.interp1d",
"numpy.sin",
"numpy.zeros_like",
"numpy.exp",
"numpy.sqrt",
"numpy.cos"
]
] |
jonpas/NuriSolver | [
"de099b6e2f111e295f14fe24d1fff43879b78b98"
] | [
"nurisolver.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport sys\nimport os\nimport time\nimport logging\nimport unittest\nimport copy\nimport queue\nimport concurrent.futures\nimport multiprocessing\nfrom collections import deque\nfrom operator import itemgetter\nfrom pprint import pprint\n\nimport numpy as np # [y, x] or ... | [
[
"numpy.sum",
"numpy.genfromtxt",
"numpy.array_equal",
"numpy.abs"
]
] |
isaaccorley/torchgeo | [
"ff28a3b358281841e22e76c9858075a563522517"
] | [
"tests/data/sen12ms/data.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport hashlib\nimport os\nimport shutil\n\nimport numpy as np\nimport rasterio\nfrom rasterio.transform import Affine\nfrom rasterio.crs import CRS\n\nSIZE = 64 # image width/height\n\nnp.r... | [
[
"numpy.random.seed",
"numpy.iinfo",
"numpy.random.randint"
]
] |
OmerLif/IML.HUJI | [
"11646142cdded475b66cb4db296efc40e7ad8de6"
] | [
"IMLearn/learners/classifiers/perceptron.py"
] | [
"from __future__ import annotations\nfrom typing import Callable\nfrom typing import NoReturn\nfrom ...base import BaseEstimator\nimport numpy as np\n\n\ndef default_callback(fit: Perceptron, x: np.ndarray, y: int):\n pass\n\n\nclass Perceptron(BaseEstimator):\n \"\"\"\n Perceptron half-space classifier\n\... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.ones"
]
] |
lmxing/keras | [
"ba27f0fd4d16bf5cd15e7cea70b74ece11efa8ad"
] | [
"examples/recommendModel_tfv1/wideAndDeepModel/wideAndDeep.py"
] | [
"import math\nimport numpy as np\nimport random as rn\n# import tensorflow as tf\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\nclass wideAndDeep(object):\n\n \"\"\"\n 初始化参数\n \"\"\"\n def __init__(self, learning_rate, feature_length, embedding_length, batch_size, hidden_layer):\n ... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.nn.dropout",
"tensor... |
Radwa-Saeed/Didital-Signal-Processing-PyQt-GUI | [
"8d97e2925a20dd6a74d4bc0613bfceea668f2731"
] | [
"Shazam/class.py"
] | [
"import pylab\nimport os\nimport numpy as np\nimport librosa\nimport imagehash\nfrom PIL import Image\nimport operator\nimport pickle\nimport soundfile as sf\nimport matplotlib.pyplot as plt\nimport librosa.display\n\n# TODO:\n# - implement protected variables?\n# - rectify similarity index value *IMPORTANT*\n#... | [
[
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.semilogy"
]
] |
alecuba16/python_pytorch_keras_models | [
"0784476661b30ee7dfb70ec708bf1a3a1b7f2650"
] | [
"autoencoder/ae_v0.py"
] | [
"# AutoEncoders\n\n# Importing the libraries\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.autograd import Variable\n\n#Configs\ntrain_file = '../datasets/Escamb_wtdata_train_alarm_86400.csv.g... | [
[
"torch.nn.Linear",
"pandas.isnull",
"torch.nn.MSELoss",
"sklearn.preprocessing.StandardScaler",
"torch.autograd.Variable",
"torch.nn.Sigmoid",
"torch.FloatTensor",
"torch.sum",
"numpy.sqrt",
"pandas.read_csv",
"sklearn.preprocessing.Imputer",
"numpy.floor"
]
] |
gmfang/hummingbot | [
"03c6ab488cca620f622c432a5a09a40cd854e475"
] | [
"hummingbot/strategy/spot_perpetual_arbitrage/spot_perpetual_arbitrage.py"
] | [
"from decimal import Decimal\nimport time\nimport logging\nimport asyncio\nimport pandas as pd\nfrom typing import List, Dict, Tuple\nfrom hummingbot.core.utils.async_utils import safe_ensure_future\nfrom hummingbot.core.clock import Clock\nfrom hummingbot.core.data_type.limit_order import LimitOrder\nfrom hummingb... | [
[
"pandas.DataFrame"
]
] |
talonchandler/dipsim | [
"04904871924276fd1662ca15b7224166d271c0d8"
] | [
"paper/figures/single-arm.py"
] | [
"from dipsim import multiframe, util\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport matplotlib.patches as patches\nimport os; import time; start = time.time(); print('Running...')\nimport matplotlib.gridspec as gridspec\n\n# Main input parameters\ncol_labels = ['Geometry\\n(NA${}_{\... | [
[
"numpy.array",
"matplotlib.gridspec.GridSpecFromSubplotSpec",
"matplotlib.colors.LogNorm",
"matplotlib.cm.get_cmap",
"matplotlib.patches.Rectangle",
"numpy.median",
"matplotlib.pyplot.figure",
"numpy.apply_along_axis",
"matplotlib.colors.Normalize",
"numpy.abs",
"matplo... |
Fabian-Balzer/Randomkingdominion | [
"2d78400722376c4aa1c2a372f5286693bfbb4f90"
] | [
"modules/info_adder.py"
] | [
"\"\"\"Module for trying to find card info and write them to card_info\"\"\"\n\n\nimport json\nimport pandas as pd\nimport numpy as np\nfrom collections import defaultdict\n\n\nPATHBASE = \"../card_info/specifics/\"\n\n\ndef get_card_quality(df):\n df[\"DrawQualityNew\"] = (2*pd.to_numeric(df[\"Cards\"], errors=... | [
[
"pandas.read_csv",
"pandas.to_numeric"
]
] |
davidreiman/nsf | [
"ed70316c3bf1acd4ffdf309f1773172c34e48320"
] | [
"nsf/experiments/face.py"
] | [
"import argparse\nimport json\nimport numpy as np\nimport torch\nimport os\n\nfrom matplotlib import cm, pyplot as plt\nfrom tensorboardX import SummaryWriter\nfrom torch import optim\nfrom torch.nn.utils import clip_grad_norm_\nfrom torch.utils import data\nfrom tqdm import tqdm\n\nimport data as data_\nimport nn ... | [
[
"torch.zeros",
"torch.device",
"numpy.array",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"numpy.random.seed",
"torch.set_default_tensor_type",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"torch.ones",
"to... |
add54/Data_PipeLine_Apache_Airflow | [
"40b52ba6fcda3203b194be9e1c2850135997215a"
] | [
"chapter08/dags/custom/ranking.py"
] | [
"import pandas as pd\n\n\ndef rank_movies_by_rating(ratings, min_ratings=2):\n ranking = (\n ratings.groupby(\"movieId\")\n .agg(\n avg_rating=pd.NamedAgg(column=\"rating\", aggfunc=\"mean\"),\n num_ratings=pd.NamedAgg(column=\"userId\", aggfunc=\"nunique\"),\n )\n ... | [
[
"pandas.NamedAgg"
]
] |
patrickmineault/packaging_user_guide | [
"1e89e217ce15b6eda666f098804cb9f20ddfcec0"
] | [
"research_code/cka_step4.py"
] | [
"from typing import List\nimport os\nimport seaborn as sns\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport pickle\n\n\ndef cka_wide(X, Y):\n \"\"\"\n Calculate CKA for two matrices. This algorithm uses a Gram matrix \n implementation, which is fast when the data is wider... | [
[
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.title"
]
] |
miguel-bm/ai6rl | [
"cd751b734e485784e0d42bf4af7068860635ea91",
"cd751b734e485784e0d42bf4af7068860635ea91"
] | [
"03_DeepQ/src/play_DQN_ATARI.py",
"05_Environments/src/test_2048.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport typer\nimport time\nimport gym\nimport torch\nimport collections\nimport numpy as np\nimport pandas as pd\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nfrom sklearn.manifold import TSNE\n\nimport pygame\nfrom pygame.locals import VIDEORESIZE\n\... | [
[
"matplotlib.cm.ScalarMappable",
"numpy.array",
"torch.device",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"sklearn.manifold.TSNE",
"numpy.argmax",
"matplotlib.pyplot.scatter",
"matplotlib.colors.Colormap"
],
[
"numpy.random.choice"
... |
max-liu-112/STGAN-WO | [
"5e23597215de60e1381e7a2893c950ab7a3dc501"
] | [
"training/misc.py"
] | [
"\n\n\"\"\"Miscellaneous utility functions.\"\"\"\n\nimport os\nimport glob\nimport pickle\nimport re\nimport numpy as np\nfrom collections import defaultdict\nimport PIL.Image\nimport dnnlib\n\nimport config\nfrom training import dataset\n\n#-------------------------------------------------------------------------... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.rint",
"numpy.random.randn",
"numpy.float32",
"numpy.argmax",
"numpy.sqrt",
"numpy.clip"
]
] |
kdere/ChiantiPy | [
"0d47cc1c5855ab0290d0c6bd43628722651a77c5"
] | [
"ChiantiPy/core/IpyMspectrum.py"
] | [
"from datetime import datetime\nimport copy\nimport warnings\n\nimport numpy as np\ntry:\n from ipyparallel import Client\nexcept ImportError:\n warnings.warn(\"ipyparallel not found. You won't be able to use the ipymspectrum module\")\n\nimport ChiantiPy\nimport ChiantiPy.tools.data as chdata\nimport Chianti... | [
[
"numpy.hstack",
"numpy.atleast_1d",
"numpy.asarray",
"numpy.zeros"
]
] |
vijinkp/graph-analysis | [
"655dffcd6caaf2fcfddb9867399d500159efdf00"
] | [
"node_clusters.py"
] | [
"import os\nfrom matplotlib import pyplot as plt \nimport seaborn as sns\nimport pandas as pd \nimport numpy as np\nfrom graph_embedding import get_networkx_graph, get_graph_embedding_model\n\ndef tagcount(row):\n year_key = str(row['CreationYear']) + \"{0:0=2d}\".format(row['CreationMonth'])\n tags = row.Cle... | [
[
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
deepaknlp/HQS | [
"e2d6394edc7a700d43ae2a4497acfd70dc59b3a0"
] | [
"src/scripts/train.py"
] | [
"import sys\nimport os\nimport numpy as np\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' \nimport tensorflow as tf\n\nfrom keras import *\nfrom keras.layers import *\nfrom keras.models import *\nfrom keras.preprocessing import *\nfrom keras.callbacks import *\n\ndim = 128\nmaxlen = 9\n\ndef create_model(ans_dic_ot, w... | [
[
"numpy.load"
]
] |
Ximilar-com/xcenternet | [
"7b057b7742b7d46e91e1ec2f277b758463309f75"
] | [
"scripts/train.py"
] | [
"import argparse\nimport os\nimport tensorflow as tf\n\nfrom xcenternet.datasets import CocoDataset, VocDataset, CustomDataset\nfrom xcenternet.model.callbacks import MAPValidationCallback\nfrom xcenternet.model.config import ModelConfig, XModelType, XModelBackbone, XModelMode\nfrom xcenternet.model.model_factory i... | [
[
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.distribute.MirroredStrategy"
]
] |
timofriedl/multicam-ihgg | [
"f52659a1bb38369b6e2ac62261cc9c65fbc3ca80",
"f52659a1bb38369b6e2ac62261cc9c65fbc3ca80"
] | [
"envs/hand/reach.py",
"gym/envs/robotics/myUR5Gripper/find.py"
] | [
"import gym\nimport numpy as np\nfrom gym.envs.robotics.hand.reach import FINGERTIP_SITE_NAMES\n\nfrom .vanilla import VanillaGoalEnv\nfrom envs.utils import quat_from_angle_and_axis\n\n\nclass ReachGoalEnv(VanillaGoalEnv):\n\tdef __init__(self, args):\n\t\tVanillaGoalEnv.__init__(self, args)\n\n\tdef generate_goal... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.random.randint"
],
[
"numpy.concatenate",
"numpy.zeros_like",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
TakuyaHiraoka/Learning-Robust-Options-by-Conditional-Value-at-Risk-Optimization | [
"78d3f8e36cdc954897ddc6af9029991bff19fb58"
] | [
"LearningMoreRobustOption/mlp_policy.py"
] | [
"from baselines.common.mpi_running_mean_std import RunningMeanStd\nimport baselines.common.tf_util as U\nimport tensorflow as tf\nimport gym\nfrom baselines.common.distributions import make_pdtype\nimport numpy as np\nimport pdb\n\n\ndef dense3D2(x, size, name, option, num_options=1, weight_init=None, bias=True):\n... | [
[
"tensorflow.zeros_initializer",
"numpy.array",
"tensorflow.shape",
"numpy.sum",
"tensorflow.matmul",
"tensorflow.variable_scope",
"tensorflow.clip_by_value",
"tensorflow.placeholder",
"tensorflow.get_variable_scope",
"tensorflow.stop_gradient",
"tensorflow.get_collectio... |
sanchitsgupta/recommendation-algorithms | [
"d4bc45f10ebdb3e45bccc4f31d826556b3ff86a0"
] | [
"src/metrics.py"
] | [
"import math\n\nimport numpy as np\n\n\ndef rmse_spearman(matrix_predicted, matrix_actual, path):\n \"\"\"\n Calculates the RMSE error and Spearman correlation\n\n Parameters:\n matrix_predicted: this matrix contains detected values\n matrix_test: this matrix contains original values\n path: this ... | [
[
"numpy.isnan"
]
] |
ax3l/yt | [
"b9e5dfd7d1fdac3b1c0ba20b600e05f16199e3a3",
"b9e5dfd7d1fdac3b1c0ba20b600e05f16199e3a3",
"b9e5dfd7d1fdac3b1c0ba20b600e05f16199e3a3"
] | [
"yt/frontends/exodus_ii/data_structures.py",
"yt/frontends/stream/data_structures.py",
"yt/visualization/fixed_resolution.py"
] | [
"\"\"\"\nExodus II data structures\n\n\n\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2013, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this softw... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.ones",
"numpy.append"
],
[
"numpy.equal",
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.linspace",
"numpy.finfo",
"numpy.argsort",
"numpy.all",
"numpy.ind... |
HCDM/BanditLib | [
"df0e943db5d4c6f03061f1776038f59ebc5b2304"
] | [
"lib/NeuralTS.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom backpack import backpack\nfrom backpack.extensions import BatchGrad\nfrom lib.BaseAlg import BaseAlg, get_device, Network, obs_data_all\nimport numpy as np\nfrom backpack import backpack, extend\n\n\nclass NeuralTSUserStruct:\n def __init__(... | [
[
"numpy.array",
"torch.optim.lr_scheduler.StepLR",
"torch.nn.MSELoss",
"torch.argsort",
"torch.diag",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.eye",
"torch.transpose",
"torch.matmul",
"torch.sum"
]
] |
Shank2358/LO-Det | [
"869f3f537af9bc656f2bfdfa97ebb95bf70847a7"
] | [
"utils/cosine_lr_scheduler.py"
] | [
"import numpy as np\n\nclass CosineDecayLR(object):\n def __init__(self, optimizer, T_max, lr_init, lr_min=0., warmup=0):\n \"\"\"\n a cosine decay scheduler about steps, not epochs.\n :param optimizer: ex. optim.SGD\n :param T_max: max steps, and steps=epochs * batches\n :par... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"numpy.cos",
"matplotlib.pyplot.show"
]
] |
Aldair47x/DISTRIBUIDOS-UTP | [
"182f143b3a5d73744f78eb4fe1428cbca22387c2"
] | [
"socket inv matriz/server.py"
] | [
"import zmq\nimport sys\nimport os\nimport numpy as np\nfrom io import StringIO\nfrom numpy.linalg import inv\nfrom scipy.linalg import *\nimport json\n\ndef loadFiles(path):\n files = {}\n dataDir = os.fsencode(path)\n for file in os.listdir(dataDir):\n filename = os.fsdecode(file)\n print(\... | [
[
"numpy.linalg.inv"
]
] |
CutlerRU/librarian | [
"45205d7fc75740e29f4a90a5d91d6a4a07b5a0f1"
] | [
"server/librarian_server/observation.py"
] | [
"# -*- mode: python; coding: utf-8 -*-\n# Copyright 2016 the HERA Collaboration\n# Licensed under the BSD License.\n\n\"Observations.\"\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\n__all__ = str('''\nObservingSession\nObservation\n''').split()\n\nfrom flask import flash, ... | [
[
"numpy.median",
"numpy.array",
"numpy.clip",
"numpy.diff"
]
] |
Pythonimous/fic-bot | [
"d016ee3e8ff465ca3d507a863fb0ff53171ac78e"
] | [
"ficbot/character/name/generation.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom ficbot.data.loaders import ImageLoader\n\nimport pickle\n\n\ndef sample(preds, temperature=1.0):\n \"\"\" Helper function to sample an index from a probability array \"\"\"\n preds = np.asarray(preds).astype(\"float64\")\n preds = np.log(preds) / temperatu... | [
[
"numpy.asarray",
"numpy.log",
"numpy.sum",
"numpy.exp",
"tensorflow.keras.models.load_model",
"numpy.argmax",
"numpy.random.multinomial",
"numpy.expand_dims"
]
] |
nvanva/ngram-view | [
"c71cc082131ba51a00629dc4fc26dc9d72ebf800"
] | [
"BERT/supervisedPCA-Python/supervised_pca_vs_lda_qda.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n=====================\nSupervised PCA against LDA and QDA\n=====================\n\nA comparison of supervised PCA against LDA and QDA.\n\"\"\"\nprint(__doc__)\n\n\n# Code source: Gaël Varoquaux\n# Andreas Müller\n# Modified for documentation by Ja... | [
[
"sklearn.preprocessing.StandardScaler",
"sklearn.lda.LDA",
"matplotlib.pyplot.title",
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"sklearn.datasets.make_classification",
"sklearn.qda.QDA",
"sklearn.cross_val... |
Yuval-H/iclr_17_compression | [
"f9b04a6cb93e32d17c2f2548614690dee8840d78"
] | [
"models/model_temp_DSC.py"
] | [
"# Copyright 2020 InterDigital Communications, 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 app... | [
[
"torch.cat",
"torch.nn.LeakyReLU",
"torch.clamp",
"torch.nn.L1Loss",
"torch.zeros_like",
"torch.clip"
]
] |
mankar1257/Drug-Prediction-using-neural-collaborative-filtering | [
"03c51c5c830ffd0794add2bfed488b0bc7625180"
] | [
"src/Utilities/Data.py"
] | [
"# For loading and preprossing the data\n\nimport pandas as pd\nimport scipy.sparse as sp\nimport numpy as np\nimport random\n\n\nclass Data:\n\n def __init__(self):\n\n self.df = pd.read_csv(\n '/home/vaibhav/Downloads/archive/drugsComTrain_raw.csv').drop(['uniqueID', 'date'], axis=1)\n ... | [
[
"scipy.sparse.dok_matrix",
"pandas.read_csv"
]
] |
RitikRajSharma/Face-Recognition-Project | [
"0894a986abf074cc13920d68ac8fd8ef69083eab"
] | [
"opencv_1.py"
] | [
"import cv2\r\nimport matplotlib.pyplot as plt\r\n# Read an Image\r\nimg = cv2.imread('1.jpg')\r\nnewImg = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)\r\nplt.imshow(img)\r\nplt.show()\r\nplt.imshow(newImg)\r\nplt.show()\r\nprint(img)"
] | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
GodGamer029/YangBot | [
"83f33a43a969aede25c00c9dab41eab2fb307c47"
] | [
"visualizer.py"
] | [
"\nfrom pyqtgraph.Qt import QtGui, QtCore\nimport numpy as np\nimport code\nimport pyqtgraph as pg\n\nimport pyqtgraph.examples\nfrom numpy.polynomial.polynomial import Polynomial as Poly\n#pyqtgraph.examples.run()\n\n#QtGui.QApplication.setGraphicsSystem('raster')\napp = QtGui.QApplication([])\n#mw = QtGui.QMainWi... | [
[
"numpy.concatenate",
"numpy.delete",
"numpy.empty",
"numpy.set_printoptions",
"numpy.genfromtxt",
"numpy.arange",
"numpy.append",
"numpy.polynomial.polynomial.Polynomial.fit"
]
] |
MHC-F2V-Research/Image-Reconstruction-Ref2 | [
"0a124365fc14708bca092f68205987885c91212a"
] | [
"util/eval/InceptionScore.py"
] | [
"\"\"\"\nprovides a code to compute Inception Score. Inception model is downloaded automatically. The function to compute score is called \"get_inception_score\"\n\nsource: https://github.com/openai/improved-gan/tree/master/inception_score\n\"\"\"\n\n\n# Code derived from tensorflow/tensorflow/models/image/imagenet... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.log",
"numpy.sum",
"tensorflow.GraphDef",
"tensorflow.Session",
"tensorflow.import_graph_def",
"numpy.min",
"numpy.mean",
"numpy.exp",
"tensorflow.TensorShape",
"numpy.std",
"tensorflow.squeeze",
"tensorflow.nn.softma... |
QUVA-Lab/artemis | [
"84d3b1daf0de363cc823d99f978e2861ed400b5b"
] | [
"artemis/general/nested_structures.py"
] | [
"from collections import OrderedDict\n\nimport numpy as np\nfrom six import string_types, next\n\nfrom artemis.general.should_be_builtins import all_equal\n\n__author__ = 'peter'\n\n_immutible_types = (int, float, bool, type(None))+string_types\nPRIMATIVE_TYPES = (int, float, np.ndarray, type(None), bool)+string_ty... | [
[
"numpy.array"
]
] |
bjmcnabb/Sulfur-Cycling | [
"eae43d234dfadf235f33d1ac699adc7c2323084b"
] | [
"Southern_Ocean/SO_DMS_build_models.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Aug 4 09:28:55 2021\r\n\r\n@author: bcamc\r\n\"\"\"\r\n#%% Reference\r\n\r\n# CCMP Wind Speeds (<2007)\r\n# https://podaac.jpl.nasa.gov/dataset/CCMP_MEASURES_ATLAS_L4_OW_L3_5A_MONTHLY_WIND_VECTORS_FLK\r\n\r\n# NSIDC sea ice climatology\r\n# https://nsidc.org/dat... | [
[
"numpy.min",
"numpy.exp",
"numpy.nanmean",
"pandas.concat",
"sklearn.metrics.r2_score",
"pandas.read_csv",
"numpy.arange",
"torch.utils.data.DataLoader",
"numpy.sqrt",
"numpy.sinh",
"pandas.to_datetime",
"numpy.round",
"matplotlib.pyplot.figure",
"numpy.stac... |
Matgen-project/CrystalNet | [
"0e97176aeb58379715faa447c4c656a9061cdfd3"
] | [
"crystalnet/nn_utils.py"
] | [
"import math\nfrom typing import List, Union\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.optim import Optimizer\nfrom torch.optim.lr_scheduler import _LRScheduler\nfrom tqdm import trange\n\nfrom chemprop.data import CrystalDataset\n\n\ndef compute_pnorm(model: nn.Module) -> float:\n \... | [
[
"numpy.array",
"torch.nn.SELU",
"torch.nn.init.constant_",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.no_grad",
"torch.nn.ReLU",
"torch.nn.PReLU",
"torch.nn.init.xavier_normal_",
"torch.nn.ELU"
]
] |
neizod/neizod.github.io | [
"725f1306413c81ce8982091216575c0235cf1c2b"
] | [
"scripts/draw_segements_intersection.py"
] | [
"#!/usr/bin/env python3\n\nfrom collections import namedtuple\n\nimport matplotlib.pyplot as plt\n\n\nPoint = namedtuple('Point', 'x y')\n\nSegment = namedtuple('Segment', 'p q')\nSegment.from_floats = lambda x0, y0, x1, y1: Segment.from_points(Point(x0, y0), Point(x1, y1))\nSegment.from_points = lambda p, q: Segme... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot"
]
] |
ys10/Tacotron-cn | [
"0420aedb3c04359327de58b978198846e7c1a887"
] | [
"operators/orig_predictor.py"
] | [
"# coding=utf-8\nimport os\nimport tensorflow as tf\nimport numpy as np\nfrom scipy.io.wavfile import write\nfrom tqdm import tqdm\nfrom base.base_predict import BasePredict\nfrom utils.signal_process import spectrogram2wav\n\n\ndef embedding_lookup(lookup_table, text_idices):\n return [list(map(lambda x: looku... | [
[
"numpy.zeros"
]
] |
ananthsridharan/vtol_sizing | [
"3f754e1bd3cebdb5b5c68c8a2d84c47be1df2f02"
] | [
"src/Python/Stage_1/afdd/fixed_wing.py"
] | [
"#====================================================================\n# Ananth Sridharan, Jan 24th 2017\n#\n# AIRCRAFT WING GROUP: 29-1.2 SECTION IN NDARC THEORY MANUAL V1_11.PDF, pg 249\n#\n# AFDD 93 Model implemented by AS\n# frequency-based sizing also implemented by AS\n#======================================... | [
[
"numpy.amax"
]
] |
darrenleeweber/ulmo | [
"203899e4390a1dc090f17b4e4091658591a824ae"
] | [
"ulmo/ncdc/ghcn_daily/core.py"
] | [
"\"\"\"\n ulmo.ncdc.ghcn_daily.core\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This module provides direct access to `National Climatic Data Center`_\n `Global Historical Climate Network - Daily`_ dataset.\n\n\n .. _National Climatic Data Center: http://www.ncdc.noaa.gov\n .. _Global Historical Climate Netwo... | [
[
"pandas.DataFrame",
"pandas.merge",
"pandas.Period"
]
] |
Actis92/lightning-flash | [
"49972268cfc0f95f1bd2b8fbf25036970cc44b59"
] | [
"tests/core/serve/test_types/test_label.py"
] | [
"import pytest\nimport torch\n\nfrom flash.core.serve.types import Label\n\n\ndef test_path(session_global_datadir):\n label = Label(path=str(session_global_datadir / \"imagenet_labels.txt\"))\n assert label.deserialize(\"chickadee\") == torch.tensor(19)\n assert label.serialize(torch.tensor(19)) == \"chic... | [
[
"torch.tensor"
]
] |
em3ndez/CompreFace | [
"503153ebbe158d091155d924576610d7d7a88e4d"
] | [
"embedding-calculator/src/services/facescan/plugins/agegender/helpers.py"
] | [
"# Copyright (c) 2020 the original author or 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"tensorflow.truncated_normal_initializer",
"tensorflow.summary.histogram",
"tensorflow.matmul",
"tensorflow.contrib.layers.avg_pool2d",
"numpy.mean",
"numpy.std",
"tensorflow.variable_scope",
"numpy.subtract",
"tensorflow.contrib.slim.python.slim.nets.inception_v3.inception_v3_... |
AustinRochford/arviz | [
"5f202d9530abffc69dcc1b0d4bfc0dc34fe58e13"
] | [
"arviz/plots/energyplot.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom .kdeplot import kdeplot\nfrom ..stats import bfmi as e_bfmi\nfrom ..utils import get_stats\n\n\ndef energyplot(trace, kind='kde', bfmi=True, figsize=None, legend=True, fill_alpha=(1, .75),\n fill_color=('C0', 'C5'), bw=4.5, skip_first=0, fill_... | [
[
"matplotlib.pyplot.subplots",
"numpy.diff"
]
] |
nthuy190991/geoseg | [
"b679af5dc558720df36dddc7abfd4e6ecb46d7de"
] | [
"src/models/mcfcn.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n @Email: guangmingwu2010@gmail.com\n @Copyright: go-hiroaki\n @License: MIT\n\"\"\"\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .blocks import *\n\n\nclass MCFCN(nn.Module):\n def __init__(self,\n ... | [
[
"torch.nn.Softmax",
"torch.nn.Sigmoid",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"numpy.random.random"
]
] |
stonebig/robotics-toolbox-python | [
"8bb9ac54549701c2d00b1a1fc00c8eb5b44df6a6"
] | [
"roboticstoolbox/examples/icra2021.py"
] | [
"# -*- coding: utf-8 -*-\n# # Not your grandmother’s toolbox– the Robotics Toolbox reinvented for python\n# ### Peter Corke and Jesse Haviland\n#\n# This is the code for the examples in the paper published at ICRA2021.\n#\n\nimport swift.Swift\nimport spatialmath.base.symbolic as sym\nfrom roboticstoolbox import ET... | [
[
"numpy.linalg.matrix_rank",
"numpy.zeros",
"numpy.ones",
"numpy.arange",
"numpy.linspace"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.