repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
mxndrwgrdnr/activitysim | [
"722d6e36b2210d5d24dfa2ac4a3504c1e8f75336"
] | [
"activitysim/abm/models/atwork_subtour_scheduling.py"
] | [
"# ActivitySim\n# See full license in LICENSE.txt.\nimport logging\n\nimport pandas as pd\nimport numpy as np\n\nfrom activitysim.core import simulate\nfrom activitysim.core import tracing\nfrom activitysim.core import pipeline\nfrom activitysim.core import config\nfrom activitysim.core import inject\nfrom activity... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
willprice/shap | [
"e491b2c2332b1cf9d4d79b194a3f98fb7b9f2001"
] | [
"shap/plots/waterfall.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as pl\nfrom shap.plots import labels\nfrom shap.common import safe_isinstance\nfrom . import colors\n\n\ndef waterfall_plot(expected_value, shap_values, features=None, feature_names=None, max_display=10, show=True):\n \n # unwrap pandas series\n if safe_isinsta... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.axhline",
"numpy.abs",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show"
]
] |
apexrl/malib | [
"3785309e9b695ff359131fbbecabb6b5a52ef559"
] | [
"malib/backend/datapool/test/test_parameter_server.py"
] | [
"# -*- encoding: utf-8 -*-\n# -----\n# Created Date: 2021/7/16\n# Author: Hanjing Wang\n# -----\n# Last Modified:\n# Modified By:\n# -----\n# Copyright (c) 2020 MARL @ SJTU\n# -----\n\nimport os\nimport ray\nimport copy\nimport pytest\nimport torch\nimport time\n\nfrom malib.backend.datapool.parameter_server import... | [
[
"torch.all",
"torch.sub",
"torch.nn.Linear",
"torch.no_grad",
"torch.rand",
"torch.nn.init.normal_",
"torch.nn.ReLU"
]
] |
satra/nibabel | [
"b04fe7c29e4c097edc9d519fccf1c804969232f1",
"b04fe7c29e4c097edc9d519fccf1c804969232f1",
"b04fe7c29e4c097edc9d519fccf1c804969232f1"
] | [
"nibabel/spm2analyze.py",
"nibabel/tests/test_funcs.py",
"nibabel/eulerangles.py"
] | [
"# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n#\n# See COPYING file distributed along with the NiBabel package for the\n# copyright and license terms.\n#\n#... | [
[
"numpy.isfinite",
"numpy.dtype"
],
[
"numpy.diag",
"numpy.arange",
"numpy.eye",
"numpy.flipud",
"numpy.concatenate"
],
[
"numpy.asarray",
"numpy.eye",
"numpy.array",
"numpy.finfo"
]
] |
david-lindner/idrl | [
"54cfad330b0598ad4f6621796f2411644e50a6ba"
] | [
"active_reward_learning/reward_models/basic_gp_reward_model.py"
] | [
"import os\nimport pickle\nimport time\nfrom collections import Counter\nfrom typing import Callable, Dict, List, Optional, Tuple, Union\n\nimport gym\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom active_reward_learning.common.policy import (\n BasePolicy,\n CombinedPolicy,\n EpsGreedyPolicy,\n ... | [
[
"numpy.diag",
"numpy.dot",
"numpy.random.choice",
"numpy.min",
"numpy.linalg.norm",
"scipy.sparse.csr_matrix",
"numpy.max",
"numpy.fromstring",
"numpy.zeros",
"numpy.sum"
]
] |
bileschi/tpu | [
"0731831addc47d45342708093697492e4e9a68ca"
] | [
"models/official/squeezenet/squeezenet_main.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.logging.warn",
"tensorflow.ConfigProto",
"tensorflow.logging.info",
"tensorflow.logging.set_verbosity",
"tensorflow.contrib.tpu.python.tpu.tpu_config.TPUConfig",
"tensorflow.app.run"
]
] |
sergpolly/cworld-dekker | [
"7557bbe873e623e9059482722922faca4e784ad0"
] | [
"scripts/python/boundary2tad.py"
] | [
"#!/usr/local/bin/python\r\n\"\"\"\r\n***********************************************\r\n- PROGRAM: boundary2tad.py\r\n- CONTACT: Bryan lajoie (bryan.lajoie@umassmed.edu)\r\n***********************************************\r\n\"\"\"\r\n\r\nfrom __future__ import print_function\r\nfrom __future__ import division\r\n\... | [
[
"numpy.nanmax",
"numpy.nonzero",
"numpy.min",
"numpy.isnan",
"numpy.nanmin",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
Timothy102/EEG-Sleep | [
"2dd7020fc8c3e7e5c195416b9177227aef4dc278"
] | [
"dhedfreader.py"
] | [
"import re, logging\nimport numpy as np\nfrom collections import namedtuple\nfrom functools import reduce\nimport datetime\n\nEVENT_CHANNEL = 'EDF Annotations'\nlog = logging.getLogger(__name__)\n\nclass EDFEndOfData(BaseException): pass\n\n\ndef tal(tal_str):\n '''Return a list with (onset, duration, annotation) ... | [
[
"numpy.hstack",
"numpy.linspace",
"numpy.arange",
"numpy.all",
"numpy.fromstring"
]
] |
bnord01/alpha-zero-general-sogo | [
"76e08d2fc1f0d331018ee1b07bdd33128fbd6d83"
] | [
"othello/tensorflow/NNet.py"
] | [
"import os\nimport shutil\nimport time\nimport random\nimport numpy as np\nimport math\nimport sys\nsys.path.append('../../')\nfrom utils import *\nfrom pytorch_classification.utils import Bar, AverageMeter\nfrom NeuralNet import NeuralNet\n\nimport tensorflow as tf\nfrom .OthelloNNet import OthelloNNet as onnet\n\... | [
[
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer",
"tensorflow.Session"
]
] |
carrier-io/perfreporter | [
"f5b472137af5471bce0252af7de6995cc9d87532"
] | [
"perfreporter/jtl_parser.py"
] | [
"import csv\nimport re\nfrom os import path\nimport numpy as np\n\n\nFIELDNAMES = 'timeStamp', 'response_time', 'request_name', \"status_code\", \"responseMessage\", \"threadName\", \"dataType\",\\\n \"success\", \"failureMessage\", \"bytes\", \"sentBytes\", \"grpThreads\", \"allThreads\", \"URL\", \"La... | [
[
"numpy.percentile"
]
] |
makaveli10/4P | [
"fea29d9b5a1bd3f7ca3fef1e7b1a2218ba14e8db",
"fea29d9b5a1bd3f7ca3fef1e7b1a2218ba14e8db"
] | [
"tflib/data_helpers.py",
"tflib/train_tff.py"
] | [
"import os\nimport pathlib\n\nimport tensorflow as tf\nimport tensorflow_federated as tff\n\n\nAUTOTUNE = tf.data.experimental.AUTOTUNE\n\ndef make_client_ids(clients_dir: pathlib.Path):\n return [p.name for p in clients_dir.iterdir() if p.is_dir()]\n\n\ndef provide_client_data_fn(\n clients_dir: pathlib.Path,\... | [
[
"tensorflow.strings.split",
"tensorflow.image.resize",
"tensorflow.image.convert_image_dtype",
"tensorflow.io.read_file",
"tensorflow.image.decode_jpeg"
],
[
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorfl... |
jbuckman/pytorch-lightning | [
"cc74fb717a7127fecd4dbb9c743ba28b40de7f64",
"cc74fb717a7127fecd4dbb9c743ba28b40de7f64"
] | [
"tests/helpers/pipelines.py",
"tests/models/test_tpu.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.abs",
"torch.norm",
"torch.no_grad"
],
[
"torch.utils.data.DataLoader",
"torch.tensor"
]
] |
johnh2o2/pylabeler | [
"afabd72f899efeced0ed488b0addbf15fe101938"
] | [
"test/test.py"
] | [
"# Test script that demonstrates the capabilities\n# of the pylabeler library\n\nfrom pylabeler.labeler import Labeler\nimport matplotlib.pyplot as plt\n\n# Locations of images\nimage_folder = 'img'\nimage_filename = lambda ID : \"%s/%s.jpg\"%(image_folder, ID)\n\n# Where to load/save the labels for each image\nlab... | [
[
"matplotlib.pyplot.show"
]
] |
Aaron-Jin-Xu/probabilistic-semantic-image-inpainting | [
"8ce630eaf7e8f9ef5fc5ad19d5474d050d71807d"
] | [
"learners/learner.py"
] | [
"import os\nimport sys\nimport json\nimport time\nimport numpy as np\nimport tensorflow as tf\nfrom blocks.helpers import Monitor\nfrom blocks.helpers import visualize_samples, get_nonlinearity, int_shape, get_trainable_variables, broadcast_masks_np\nfrom blocks.optimizers import adam_updates\nimport data.load_data... | [
[
"tensorflow.device",
"tensorflow.gradients",
"tensorflow.trainable_variables",
"tensorflow.make_template",
"tensorflow.train.Saver",
"tensorflow.add_n"
]
] |
lixiny/CPF | [
"69129a3a2ec76347752241850da5ced09d795b1d"
] | [
"hocontact/models/manobranch.py"
] | [
"import pickle\n\nimport numpy as np\nimport torch\nfrom manopth.manolayer import ManoLayer\nfrom torch import nn\n\n\nclass ManoAdaptor(torch.nn.Module):\n def __init__(self, mano_layer, load_path=None):\n super().__init__()\n self.adaptor = torch.nn.Linear(778, 21, bias=False)\n if load_pa... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.cat",
"torch.from_numpy",
"torch.nn.Linear",
"numpy.identity",
"torch.rand",
"torch.nn.ReLU"
]
] |
isotrforever/R-BERT | [
"99e986cab12f2d91f2445c651908c8a18c8c9efe"
] | [
"model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom transformers import BertModel, BertPreTrainedModel\n\n\nclass FCLayer(nn.Module):\n def __init__(self, input_dim, output_dim, dropout_rate=0.0, use_activation=True):\n super(FCLayer, self).__init__()\n self.use_activation = use_activation\n self.dro... | [
[
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.cat",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.nn.MSELoss"
]
] |
finagle29/linetools | [
"8da5c232d8744864f8f5d7ff8c31e4165f03c5ac"
] | [
"linetools/analysis/interactive_plot.py"
] | [
"\"\"\" Classes for making interactive plots.\n\"\"\"\nfrom __future__ import division, print_function, unicode_literals, absolute_import\n\nimport os\nimport numpy as np\nfrom ..utils import between, loadjson, savejson\nfrom ..spectra.convolve import convolve_psf\nfrom ..spectra.plotting import get_flux_plotrange\... | [
[
"numpy.linspace",
"numpy.max",
"numpy.argmin",
"numpy.searchsorted",
"numpy.unique",
"numpy.arange",
"numpy.diff",
"numpy.interp",
"matplotlib.pyplot.close",
"numpy.repeat",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.isnan",
"numpy.median",
"numpy.a... |
jrueb/uproot-methods | [
"8b38c49acc233228d4fed32a6d4f77f057f8eb2f"
] | [
"uproot_methods/classes/TGraphAsymmErrors.py"
] | [
"#!/usr/bin/env python\n\n# BSD 3-Clause License; see https://github.com/scikit-hep/uproot-methods/blob/master/LICENSE\n\nimport uproot_methods.base\n\nclass Methods(uproot_methods.base.ROOTMethods):\n\t\n\t@property\n\tdef xerrorshigh(self):\n\t\treturn self._fEXhigh\n\t\t\n\t@property\n\tdef xerrorslow(self):\n\t... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
hanyas/mimo | [
"6f9b327a1a202a88b33a419520474ef4f10749e8",
"6f9b327a1a202a88b33a419520474ef4f10749e8"
] | [
"examples/ilr/toy/evaluate_cmb.py",
"examples/ilr/toy/evaluate_ard.py"
] | [
"import os\nimport argparse\n\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\n\nimport numpy as np\nimport numpy.random as npr\n\nimport mimo\nfrom mimo.distributions import NormalGamma\nfrom mimo.distributions import MatrixNormalWishart\nfrom mimo.distributions import GaussianWithNormalGamma\nfrom mimo.distributions imp... | [
[
"sklearn.metrics.explained_variance_score",
"sklearn.metrics.r2_score",
"numpy.random.seed",
"sklearn.utils.shuffle",
"numpy.eye",
"matplotlib.pyplot.subplots",
"sklearn.metrics.mean_squared_error",
"numpy.ones",
"numpy.argsort",
"matplotlib.pyplot.show",
"numpy.zeros",... |
norveclibalikci/easyreg-mirror | [
"a16254733fe957cc4024923f8dce91412966a189",
"a16254733fe957cc4024923f8dce91412966a189"
] | [
"tools/draw_deformation.py",
"easyreg/seg_unet.py"
] | [
"import numpy as np\nimport sys,os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = ''\nfrom easyreg.viewers_tomv import *\nfrom mermaid.utils import *\nfrom mermaid.data_utils import *\nimport SimpleITK as sitk\nfrom glob import glob\nimport os\n\n\n\nsz = [160,200,200]\ndef get_image_list_to_draw(refer_folder,momentum_fo... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.sum",
"numpy.transpose"
],
[
"torch.nn.functional.softmax",
"torch.max",
"torch.Tensor",
"torch.cat",
"numpy.stack",
"numpy.transpose",
"torch.no_grad",
"torch.split",
"numpy.array",
"numpy.zeros"
]
] |
stuarteberg/schist | [
"330476567cf061478aff5ce862c741095b8795a3"
] | [
"schist/tools/_affinity_tools.py"
] | [
"from typing import Optional#, Tuple, Sequence, Type, Union, Dict\n\nimport numpy as np\nfrom anndata import AnnData\nimport scipy.stats\n\nfrom scanpy import logging as logg\n\n\ndef cluster_consistency(\n adata: AnnData,\n level: int = 1,\n group: Optional[str] = None,\n key: Optional[str] = 'nsbm',\n... | [
[
"numpy.nanmax",
"numpy.log"
]
] |
thoughtmachines/Stochastic-AlgoTrader | [
"62c9a5f9b2778fec2e964401159497da3580cd5b"
] | [
"trader/pairsTradingLstm.py"
] | [
"import sys, os\nmyPath = os.path.dirname(os.path.abspath(__file__))\nsys.path.insert(0, myPath + '/../')\n\nimport torch\nfrom torch import nn\nfrom torch.optim import Adam\nfrom torch.nn.init import xavier_normal as xavier\nimport matplotlib.pyplot as plt\n\nfrom data.loader import cryptoData\nfrom models.model ... | [
[
"torch.mean",
"torch.cat",
"torch.sum",
"torch.std",
"torch.device"
]
] |
Blitzdude/RealTimeGraphics-engine | [
"0a92467f7ab9710aabe14f8d4bb25c51f277ed26"
] | [
"RTG_proj/Vendor/bullet/examples/pybullet/gym/pybullet_envs/agents/visualize_ppo.py"
] | [
"# Copyright 2017 The TensorFlow Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"tensorflow.device",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.ConfigProto",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.Session",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.app.run"
]
] |
johnbomidi/data-explorer-dash-app | [
"80df9928aa41a20d8098870662f444ba1fb1aa74"
] | [
"_app/callback.py"
] | [
"\nfrom dash_extensions.enrich import Output, Input, State, ServersideOutput\n\nfrom _app.gen import parse_contents, find_closest\nfrom _app.update import update_dropdown, update_marks, update_table, update_graph\n\nfrom dash import callback_context\nfrom dash.exceptions import PreventUpdate\nimport pandas as pd\n\... | [
[
"pandas.to_datetime"
]
] |
berak/opencv_smallfry | [
"fd8f64980dff0527523791984d6cb3dfcd2bc9bc"
] | [
"audio_landmarks3d/lm.py"
] | [
"import numpy as np\nimport cv2\nimport wave\nimport subprocess\nimport os, base64\n\n# landmarks connections\ncons = [[48, 49], [49, 50], [50, 51], [51, 52], [52, 53], [53, 54], [54, 55], [55, 56], [56, 57],\n [57, 58], [58, 59], [59, 48], [60, 61], [61, 62], [62, 63], [63, 64], [64, 65], [65, 66],\n ... | [
[
"numpy.load",
"numpy.ones",
"numpy.array",
"numpy.frombuffer"
]
] |
ArthurWuTW/openpilot | [
"920d8bf9d292f1ff076dd75c130a31805c357fb4"
] | [
"selfdrive/controls/lib/pid.py"
] | [
"import numpy as np\nfrom common.numpy_fast import clip, interp\n\ndef apply_deadzone(error, deadzone):\n if error > deadzone:\n error -= deadzone\n elif error < - deadzone:\n error += deadzone\n else:\n error = 0.\n return error\n\nclass PIController(object):\n def __init__(self, k_p, k_i, k_f=1., po... | [
[
"numpy.sign"
]
] |
RBrearton/local_stats | [
"d38a10d296d3b1f0a83f81b3ebc95e17779d394a"
] | [
"tests/test_cluster.py"
] | [
"\"\"\"\nThis file contains tests for the cluster module's Cluster class.\n\"\"\"\n\n# Obviously we want to test 'private' attributes.\n# pylint: disable=protected-access\n\nimport numpy as np\n\nfrom local_stats.cluster import Cluster\n\n\ndef test_init():\n \"\"\"\n Classic test to blow up if attribute name... | [
[
"numpy.array",
"numpy.ones"
]
] |
karhankaan/CausalGAN | [
"2cf4d2038f5a2522cb60a18d1e2b5d67b82ab19f"
] | [
"figure_scripts/utils.py"
] | [
"from __future__ import print_function,division\nimport tensorflow as tf\nimport os\nfrom os import listdir\nfrom os.path import isfile, join\nimport shutil\nimport sys\nimport math\nimport json\nimport logging\nimport numpy as np\nfrom PIL import Image\nfrom datetime import datetime\n\nimport tensorflow as tf\nfro... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.transpose",
"tensorflow.cast",
"numpy.array",
"numpy.zeros"
]
] |
reinforcementdriving/rlkit | [
"01319447037f3fb3b48ba0779dab2a48af357fa7"
] | [
"rlkit/data_management/obs_dict_replay_buffer.py"
] | [
"import numpy as np\nfrom gym.spaces import Dict, Discrete\n\nfrom rlkit.data_management.replay_buffer import ReplayBuffer\n\n\nclass ObsDictRelabelingBuffer(ReplayBuffer):\n \"\"\"\n Replay buffer for environments whose observations are dictionaries, such as\n - OpenAI Gym GoalEnv environments. https:... | [
[
"numpy.asarray",
"numpy.uint8",
"numpy.arange",
"numpy.ones",
"numpy.float64",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
shawnvosburg/IFT712-Projet | [
"bf7fe023f4cec02291dd1198d65824bc74ee05e4"
] | [
"src/DataManagement/Preprocessing/PolynomialFeatures.py"
] | [
"#!/usr/bin/python\n#-*- coding: utf-8 -*-\n\nimport pandas as pd\nfrom src.DataManagement.Preprocessing import PreprocessingStrategy\nfrom sklearn.preprocessing import PolynomialFeatures as _PolynomialFeatures\n\nclass PolynomialFeatures(PreprocessingStrategy):\n def __init__(self,**kwargs):\n super().__... | [
[
"sklearn.preprocessing.PolynomialFeatures"
]
] |
Cubbee/apex | [
"0a991543846966d5f586540dc2441e512139e9fc"
] | [
"examples/deprecated_api/word_language_model/generate.py"
] | [
"###############################################################################\n# Language Modeling on Penn Tree Bank\n#\n# This file generates new sentences sampled from the language model\n#\n###############################################################################\n\nimport argparse\n\nimport torch\n\nim... | [
[
"torch.load",
"torch.manual_seed",
"torch.multinomial",
"torch.no_grad",
"torch.rand",
"torch.cuda.is_available"
]
] |
AllenZYJ/torchcv | [
"8432507a910cf0b42366ed7e5a526f454956e9f1",
"8432507a910cf0b42366ed7e5a526f454956e9f1",
"8432507a910cf0b42366ed7e5a526f454956e9f1"
] | [
"methods/gan/image_translator_test.py",
"models/seg/model_manager.py",
"models/seg/nets/denseassp.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You (youansheng@gmail.com)\n# Class Definition for GAN.\n\n\nimport os\nimport torch\n\nfrom methods.tools.blob_helper import BlobHelper\nfrom methods.tools.runner_helper import RunnerHelper\nfrom models.gan.model_manager import ModelManager\nfrom data... | [
[
"torch.no_grad"
],
[
"torch.cuda.device_count"
],
[
"torch.nn.functional.dropout2d",
"torch.nn.Dropout2d",
"torch.cat",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.ReLU"
]
] |
carlgogo/dl4ds | [
"2675fe772b7e165ab8726a51c75dd3d9d0a7a465"
] | [
"dl4ds/models/spt_preups.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.layers import (Add, Conv2D, Input, Concatenate, \n TimeDistributed)\nfrom tensorflow.keras.models import Model\n\nfrom .blocks import (RecurrentConvBlock, ResidualBlock, ConvBlock, \n DenseBlock, TransitionBlock,... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.TimeDistributed",
"tensorflow.expand_dims",
"tensorflow.repeat",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Input"
]
] |
navinsingh1977/ga-learner-dsmp-repo | [
"8eebf96b1c7289b9c325737251ec0042b8151be0",
"8eebf96b1c7289b9c325737251ec0042b8151be0"
] | [
"Gradient-Boosting-Machine/code.py",
"Linear-Regression/code.py"
] | [
"# --------------\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n#path - Path of file \ndf = pd.read_csv(path)\n# Code starts here\nX = df.drop(['customerID','Churn'], axis = 1)\ny = df['Churn'].copy()\nX_train,X_test,y_train,y_test = train_test_split(X,y, test_size = 0.3, random_state ... | [
[
"sklearn.model_selection.GridSearchCV",
"pandas.read_csv",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.classification_report",
"sklearn.metrics.accuracy... |
Harsha-Musunuri/stylegan2-pytorch | [
"bd9b42f7031aa1d16245ac64bc562baf0fc0945f",
"bd9b42f7031aa1d16245ac64bc562baf0fc0945f"
] | [
"train_styleGAN2_expts.py",
"dev/train_swap_cond.py"
] | [
"import argparse\nimport math\nimport random\nimport os\nfrom PIL import Image\nimport numpy as np\nimport torch\nfrom torch import nn, autograd, optim\nfrom torch.nn import functional as F\nfrom torch.utils import data\nimport torch.distributed as dist\nfrom torchvision import datasets, transforms, utils\nfrom tqd... | [
[
"torch.randn_like",
"torch.distributed.init_process_group",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.set_device",
"torch.load",
"torch.randn",
"torch.utils.data.SequentialSampler",
"torch.utils.data.RandomSampler",
"torch.tensor",
"numpy.cov",
"tor... |
vhwzIs/mmgeneration | [
"f4c950fa4cb81b8151cf9baf71abd6d8cb204f9b"
] | [
"tools/utils/inception_stat.py"
] | [
"import argparse\nimport os.path as osp\nimport pickle\nimport sys\n\nimport mmcv\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom mmcv import Config, print_log\n\n# yapf: disable\nsys.path.append(osp.abspath(osp.join(__file__, '../../..'))) # isort:skip # noqa\n\nfrom mmgen.core.evaluation.metric_u... | [
[
"torch.nn.DataParallel",
"numpy.cov",
"numpy.mean",
"torch.jit.load"
]
] |
NSLS-II-SMI/pygix | [
"2bcdb881366e061c20c6bcc6a5abf463c643f28a",
"2bcdb881366e061c20c6bcc6a5abf463c643f28a"
] | [
"pygix/tools.py",
"pygix/process.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" A collection of useful tools for GIXS and fibre diffraction.\n\nThere are two main tools:\n\n1. Four quadrant averaging:\n Fibre diffraction patterns are related through four quadrant symmetry\n (assuming ideal fibre texture). This means that the data ... | [
[
"numpy.hstack",
"numpy.linspace",
"numpy.fliplr",
"numpy.flipud",
"numpy.cos",
"numpy.sin",
"numpy.append",
"numpy.array",
"numpy.zeros",
"numpy.where"
],
[
"numpy.arange",
"numpy.flipud",
"numpy.zeros"
]
] |
shvetsiya/mask-rcnn | [
"dbe1ae7a7bf457ae53aa88f2d1dee3aef1a32936"
] | [
"net/lib/box/nms/gpu_nms/setup.py"
] | [
"from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\nfrom Cython.Build import cythonize\n\nimport os\nfrom os.path import join as pjoin\nimport numpy as np\n\n# /opt/anaconda3/bin/python3 setup.py build_ext --inplace\n# http://martinsosic.com/develo... | [
[
"numpy.get_numpy_include",
"numpy.get_include"
]
] |
unAlpha/AgManim | [
"c34390af41d943c8785beee52015b22eb9df8bde"
] | [
"manimlib/mobject/value_tracker.py"
] | [
"import numpy as np\n\nfrom manimlib.mobject.mobject import Mobject\n\n\nclass ValueTracker(Mobject):\n \"\"\"\n Note meant to be displayed. Instead the position encodes some\n number, often one which another animation or continual_animation\n uses for its update function, and by treating it as a mobje... | [
[
"numpy.log",
"numpy.zeros"
]
] |
fwgg8547/deeplean_mc | [
"1b858e59caf082df0cd4b1ca12dc21875fb00b26"
] | [
"trainmine.py"
] | [
"from absl import app, flags, logging\nfrom absl.flags import FLAGS\n\nimport tensorflow as tf\nimport numpy as np\nimport cv2\nfrom tensorflow.keras.callbacks import (\n ReduceLROnPlateau,\n EarlyStopping,\n ModelCheckpoint,\n TensorBoard\n)\nfrom yolov3_tf2.models import (\n YoloV3, YoloV3Tiny, Yol... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.reduce_sum",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.callb... |
bugface/NeMo | [
"431c561380a120e9e164a4c9deed8f1ca9acace5",
"431c561380a120e9e164a4c9deed8f1ca9acace5"
] | [
"nemo/collections/nlp/modules/common/megatron/token_level_encoder_decoder.py",
"nemo/collections/tts/models/talknet.py"
] | [
"# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"torch.zeros"
],
[
"torch.sigmoid",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.nn.functional.mse_loss",
"torch.nn.Conv1d"
]
] |
davidpvilaca/TEP | [
"decbf61a96863d76e1b84dc097aa37b12038aa75",
"decbf61a96863d76e1b84dc097aa37b12038aa75"
] | [
"aula13/tarefa.py",
"aula8/tarefa3.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 16 00:14:59 2017\n\n@author: davidpvilaca\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport cv2\nimport numpy as np\nimport scipy\nfrom scipy import ndimage\nfrom skimage import measure\n\n\ndef showImg(img, gray=False):\n plt.figure()... | [
[
"matplotlib.pyplot.imshow",
"scipy.sparse.csgraph.connected_components",
"matplotlib.pyplot.figure"
],
[
"matplotlib.pyplot.imshow"
]
] |
psobolewskiPhD/SEM_fiber_analysis | [
"a378e842d32b7cf2f5d7e69d28a423d928c2fafc"
] | [
"Analyze_fibers.py"
] | [
"# %%\n# Import needed libraries and modules\nimport os\n\nimport dask\nimport numpy as np\nfrom dask import delayed\nfrom dask_image.imread import imread\nfrom quanfima import morphology as mrph\nfrom skimage import filters, morphology\n\n# %%\n# Use dask to read the image files, which permits for lazy loading.\na... | [
[
"numpy.std",
"numpy.mean"
]
] |
PUT-II/Computer-Vision-Project-2 | [
"14da786e0beb94eb8df1d3d06fdd1fde718dad05"
] | [
"src/pipeline_digit_recognition.py"
] | [
"from typing import List\r\n\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\n\r\ndef segment_to_digits(segment: np.array, verbose: int = 0) -> List[np.array]:\r\n from sklearn.cluster import OPTICS\r\n from statistics import mean\r\n\r\n nonzero_y, nonzero_x = np.where(segment > 0)\r\n... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.scatter",
"numpy.unique",
"numpy.ones",
"sklearn.cluster.OPTICS",
"sklearn.svm.SVC",
"matplotlib.pyplot.show",
"numpy.where",
"sklearn.datasets.fetch_openml"
]
] |
abdulhaim/d4rl | [
"fe9e711ad7335be492759af563c6fa2f80c8e906"
] | [
"d4rl/pointmaze/maze_model.py"
] | [
"\"\"\" A pointmass maze env.\"\"\"\nfrom gym.envs.mujoco import mujoco_env\nfrom gym import utils\nfrom d4rl import offline_env\nfrom d4rl.pointmaze.dynamic_mjc import MJCModel\nimport numpy as np\nimport random\n\n\nWALL = 10\nEMPTY = 11\nGOAL = 12\n\n\ndef parse_maze(maze_str):\n lines = maze_str.strip().spli... | [
[
"numpy.clip",
"numpy.linalg.norm",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
willsmithorg/autogluon | [
"1e8c6a2f30fcc473411bf393c9827eb4713dcef6",
"1e8c6a2f30fcc473411bf393c9827eb4713dcef6"
] | [
"text/src/autogluon/text/automm/optimization/utils.py",
"tabular/src/autogluon/tabular/learner/abstract_learner.py"
] | [
"from typing import Optional, Union, Tuple, List, Dict\nimport functools\nfrom torch import nn\nfrom torch import optim\nfrom torch.nn import functional as F\nfrom transformers.trainer_pt_utils import get_parameter_names\nimport torchmetrics\nfrom .lr_scheduler import (\n get_cosine_schedule_with_warmup,\n ge... | [
[
"torch.optim.Adam",
"torch.nn.CrossEntropyLoss",
"torch.optim.AdamW",
"torch.optim.SGD",
"torch.nn.MSELoss"
],
[
"pandas.merge",
"pandas.concat",
"pandas.Series",
"numpy.unique",
"pandas.option_context",
"pandas.DataFrame",
"numpy.array",
"sklearn.metrics.cl... |
cffbots/swan | [
"ea8f1a0943a7ffd3cd20d8adee6f8b7a96a117f1"
] | [
"scripts/run_torch_models.py"
] | [
"#!/usr/bin/env python\n\nimport logging\nfrom pathlib import Path\nimport torch\nfrom swan.dataset import TorchGeometricGraphData, FingerprintsData, DGLGraphData\nfrom swan.modeller import TorchModeller\nfrom swan.modeller.models import FingerprintFullyConnected, MPNN, SE3Transformer\nfrom swan.utils.log_config im... | [
[
"torch.set_default_dtype"
]
] |
anuragbms/Sales-forecasting-with-RNNs | [
"22b4639ecbb48381af53326ace94a3538201b586",
"22b4639ecbb48381af53326ace94a3538201b586",
"22b4639ecbb48381af53326ace94a3538201b586",
"22b4639ecbb48381af53326ace94a3538201b586",
"22b4639ecbb48381af53326ace94a3538201b586",
"22b4639ecbb48381af53326ace94a3538201b586",
"22b4639ecbb48381af53326ace94a3538201b58... | [
"MetamorphicTests/all_mutants/sales_forecasting_file/228.py",
"MetamorphicTests/all_mutants/sales_forecasting_file/230.py",
"MetamorphicTests/all_mutants/sales_forecasting_file/273.py",
"MetamorphicTests/mutants_of_interest/sales_forecasting_file/257_bug.py",
"MetamorphicTests/all_mutants/sales_forecasting_... | [
"def gen_mutants():\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n import tensorflow as tf\n import pandas\n import numpy as np\n \n \n \n \n \n \n DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv'\n \n ... | [
[
"tensorflow.nn.dynamic_rnn",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"pandas.read_csv",
"tensorflow.reset_default_graph",
"tensorflow.add",
"tensorflow.Session",
"tensorflow.matmul",
"tensorflow.truncated_normal",
"tensorflow.saved_model.simple_save",... |
hyunwoo18/decisionengine_modules | [
"a67462628c2074e768d0825edee4ee5d570030e0",
"a67462628c2074e768d0825edee4ee5d570030e0"
] | [
"src/decisionengine_modules/tests/test_GceFigureOfMerit.py",
"src/decisionengine_modules/tests/test_GCEResourceLimits.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\nimport tabulate\n\nfrom decisionengine_modules.GCE.transforms import GceFigureOfMerit\n\nDATA_DIR = os.path.join(os.path.dirname(__file__), \"data\")\nCSV_FILE = os.path.join(DATA_DIR, \"GceOccupancy.output.fixture.csv\")\n\n_PRODUCES = [\"GCE_Price_Performance... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.isclose"
],
[
"pandas.DataFrame"
]
] |
WangHelin1997/MaskSpec | [
"d4acf1343c780ba481abecbfe426ff657857b8f1",
"d4acf1343c780ba481abecbfe426ff657857b8f1"
] | [
"audioset/dataset.py",
"trainer/engine_pretrain.py"
] | [
"import io\nimport os\nimport random\n\nimport av\nfrom torch.utils.data import Dataset as TorchDataset, ConcatDataset, DistributedSampler, WeightedRandomSampler, RandomSampler\nimport torch\nimport numpy as np\nimport sys\nsys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))\nfrom audioset... | [
[
"torch.Generator",
"numpy.random.beta",
"torch.randint",
"torch.utils.data.RandomSampler",
"torch.utils.data.WeightedRandomSampler",
"numpy.concatenate",
"torch.utils.data.ConcatDataset",
"numpy.unpackbits",
"numpy.random.random_integers",
"torch.rand",
"torch.as_tensor... |
uofuseismo/shakemap | [
"cbad8622bd520e1936447620edfb3a4feea1a8d9",
"cbad8622bd520e1936447620edfb3a4feea1a8d9"
] | [
"tests/shakelib/conversions/imc/beyer_bommer_2006_test.py",
"shakelib/conversions/imc/boore_kishida_2017.py"
] | [
"#!/usr/bin/env python\n\n# stdlib imports\nimport os.path\nimport sys\n\n# third party imports\nimport numpy as np\nfrom openquake.hazardlib import const\nfrom openquake.hazardlib.imt import PGA, PGV, SA\nimport pytest\n\n# local imports\nfrom shakelib.conversions.imc.beyer_bommer_2006 import BeyerBommer2006\n\n\n... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.asarray",
"numpy.vstack",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.empty"
],
[
"numpy.log",
"pandas.read_csv",
"numpy.sqrt",
"numpy.clip",
"numpy.interp"
]
] |
kongfanmiao/Qcodes | [
"de6b0d312cca2b252087885fc8812875e81c6a59"
] | [
"qcodes/dataset/sqlite/queries.py"
] | [
"\"\"\"\nThis module contains useful SQL queries and their combinations which are\nspecific to the domain of QCoDeS database.\n\"\"\"\nimport logging\nimport sqlite3\nimport time\nimport unicodedata\nimport warnings\nfrom typing import (Any, Callable, Dict, List, Mapping, Optional, Sequence,\n Tu... | [
[
"numpy.unique",
"numpy.dtype",
"numpy.append",
"numpy.prod",
"numpy.array",
"numpy.zeros"
]
] |
Wesley-Du/analytics-zoo | [
"e4ca11b219a43bceec99aba39cf30c8aa368e8b3",
"439f2c99d657fb20a5ff4bf510869616402ba0cf",
"439f2c99d657fb20a5ff4bf510869616402ba0cf"
] | [
"pyzoo/zoo/tfpark/utils.py",
"pyzoo/zoo/models/recommendation/utils.py",
"pyzoo/test/zoo/automl/model/test_Seq2Seq.py"
] | [
"#\n# Copyright 2018 Analytics Zoo Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"tensorflow.shape"
],
[
"numpy.array"
],
[
"numpy.testing.assert_array_almost_equal"
]
] |
samgeen/Weltgeist | [
"c7d52e879bb3473cecbb06651b5e76dac3020da6"
] | [
"examples/example06_loading.py"
] | [
"\"\"\"\nExample 6 - Loading\nLoading a save file\n\n@author: samgeen\n\"\"\"\n\n# This piece of code basically adds the parent directory to PYTHONPATH\nimport os, sys\nparent = os.path.dirname(os.getcwd())\nsys.path.append(parent)\n\n# Import numpy, matplotlib and weltgeist\nimport numpy as np\nimport matplotlib.p... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
JayZhu0104/maskrcnn-benchmark | [
"0296cae312566b2fad79074736dc64760af86fe4"
] | [
"maskrcnn_benchmark/layers/roi_align.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nfrom torch import nn\nfrom torch.autograd import Function\nfrom torch.autograd.function import once_differentiable\nfrom torch.nn.modules.utils import _pair\n\n# from maskrcnn_benchmark import _C\nfrom ._utils import _C\nfrom ap... | [
[
"torch.nn.modules.utils._pair"
]
] |
leelastar/leelastar-training | [
"b6b4a36c48c418fcc0bd3ccb7f9c2e95e29f26c9"
] | [
"polaris/tests/test_layers.py"
] | [
"\"\"\" Group all tests cases for layers\"\"\"\n\nimport pytest\nimport torch\n\nfrom polaris.network.layers import SqueezeExcitation, ResidualBlock2D\n\n\ndef test_squeeze_excitation():\n X = torch.tensor([[[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]]])\n se = SqueezeExcitation(channels=1, ratio=1)\n... | [
[
"torch.tensor"
]
] |
MrHuff/keops | [
"a7f44609ba444af8d9fcb11bc3a75f2024841dfa"
] | [
"pykeops/benchmarks/plot_benchmark_invkernel.py"
] | [
"\"\"\"\nSolving positive definite linear systems\n=========================================\n\nThis benchmark compares the performances of KeOps versus Numpy and Pytorch on a inverse matrix operation. It uses the functions :class:`torch.KernelSolve <pykeops.torch.KernelSolve>` (see also :doc:`here <../_auto_exampl... | [
[
"matplotlib.pyplot.legend",
"numpy.dtype",
"numpy.random.randn",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"torch.device",
"torch.cuda.synchronize",
"matplotlib.pyplot.tight_layout",
"torch.ones",
"torch.solve",
"torch.randn",
"numpy.eye",
"scipy.... |
ionicsolutions/ytterbium | [
"8cc6b4f942d7040e008ecf03f58b1a241800e74f",
"8cc6b4f942d7040e008ecf03f58b1a241800e74f"
] | [
"simulations/examples/lineshape.py",
"polarization.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nimport ytterbium as yb\nfrom ytterbium.Yb174 import FourLevelSystem\n\n# initialize the S-P transition in 174Yb+ as a four-level system\nFLS = FourLevelSystem(sat=0.5)\n\n# to measure the lineshape, we drive the system at different laser detunings,\n# which ar... | [
[
"numpy.sqrt",
"numpy.linspace",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
],
[
"numpy.array",
"numpy.isreal",
"numpy.power"
]
] |
L5vD5/PyElastica | [
"1fec949ff3dc292ae558cab8beebea7405f9d14b",
"1fec949ff3dc292ae558cab8beebea7405f9d14b"
] | [
"elastica/joint.py",
"examples/Visualization/AxialStretchingVisualization/axial_stretching_render.py"
] | [
"__doc__ = \"\"\" Module containing joint classes to connect multiple rods together. \"\"\"\n__all__ = [\"FreeJoint\", \"HingeJoint\", \"FixedJoint\", \"ExternalContact\", \"SelfContact\"]\nimport numpy as np\nimport numba\nfrom elastica.utils import Tolerance, MaxDimension\nfrom elastica._linalg import _batch_prod... | [
[
"numpy.dot",
"numpy.abs",
"numpy.min",
"numpy.linalg.norm",
"numpy.max",
"numpy.ceil",
"numpy.zeros_like",
"numpy.cross",
"numpy.array",
"numpy.zeros",
"numpy.empty"
],
[
"numpy.array",
"numpy.ones_like",
"scipy.interpolate.interp1d",
"numpy.linspace... |
cynerelee/SIRnet | [
"c03d7ace0c396095a32ff057b1b0e51fc8b5963b"
] | [
"Model/my_mlp.py"
] | [
"from torch import nn\r\nfrom functools import partial\r\nfrom einops.layers.torch import Rearrange, Reduce\r\nfrom torch.autograd import Variable\r\nimport torch\r\n\r\nclass PreNormResidual(nn.Module):\r\n def __init__(self, dim, fn):\r\n super().__init__()\r\n self.fn = fn\r\n self.norm =... | [
[
"torch.nn.Dropout",
"torch.nn.GELU",
"torch.randn",
"torch.nn.LayerNorm",
"torch.nn.Linear"
]
] |
Nishant-codex/rnn_flip_flops | [
"4d91315ead94b87d53d9e3e403a3ea543cb7e308"
] | [
"rate_nets/distributed_r_kim/FixedPointSearch.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n#import os\nimport sys \n\nimport os\nsys.path.insert(0,os.getcwd())\nimport absl\nfrom tensorflow.python.ops import parallel_for as pfor\nfrom FixedPointStore import *\nimport tens... | [
[
"numpy.true_divide",
"tensorflow.concat",
"tensorflow.nn.rnn_cell.LSTMStateTuple",
"tensorflow.variables_initializer",
"numpy.concatenate",
"numpy.mean",
"numpy.random.randn",
"tensorflow.train.AdamOptimizer",
"numpy.where",
"tensorflow.Variable",
"tensorflow.gradients"... |
mcx/kaolin | [
"abe006921b5d522ecd0f7c5e30abe760a4459dc7"
] | [
"kaolin/render/mesh/dibr.py"
] | [
"# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.\n# 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... | [
[
"torch.min",
"torch.max",
"torch.cat"
]
] |
tatikhonova/FEDOT.Algs | [
"aeb539f52bfbdb0ba8f4975e9ea7cb5a60859e25"
] | [
"estar/examples/ode_textbook.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Apr 21 17:36:43 2021\n\n@author: mike_ubuntu\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom collections import OrderedDict\nimport pickle\n\nimport src.globals as global_var\n\nfrom src.moeadd.moeadd import *\nfrom src.moeadd.moeadd_... | [
[
"numpy.load",
"numpy.linspace",
"numpy.ones"
]
] |
cesine/BrainHacks-mmMRI | [
"388cb978b355d5e1cd2b6e4aac99145b89f19237"
] | [
"scripts/Zscoring_masking.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Oct 25 20:34:32 2014\n\n@author: Imane\n\"\"\"\nimport numpy as np\nfrom os import listdir\nfrom os.path import isfile, join\nfrom zscoring import zscoringNII\nfrom masking import maskdata\n\n#Applying Z-score and saving in NII files\nsourcedir = 'brainimages'\nfilen... | [
[
"numpy.asarray",
"numpy.vstack"
]
] |
eamontoyaa/pybimstab | [
"7844b5d29b4bb31f4b14f11ac4de63ad06fe83e6"
] | [
"examples/figuresScripts/polygon_example1.py"
] | [
"from numpy import array\nfrom pybimstab.polygon import Polygon\ncoords = array([[0, 1, 1, 0], [0, 0, 1.5, 1.5]])\nx, y = 0.5, 2\npolygon = Polygon(coordinates=coords)\npolygon.isinside(x=x, y=y, meshgrid=False, want2plot=True)\n"
] | [
[
"numpy.array"
]
] |
ajshajib/cosmopy | [
"f56eb76e8078e917a407cad3cbe3c3641e24809f"
] | [
"test/test_angular.py"
] | [
"from astropy.cosmology import wCDM\nfrom cosmopy import Cosmology\nimport numpy as np\n\nn_sample = 300 # number of test samples\nn_dim = 4\n\ncenter = np.array([72., .5, .5, -1.5]) # H_0, omega_m, omega_v, w\nscale = np.array([8., .5, .5, 1.]) # width to uniformly distribute cosmological parameters along one dir... | [
[
"numpy.random.uniform",
"numpy.array"
]
] |
lulzsec2012/tensorflow | [
"6c22bbdda41d839cb9e1f7803533c571596ea4ee",
"d68d869e397515655e9f41570f4db463df770563"
] | [
"tensorflow/python/kernel_tests/init_ops_test.py",
"tensorflow/python/training/saver.py"
] | [
"# Copyright 2015 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... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.asarray",
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.init_ops.random_uniform_initializer",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.init_ops.orthogonal_initializer",
"tensorflow.python.ops.init_ops.co... |
WatChMaL/CNN | [
"2e14397bca6ced2fdfeab406e3c28561bb3af384"
] | [
"plot_utils/plot_utils.py"
] | [
"\"\"\"\nSource code borrowed from https://github.com/WatChMaL/UVicWorkshopPlayground/blob/master/B/notebooks/utils/utils.py\nEdited by : Abhishek .\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\nimport math\nimport os\n... | [
[
"matplotlib.pyplot.legend",
"numpy.amax",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"numpy.unique",
"numpy.arange",
"matplotlib.colors.DivergingNorm",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots_adjust",
"numpy.zeros",
"matplotlib.... |
Giuseppe5/NeMo | [
"f946aca100c9a1bf22e6bd25fba9f80299722112",
"f946aca100c9a1bf22e6bd25fba9f80299722112",
"f946aca100c9a1bf22e6bd25fba9f80299722112",
"f946aca100c9a1bf22e6bd25fba9f80299722112",
"f946aca100c9a1bf22e6bd25fba9f80299722112",
"f946aca100c9a1bf22e6bd25fba9f80299722112"
] | [
"collections/nemo_asr/nemo_asr/losses.py",
"collections/nemo_nlp/nemo_nlp/data/datasets/joint_intent_slot.py",
"collections/nemo_tts/nemo_tts/parts/waveglow.py",
"collections/nemo_tts/nemo_tts/data_layers.py",
"collections/nemo_nlp/nemo_nlp/utils/callbacks/sentence_classification.py",
"nemo/nemo/backends/... | [
"# Copyright (c) 2019 NVIDIA Corporation\nimport torch\nimport torch.nn as nn\n\nfrom nemo.backends.pytorch.nm import LossNM\nfrom nemo.core.neural_types import (NeuralType, AxisType, BatchTag, TimeTag,\n ChannelTag)\n\n\nclass CTCLossNM(LossNM):\n \"\"\"\n Neural Module wra... | [
[
"torch.mean",
"torch.nn.CTCLoss"
],
[
"numpy.array"
],
[
"torch.sigmoid",
"torch.cat",
"torch.nn.utils.weight_norm",
"torch.nn.ModuleList",
"torch.det",
"torch.nn.functional.conv1d",
"torch.IntTensor",
"torch.nn.utils.remove_weight_norm",
"torch.tanh",
"... |
ajjimeno/nn-hyperplane-bounds | [
"21d6fe255eb300113253ad3137694dedc90b0f83"
] | [
"Experiments.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\n\nfrom Losses import MultiHuberLoss\n\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nbatch_size = 32\n\ndef train(model, criteria, training_set, testing_set, optim_wd=0.0, lr=0.001, epochs=100):\n optimizer = ... | [
[
"torch.optim.lr_scheduler.StepLR",
"torch.nn.CrossEntropyLoss",
"torch.sum",
"torch.tensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.argmax"
]
] |
awesome-archive/delta | [
"a916e06f55213dcd1fea39a5950927dfed1483c7",
"a916e06f55213dcd1fea39a5950927dfed1483c7",
"841d853cf0bdb479260be112432813dcb705f859",
"841d853cf0bdb479260be112432813dcb705f859",
"841d853cf0bdb479260be112432813dcb705f859",
"841d853cf0bdb479260be112432813dcb705f859"
] | [
"delta/utils/misc_test.py",
"delta/layers/ops/kernels/simple_vocab_op_test.py",
"delta/data/task/text_seq_label_task_test.py",
"delta/utils/solver/asr_solver.py",
"delta/data/task/text_cls_task.py",
"delta/utils/solver/raw_pretrain_seq_label_solver.py"
] | [
"# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.\n# 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.o... | [
[
"tensorflow.TensorShape",
"numpy.array",
"tensorflow.test.main",
"numpy.ones"
],
[
"tensorflow.test.main"
],
[
"numpy.shape",
"tensorflow.test.main"
],
[
"tensorflow.device",
"tensorflow.keras.utils.multi_gpu_model",
"tensorflow.reduce_mean",
"tensorflow.ker... |
syushinski/ra-accuracy-research | [
"b9114b610e38959b261275c7b67d3973645e5c47"
] | [
"python/dtextract/data/data.py"
] | [
"# Copyright 2015-2016 Stanford University\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 la... | [
[
"numpy.array",
"pandas.read_csv",
"pandas.get_dummies"
]
] |
BurntSushi/clam | [
"e374c08d016018d6be4d2fc4e8b0999b52f82929"
] | [
"pyclam/tests/test_manifold.py"
] | [
"import random\nimport unittest\nfrom tempfile import TemporaryFile\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\n\nfrom pyclam import datasets, criterion\nfrom pyclam.manifold import Manifold, Cluster\n\nnp.random.seed(42)\nrandom.seed(42)\n\n\nclass TestManifold(unittest.TestCase):\n @classm... | [
[
"numpy.asarray",
"numpy.random.seed"
]
] |
BecauseWeCanStudios/LEGOVNO | [
"97654da906e5d8ee999fea6dbc062914cc5710b2"
] | [
"source/utils/apply_backgrounds.py"
] | [
"#!/usr/bin/python\nimport os\nimport glob\nimport utils\nimport random\nimport argparse\nimport platform\nimport threading\nimport numpy as np\nfrom PIL import Image\nfrom tqdm import tqdm\nfrom math import ceil\nfrom itertools import chain\n\ndef apply_background(back, img, path):\n\tback.paste(img, (0, 0), img)\... | [
[
"numpy.array",
"numpy.random.randint"
]
] |
leopauly/Observation-Learning-Simulations | [
"462c04a87c45aae51537b8ea5b44646afa31d3a5",
"462c04a87c45aae51537b8ea5b44646afa31d3a5",
"462c04a87c45aae51537b8ea5b44646afa31d3a5",
"462c04a87c45aae51537b8ea5b44646afa31d3a5",
"462c04a87c45aae51537b8ea5b44646afa31d3a5",
"462c04a87c45aae51537b8ea5b44646afa31d3a5",
"462c04a87c45aae51537b8ea5b44646afa31d3a... | [
"sandbox/bradly/third_person/algos/trainer.py",
"sandbox/bradly/third_person/launchers/cyberpunk_aws_gail.py",
"rllab/envs/mujoco/mujoco_env.py",
"S2l/Thesis_Ch4/Results/Task1/V/runtime_data/correlation_metric_val_graph.py",
"S2l/Thesis_Ch3/Exp2_push3dof/push3dof_train_ddpg_new1.py",
"S2l/Initial works/Ex... | [
"from rllab.core.serializable import Serializable\nfrom rllab.misc import logger\nimport numpy as np\nimport tensorflow as tf\nimport pyprind\nfrom rllab.sampler.utils import rollout\nfrom sandbox.rocky.analogy.policies.apply_demo_policy import ApplyDemoPolicy\nfrom sandbox.rocky.analogy.dataset import SupervisedDa... | [
[
"numpy.random.get_state",
"numpy.random.seed",
"numpy.min",
"numpy.asarray",
"tensorflow.assign",
"tensorflow.placeholder",
"numpy.max",
"tensorflow.initialize_all_variables",
"numpy.random.set_state",
"numpy.mean",
"numpy.iinfo",
"tensorflow.train.AdamOptimizer",
... |
LouisLesueur/gods | [
"9522b6fc43851be062e2f9be84fa12cb8d74ccbb"
] | [
"python/generate.py"
] | [
"import pygraphviz as pgv\nimport numpy as np\n\n\nclass Person:\n\tdef __init__(self, name,id,origin=0):\n\t\tself.name = name\n\t\tself.id = id\n\t\tself.origin=origin\n\t\tself.specs=[]\n\n\tdef to_js(self):\n\n\t\tspecs_js = \"\"\n\t\tfor spec in self.specs:\n\t\t\tspecs_js += spec + ', '\n\n\t\treturn \" { ... | [
[
"numpy.loadtxt"
]
] |
kimjaed/simpeg | [
"b8d716f86a4ea07ba3085fabb24c2bc974788040",
"b8d716f86a4ea07ba3085fabb24c2bc974788040",
"b8d716f86a4ea07ba3085fabb24c2bc974788040",
"b8d716f86a4ea07ba3085fabb24c2bc974788040"
] | [
"examples/02-mesh/plot_quadtree_facediv.py",
"tests/base/test_directives.py",
"tests/em/fdem/inverse/derivs/test_FDEM_derivs.py",
"tests/em/tdem/test_TDEM_inductive_permeable.py"
] | [
"\"\"\"\nMesh: QuadTree: FaceDiv\n=======================\n\nShowing the face divergence on the quadtree with numbering.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom SimPEG import Mesh\n\n\ndef run(plotIt=True, n=60):\n\n M = Mesh.TreeMesh([[(1, 16)], [(1, 16)]], levels=4)\n\n M.insert_c... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
],
[
"numpy.sum",
"numpy.zeros",
"numpy.random.rand",
"numpy.vstack"
],
[
"numpy.log",
"numpy.random.randn",
"numpy.ones"
],
[
"matplotlib.pyplot.tight_layout",
"numpy.absolute",
"matplotlib.colors.L... |
twn29004/OpenPCDet | [
"3457cc30b21d882a1376ef272fbaa49755c72a2e",
"3457cc30b21d882a1376ef272fbaa49755c72a2e",
"3457cc30b21d882a1376ef272fbaa49755c72a2e"
] | [
"pcdet/datasets/kitti/kitti_object_eval_python/kitti_common.py",
"pcdet/models/detectors/second_net_iou.py",
"pcdet/datasets/kitti/kitti_object_eval_python/eval.py"
] | [
"import concurrent.futures as futures\r\nimport os\r\nimport pathlib\r\nimport re\r\nfrom collections import OrderedDict\r\n\r\nimport numpy as np\r\nfrom skimage import io\r\n\r\n\r\ndef get_image_index_str(img_idx):\r\n return \"{:06d}\".format(img_idx)\r\n\r\n\r\ndef get_kitti_info_path(idx,\r\n ... | [
[
"numpy.logical_not",
"numpy.logical_xor",
"numpy.split",
"numpy.expand_dims",
"numpy.amax",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
],
[
"torch.sigmoid",
"torch.unique",
"torch.max",
"torch.zeros"
],
[
"numpy.linspace",
"numpy.cos",
"nump... |
attawesome/Computer-Vision-with-OpenCV | [
"1198bfee8683f6b5c415e07e085fa528e00ecd0a"
] | [
"solutions/canny_license_plate.py"
] | [
"import cv2\nimport matplotlib.pyplot as plt\n\nimage = cv2.imread('../img/license_plate.png')\n\ngray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\nblurred = cv2.GaussianBlur(gray, (3, 3), 0)\n\n# compute a \"wide\", \"mid-range\", and \"tight\" threshold for the edges\nwide = cv2.Canny(blurred, 10, 200)\nmid = cv2.C... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
caniko/tridesclous | [
"9f412a42697561e3c7d8e3a35249cd13240239a0"
] | [
"tridesclous/peeler_engine_geometry.py"
] | [
"\"\"\"\nHere implementation that tale in account the geometry\nof the probe to speed up template matching.\n\n\"\"\"\n\nimport time\nimport numpy as np\nimport joblib\nfrom concurrent.futures import ThreadPoolExecutor\nimport itertools\n\n\n\nfrom .peeler_engine_base import PeelerEngineGeneric\n\nfrom .peeler_tool... | [
[
"numpy.abs",
"numpy.nonzero",
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.argmin",
"numpy.argsort",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.sum"
]
] |
reichang182/Transformer | [
"6f90c29eaaba898919b7689ab7e2cfce1604cdb8",
"6f90c29eaaba898919b7689ab7e2cfce1604cdb8"
] | [
"src/transformers/models/roberta/modeling_roberta.py",
"src/transformers/models/rag/modeling_rag.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.zeros",
"torch.cat",
"torch.einsum",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.matmul",
"torch.tanh",
"torch.tensor",
"... |
tum-ei-eda/transform_allocs_static | [
"9639eb5178e8135086511f5f1759b2a996c0236b"
] | [
"python/offseter.py"
] | [
"#!/home/osm/Documents/EI-EDA/ml_on_mcu/venv/bin/python3.7 \n#Change the venv path above.\n\n# Add offset to a given datasheet.\n# Two methods : \n# - Give offset for every ID (every malloc call) --> MORE Memory\n# - Give offset for every pointer (every container) -->Less Memory.\n# Datasheet format:\n# ID2.0|S... | [
[
"pandas.read_excel"
]
] |
yangheng95/LCF-ABSA | [
"0eeb4788269a498d34c2aff942e03af78026617e",
"0eeb4788269a498d34c2aff942e03af78026617e",
"0eeb4788269a498d34c2aff942e03af78026617e"
] | [
"pyabsa/core/tc/prediction/text_classifier.py",
"pyabsa/core/atepc/training/atepc_trainer.py",
"pyabsa/core/apc/classic/__glove__/models/asgcn.py"
] | [
"# -*- coding: utf-8 -*-\r\n# file: text_classifier.py\r\n# author: yangheng <yangheng@m.scnu.edu.cn>\r\n# Copyright (C) 2020. All Rights Reserved.\r\nimport json\r\nimport os\r\nimport pickle\r\nimport random\r\n\r\nimport autocuda\r\nimport numpy\r\nimport torch\r\nimport tqdm\r\nfrom findfile import find_file\r\... | [
[
"torch.softmax",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.no_grad"
],
[
"torch.nn.parallel.DataParallel",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.cat",
... |
ahmedjawedaj/jax | [
"f7009ed1072bf48ea6ba9d6d2ce573ce0ce13377"
] | [
"jax/interpreters/xla.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.take",
"numpy.get_printoptions",
"numpy.asarray",
"numpy.dtype",
"numpy.array2string",
"numpy.array",
"numpy.zeros"
]
] |
godisreal/CrowdEgress | [
"4e284f0108e9a6ed09c07d8738fb17421b82039b"
] | [
"code/code_version1.0/agent_model_obst3.py"
] | [
"# -*-coding:utf-8-*-\n# Author: WP\n# Email: wp2204@gmail.com\n\n\nimport numpy as np\nfrom math_func import *\nfrom math import *\nimport random\n#from stack import *\n\nclass Pedestrian(object):\n def __init__(self, x=1, y=1):\n # random initialize a agent\n #self.memory = np.array([0.0, 0.0], [... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.argmin",
"numpy.array",
"numpy.exp",
"numpy.zeros"
]
] |
ddebby/AI-Lab | [
"247f5ed0d93955e061e65d06f48cf9c7afc6b4a8"
] | [
"0.Demo/2.object_detection_by_tensorflow/9.libs/predict-5classes.py"
] | [
"# USAGE\n# python predict.py --model lisa/experiments/exported_model/frozen_inference_graph.pb \\\n# \t--image lisa/vid8/frameAnnotations-MVI_0120.MOV_annotations/stop_1324866406.avi_image4.png \\\n\n# import the necessary packages\n#from object_detection.utils import label_map_util\nimport tensorflow as tf\nimpor... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"numpy.expand_dims",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.Session",
"tensorflow.GraphDef"
]
] |
CONDUITlab/CCDEF | [
"b0ec05870d0d75afe69e551ff8ad4521050577a0"
] | [
"ccdef/convert/wfdb_clinical_sql.py"
] | [
"\"\"\"\nConvert MIMIC III data to CCDEF (hdf5 based)\n\"\"\"\nimport numpy as np\nimport pandas as pd\nimport psycopg2 \n#import sqlite3\nimport h5py\nimport json\nimport wfdb\nfrom ccdef._utils import df_to_sarray\n\ndef open_db():\n schema = 'mimiciii'\n con = psycopg2.connect(dbname='mimic', user='queryus... | [
[
"pandas.read_sql_query",
"pandas.merge",
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.DataFrame.from_dict",
"pandas.to_timedelta"
]
] |
pandafengye/OutbreakPAD | [
"742f5ac71919c9a529d9ff12f55074d15e8db9a6"
] | [
"build/lib/OutbreakPAD/Prediction/GRNN_Predict_Model.py"
] | [
"from neupy import algorithms\r\nimport numpy as np\r\nfrom sklearn import datasets, preprocessing\r\nfrom sklearn.model_selection import train_test_split\r\n\r\ndef GRNN_Predict_Model(X,Y,std=0.02):\r\n scaler = preprocessing.MinMaxScaler()\r\n arima_values=scaler.fit_transform(X)\r\n origin_values=scaler... | [
[
"numpy.isnan",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MinMaxScaler"
]
] |
maguileracanon/gcn | [
"b6578fa62315bfe02b4f829d44a853ca156588ab"
] | [
"gcn/GCNLayer.py"
] | [
"\"\"\"Linear module.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\n# from __future__ import google_type_annotations\nfrom __future__ import print_function\nimport numpy as np\n\nimport sonnet as snt\nimport tensorflow as tf\n\n\ndef glorot(shape, name=None):\n \"\"\"Glorot & ... | [
[
"tensorflow.nn.relu",
"tensorflow.matmul",
"numpy.sqrt",
"tensorflow.Variable",
"tensorflow.zeros",
"tensorflow.random.uniform",
"tensorflow.sparse.sparse_dense_matmul",
"tensorflow.nn.dropout"
]
] |
GittiHab/mbrl-thesis-code | [
"10ecd6ef7cbb2df4bd03ce9928e344eab4238a2e"
] | [
"algos/PlaNet/reward_space.py"
] | [
"import abc\nfrom copy import deepcopy\nfrom typing import Optional\n\nfrom torch.nn import functional as F\nfrom torch.nn.utils import clip_grad_norm_\nfrom models.models import bottle\nimport torch\nfrom stable_baselines3.common.torch_layers import MlpExtractor\nfrom exploration.base import Explorer\nfrom utils i... | [
[
"torch.optim.lr_scheduler.CyclicLR",
"torch.cat",
"torch.nn.Linear",
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.optim.lr_scheduler.StepLR"
]
] |
Zhaoyi-Yan/PFDNet | [
"86798fbc4fadc673e7912c08492ea3611bc20154",
"86798fbc4fadc673e7912c08492ea3611bc20154"
] | [
"metrics.py",
"net/CSRNet.py"
] | [
"import torch\nimport torch.nn as nn\nimport sys\nfrom functools import reduce\n\nclass JointLoss(nn.Module):\n def __init__(self, alpha, beta):\n super(JointLoss, self).__init__()\n self.MSELoss = nn.MSELoss(size_average=False)\n self.BCELoss = nn.BCELoss(size_average=True)\n self.al... | [
[
"torch.sum",
"torch.nn.MSELoss",
"torch.nn.BCELoss"
],
[
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.init.normal_",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
ChyiYaqing/chyidlTutorial | [
"77e7f6f84f21537a58a8a8a42e31cf2e3dd31996"
] | [
"root/os/DSAA/DataStructuresAndAlgorithms/python/sort_insert_array_implement.py"
] | [
"#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# sort_insert_array_implement.py\n# python\n#\n# 🎂\"Here's to the crazy ones. The misfits. The rebels.\n# The troublemakers. The round pegs in the square holes.\n# The ones who see things differently. They're not found\n# of rules. And they have no respect for ... | [
[
"numpy.random.randint"
]
] |
gabiherman/datman | [
"dcbca4981ff7bb1be536d6c62c3b27786cabdef9"
] | [
"bin/dm_header_checks.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nUsage:\n dm_header_checks.py [options] [--ignore=<STR>]... <series> <standard>\n\nArguments:\n <series> Full path to the series JSON file being examined\n <standard> Full path to the standards JSON file to compare\n agai... | [
[
"numpy.isclose"
]
] |
jaesik817/svpg_tensorflow | [
"ef8323af45bcb4f7c06588b4ee4ac8ec478b6027"
] | [
"svpg_cont_action/tmp.py"
] | [
"import gym\nimport itertools\nimport matplotlib\nimport numpy as np\nimport sys\nimport tensorflow as tf\nimport collections\n\nimport sklearn.pipeline\nimport sklearn.preprocessing\n\nfrom sklearn.kernel_approximation import RBFSampler\n\nfrom svpg import SVPG\n\n###################\n# parameters\n###############... | [
[
"numpy.mean",
"tensorflow.train.AdamOptimizer",
"tensorflow.Variable",
"numpy.reshape",
"tensorflow.layers.dense",
"tensorflow.subtract",
"tensorflow.reset_default_graph",
"tensorflow.contrib.distributions.Normal",
"tensorflow.Session",
"tensorflow.random_normal_initializer... |
spowlas/sarpy | [
"c4a404203607d404b93a556459aa5311d7148e95",
"c4a404203607d404b93a556459aa5311d7148e95"
] | [
"sarpy/geometry/point_projection.py",
"sarpy/deprecated/io/DEM/DEM.py"
] | [
"\"\"\"\nFunctions to map between the coordinates in image pixel space and geographical coordinates.\n\"\"\"\n\nimport logging\nfrom typing import Tuple\nfrom types import MethodType # for binding a method dynamically to a class\n\nimport numpy\n\nfrom . import geocoords\nfrom ..io.complex.sicd_elements.blocks imp... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.linspace",
"numpy.rad2deg",
"numpy.all",
"numpy.max",
"numpy.argmin",
"numpy.any",
"numpy.cross",
"numpy.reshape",
"numpy.arange",
"numpy.multiply.outer",
"numpy.sin",
"numpy.argmax",
"numpy.outer",
"numpy.zeros",
... |
uguisu/tensorflow_without_keras | [
"fe03b4febf2267921207ef3321926d14f5672bc3"
] | [
"src/Chapter_001/003_function_001.py"
] | [
"# coding=utf-8\n# author uguisu\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.framework.errors_impl import InvalidArgumentError\n\n\ndef matrix_001():\n\n print('\\n- 矩阵转置 ------------------------')\n # 矩阵转置\n np_array = np.array([[1., 2., 3.], [4., 5., 6.]])\n tensor_a = tf.cons... | [
[
"tensorflow.transpose",
"tensorflow.constant",
"tensorflow.range",
"tensorflow.less",
"tensorflow.greater",
"tensorflow.squeeze",
"numpy.array"
]
] |
ardihikaru/mlsp | [
"db38972bcceac7b95808132457c4de9170546c9d",
"db38972bcceac7b95808132457c4de9170546c9d"
] | [
"hw1/others/coba.py",
"hw5/libs/common/dataset.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n# target = 100\nsize = 20\n# alpha = 1\n# beta = 1.0/target\nlam = 0.2\n# target = 0.5\n# target = 2.5*lam #\nbeta = 1 / lam # beta = 1 / lambda\n\n\nY = np.random.exponential(beta, size)\n\n# plt.plot(x, Y, 'b-')\n# plt.plot(x[:size], Y, 'r.')\n# # plt.plot(x... | [
[
"numpy.random.exponential",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist"
],
[
"numpy.reshape"
]
] |
TangYuan-Liu/mindspore | [
"fb8fd3338605bb34fa5cea054e535a8b1d753fab",
"fb8fd3338605bb34fa5cea054e535a8b1d753fab"
] | [
"mindspore/python/mindspore/ops/composite/math_ops.py",
"mindspore/python/mindspore/dataset/text/utils.py"
] | [
"# Copyright 2020 Huawei Technologies Co., Ltd\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 l... | [
[
"numpy.prod"
],
[
"numpy.char.encode",
"numpy.char.decode"
]
] |
MarcoGorelli/precise | [
"227d017d45f1c4b39887a85133f3d62950a1e341",
"227d017d45f1c4b39887a85133f3d62950a1e341",
"227d017d45f1c4b39887a85133f3d62950a1e341"
] | [
"tests/portfolio/test_parity.py",
"precise/skaters/location/empirical.py",
"precise/skaters/portfoliostatic/ppoportfactory.py"
] | [
"\nfrom precise.skaters.covarianceutil.covrandom import random_band_cov\nfrom precise.skaters.portfoliostatic.hrpport import hrp_unit_unit_s5_port\nimport numpy as np\n\n\ndef test_parity():\n cov = random_band_cov()\n print(np.shape(cov))\n w = hrp_unit_unit_s5_port(cov=cov)\n print(sum(w))",
"from p... | [
[
"numpy.shape"
],
[
"numpy.array",
"numpy.zeros_like"
],
[
"numpy.copy",
"numpy.shape"
]
] |
piiswrong/caffe | [
"d8f676d85eb9b84221c74d0efc5ed0b34d78d3ac"
] | [
"python/caffe_util/imshow_layer.py"
] | [
"import cv2\nimport cv\nimport caffe\nimport numpy as np\nimport ast\nimport datetime\nimport time\n\nclass ImshowLayer(caffe.Layer):\n def setup(self, bottom, top):\n assert len(top) == 0, 'ImshowLayer has no output.'\n self.param_ = ast.literal_eval(self.param_str)\n if 'resize' not in sel... | [
[
"numpy.zeros",
"numpy.tile"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.