repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
lboeman/solarforecastarbiter-api | [
"9df598b5c638c3e36d0649e08e955b3ddc1b542d"
] | [
"sfa_api/utils/request_handling.py"
] | [
"from collections import defaultdict\nfrom io import StringIO\nimport json\nimport re\n\n\nfrom flask import request, current_app\nimport numpy as np\nimport pandas as pd\nfrom solarforecastarbiter.datamodel import Forecast, Site\nfrom solarforecastarbiter.reference_forecasts import utils as fx_utils\nfrom werkzeug... | [
[
"pandas.isnull",
"pandas.to_datetime",
"pandas.Timedelta",
"pandas.DataFrame",
"pandas.date_range",
"pandas.Timestamp.now",
"pandas.Timestamp",
"pandas.read_csv",
"pandas.to_numeric"
]
] |
jungtaekkim/QMCSoftware | [
"4518d26b06ef737797d5e522cb61d9f7b516d74e"
] | [
"qmcpy/stopping_criterion/cub_qmc_ml.py"
] | [
"from ._stopping_criterion import StoppingCriterion\nfrom ..accumulate_data import MLQMCData\nfrom ..discrete_distribution import Lattice\nfrom ..true_measure import Gaussian\nfrom ..integrand import MLCallOptions\nfrom ..util import MaxSamplesWarning, ParameterError\nfrom numpy import *\nfrom scipy.stats import no... | [
[
"scipy.stats.norm.ppf"
]
] |
kfranson/VIP | [
"5975fd6ce7c02adace013c8a2412062ac2b92bbc"
] | [
"vip_hci/preproc/rescaling.py"
] | [
"#! /usr/bin/env python\n\n\"\"\"\nModule with frame px resampling/rescaling functions.\n\"\"\"\n__author__ = 'Carlos Alberto Gomez Gonzalez, V. Christiaens, R. Farkas'\n__all__ = ['frame_px_resampling',\n 'cube_px_resampling',\n 'cube_rescaling_wavelengths',\n 'frame_rescaling',\n ... | [
[
"numpy.ones_like",
"numpy.fft.fft2",
"numpy.where",
"numpy.zeros_like",
"numpy.nonzero",
"scipy.ndimage.interpolation.zoom",
"numpy.arange",
"numpy.fft.fftshift",
"scipy.optimize.minimize",
"numpy.nanmedian",
"numpy.array",
"numpy.pad",
"numpy.zeros",
"numpy... |
locuslab/robust-nn-control | [
"666fb1540f20555aa04bccde12603e67a1c0b913"
] | [
"envs/cartpole.py"
] | [
"import numpy as np\nimport torch\nimport os\n\nfrom envs import ode_env\nimport disturb_models as dm\nfrom constants import *\n\n\nclass CartPoleEnv(ode_env.NLDIEnv):\n\n def __init__(self, l=1, m_cart=1, m_pole=1, g=9.81, Q=None, R=None, random_seed=None, device=None):\n if random_seed is not None:\n ... | [
[
"torch.cos",
"torch.cat",
"torch.stack",
"numpy.random.rand",
"torch.sin",
"numpy.random.seed",
"numpy.random.randn",
"torch.clamp",
"torch.manual_seed",
"torch.tensor"
]
] |
astog/soccer-predictor | [
"c6030b350fd5049be43bd474fca8d5ea933a4604"
] | [
"soccer_predictor_fodds.py"
] | [
"from __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.data.sampler import SubsetRandomSampler\nfrom torch.autograd import Variable\nfrom soccer_loader import SoccerDataset\nfrom mlp import Net\n\nimport time\nimport datetime\nimpo... | [
[
"torch.cuda.manual_seed",
"torch.autograd.Variable",
"torch.optim.lr_scheduler.ExponentialLR",
"numpy.random.shuffle",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.utils.data.sampler.SubsetRandomSampler",
"to... |
PengWan-Yang/few-shot-transformer | [
"c055239061744124c72960420cd4037495952b6d"
] | [
"models/position_encoding.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nVarious positional encodings for the transformer.\n\"\"\"\nimport math\nimport torch\nfrom torch import nn\n\nfrom util.misc import NestedTensor\n\n\nclass PositionEmbeddingSine(nn.Module):\n \"\"\"\n This is a more standard vers... | [
[
"torch.nn.init.uniform_",
"torch.cat",
"torch.nn.Embedding",
"torch.arange"
]
] |
beyondacm/lingvo | [
"99c0da11d4abacf41850e2d9df1e11d211a30420"
] | [
"lingvo/core/favor_attention_test.py"
] | [
"# Lint as: python3\n# Copyright 2020 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... | [
[
"numpy.abs"
]
] |
akoul1/mvlearn | [
"177d391bb12c6e94335720d9af3608bd719d8be1"
] | [
"mvlearn/embed/gcca.py"
] | [
"# Copyright 2019 NeuroData (http://neurodata.io)\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 appli... | [
[
"scipy.stats.zscore",
"scipy.sparse.linalg.svds",
"numpy.concatenate",
"numpy.isnan",
"numpy.square",
"scipy.linalg.svd",
"numpy.min",
"numpy.mean",
"sklearn.preprocessing.normalize",
"numpy.sqrt",
"numpy.diag",
"numpy.flip"
]
] |
mrleu/lightning-flash | [
"644f2b559f87b40a5b623f5260eee0cf924ea0a5"
] | [
"flash_examples/tabular_classification.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.cuda.device_count"
]
] |
crisien/ooi-data-explorations | [
"5504444eded7f96ec59917edb002c77438ae6b10"
] | [
"python/ooi_data_explorations/qartod/endurance/qartod_ce_phsen.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n@author Christopher Wingard\n@brief Load the PHSEN data from the uncabled, Coastal Endurance Surface\n Moorings and processes the data to generate QARTOD Gross Range and\n Climatology test limits\n\"\"\"\nimport dateutil.parser as parser\nimport os\nimp... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
arra1997/zipline | [
"38d47f1b470f47ff7e8c35d9874d68785d6d2927"
] | [
"zipline/data/bcolz_daily_bars.py"
] | [
"# Copyright 2015 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ag... | [
[
"numpy.full",
"numpy.array",
"numpy.nan_to_num",
"pandas.DatetimeIndex",
"pandas.Timestamp",
"numpy.iinfo"
]
] |
codyly/locomotion-by-mann | [
"89139466829ef7802bf645f865e335d4cda444e4"
] | [
"runners/a1/a1-wiki.py"
] | [
"\"\"\"\nmotion_wiki = {\n \"walk\": ForwardProfile(\"walk\", 0.5, startup=True),\n \"trot\": ForwardProfile(\"trot\", 1.28, startup=True),\n \"jump\": Profile(\"dynamic_jumping\", stages=[0.1, 0.05], ops=[JMP, FWD], startup=True),\n \"turn\": TurningProfile(\"turn\", 0.01, startup=True),\n \"sit\": ... | [
[
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
yangzhou95/opioid_on_reddit | [
"626676773b2cd826e28f6e19c5900a9439534f0c"
] | [
"code/text_classifier/src/core/text_to_number.py"
] | [
"from core.preprocessor import processor\nimport dill as dpickle\nimport numpy as np\n\n\nclass TextToNumber:\n\n @staticmethod\n def create_number_vector(raw_text_array, append_indicators=True, max_uniqie_words_size=8000, padding_maxlen=70, padding_position='post', output_file='nummerical_text'):\n bo... | [
[
"numpy.load",
"numpy.save"
]
] |
luyaojie/Text2Event | [
"bfa818c58f1856a2bce194e58b53995a22be0f72"
] | [
"seq2seq/constrained_seq2seq.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\nimport logging\nimport os\n\nimport torch\nimport torch.nn as nn\nfrom dataclasses import dataclass, field\nfrom typing import Union, List, Callable, Dict, Tuple, Any, Optional\nimport numpy as np\nfrom torch.cuda.amp import autocast\n\nfrom transformers import (\n ... | [
[
"numpy.where",
"numpy.count_nonzero",
"torch.cuda.amp.autocast",
"torch.no_grad"
]
] |
qianyingw/rob | [
"4881c26a095e51036989ffd1bc76a97adf44e7c6"
] | [
"bin/pomegranate_20190615/models_prev/model2_0a.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 12 15:15:01 2019\nref: github/GokuMohandas/practicalAI: notebooks/12_Embeddings.ipynb\n@author: qwang\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass PapersModel(nn.Module):\n def __init__(self, embedding_dim, num_embed... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.nn.Conv1d",
"torch.from_numpy",
"torch.nn.functional.softmax",
"torch.nn.functional.relu",
"torch.nn.Embedding"
]
] |
iratao/deep-learning | [
"4099c096623318669286cb555c2ffa7d8f3a8354"
] | [
"practice/intro-tensorflow/linearfunc.py"
] | [
"# Solution is available in the other \"sandbox_solution.py\" tab\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\nfrom quiz import get_weights, get_biases, linear\n\n\ndef mnist_features_labels(n_labels):\n \"\"\"\n Gets the first <n> labels from the MNIST dataset\n :p... | [
[
"tensorflow.Session",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.log",
"tensorflow.placeholder",
"tensorflow.nn.softmax",
"tensorflow.global_variables_initializer",
"tensorflow.reduce_mean"
]
] |
VolkerH/imarispy | [
"d00415ffc8e341bf2e034e29c1feb32d915f2f18"
] | [
"imarispy/util.py"
] | [
"import numpy as np\n\n\ndef make_thumbnail(array, size=256):\n \"\"\" array should be 4D array \"\"\"\n # TODO: don't just crop to the upper left corner\n mip = np.squeeze(array).max(1)[:3, :size, :size].astype(np.float)\n for i in range(mip.shape[0]):\n mip[i] -= np.min(mip[i])\n mip[i] ... | [
[
"numpy.max",
"numpy.pad",
"numpy.squeeze",
"numpy.min"
]
] |
amirdel/dispersion-continua | [
"2e1f7a3fbfcdc0b27c546cb0ae51a628a926ad60"
] | [
"tests/test_dispersionSystemContinua.py"
] | [
"# Copyright 2017 Amir Hossein Delgoshaie, amirdel@stanford.edu\n#\n# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee\n# is hereby granted, provided that the above copyright notice and this permission notice appear in all\n# copies.\n#\n# THE SOFTWARE IS PROVIDED... | [
[
"numpy.zeros"
]
] |
solohan22/deep-q-learning | [
"f267f6b716ce16994346415d91e0eec06ab0dbe2"
] | [
"ddqn.py"
] | [
"# -*- coding: utf-8 -*-\nimport random\nimport gym\nimport gym_pomdp\nimport numpy as np\nfrom collections import deque\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.optimizers import Adam\nfrom keras import backend as K\n\nimport tensorflow as tf\n\nEPISODES = 5000\n\nclass DQNA... | [
[
"numpy.random.rand",
"numpy.reshape",
"tensorflow.where",
"numpy.amax",
"numpy.argmax"
]
] |
samuilstoychev/research_project | [
"897bde82471ef92ded396aa31d91ec19826d4ce2"
] | [
"cnn_root_classifier.py"
] | [
"import torch\nfrom torch.nn import functional as F\nimport torch.nn as nn\nfrom linear_nets import MLP,fc_layer\nfrom exemplars import ExemplarHandler\nfrom continual_learner import ContinualLearner\nfrom replayer import Replayer\nimport utils\n\n\nclass CNNRootClassifier(ContinualLearner, Replayer, ExemplarHandle... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.flatten",
"torch.nn.Conv2d",
"torch.nn.functional.cross_entropy",
"torch.nn.functional.relu",
"torch.nn.functional.max_pool2d"
]
] |
ajaykrishna1878/Robotics-Automation-QSTP-2021 | [
"f5b8626db20a60f9dd923bab5a0bec118d0abc67"
] | [
"Week1/Task1.py"
] | [
"import numpy as np\nimport math\nimport matplotlib.pyplot as plt\n\nclass Unicycle:\n def __init__(self, x: float, y: float, theta: float, dt: float):\n self.x = x\n self.y = y\n self.theta = theta\n self.dt = dt\n\n self.x_points = [self.x]\n self.y_points = [self.y]\n... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
LibertFan/TAGS | [
"3c059a1ed6768ef76c1f0f0a587b02eed18bb58f"
] | [
"inf_nsgd.py"
] | [
"\"\"\"\nCopyright (c) Microsoft Corporation.\nLicensed under the MIT license.\n\nrun inference for Image Text Retrieval\n\"\"\"\nimport argparse\nimport json\nimport os\nfrom os.path import exists\nimport pickle\nfrom time import time\n\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom apex import amp... | [
[
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
pminervini/clarify-biore | [
"d2cfa40ccb89d0f685bdbe02446ccbe90d8c1bbc"
] | [
"utils/train_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport json\nimport os\nimport pickle\nimport random\n\nimport numpy as np\nimport torch\n\nfrom sklearn import metrics\nfrom sklearn.metrics import precision_recall_fscore_support, accuracy_score\nfrom torch.utils.data import DataLoader, SequentialSampler, TensorDataset\nfrom tqdm impor... | [
[
"numpy.array",
"torch.cuda.manual_seed",
"torch.cat",
"numpy.asarray",
"torch.nn.Softmax",
"numpy.random.seed",
"torch.IntTensor",
"torch.utils.data.SequentialSampler",
"torch.manual_seed",
"torch.inference_mode",
"torch.tensor",
"torch.utils.data.DataLoader",
"... |
ETHmodlab/BIMODAL | [
"31c3265498ea8021acca558e7de22c8fdaf6578f"
] | [
"model/trainer.py"
] | [
"\"\"\"\nImplementation of different training methods\n\"\"\"\n\nimport numpy as np\nfrom sklearn.model_selection import KFold, train_test_split, ShuffleSplit\nimport pandas as pd\nimport configparser\nfrom fb_rnn import FBRNN\nfrom forward_rnn import ForwardRNN\nfrom nade import NADE\nfrom bimodal import BIMODAL\n... | [
[
"numpy.repeat",
"numpy.array",
"sklearn.model_selection.train_test_split",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.random.shuffle",
"numpy.argmax",
"sklearn.model_selection.KFold"
]
] |
halsayed/kps_mask_detector | [
"b1fa3c6c54ceb2e919fd21a8e53f996000f46680"
] | [
"functions/local_test_detect_faces.py"
] | [
"import cv2\nimport numpy as np\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import img_to_array\nfrom tensorflow.keras.models import load_model\n\nprototext_file = 'models/face_detector.prototxt'\nweights_file = 'models/face_detector.caffemodel... | [
[
"tensorflow.keras.models.load_model",
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input"
]
] |
archer1211/LSSTM | [
"27fca510faeaf0ae4bdb19c8fee8b792eca0262a"
] | [
"LS_STM.py"
] | [
"import numpy as np\nfrom hottbox.core import Tensor\nimport copy\nimport time\nfrom scipy.spatial.distance import pdist, cdist, squareform\nfrom aiding_functions import contractor\n\nclass LSSTM:\n def __init__(self, C=10, kernel='linear', sig2=1, max_iter=100):\n\n self.order = None\n self.shape ... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.delete",
"scipy.spatial.distance.pdist",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.random.randn",
"numpy.linalg.pinv",
"numpy.eye",
"numpy.abs",
"numpy.append",
"scipy.spatial.distance.cdist",
"numpy.linalg.i... |
hannahaih/panda-gym | [
"cbbe9deb85f53d6f4f805917781857cdce0af957",
"cbbe9deb85f53d6f4f805917781857cdce0af957"
] | [
"panda_gym/envs/panda_tasks/panda_push.py",
"panda_gym/utils.py"
] | [
"import numpy as np\n\nfrom panda_gym.envs.core import RobotTaskEnv\nfrom panda_gym.envs.robots.panda import Panda\nfrom panda_gym.envs.tasks.push import Push\nfrom panda_gym.pybullet import PyBullet\n\n\nclass PandaPushEnv(RobotTaskEnv):\n \"\"\"Push task wih Panda robot.\n\n Args:\n render (bool, opt... | [
[
"numpy.array"
],
[
"numpy.inner",
"numpy.linalg.norm"
]
] |
buaayhq/cs131mysolution | [
"2cceaeb4133a54a2ba6e30d67e48b7d7083adaa7"
] | [
"hw1_release/filters.py"
] | [
"\"\"\"\nCS131 - Computer Vision: Foundations and Applications\nAssignment 1\nAuthor: Donsuk Lee (donlee90@stanford.edu)\nDate created: 07/2017\nLast modified: 10/16/2017\nPython Version: 3.5+\n\"\"\"\n\nimport numpy as np\n\n\ndef conv_nested(image, kernel):\n \"\"\"A naive implementation of convolution filter.... | [
[
"numpy.zeros",
"numpy.sum",
"numpy.mean",
"numpy.std",
"numpy.flip"
]
] |
cuemacro/cufflinks | [
"1f361221698abd59a36b576ae3e6892ec2708c40"
] | [
"cufflinks/colors.py"
] | [
"##\n# Special thanks to @krey for the python3 support\n##\n\nimport numpy as np\nimport colorsys\nimport colorlover as cl\nimport operator\nimport copy\n\nfrom collections import deque\nfrom six import string_types\nfrom IPython.display import HTML, display\n\nfrom . import themes\nfrom .utils import inverseDict\n... | [
[
"numpy.arange"
]
] |
zeynepakkalyoncu/BERT-Fine_tune | [
"79b17151e607a03c70bbd7a5015759c1a5263b0e"
] | [
"src1/main.py"
] | [
"import random\nimport numpy as np\nimport argparse\n\nimport torch\n\nfrom util import *\nfrom eval import *\nfrom data import DataGenerator\n\nRANDOM_SEED = 12345\nrandom.seed(RANDOM_SEED)\nnp.random.seed(RANDOM_SEED)\ntorch.manual_seed(RANDOM_SEED)\nif torch.cuda.is_available():\n torch.cuda.manual_seed_all(R... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.argmax"
]
] |
fulequn/DLAction | [
"da2ff080f7a65f89010a5829b86fc1b45beb9dc8"
] | [
"classifiers/chapter5/bn_layers.py"
] | [
"#-*- coding: utf-8 -*-\nimport sys, os\nsys.path.append(os.path.realpath(os.path.dirname(os.path.realpath(__file__))))\n\nimport numpy as np\nfrom layers import *\nfrom dropout_layers import *\n\ndef batchnorm_forward(x, gamma, beta, bn_param):\n \"\"\"\n 使用类似动量衰减的运行时平均,计算总体均值与方差 例如:\n running_mean = mome... | [
[
"numpy.sum",
"numpy.ones",
"numpy.sqrt",
"numpy.zeros"
]
] |
liujuanLT/TensorRT | [
"611dba63880da20a21771a0e9941a1fa0039887d"
] | [
"tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/graph.py"
] | [
"#\n# Copyright (c) 2021, 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 ... | [
[
"numpy.array"
]
] |
david8862/keras-YOLOv3-model-se | [
"8822619f8f241b4b8ee34b881e3fd5c5233cb558"
] | [
"eval.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCalculate mAP for YOLO model on some annotation dataset\n\"\"\"\nimport os, argparse, time\nimport numpy as np\nimport operator\nfrom operator import mul\nfrom functools import reduce\nfrom PIL import Image\nfrom collections import OrderedDict\nimport matplo... | [
[
"numpy.array",
"tensorflow.compat.v1.__version__.startswith",
"numpy.zeros",
"tensorflow.compat.v1.Graph",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.compat.v1.GraphDef",
"tensorflow.compat.v1.Session",
"tensorflow.lite.python.interpreter.Interpreter",
"tensorf... |
mtsnel006/covid19za | [
"5db79ecb616041ff7980230d5995d90d6dbc86f5"
] | [
"scripts/realtime_r0.py"
] | [
"# Python script version of the Realtime R0 notebook\n# Used for automated processing\n\n# Originally by Kevin Systrom - April 17\n# Adapted for South Africa - Vukosi Marivate & Schalk van Heerden 29 April\n\nimport pandas as pd\nimport numpy as np\n\nfrom scipy import stats as sps\nfrom scipy.interpolate import in... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.ones_like",
"scipy.stats.norm",
"numpy.log",
"pandas.DataFrame",
"numpy.sum",
"scipy.stats.poisson.pmf",
"numpy.exp",
"pandas.MultiIndex.from_product",
"pandas.concat",
"numpy.cumsum",
"numpy.searchsorted",
"numpy.li... |
scutyuanzhi/gin-config | [
"263624840fd9f9494e20926ad9e8b1a1d15a6853"
] | [
"tests/torch/external_configurables_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Gin-Config Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ... | [
[
"torch.rand"
]
] |
renjithbaby23/tf2.0_examples | [
"79f8f0b018536e5f011fc7e413039e933f786b2e"
] | [
"13_guide_to_activations_and_initializations.py"
] | [
"\"\"\"\n* This script just lists GENERALLY BEST activation functions and\nthe best kernel initializers associated with them.\n\nGlorot and Bengio propose a way to significantly alleviate the problem with vanishing gradients.\nWe need the signal to flow properly in both directions: in the forward direction when mak... | [
[
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.initializers.VarianceScaling",
"tensorflow.keras.layers.Dense"
]
] |
joshuous/lisa | [
"4f6e3bf0ed051aaaf36eb7fa8eb4e5ba20fa1bb7"
] | [
"libs/utils/energy_model.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n#\n# Copyright (C) 2016, ARM Limited and contributors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# 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/L... | [
[
"pandas.concat",
"pandas.Series"
]
] |
sunjaeyoon/LearningPytorch | [
"aaee0418929e7ec1d8e8b21afa582cbb42e39de2"
] | [
"GettingStarted/linear_regressionPT.py"
] | [
"# -*- coding: utf-8 -*- Using Torch\n\nimport torch\nimport math\n\n\ndtype = torch.float\ndevice = torch.device(\"cpu\")\n# device = torch.device(\"cuda:0\") # Uncomment this to run on GPU\n\n# Create random input and output data\nx = torch.linspace(-math.pi, math.pi, 2000, device=device, dtype=dtype)\ny = torch.... | [
[
"torch.device",
"torch.randn",
"torch.linspace",
"torch.sin"
]
] |
lmriccardo/SBML2Modelica | [
"b16705e26346de1780cea9b8bc08b17ee2cb1073"
] | [
"tests/biomodels/biomd190/BIOMD190_MPGOS/plot.py"
] | [
"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sys\n\nfilename=sys.argv[-1]\nvalues = []\nwith open(filename, mode=\"r\", encoding=\"utf-8\") as f:\n start = False\n while (line := f.readline()):\n if start:\n new_line = line.strip().replace('\\n', '')\n values.app... | [
[
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
ArneKramerSunderbrink/adaptivetuning | [
"80dce0c8d031918a9d45dc84fdd6cd64f6df7a8a"
] | [
"tests/test_dissonancereduction.py"
] | [
"from adaptivetuning import Dissonancereduction\nimport numpy as np\n\ndef approx_equal(a, b, epsilon = 0.01):\n if isinstance(a, list):\n return all([approx_equal(a[i], b[i], epsilon) for i in range(len(a))])\n return abs((a - b) / (0.5 * (a + b))) < epsilon\n\ndef test_reduction():\n ji_intervals ... | [
[
"numpy.array"
]
] |
astrophysicist87/PHripser | [
"7a124f6fe66fb802f63a2f6f548f134fc265133f"
] | [
"pers_hom.py"
] | [
"import numpy as np\nimport os\nimport scipy.stats as st\nimport matplotlib.pyplot as plt\nimport scipy.spatial.distance as ssd \nimport itertools as it\n\nclass ph:\n def __init__(self,my_data,my_hom_dim,my_thresh,my_dist_type=None,my_dist_mat = None,my_dist_max=None):\n self.data= my_data\n self.... | [
[
"numpy.arccos",
"numpy.where",
"numpy.cos",
"numpy.max",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.log",
"numpy.arange",
"numpy.sqrt",
"numpy.vstack",
"numpy.array",
"numpy.savetxt",
"matplotlib.pyplot.title",
"numpy.loadtxt",
"matplotlib.pyplot.sh... |
itremel/twitchchess | [
"dcf7fc0b26dd863f8fd4cde729fcf47e866d6a6b"
] | [
"MCTSNode.py"
] | [
"import numpy as np\r\nimport chess\r\nfrom collections import defaultdict\r\nfrom state import State\r\nimport copy\r\n\r\n\r\nclass MCTSNode(object):\r\n\r\n def __init__(self, state, parent=None, previous_move=None):\r\n self.state = state\r\n self.parent = parent\r\n self.children = []\r\n self._nu... | [
[
"numpy.argmax"
]
] |
amsclark/docassemble | [
"ae5c194831faabb52681a6c827ec30c106273eb7"
] | [
"docassemble_webapp/docassemble/webapp/machinelearning.py"
] | [
"from six import string_types, text_type, PY2\nfrom docassemble.webapp.core.models import MachineLearning\nfrom docassemble.base.core import DAObject, DAList, DADict\nfrom docassemble.webapp.db_object import db\nfrom sqlalchemy import or_, and_\nfrom sklearn.datasets import load_iris\nfrom sklearn.ensemble import R... | [
[
"sklearn.ensemble.RandomForestClassifier",
"pandas.DataFrame",
"pandas.api.types.CategoricalDtype",
"pandas.Series",
"pandas.get_dummies"
]
] |
ArloZ/Tacotron-2 | [
"08bf8e2d60925b1cd47ca69e2bb1a9447fd13b62"
] | [
"tacotron/models/modules.py"
] | [
"import tensorflow as tf \n\n\ndef conv1d(inputs, kernel_size, channels, activation, is_training, drop_rate, scope):\n\twith tf.variable_scope(scope):\n\t\tconv1d_output = tf.layers.conv1d(\n\t\t\tinputs,\n\t\t\tfilters=channels,\n\t\t\tkernel_size=kernel_size,\n\t\t\tactivation=None,\n\t\t\tpadding='same')\n\t\tba... | [
[
"tensorflow.contrib.rnn.MultiRNNCell",
"tensorflow.losses.mean_squared_error",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.layers.batch_normalization",
"tensorflow.layers.conv1d",
"tensorflow.variable_scope",
"tensorflow.nn.rn... |
steveli/mogp | [
"d142e7b9e5b7dbc67cfae4760c837cafd9691a51"
] | [
"pyPQN/polyinterp.py"
] | [
"from __future__ import division\nimport numpy as np\nfrom scipy.linalg import solve\n\n\ndef polyinterp(points):\n \"\"\"Minimum of interpolating polynomial based on function and derivative\n values\n\n In can also be used for extrapolation if {xmin,xmax} are outside\n the domain of the points.\n\n ... | [
[
"numpy.isinf",
"numpy.array",
"numpy.zeros",
"numpy.roots",
"numpy.real",
"numpy.polyval",
"numpy.isreal",
"numpy.vstack",
"numpy.sqrt",
"numpy.append",
"scipy.linalg.solve"
]
] |
Columbine21/TFR-Net | [
"1da01577542e7f477fdf7323ec0696aebc632357"
] | [
"models/baselines/MISA.py"
] | [
"\"\"\"\nFrom: https://github.com/declare-lab/MISA\nPaper: MISA: Modality-Invariant and -Specific Representations for Multimodal Sentiment Analysis\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Function\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom mo... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LayerNorm",
"torch.stack",
"torch.nn.Dropout",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.ReLU",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Trans... |
saraahsimon/landlab | [
"1cf809b685efbccaaa149b5899a600c3ccedf30f"
] | [
"landlab/graph/ugrid.py"
] | [
"import numpy as np\nimport xarray as xr\n\nfrom ..utils.jaggedarray import flatten_jagged_array\n\nMESH_ATTRS = {\n \"cf_role\": \"mesh_topology\",\n \"long_name\": \"Topology data of 2D unstructured mesh\",\n \"topology_dimension\": 2,\n \"node_coordinates\": \"x_of_node y_of_node\",\n \"face_node_... | [
[
"numpy.arange",
"numpy.asarray"
]
] |
Asurada2015/TFAPI_translation | [
"1c8d9432b0b8a21c2bb5670b25456d095d0a1ecf"
] | [
"array_ops/tf_rank.py"
] | [
"\"\"\"tf.rank(input, name = None)\n解释:这个函数是返回Tensor的秩。\n注意:Tensor的秩和矩阵的秩是不一样的,Tensor的秩指的是元素维度索引的数目,\n这个概念也被成为order, degree或者ndims。比如,一个Tensor的维度是[1, 28, 28, 1],那么它的秩就是4。\"\"\"\n\nimport tensorflow as tf\n\nsess = tf.Session()\ndata = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])\nprint(sess.run(dat... | [
[
"tensorflow.rank",
"tensorflow.constant",
"tensorflow.Session",
"tensorflow.shape"
]
] |
debbiemarkslab/variational-synthesis | [
"75c1edbe0aeb369d6985a68f5e4c6c63825cec2b"
] | [
"VariationalSynthesis/model.py"
] | [
"import argparse\nimport configparser\nfrom datetime import datetime\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport pickle\n\nimport torch\nfrom torch.distributions import OneHotCategorical\nfrom torch import optim\nfrom torch.utils.data import DataLoader\n\nfrom pyro.contrib.m... | [
[
"torch.cat",
"torch.einsum",
"torch.Generator",
"torch.randperm",
"torch.ones",
"torch.eye",
"torch.set_default_dtype",
"torch.exp",
"torch.sum",
"torch.matrix_power",
"numpy.save",
"torch.manual_seed",
"torch.distributions.OneHotCategorical",
"torch.tensor"... |
szmark001/orbit | [
"ad13b094d59c16e15159d658f8b8ce9383f52b13"
] | [
"orbit/utils/simulation.py"
] | [
"import pandas as pd\nimport numpy as np\nimport statsmodels.api as sm\nimport math\nfrom orbit.exceptions import IllegalArgument\n\n\ndef make_trend(series_len, rw_loc=0.001, rw_scale=0.1, type='rw', seed=1):\n \"\"\" Module to generate time-series trend with different methods\n\n Parameters\n ----------\... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.sin",
"numpy.random.choice",
"numpy.matmul",
"numpy.zeros",
"pandas.DataFrame",
"pandas.date_range",
"numpy.sum",
"numpy.random.default_rng",
"numpy.exp",
"numpy.expm1",
"numpy.arange",
"numpy.cos",
"numpy.cumsu... |
taylorfturner/data-profiler | [
"da416d1ccaed4b04d2e5b93da41a508de58b642e"
] | [
"data_profiler/tests/profilers/test_datetime_column_profile.py"
] | [
"from __future__ import print_function\n\nimport unittest\nfrom unittest import mock\nimport datetime\nimport six\nimport warnings\nfrom collections import defaultdict\n\nimport pandas as pd\nimport numpy as np\n\nfrom . import utils\nfrom .. import test_utils\n\nfrom data_profiler.profilers import DateTimeColumn\n... | [
[
"pandas.concat",
"pandas.Timestamp",
"numpy.array",
"pandas.Series"
]
] |
vishwakarmarhl/SlowFast | [
"91cf75d4404c68c108057bbfd525edf9671799e7"
] | [
"slowfast/utils/metrics.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Functions for computing metrics.\"\"\"\n\nimport torch\nimport numpy as np\n\n\ndef topks_correct(preds, labels, ks):\n \"\"\"\n Given the predictions, labels, and a list of top-k values, compute the\n ... | [
[
"numpy.max",
"torch.cuda.is_available",
"torch.zeros"
]
] |
lsx137946009/pawo | [
"69cef1797fe1971d87c59cb8c5c167089fa66ecd"
] | [
"parseData/microband.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 11 16:46:06 2019\n\n@author: lsx\n\"\"\"\n\nimport time\nimport pandas as pd\n\n#filepath = './data/micro'\n##savepath = './result'\n#filelist = os.listdir(filepath)\n#\n#\n#HR = [] # Heart Rate No.1\n#ST = [] # Skin Temperature NO.2\n#GS = [] # Galvanic skin rea... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
abhishek9594/nl_to_pl | [
"09c6ad979e3b8d7b4432a4f701875d959adaa972"
] | [
"node.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nnode.py: Map all the node types of the PL grammar to node_id\n\nUsage:\n node.py --lang=<str> NODE_FILE [options]\n\nOptions:\n -h --help Show this screen.\n --lang=<str> target language\n\"\"\"\n\nfrom docopt import docopt\nimport pickle\nim... | [
[
"torch.tensor"
]
] |
fusecloud/fusetools | [
"4352d0beebd4d676b8578a1f96977553d3ebf28c"
] | [
"fusetools/social_tools.py"
] | [
"import pandas as pd\nimport tweepy\nimport os\n\n\nclass Twitter:\n\n @classmethod\n def pull_user_likes(cls, screen_name, twtr_api_key, twtr_api_secret, **kwargs):\n # TWITTER AUTH\n print(\"Authenticating to Twitter\")\n\n screen_name = screen_name\n auth = tweepy.AppAuthHandler... | [
[
"pandas.to_datetime"
]
] |
vivekparasharr/Challenges-and-Competitions | [
"c99d67838a0bb14762d5f4be4993dbcce6fe0c5a",
"c99d67838a0bb14762d5f4be4993dbcce6fe0c5a"
] | [
"30DayChartChallenge/20210430-uncertainties-3d.py",
"30DayChartChallenge/20210404-comparisons-magical.py"
] | [
"\n# https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html\n#!/usr/bin/env python3\nfrom re import X\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nfrom matplotlib.ticker import LinearLocator, FormatStrFormatter\nimport matplotlib.pyplot as plt\nimport numpy... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.meshgrid"
],
[
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.ax... |
BakerAugust/natelib | [
"7e79c705b0593fdd9348c05f4d8a835abe4f6b30"
] | [
"src/tests/test_neurons.py"
] | [
"from torch.nn.functional import mse_loss\nfrom deep_learning.neurons import LogisticRegression, Perceptron, Adaline, AdalineNN\nfrom sklearn.datasets import make_blobs, load_breast_cancer\nfrom sklearn.metrics import roc_auc_score\nimport torch\n\n\ndef test_perceptron():\n # Generate some linearly seperable da... | [
[
"sklearn.datasets.make_blobs",
"sklearn.datasets.load_breast_cancer",
"torch.no_grad",
"torch.std",
"torch.nn.functional.mse_loss",
"torch.tensor",
"torch.mean"
]
] |
svmillin/covid-19-canada-gov-data | [
"7b04fe719c394355104262fd113ff525edd73ad6"
] | [
"archiver.py"
] | [
"# archiver.py: Automated, daily backups of COVID-19 data from Canadian government sources #\n# https://github.com/jeanpaulrsoucy/covid-19-canada-gov-data #\n# Maintainer: Jean-Paul R. Soucy #\n\n# import modules\n\n## core utilities\nimport sys\nimport time\nimport os\nfrom shutil import copyfile\nfrom datetime im... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
panvaf/retina_std | [
"d2f86de9419f06fbf908e344f0f97cc6d0f7271b"
] | [
"classes.py"
] | [
"\"\"\"\nIncludes classes for all basic elements of the networks.\n\"\"\"\n\n# imports\nimport numpy as np\nfrom scipy import signal\nimport copy as cp\n\n# Global variables\nimage_size = np.array([250, 250]) # in um\npixel = 5 # in um\nimg_size = (image_size/pixel).astype(int) # number\nte... | [
[
"numpy.sin",
"numpy.array",
"numpy.array_equal",
"numpy.linalg.norm",
"numpy.isnan",
"scipy.signal.fftconvolve",
"numpy.zeros",
"numpy.sum",
"numpy.dot",
"numpy.exp",
"numpy.arange",
"numpy.isscalar",
"numpy.math.factorial",
"numpy.size",
"numpy.meshgrid... |
dfki-asr/morphablegraphs | [
"02c77aab72aa4b58f4067c720f5d124f0be3ea80"
] | [
"examples/run_construction.py"
] | [
"import os\nimport json\nimport numpy as np\nimport scipy.interpolate as si\nimport collections\nimport argparse\nimport glob\nfrom anim_utils.animation_data.bvh import BVHReader\nfrom anim_utils.animation_data import SkeletonBuilder, MotionVector\nfrom anim_utils.animation_data.skeleton_models import SKELETON_MODE... | [
[
"numpy.array",
"numpy.dot",
"numpy.asarray",
"scipy.interpolate.splrep",
"numpy.load"
]
] |
sangeetsu/LenslessLearning | [
"751efc614eff5616a229972620192478af2c39c1"
] | [
"models/admm_model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom admm_helper_functions_torch import *\nfrom admm_rgb_pytorch import *\nimport admm_filters_no_soft as admm_s\n\nclass ADMM_Net(nn.Module):\n def __init__(self, batch_size, h, iterations, learning_options = {'learned_vars': []}, \n cuda_device = torch.devi... | [
[
"torch.zeros",
"torch.device",
"torch.stack",
"torch.ones",
"torch.tensor",
"torch.ones_like",
"torch.zeros_like"
]
] |
andrybicio/ByteTrack_ReID | [
"ae43f9d7d3daee796f80f34dde76324f902999bf"
] | [
"exps/example/mot/yolox_s_mix_det.py"
] | [
"# encoding: utf-8\nimport os\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\n\nfrom yolox.exp import Exp as MyExp\nfrom yolox.data import get_yolox_datadir\n\nclass Exp(MyExp):\n def __init__(self):\n super(Exp, self).__init__()\n self.num_classes = 1\n ... | [
[
"torch.distributed.get_world_size",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler"
]
] |
IlyaKodua/AutorncoderSignal | [
"ba5e020c8230fe70858d2c22e7c4e1f3b0c584ce"
] | [
"Model.py"
] | [
"from torch import nn\nimport torch.nn.functional as F\nimport torch\nimport torchvision\nimport numpy as np\n\nclass DNCNN(nn.Module):\n\n def __init__(self, n_channels, n_filters, kernel_size):\n\n super(DNCNN, self).__init__()\n\n\n layers = [\n nn.Conv2d(in_channels=n_channels, out_c... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
tomaszps/pandas | [
"4628665e53c214ae2e2efde54c4d703fb1c198ab"
] | [
"pandas/tests/indexes/multi/test_indexing.py"
] | [
"from datetime import timedelta\n\nimport numpy as np\nimport pytest\n\nfrom pandas.errors import InvalidIndexError\n\nimport pandas as pd\nfrom pandas import Categorical, Index, MultiIndex, date_range\nimport pandas._testing as tm\n\n\nclass TestSliceLocs:\n def test_slice_locs_partial(self, idx):\n sort... | [
[
"numpy.array",
"pandas.Index",
"pandas.date_range",
"pandas.MultiIndex.from_tuples",
"pandas._testing.assert_almost_equal",
"pandas.timedelta_range",
"pandas._testing.makeCustomDataframe",
"pandas.MultiIndex.from_arrays",
"pandas._testing.makeTimeDataFrame",
"pandas._testin... |
LilDataScientist/Kaggle | [
"03ebd6f73b530ef698ee978784374b2fabe6679d"
] | [
"Multiclass Classification/example.py"
] | [
"from sklearn import datasets\nfrom MulticlassClassification import MulticlassClassification\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\n\nX, y = datasets.load_iris(return_X_y=True)\n\nlabel_encoding = LabelEncode... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.LabelEncoder",
"sklearn.datasets.load_iris"
]
] |
slippy0/gpt-2 | [
"26d55a564c1da8c0a1697a9e2fe63dd8923dadd3"
] | [
"train.py"
] | [
"#!/usr/bin/env python3\n# Usage:\n# PYTHONPATH=src ./train --dataset <file|directory|glob>\n\nimport argparse\nimport json\nimport os\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport tqdm\nfrom tensorflow.core.protobuf import rewriter_config_pb2\n\nimport model, sample, encoder\nfrom load_dataset... | [
[
"tensorflow.trainable_variables",
"tensorflow.summary.merge",
"tensorflow.train.AdamOptimizer",
"tensorflow.shape",
"tensorflow.train.latest_checkpoint",
"tensorflow.summary.scalar",
"tensorflow.where",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.mean",
"tens... |
kevjp/openstreetmap-carto | [
"be30cfe8d73f78cb4b5ba9acaaf42a942c70270d"
] | [
"geo_agent/visualiser_geo.py"
] | [
"'''\ncontains all methods for visualisation tasks\n'''\n\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport geopandas as gpd\nimport geoplot.crs as gcrs\nimport geoplot as gplt\nimport numpy as np\nimport pandas as pd\nfrom shapely.geometry import Point, LineString, shape\nimport ruamel.yaml as yam... | [
[
"matplotlib.style.use",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause"
]
] |
noskill/JRMOT_ROS | [
"ca1e87e51ecfeb14f2b652d613f3b02c592afb38"
] | [
"paper_experiments/utils/detection.py"
] | [
"# vim: expandtab:ts=4:sw=4\nimport numpy as np\n\n\nclass Detection(object):\n \"\"\"\n This class represents a bounding box detection in a single image.\n\n Parameters\n ----------\n tlwh : array_like\n Bounding box in format `(x, y, w, h)`.\n confidence : float\n Detector confiden... | [
[
"numpy.asarray",
"numpy.sqrt"
]
] |
tom-bird/binary-gen-models | [
"a9311d27d74e25eb55d1b06295ac8a121b5c1d7b"
] | [
"models/flowpp_cifar.py"
] | [
"import re\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom models.coupling import (\n Parallel, MixLogisticConvAttnCoupling, TupleFlip, Squeeze, StripeSplit, ChannelSplit, GatedConv\n)\nfrom models.flows import BaseFlow, Compose, Inverse, ImgProc, Normalize, Sigmoid, Pointwise\nfrom models.modul... | [
[
"torch.no_grad",
"numpy.load",
"torch.sign",
"torch.from_numpy",
"torch.randn",
"torch.randn_like",
"numpy.prod",
"numpy.log2",
"torch.sum"
]
] |
anandsaha/ai.ml.lib | [
"1866bb0c163a171d7f2478bbee81f83b04d5c20b"
] | [
"src/run.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndataset = pd.read_csv('Mall_Customers.csv')\n\nX = dataset.iloc[:, [3, 4]].values\n\nprint(type(X))\n"
] | [
[
"pandas.read_csv"
]
] |
rebryk/kaggle | [
"0c656f64ce681dd313ca5145f0ff834a1a6d822e"
] | [
"recursion-cellular/challenge/test.py"
] | [
"import argparse\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nfrom scipy.optimize import linear_sum_assignment\n\nimport utils\nfrom challenge.dataset import EXP_TRAIN\nfrom utils.neighbors import k_neighbors_classify, k_neighbors_classify_scores\n\n\ndef parse_args() -> argparse.Namespace:... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"numpy.load",
"numpy.mean",
"scipy.optimize.linear_sum_assignment",
"pandas.read_csv",
"numpy.unique"
]
] |
shan18/EVA4-Phase-2 | [
"12922fbeac63397944e9b464c2d5c60faf24e532"
] | [
"08 - SRGAN and Neural Style Transfer/srgan/model.py"
] | [
"import math\nimport torch\nfrom torch import nn\nimport torchvision\n\n\nclass Generator(nn.Module):\n def __init__(self, scale_factor):\n upsample_block_num = int(math.log(scale_factor, 2))\n\n super(Generator, self).__init__()\n self.block1 = nn.Sequential(\n nn.Conv2d(3, 64, k... | [
[
"torch.nn.Sequential",
"torch.tanh",
"torch.nn.BatchNorm2d",
"torch.nn.PixelShuffle",
"torch.nn.Conv2d",
"torch.nn.PReLU",
"torch.nn.AdaptiveAvgPool2d"
]
] |
Office2012/DameDaneGenerator | [
"ff32a948eee18f18e97fd8991a3e75174097d85e"
] | [
"firstordermodel/modules/util.py"
] | [
"from torch import nn\r\n\r\nimport torch.nn.functional as F\r\nimport torch\r\n\r\nfrom firstordermodel.sync_batchnorm import SynchronizedBatchNorm2d as BatchNorm2d\r\n\r\n\r\ndef kp2gaussian(kp, spatial_size, kp_variance):\r\n \"\"\"\r\n Transform a keypoint into gaussian like representation\r\n \"\"\"\r... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.arange",
"torch.nn.AvgPool2d",
"torch.nn.functional.interpolate",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.nn.functional.pad",
"torch.nn.functional.conv2d",
"torch.exp",
"torch.sum"
]
] |
antuniooh/probability-and-statistics-database-analysis | [
"a23d2e3fc4f51b0a64732d67cfc7ea7661ff8112"
] | [
"src/main.py"
] | [
"#Passo 1 - Definir Database\n\nfrom scipy.stats import shapiro\nimport pandas as pd\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\nimport matplotlib.pyplot as plt\nfrom sklearn import datasets\n\ndf = pd.read_csv('data/concrete_data.csv')\n\n#Passo 2 - Limpar Database\n\n#exibir valores au... | [
[
"numpy.histogram",
"scipy.stats.shapiro",
"numpy.median",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.mean",
"numpy.std",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv",
"numpy.var"
]
] |
carmelrabinov/contrastive-domain-randomization | [
"f6fc6173a072da821d1b2ab6bd9558bf7e609bd4"
] | [
"franka_panda/pybullet_simulation/environment.py"
] | [
"import os\nimport numpy as np\n\nfrom franka_panda.environment import PushPandaEnv\nfrom franka_panda.pybullet_simulation.push_simulation import Sim2RealPushPandaSimulation\n\n\nclass PybulletPushPandaEnv(PushPandaEnv):\n def __init__(self, config_path: str = \"configs/default_push.yml\",\n load... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.random.uniform"
]
] |
crazystone1314/poker-hands-classification | [
"131ad27d7344e480dc54e5b3efc520f3cf39adb6"
] | [
"predict_model.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport numpy as np\r\nimport pandas as pd\r\nimport catboost as cb\r\n\r\n\r\n# 原始数据路径\r\ntraining_path = 'D://train_data.csv'\r\nsource_data_path = 'D://preliminary-testing.csv'\r\n\r\n# --------读取原始数据-------\r\n# training数据\r\ntrain_data = pd.read_csv(training_path, names=['S1', 'C1', ... | [
[
"pandas.merge",
"pandas.DataFrame",
"numpy.arange",
"numpy.abs",
"pandas.read_csv"
]
] |
DeepDarkOdyssey/exalt | [
"82f06b47d735c56d277ac2df37f0459e6fba6fc9"
] | [
"exalt/text_encoder/utils.py"
] | [
"from copy import copy\nfrom typing import List, Tuple, Callable, Set\nimport io\nimport os\nimport numpy as np\nimport spacy\n\n\ndef gram_schmidt_process(A: np.array) -> Tuple[np.ndarray]:\n d, n = A.shape\n Q = np.zeros((d, n))\n R = np.zeros((n, n))\n for i in range(n):\n v_i = A[:, i]\n ... | [
[
"numpy.sum",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
kgb0255/deepCR | [
"bb449d77fb99abc052bf76d01e85dfdce326b779"
] | [
"deepCR/model.py"
] | [
"\"\"\"main module to instantiate deepCR models and use them\n\"\"\"\nfrom os import path, mkdir\nimport math\nimport shutil\nimport secrets\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch import from_numpy\nfrom joblib import Parallel, delayed\nfrom joblib import dump, load\nfrom joblib impo... | [
[
"numpy.array",
"numpy.pad",
"torch.cat",
"numpy.zeros",
"numpy.percentile",
"torch.from_numpy",
"numpy.memmap",
"torch.cuda.is_available",
"torch.load"
]
] |
hj424/heterocl | [
"e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b"
] | [
"tvm/tests/verilog/unittest/test_vpi_mmap.py"
] | [
"import tvm\nimport numpy as np\nfrom tvm.contrib import verilog\n\ndef test_mmap():\n n = 10\n # context for VPI RAM\n ctx = tvm.vpi(0)\n a_np = np.arange(n).astype('int8')\n a = tvm.nd.array(a_np, ctx)\n\n # head ptr of a\n a_ptr = int(a.handle[0].data)\n sess = verilog.session([\n ... | [
[
"numpy.arange"
]
] |
adwasser/modds | [
"9720e6550c0a5c23a9e868794eabcd9acd0ae2fa"
] | [
"modds/measurement.py"
] | [
"\"\"\"\nmeasurement.py\n\nMeasurementModel wraps up a halo.HaloDensityProfile instance with both a set of \nobservables (e.g., {r, DeltaSigma, DeltaSigma_err}) and a prior on the model \nparameters of interest.\n\"\"\"\n\nfrom collections import OrderedDict\n\nimport numpy as np\nfrom scipy import optimize\nfrom c... | [
[
"numpy.log",
"numpy.ones",
"numpy.interp",
"numpy.any",
"numpy.isfinite",
"scipy.optimize.fminbound"
]
] |
jerjohste/exopy_hqc_legacy | [
"c746beea6b175697ae3bfdab94309dc872d3d908"
] | [
"exopy_hqc_legacy/pulses/contexts/awg_context.py"
] | [
"# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright 2015-2018 by ExopyPulses Authors, see AUTHORS for more details.\n#\n# Distributed under the terms of the BSD license.\n#\n# The full license is in the file LICENCE, distributed with this software.\... | [
[
"numpy.logical_not",
"numpy.empty",
"numpy.zeros",
"numpy.rint",
"numpy.ones"
]
] |
khirotaka/enchanter | [
"71faa51f998da5c8d9185a979a4f5849c9b5f9e6"
] | [
"enchanter/engine/saving.py"
] | [
"from typing import Union, Optional, Dict\nfrom collections import OrderedDict\nfrom time import ctime\nfrom pathlib import Path\nfrom copy import deepcopy\n\nimport torch\nimport torch.nn as nn\n\n\n__all__ = [\"RunnerIO\"]\n\n\nclass RunnerIO:\n \"\"\"\n A class responsible for loading and saving parameters... | [
[
"torch.save",
"torch.load"
]
] |
octree-nn/ocnn-pytorch | [
"cdff2f5e589fd8a0b79c4f7b90042a8cefabf2d0"
] | [
"test/test_utils.py"
] | [
"import os\nimport torch\nimport unittest\n\nimport ocnn\n\n\nclass TestScatter(unittest.TestCase):\n\n def test_scatter_add(self):\n devices = ['cpu', 'cuda'] if torch.cuda.is_available() else ['cpu']\n for device in devices:\n src = torch.arange(1, 11, device=device).view(2, 5)\n idx = torch.tens... | [
[
"torch.cuda.is_available",
"torch.tensor",
"torch.equal",
"torch.arange"
]
] |
conansherry/Ultra-Light-Fast-Generic-Face-Detector-1MB | [
"5a6ad4cacb0a8545a5b9c126bd3f344eec56fb8d"
] | [
"tf/det_image.py"
] | [
"import argparse\nimport sys\n\nimport cv2\nimport tensorflow as tf\nimport numpy as np\n\nparser = argparse.ArgumentParser(\n description='convert model')\n\nparser.add_argument('--net_type', default=\"RFB\", type=str,\n help='The network architecture ,optional: RFB (higher precision) or slim... | [
[
"tensorflow.keras.models.load_model",
"numpy.expand_dims"
]
] |
NegatioN/pytorch-tutorial | [
"1ec90fad7260e7871a4912fce552cad90f6c2f4a"
] | [
"tutorials/03-advanced/image_captioning/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision.models as models\nfrom torch.nn.utils.rnn import pack_padded_sequence\nfrom torch.autograd import Variable\n\n\nclass EncoderCNN(nn.Module):\n def __init__(self, embed_size):\n \"\"\"Load the pretrained ResNet-152 and replace top fc layer.\"\"\"\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.Sequential",
"torch.autograd.Variable",
"torch.nn.BatchNorm1d",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Embedding"
]
] |
thcasey3/lsframe | [
"f1d667a305ecd860417b7d1cbbfa1bbfcc40107e"
] | [
"unittests/test_lsframe.py"
] | [
"import unittest\nimport numpy as np\nimport os\nimport pandas as pd\nfrom datetime import date\nfrom lsframe import start, intake, engine, tools\nfrom numpy.testing import assert_array_equal\n\n\nclass startTester(unittest.TestCase):\n def setUp(self):\n self.path = os.path.normpath(\"./data/\")\n ... | [
[
"pandas.DataFrame"
]
] |
Jd8111997/Speech-Enhancer | [
"2f9a5c16c171d447328f3dc80ac7d3a5c53bf7ad"
] | [
"VirtualBatchNorm.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.nn.parameter import Parameter\nfrom torch.nn.modules import Module\n\nclass VirtualBatchNorm1d(Module):\n\n\t\"\"\"\n\n\tModule for Virtual Batch Normalizaton\n\n\tImplementation borrowed and modified from Rafael_Valle's code + he... | [
[
"torch.zeros",
"torch.sqrt",
"torch.normal"
]
] |
JibranKalia/tfx | [
"05ce31aa71ed38f7978f6cb7c7571202f8283e93"
] | [
"tfx/examples/chicago_taxi/chicago_taxi_client.py"
] | [
"# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"tensorflow.app.run"
]
] |
moosichu/introduction-to-neural-networks | [
"8cf481d97d4feb98e9df532e174cc9376434c82a"
] | [
"presentation_scripts/single_neuron_sample_data_generator.py"
] | [
"import random\nimport matplotlib.pyplot as plt\nimport numpy\n\n\ndef dcdw_dcdb(xs, ys, w, b):\n total_w = 0\n total_b = 0\n for x, y in zip(xs, ys):\n total_w += 2 * x * ((b + (w * x)) - y)\n total_b += 2 * ((b + (w * x)) - y)\n return total_w, total_b\n\n# TODO: look into https://stacko... | [
[
"numpy.random.normal",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"numpy.polyfit"
]
] |
zdx3578/gym-zdx | [
"b72e638095e23b256fe72fc38ef45d2ca1652b6c"
] | [
"gym/spaces/box.py"
] | [
"import numpy as np\n\nimport gym\nfrom gym.spaces import prng\n\nclass Box(gym.Space):\n \"\"\"\n A box in R^n.\n I.e., each coordinate is bounded.\n \"\"\"\n def __init__(self, low, high, shape=None):\n \"\"\"\n Two kinds of valid input:\n Box(-1.0, 1.0, (3,4)) # low and hi... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.allclose",
"numpy.isscalar"
]
] |
danforthcenter/plantcv-dev-scripts | [
"57ebc9a031b7141b8965c927c3b7b01ba6504dc1"
] | [
"dev/analyze_vis_results.py"
] | [
"#!/usr/bin/env python\n\nimport sys, traceback\nimport os\nimport re\nimport sqlite3 as sq\nimport distutils.core\nimport cv2\nimport numpy as np\nimport argparse\nimport string\nimport plantcv as pcv\nfrom datetime import datetime\nimport Image\nimport matplotlib\nif not os.getenv('DISPLAY'):\n matplotlib.use('A... | [
[
"matplotlib.use",
"matplotlib.pyplot.subplot",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.savefig",
"numpy.shape",
"numpy.transpose",
"numpy.dstack",
"matplotlib.pyplot.clf",
"numpy.column_stack",
"numpy.dsplit",
"numpy.unique",
"matplotlib.pyplot.imshow"
... |
boti996/onlab-public | [
"3ee399b9f40979a54236cd646cc7566a3639a03f"
] | [
"codes/train_roma_segmentation.py"
] | [
"import os\nimport pickle\n\nimport numpy as np\nfrom keras.losses import categorical_crossentropy\nfrom keras.optimizers import Adam\nfrom sklearn.model_selection import train_test_split\n\nimport codes.my_helper as helper\nimport codes.my_models as my_models\nimport codes.my_losses as my_losses\n\n\ndef main():\n... | [
[
"sklearn.model_selection.train_test_split",
"numpy.array"
]
] |
YSL-1997/DBx1000 | [
"1e2ecfd21316a09967a5420e31bd9d2a5f98fe2b"
] | [
"plot4_7.py"
] | [
"import itertools\nimport operator\n\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\n\n\ndef parse(field, t=float):\n _, field = field[:-1].split(\"=\")\n return t(field)\n\n\ndef read_result(results_dir):\n for result_path in sorted(results_dir.iterdir()):\n job_name = result_path.nam... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot"
]
] |
PolKul/CASA-Dialogue-Act-Classifier | [
"32214d64d556505424b1efe54905371e7f417dcb"
] | [
"models/UtteranceRNN.py"
] | [
"\nimport torch\nimport torch.nn as nn\nfrom transformers import AutoConfig, AutoModel, AutoTokenizer\n\n\nclass UtteranceRNN(nn.Module):\n \n def __init__(self, model_name=\"roberta-base\", hidden_size=768, bidirectional=True, num_layers=1, device=torch.device(\"cpu\")):\n super(UtteranceRNN, self)._... | [
[
"torch.nn.RNN",
"torch.device"
]
] |
ravescovi/ffn | [
"82329f728757f732c381fed9d769fd70ad79db2f"
] | [
"ffn/inference/inference.py"
] | [
"# Copyright 2017 Google 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed... | [
[
"numpy.lib.stride_tricks.as_strided",
"numpy.minimum",
"numpy.load",
"numpy.mean",
"scipy.special.logit",
"numpy.concatenate",
"numpy.max",
"numpy.sin",
"tensorflow.train.Saver",
"numpy.seterr",
"tensorflow.ConfigProto",
"tensorflow.gfile.MakeDirs",
"numpy.savez... |
Gorilla-Lab-SCUT/SSTNet | [
"c50ae25faceb223457e6e906663d3400bfcba559"
] | [
"sstnet/data/scannetv2.py"
] | [
"# Copyright (c) Gorilla-Lab. All rights reserved.\nimport os\nimport time\nimport math\nimport glob\nimport multiprocessing as mp\nfrom typing import Dict, List, Sequence, Tuple, Union\n\nimport gorilla\nimport open3d as o3d\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\n\nimport segmenta... | [
[
"numpy.array",
"torch.cat",
"torch.stack",
"numpy.matmul",
"numpy.zeros",
"numpy.random.rand",
"numpy.ones",
"numpy.random.randn",
"numpy.eye",
"torch.from_numpy",
"numpy.where",
"torch.tensor",
"numpy.random.randint",
"torch.load",
"numpy.clip",
"to... |
sgtc-stanford/scCRISPR | [
"46edd390b80576aeb4555a9c727544588149b59f"
] | [
"select_best_barcode.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n\n:Author: Ji Research Group/Stanford Genome Technology Center\n:Contact: sgrimes@stanford.edu\n:Creation date: 04/19/2021\n:Description: \n\nThis script selects the best barcode per read, using edit distance as primary criteria,\n with ties broken using cosine-similarity score.\n ... | [
[
"pandas.read_csv"
]
] |
Cray-HPE/canu | [
"3a92ce1e9b63f35aa30b9135afaa734e61909407"
] | [
"network_modeling/NetworkDrawing.py"
] | [
"# MIT License\n#\n# (C) Copyright [2022] Hewlett Packard Enterprise Development LP\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitati... | [
[
"matplotlib.pyplot.savefig"
]
] |
robingather/com-thesis | [
"30a6e815c4f71edc332a4e74a25faf0dd21c1244"
] | [
"renderer.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport pygame\nimport seaborn as sns\nfrom helper import Point\nimport constants as C\n\n# rgb colors\nWHITE = (250,250,250)\nLIGHT_BLUE = (167, 148, 246)\nLIGHT_RED = (242, 121, 125)\nLIGHTER_RED = (252, 198, 164)\nDARK_RED = (100, 0, 0)\nLIGHT_GREEN = (146,247... | [
[
"matplotlib.pyplot.ion",
"numpy.round",
"matplotlib.pyplot.sca",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.pause",
"mat... |
zhupengjia/nlptools | [
"a0afc4873ee1b3adb383d38075ad5ae5e0293055"
] | [
"nlptools/utils/utils.py"
] | [
"#!/usr/bin/env python\nimport os, zlib, numpy, re, pickle\nfrom collections import Counter\nfrom sklearn.utils import murmurhash3_32\n\n'''\n Author: Pengjia Zhu (zhupengjia@gmail.com)\n Some tool functions\n'''\n\n\ndef zdump(value,filename):\n ''' \n serialize compress variable to file using zlib... | [
[
"sklearn.utils.murmurhash3_32"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.