repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
7568/simple-faster-rcnn-pytorch | [
"19bae34ab09c9d6f576fa5ded045258d7d4d34e7"
] | [
"model/faster_rcnn_vgg16.py"
] | [
"from __future__ import absolute_import\nimport torch as t\nfrom torch import nn\nfrom torchvision.models import vgg16\nfrom torchvision.ops import RoIPool\n\nfrom model.region_proposal_network import RegionProposalNetwork\nfrom model.faster_rcnn import FasterRCNN\nfrom utils import array_tool as at\nfrom utils.co... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.nn.Linear",
"torch.load"
]
] |
disi-unibo-nlu/qagnn | [
"85b9cfd8f4094a6e1501ffcd8d0fdae6c7b29a7a"
] | [
"utils_biomed/compute_kg_entity_embeddings.py"
] | [
"\"\"\"\nPre-compute the embedding for each entity within the biomedical KG\nusing the specified language model.\n\"\"\"\n\nimport torch\nfrom transformers import AutoTokenizer, AutoModel, AutoConfig\nfrom tqdm import tqdm\nimport numpy as np\nimport os\nimport sys\n\nrepo_root = \"..\"\n\n# Directory where storing... | [
[
"numpy.concatenate",
"torch.device",
"torch.no_grad",
"numpy.save"
]
] |
MalcerOne/aps2MecSol | [
"91d204b1911231525db573cba9a92b41d44bc2a6"
] | [
"main.py"
] | [
"import numpy as np\nfrom funcoesTermosol import *\n\ndef main():\n [nn, N, nm, Inc, nc, F, nr, R] = importa('entrada-grupo1.xlsx')\n\n plota(N, Inc)\n\n E = Inc[0, 2]\n A = Inc[0, 3]\n \n # Definir a matriz de conectividade\n C = []\n \n for i in range(nm):\n C_i = nn*[0]\n\n ... | [
[
"numpy.array",
"numpy.diagflat",
"numpy.linalg.norm",
"numpy.matmul",
"numpy.zeros",
"numpy.transpose",
"numpy.linalg.solve",
"numpy.diag",
"numpy.kron"
]
] |
praneethy91/mlcv | [
"4221d1e8d2882cb621c0f7100e32543cedee7836"
] | [
"Localization/train.py"
] | [
"import keras\nfrom keras.applications.imagenet_utils import preprocess_input\nfrom keras.backend.tensorflow_backend import set_session\nfrom keras.models import Model\nfrom keras.preprocessing import image\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\nfrom random import shuffle\nfrom scipy.m... | [
[
"numpy.array",
"numpy.set_printoptions",
"numpy.linspace",
"scipy.misc.imread",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.imshow"
]
] |
merijn/omuse | [
"696936c211b64c3d5c10674782f9f5ba01cdcfe3"
] | [
"src/omuse/community/qgmodel/run_qgmodel.py"
] | [
"import numpy\n\nfrom os import path\n \n#try:\n#from amuse.community.qgmodel.interface import QGmodel,QGmodelInterface\n#except ImportError as ex:\nfrom interface import QGmodel,QGmodelInterface\n\nfrom amuse.units import units\n\nfrom matplotlib import pyplot\n\n\ndef low_level():\n\n q=QGmodelInterface(redirect... | [
[
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
VUB-HYDR/polygon_to_cellareafraction | [
"14d8971651bf9c1d27a9b7e4d667d1ec80519233"
] | [
"functions_cellareafraction.py"
] | [
"\"\"\"\nAuthor : Inne Vanderkelen (inne.vanderkelen@vub.be)\nInstitution : Vrije Universiteit Brussel (VUB)\nDate : June 2019\n\nThis script contains the necessary functions to convert a shape file into a raster with the area fraction of the shapefile for each raster gridcell\nThe scripts operates on g... | [
[
"numpy.arange",
"pandas.concat"
]
] |
danilw/shadertoy-render-buffers-fbo | [
"7fd5e04e114dbab0ef85bb6dc59f52e476e6c8a0"
] | [
"shadertoy-render.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015, Alex J. Champandard\n# Copyright (c) 2015, Jasmin Patry\n# Copyright (c) 2015, Vispy Development Team.\n# Distributed under the (new) BSD License.\n\n# modified, 2018, Danil\n\nfrom __future__ import unicode_literals, print_function\n\nimport argp... | [
[
"numpy.random.randint",
"numpy.zeros"
]
] |
viniciusdsmello/pt-autoencoders | [
"c06a12cdf71ef9301543c07c7af96d9740e264b8"
] | [
"autoencoders/sdae/model.py"
] | [
"from typing import Any, Callable, Optional\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom tqdm import tqdm\n\nfrom autoencoders.dae import DenoisingAutoencoder\nfrom autoencoders.sdae import StackedDenoisingAutoEncoder\n\n\ndef tr... | [
[
"torch.cat",
"torch.nn.Dropout",
"torch.nn.MSELoss",
"torch.nn.functional.dropout",
"torch.nn.ReLU",
"torch.utils.data.DataLoader"
]
] |
kensukename2/Naito_Parker_ESPL2020 | [
"c7f5606e37ba0a7df4e8f1e9f1f7494c4d76ed5f"
] | [
"models/_4regime_analysis/_main_script_4regimes.py"
] | [
"'''\r\nMinnestota River, Jordan, MN application\r\n4-regime analysis (1: 1935-1954, 2: 1955-1974, 3: 1975-1994, 4: 1995-2014)\r\nMain script\r\n\r\nScript by Kensuke Naito\r\n'''\r\n\r\n\r\n# Import libraries #########################################\r\n############################################################\... | [
[
"numpy.histogram",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.sort",
"numpy.linspace"
]
] |
koso019003/Mask_RCNN | [
"6ef650b5c97c0ea6a6b119b26ebc8273628a02f2"
] | [
"mrcnn/sub_moduls/Detection_Target_Layer.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.layers import Layer as KELayer\n\nfrom Mask_RCNN.mrcnn import utils\nfrom .Miscellenous_Graph import trim_zeros_graph\n\n\n############################################################\n# Detection Target Layer\n########################################################... | [
[
"tensorflow.control_dependencies",
"tensorflow.random.shuffle",
"tensorflow.identity",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.argmax",
"tensorflow.transpose",
"tensorflow.constant",
"tensorflow.squeeze",
"tensorflow.split",
"tensorfl... |
GOAL-Robots/CNRUPD_010618_sensorimotorcontingencies | [
"b2645fa56b3e552e3e59cdc2d71dfe129297e24c"
] | [
"simulation/src/model/Simulator.py"
] | [
"#!/usr/bin/env python\n##\n## Copyright (c) 2018 Francesco Mannella. \n## \n## This file is part of sensorimotor-contingencies\n## (see https://github.com/GOAL-Robots/CNRUPD_010618_sensorimotorcontingencies).\n## \n## Permission is hereby granted, free of charge, to any person obtaining a copy\n## of this software... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.sign",
"numpy.all",
"numpy.hstack",
"numpy.linspace",
"numpy.vstack",
"numpy.floor"
]
] |
KirillVladimirov/pytorch-lifestream | [
"83005b950d41de8afc11711fc955ffafb5ff7a9e"
] | [
"tests/dltranz_tests/metric_learning_tests/test_metrics.py"
] | [
"import math\nimport torch\n\nfrom dltranz.metric_learn.metric import outer_cosine_similarity, outer_pairwise_distance, metric_Recall_top_K, \\\n BatchRecallTopPL\n\n\ndef test_outer_cosine_similarity1():\n x = torch.eye(10, dtype=torch.float32)\n\n dists = outer_cosine_similarity(x, x)\n true_dists = t... | [
[
"torch.arange",
"torch.allclose",
"torch.eye",
"torch.tensor"
]
] |
wanzysky/evidential-deep-learning | [
"71ebd59ab3a4b66c38d919e8aa9ad3711a416796"
] | [
"torch_hello_world.py"
] | [
"from tqdm import tqdm\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch.utils.data.dataset import TensorDataset\nfrom torch.utils.data.dataloader import DataLoader\n\n\nclass LinearNormalGamma(nn.Module):\n def __init__(self, in... | [
[
"torch.nn.Linear",
"numpy.ones_like",
"numpy.minimum",
"torch.exp",
"numpy.random.normal",
"numpy.zeros_like",
"matplotlib.pyplot.fill_between",
"numpy.sqrt",
"matplotlib.pyplot.gca",
"numpy.expand_dims",
"torch.nn.functional.l1_loss",
"matplotlib.pyplot.figure",
... |
kkaatttiechang/MitoEM2021-Challenge | [
"73f6d40d503d108e36a37149579e0173182e01cc"
] | [
"connectomics/data/augmentation/mixup.py"
] | [
"import random\r\nimport numpy as np\r\nfrom numpy.core.numeric import indices\r\nimport torch\r\nfrom itertools import combinations\r\n\r\nclass MixupAugmentor(object):\r\n \"\"\"Mixup augmentor (experimental). \r\n\r\n The input can be a `numpy.ndarray` or `torch.Tensor` of shape :math:`(B, C, Z, Y, X)`.\r\... | [
[
"numpy.ones",
"torch.ones"
]
] |
dwayne45/mediapipe | [
"731d2b95363d58f12acb29a6f8435ec33fe548d9"
] | [
"mediapipe/examples/desktop/media_sequence/demo_dataset.py"
] | [
"# Copyright 2019 The MediaPipe 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 la... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.contrib.data.parallel_interleave",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.exists",
"tensorflow.io.parse_single_sequence_example",
"tensorflow.io.TFRecordWriter",
"tensorflow.train.SequenceExample"
]
] |
spatric5/robosuite | [
"9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6"
] | [
"robosuite/environments/manipulation/nut_assembly.py"
] | [
"from collections import OrderedDict\nimport random\nimport numpy as np\n\nimport robosuite.utils.transform_utils as T\nfrom robosuite.environments.manipulation.single_arm_env import SingleArmEnv\n\nfrom robosuite.models.arenas import PegsArena\nfrom robosuite.models.objects import SquareNutObject, RoundNutObject\n... | [
[
"numpy.max",
"numpy.array",
"numpy.linalg.norm",
"numpy.argmin",
"numpy.zeros",
"numpy.sum",
"numpy.eye",
"numpy.tanh",
"numpy.maximum"
]
] |
hadifar/tensorflow-starter | [
"187b6956e3a0cc45a065e753240eced93bc4c592"
] | [
"lesson6/word2vec_utils.py"
] | [
"import os\nimport random\nimport sys\nfrom collections import Counter\n\nfrom helper.utils import download_one_file, safe_mkdir\n\nsys.path.append('..')\n\nimport zipfile\n\nimport numpy as np\nimport tensorflow as tf\n\n\ndef read_data(file_path):\n \"\"\" Read data into a list of tokens \n There should be ... | [
[
"numpy.zeros"
]
] |
malte-storm/Savu | [
"16291e8a22464c50c511af01fbc648860c1236e6"
] | [
"savu/plugins/segmentation/i23segmentation/final_segment_i23.py"
] | [
"# Copyright 2019 Diamond Light Source 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 ... | [
[
"numpy.where"
]
] |
SamuelJoutard/Permutohedral_attention_module | [
"c86b8108fbfcf73ce300197e57cccbdfa25386ff"
] | [
"PAM_cuda/pl.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch\nimport HT_opp\nimport numpy as np\n\ndef _simple_hash(key, hash_vector, table_size):\n res = (key*hash_vector).sum(dim=1)\n return (res%table_size).type(torch.cuda.IntTensor)\n\nclass PermutohedralLattice(torch... | [
[
"torch.round",
"torch.cat",
"numpy.random.rand",
"torch.stack",
"torch.cuda.FloatTensor",
"torch.sum",
"torch.gather",
"torch.FloatTensor",
"torch.argsort",
"numpy.sqrt",
"torch.index_select",
"numpy.expand_dims",
"torch.zeros",
"numpy.zeros",
"torch.cud... |
Code4SA/umibukela | [
"937d49d86c3aabde923775682d6fb39f521d0e4d"
] | [
"umibukela/views.py"
] | [
"from collections import Counter\nfrom datetime import datetime\nfrom django.conf import settings\nfrom django.core.urlresolvers import reverse\nfrom django.db.models import Count\nfrom django.http import HttpResponse, Http404, JsonResponse\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import... | [
[
"pandas.DataFrame"
]
] |
RickyWang1020/Reinjection_Analysis | [
"9a3c1126990db48cc65d4efacd1ad62011e94b56"
] | [
"data_operation.py"
] | [
"\"\"\"\r\nFunction: process raw data excel (original and Reinjection data), generate aligned pandas dataframes, perform mean and standard deviation operation on Reinjection data, and can filter out potential problematic data (those with large std)\r\nAuthor: Xinran Wang\r\nDate: 09/02/2020\r\n\"\"\"\r\n\r\n# sugge... | [
[
"pandas.merge",
"pandas.set_option",
"pandas.DataFrame",
"pandas.read_excel",
"pandas.concat"
]
] |
jpmarques19/tensorflwo-test | [
"0ff8b06e0415075c7269820d080284a42595bb2e",
"0ff8b06e0415075c7269820d080284a42595bb2e"
] | [
"reinforcement_learning/common/sagemaker_rl/coach_launcher.py",
"sagemaker-python-sdk/chainer_sentiment_analysis/src/sentiment_analysis.py"
] | [
"from rl_coach.agents.clipped_ppo_agent import ClippedPPOAgentParameters\nfrom rl_coach.agents.policy_gradients_agent import PolicyGradientsAgentParameters\nfrom rl_coach.graph_managers.basic_rl_graph_manager import BasicRLGraphManager\nfrom rl_coach.graph_managers.graph_manager import ScheduleParameters\nfrom rl_c... | [
[
"tensorflow.saved_model.simple_save",
"tensorflow.get_default_graph",
"tensorflow.ConfigProto",
"tensorflow.train.init_from_checkpoint",
"tensorflow.global_variables_initializer"
],
[
"numpy.array",
"numpy.load",
"numpy.save"
]
] |
emorynlp/nlp4p | [
"78c00ec098d7626fd29ca49a9aef28950fabfed9"
] | [
"elit/tests/scripts/debug_mst.py"
] | [
"# -*- coding:utf-8 -*-\n# Author: hankcs\n# Date: 2019-10-05 22:10\nimport heapq\nimport pickle\nimport numpy as np\n\n\ndef arc_mst(parse_probs, length, tokens_to_keep, want_max=True):\n # block and pad heads\n parse_probs[0] = 1. / length\n np.fill_diagonal(parse_probs, 0)\n parse_probs = parse_probs... | [
[
"numpy.fill_diagonal",
"numpy.log"
]
] |
RajatBhageria/Reinforcement-Learning | [
"5b49b697345257d9346dc699663265fdb1401c33"
] | [
"acrobat.py"
] | [
"import gym\nimport numpy as np\nfrom maze import *\nfrom matplotlib import pyplot as plt\nfrom evaluationREINFORCE import *\nfrom evaluationAcrobat import *\n\nenv = gym.make(\"Acrobot-v1\")\nobservation = env.reset()\n\n#get the actionsSpace\nactionSpace = env.action_space\nnumActions = 3\nactions = np.linspace(0... | [
[
"numpy.dot",
"numpy.random.rand",
"numpy.random.choice",
"numpy.zeros",
"numpy.sum",
"numpy.exp",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.digitize",
"matplotlib.pyplot.show",
"numpy.argmax",
"numpy.random.random",
"numpy.linspace"
]
] |
shobhit009/Machine_Learning_Projects | [
"8be7bbd6d918b91f440074ccf76bc464d3db91dd"
] | [
"Regressions/AirBnB Price prediction/data_load_files.py"
] | [
"import pandas as pd\n\n# TASK 1\nTASK_1_OUTPUT = pd.read_csv('data/TASK_1_OUTPUT.csv')\n\n# TASK 2\nTASK_2_PART_1_OUTPUT = pd.read_csv('data/TASK_2_PART_1_OUTPUT.csv', parse_dates=[9])\nTASK_2_PART_2_T10_OUTPUT = pd.read_csv('data/TASK_2_PART_2_T10_OUTPUT.csv', index_col=0, header=None, squeeze=True)\nTASK_2_PART_... | [
[
"pandas.read_csv"
]
] |
vanderveld/tonks | [
"e87afbd9614b276b443b4a7527fd1fda01a8be4c"
] | [
"tests/test_multi_task_ensemble.py"
] | [
"import copy\nfrom pathlib import Path\nimport shutil\nimport tempfile\n\nimport torch\n\nfrom tonks.ensemble.models import BertResnetEnsembleForMultiTaskClassification\n\n\ndef test_exporting_and_loading_works_correctly():\n image_task_dict = {\n 'task1_task2': {\n 'fake_attribute1': 10,\n ... | [
[
"torch.equal",
"torch.load"
]
] |
DraganaMana/mne_microstates | [
"de3dc76e63e49fb4b61810bf737d4d5d11f5b2f0"
] | [
"example_epochs.py"
] | [
"import mne\nimport microstates as mst\nimport seaborn as sb\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom mne.datasets import sample\nfname = sample.data_path() + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'\nraw = mne.io.read_raw_fif(fname, preload=True)\n\nraw.info['bads'] = ['MEG 2443', 'EEG 053... | [
[
"numpy.concatenate",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"numpy.arange",
"numpy.transpo... |
daanreijnders/isoneutral-dispersion | [
"88259ba658d15611609f52e1615aff37a54e7289"
] | [
"ACC_particle_experiments/scripts_tracer_release/trelease_coarsened_tave_EM_Le_Sommer_C03.py"
] | [
"import importlib\nimport sys\nfrom datetime import timedelta as delta\n\nimport numpy as np\nimport parcels\nimport xarray as xr\n\nsys.path.append(\"/nethome/4302001/diffusion-hydro-mod/kernels\")\nimport density_elements_sampled\nimport Le_Sommer_elements\nimport EM_3D_BC\nimport M1_3D_BC\nimport K_Le_Sommer\nim... | [
[
"numpy.square",
"numpy.array",
"numpy.ceil",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.exp",
"numpy.random.uniform",
"numpy.meshgrid",
"numpy.vstack"
]
] |
WorldEditors/PaddleRobotics | [
"d02efd74662c6f78dfb964e8beb93f1914dcb2f3"
] | [
"QuadrupedalRobots/ETGRL/pretrain.py"
] | [
"# Copyright (c) 2020 PaddlePaddle 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 ... | [
[
"numpy.max",
"numpy.array",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.load",
"numpy.min",
"numpy.mean",
"numpy.std",
"numpy.savez",
"numpy.arange",
"numpy.stack",
"numpy.argmax",
"numpy.clip"
]
] |
SenteraLLC/py-6x-corrections | [
"e8385475a54765421ec1873516855f8767b35577"
] | [
"imgcorrect/detect_panel.py"
] | [
"import logging\r\n\r\nimport cv2 as cv\r\nimport numpy as np\r\n\r\nfrom typing import NamedTuple, Tuple\r\nfrom PIL import Image\r\n\r\n# Constants\r\nMAX_VAL_12BIT = 4096\r\n\r\nARUCO_SIDE_LENGTH_M = 0.07\r\nARUCO_TOP_TO_PANEL_CENTER_M = 0.06\r\n\r\nSAMPLE_RECT_HEIGHT = 0.04\r\nSAMPLE_RECT_WIDTH = 0.04\r\n\r\nlo... | [
[
"numpy.array",
"numpy.iinfo"
]
] |
mindspore-ai/serving | [
"e32d989ce629b4bdbbf3f16fefb02b28dce2dc4c"
] | [
"tests/ut/python/tests/test_python_parallel.py"
] | [
"# Copyright 2021 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.array",
"numpy.abs"
]
] |
rsek147/Single-Stage-Common-Object-Detection | [
"9ceaaf7226d6d587904e983717de38988130a7f0"
] | [
"mmdet/datasets/loader/build_loader.py"
] | [
"import platform\nimport random\nfrom functools import partial\n\nimport numpy as np\nfrom mmcv.parallel import collate\nfrom mmcv.runner import get_dist_info\nfrom torch.utils.data import DataLoader\n\nfrom .sampler import DistributedGroupSampler, DistributedSampler, GroupSampler\n\nif platform.system() != 'Window... | [
[
"numpy.random.seed"
]
] |
thunlp/OpenGCL | [
"52aed81db0f1534ede72080ec4fca911fa747e57"
] | [
"src/opengcl/framework/layers/others.py"
] | [
"import torch.nn as nn\n\n\n# from InfoGraph\nclass FF(nn.Module):\n def __init__(self, input_dim):\n super().__init__()\n self.block = nn.Sequential(\n nn.Linear(input_dim, input_dim),\n nn.ReLU(),\n nn.Linear(input_dim, input_dim),\n nn.ReLU(),\n ... | [
[
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
lwiart/Beiwe-Analysis | [
"f8a55387a53c68aa29565015e2a1b46a334d16f1"
] | [
"Preprocessing/find_bursts.py"
] | [
"import os, sys, math, time\nimport pandas as pd, numpy as np\n\ndata_filepath = sys.argv[1]#\"C:/Phoenix/School/Harvard/Research/Beiwe/Studies/John_Schizophrenia/Data/2017.01.09\"\nresults_filepath = sys.argv[2]#\"C:/Phoenix/School/Harvard/Research/Beiwe/Studies/John_Schizophrenia/Output/Preprocessed_Data/Individu... | [
[
"pandas.read_csv",
"numpy.diff"
]
] |
adailsonfilho/DarwinEye | [
"daef3f0595c641035876cdc9d894d0f371a802f5"
] | [
"sammon/sammon.py"
] | [
"def sammon(x, n = 2, display = 2, inputdist = 'raw', maxhalves = 20, maxiter = 500, tolfun = 1e-9, init = 'pca', distancefunc = None):\r\n\r\n #from scipy.spatial.distance import pdist, squareform\r\n import numpy as np\r\n\r\n \"\"\"Perform Sammon mapping on dataset x\r\n y = sammon(x) applies the Sam... | [
[
"numpy.isinf",
"numpy.random.normal",
"numpy.dot",
"numpy.ones",
"numpy.eye",
"numpy.linalg.svd",
"numpy.sqrt",
"numpy.abs"
]
] |
huynhtruc0309/VAL | [
"adaf51ee8b6544a889c1ae2e592b555b311290cb"
] | [
"nets/attention.py"
] | [
"from nets import nets_factory\nimport tensorflow as tf\n\n\nslim = tf.contrib.slim\n\nexpand_dims = lambda x: tf.expand_dims(tf.expand_dims(x, 1), 1)\nsqueeze = lambda x: tf.squeeze(x, [1, 2])\n\ndef self_attention(features, images, num_heads):\n batch_size, h, w, img_channels = images.get_shape().as_list()\n lo... | [
[
"tensorflow.constant_initializer",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.tile",
"tensorflow.sigmoid",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.squeeze",
"tensorflow.layers.dense",
"tensorflow.nn.softmax",
... |
habakan/automl | [
"daa5628da481097a9beaa40f192cc93d4471a0f6"
] | [
"efficientdet/hparams_config.py"
] | [
"# Copyright 2020 Google Research. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by... | [
[
"tensorflow.io.gfile.GFile"
]
] |
freelunchtheorem/conditional_density_estimators | [
"c061677f783dd5adba38349beffe41e7102c6ed5"
] | [
"ce/BaseDensityEstimator.py"
] | [
"from sklearn.model_selection import GridSearchCV\nimport warnings\nfrom sklearn.model_selection import cross_validate\n\nfrom ce import ConditionalDensity\n\nfrom ce.utils.center_point_select import *\n\nclass BaseDensityEstimator(ConditionalDensity):\n \"\"\" Interface for conditional density estimation models \... | [
[
"sklearn.model_selection.cross_validate",
"sklearn.model_selection.GridSearchCV"
]
] |
bhaskars3008/ga-learner-dsmp-repo | [
"1bedaa13201b9c20a0bb5a41a8b47061a27d9061",
"1bedaa13201b9c20a0bb5a41a8b47061a27d9061"
] | [
"Car-Insurance-claim/code.py",
"Forest-type-cover-prediction-/code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n\n# Code starts here\ndf = pd.read_csv(path)\n#Display head\nprint(df.head())\nprint(df.info)\n# replace the $ symbol\ncolumns = ['INCOME', 'HOME_... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.StandardScaler",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
],
[
"numpy.concatenate",
"sklearn.preprocessing.StandardScal... |
cg31/cule | [
"6cd8e06059c3c3a193a4b2e0821dc1b9daeb726c"
] | [
"examples/a2c/model.py"
] | [
"import numpy as np\nimport os\nimport re\nimport sys\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n_path = os.path.abspath(os.path.pardir)\nif not _path in sys.path:\n sys.path = [_path] + sys.path\n\nfrom utils.openai.vec_normalize import RunningMeanStd\n\ndef weights_init(m):\n i... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.no_grad",
"torch.nn.init.kaiming_normal_",
"numpy.finfo",
"torch.nn.Conv2d",
"torch.nn.init.calculate_gain",
"torch.nn.init.zeros_"
]
] |
MeteoSwiss/pyrad | [
"f733179075fdf3fcff475a5af8b6b71e9ac4379d"
] | [
"src/pyrad_proc/pyrad/prod/process_product.py"
] | [
"\"\"\"\npyrad.prod.process_product\n==========================\n\nFunctions for obtaining Pyrad products from the datasets\n\n.. autosummary::\n :toctree: generated/\n\n generate_occurrence_products\n generate_cosmo_coord_products\n generate_cosmo_to_radar_products\n generate_sun_hits_products\n ... | [
[
"matplotlib.use",
"numpy.histogram2d",
"numpy.histogram",
"numpy.array",
"numpy.ma.mean",
"numpy.sum",
"numpy.ma.asarray",
"matplotlib.pyplot.close",
"numpy.where",
"numpy.savez_compressed",
"matplotlib.rcParams.update",
"numpy.arange",
"numpy.ma.std"
]
] |
Schoyen/tdhf-project-fys4411 | [
"b0231c0d759382c14257cc4572698aa80c1c94d0"
] | [
"jit_example.py"
] | [
"import time\nimport numba\nimport numpy as np\n\n\ndef foo_slow(a, b):\n c = np.zeros_like(a)\n\n for i in range(c.shape[0]):\n for j in range(c.shape[1]):\n\n val = 0\n\n for k in range(a.shape[1]):\n val += a[i, k] * b[k, j]\n\n c[i, j] = val\n\n re... | [
[
"numpy.random.random",
"numpy.zeros_like",
"numpy.dot"
]
] |
GGiecold/Keras-Playground | [
"23ebb2ac2259336c399e8f1a37a02ef33f523247"
] | [
"src/weather_forecasting_with_RNN.py"
] | [
"#!/usr/bin/env python\n\n\nr\"\"\"Predicting daily temperatures from temperature, atmospheric pressure\n and hygrometry time series.\n This problem is meant to illustrate the use of recurrent neural networks\n (namely LSTM and GRU) and of various afferent techniques, such as\n recurrent dropout, stacki... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.abs",
"matplotlib.pyplot.show"
]
] |
patrickmuston1/poliastro | [
"f0532611d231c66185a81083a74c11ccbb97aa89"
] | [
"src/poliastro/twobody/orbit.py"
] | [
"from typing import List, Union\nfrom warnings import warn\n\nimport numpy as np\nfrom astropy import time, units as u\nfrom astropy.coordinates import (\n GCRS,\n ICRS,\n Angle,\n CartesianDifferential,\n CartesianRepresentation,\n get_body_barycentric,\n get_body_barycentric_posvel,\n)\nfrom ... | [
[
"numpy.isclose",
"numpy.errstate",
"numpy.any",
"numpy.abs",
"numpy.sqrt",
"numpy.cos",
"numpy.linspace",
"numpy.cross"
]
] |
mvdoc/pycortex | [
"bc8a93cac9518e3c1cd89650c703f9f3814e805b",
"bc8a93cac9518e3c1cd89650c703f9f3814e805b",
"bc8a93cac9518e3c1cd89650c703f9f3814e805b"
] | [
"examples/webgl/single_dataset.py",
"examples/quickflat/plot_make_figure.py",
"examples/utils/multi_panels_plots.py"
] | [
"\"\"\"\n========================\nCreate a 3D WebGL Viewer\n========================\n\nA webgl viewer displays a 3D view of brain data in a web browser\n\n\"\"\"\n\nimport cortex\n\nimport numpy as np\nnp.random.seed(1234)\n\n# gather data Volume\nvolume = cortex.Volume.random(subject='S1', xfmname='fullhead')\n\... | [
[
"numpy.random.seed"
],
[
"numpy.random.seed",
"matplotlib.pyplot.show"
],
[
"numpy.product",
"matplotlib.pyplot.title",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imread"
]
] |
DLPerf/tensorforce | [
"33a2d84fa850e8842dfe2cef3901de32cf7cd221"
] | [
"tensorforce/core/models/model.py"
] | [
"# Copyright 2020 Tensorforce Team. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"tensorflow.group",
"tensorflow.function",
"tensorflow.control_dependencies",
"tensorflow.saved_model.save",
"tensorflow.shape",
"tensorflow.train.latest_checkpoint",
"tensorflow.math.reduce_sum",
"tensorflow.math.reduce_mean",
"tensorflow.constant",
"tensorflow.debugging.a... |
mdolab/OpenAeroStruct | [
"a10a673ec0c0fd7e4c41b8ec39b856606ce7ec78"
] | [
"openaerostruct/tests/test_aero.py"
] | [
"from openmdao.utils.assert_utils import assert_rel_error\nimport unittest\n\n\nclass Test(unittest.TestCase):\n def test(self):\n import numpy as np\n\n import openmdao.api as om\n\n from openaerostruct.geometry.utils import generate_mesh\n from openaerostruct.geometry.geometry_group... | [
[
"numpy.array",
"numpy.zeros"
]
] |
liuyao12/imagenette_experiments | [
"96ad29b369236a4968c19cd0ac13575c25cde629"
] | [
"imagenette_experiments/consistency.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 02_consistency.ipynb (unless otherwise specified).\n\n__all__ = ['SEED_N', 'prepare_cudnn', 'set_global_seed', 'set_consistance']\n\n# Cell\n# hide\nimport torch, random\nimport numpy as np\n\n# Cell\n# hide\nSEED_N = 2020\n\n# Cell\n# export\n\n# Copyed from Catalist fr... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.set_printoptions",
"torch.cuda.is_available"
]
] |
samwill/bokeh | [
"894731860c53b7c9ddd0057dee85cf064278dc0e"
] | [
"examples/reference/models/TrianglePin.py"
] | [
"import numpy as np\n\nfrom bokeh.io import curdoc, show\nfrom bokeh.models import ColumnDataSource, Grid, LinearAxis, Plot, TrianglePin\n\nN = 9\nx = np.linspace(-2, 2, N)\ny = x**2\nsizes = np.linspace(10, 20, N)\n\nsource = ColumnDataSource(dict(x=x, y=y, sizes=sizes))\n\nplot = Plot(\n title=None, plot_width... | [
[
"numpy.linspace"
]
] |
henryfw/deep-voice-conversion | [
"8416e96df04f4ee1d7b02d8255e8374b112cdf77"
] | [
"prepare_training_as_batch.py"
] | [
"import numpy as np\nimport pickle\n\n# load all parts\nnumber_of_parts = 22\n\n\n\nfor i in range(number_of_parts + 1):\n data1 = np.load(\"H:/data/data1_{}.npy\".format(i))\n if len(data1) > 0:\n print(\"Reading part {}\".format(i))\n\n word_counts = np.array(pickle.load( open( \"H:/data/word_... | [
[
"numpy.concatenate",
"numpy.random.shuffle"
]
] |
qixiuai/BCGHeart | [
"b1127fa4420b658308acd883bc11945b7fcac4df"
] | [
"mean_hearts/bcg.py"
] | [
"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\n\nfrom absl import app\nfrom collections import Counter\nfrom scipy.signal import lfilter\n\n\ndef _parse_integer(bytes):\n int_str = bytes.decode('ASCII')\n integers = []\n... | [
[
"numpy.loadtxt",
"scipy.signal.lfilter"
]
] |
wchstrife/mmediting | [
"2a90254b677cc505df0d36a182ae710188804221"
] | [
"mmedit/models/losses/gabor_loss.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport cv2\nimport numpy as np\nfrom ..registry import LOSSES\nfrom .utils import masked_loss\n\n_reduction_modes = ['none', 'mean', 'sum']\n\n@masked_loss\ndef mse_loss(pred, target):\n \"\"\"MSE loss.\n\n Args:\n pred (Tensor): ... | [
[
"torch.nn.functional.mse_loss",
"torch.nn.Conv2d",
"torch.from_numpy"
]
] |
ralfgerlich/modypy | [
"20601c7cd9734c41e4459d8773d71703b6846876"
] | [
"tests/model/test_events.py"
] | [
"\"\"\"\nTests for the ``modypy.model.events`` module\n\"\"\"\nfrom unittest.mock import Mock\n\nimport pytest\n\nimport numpy.testing as npt\n\nfrom modypy.model import System, PortNotConnectedError\nfrom modypy.model.events import MultipleEventSourcesError, EventPort, Clock, ZeroCrossEventSource\n\n\ndef test_eve... | [
[
"numpy.testing.assert_almost_equal"
]
] |
RomaKoks/poptimizer | [
"c1ae55b79055117e13e83393ae3a2b00f87953e6"
] | [
"poptimizer/data/adapters/gateways/cpi.py"
] | [
"\"\"\"Загрузка данных по потребительской инфляции.\"\"\"\nimport types\n\nimport aiohttp\nimport pandas as pd\n\nfrom poptimizer import config\nfrom poptimizer.data.adapters.gateways import gateways\nfrom poptimizer.shared import adapters, col\n\n# Параметры загрузки валидации данных\n# Был адрес URL = \"https://r... | [
[
"pandas.Timestamp",
"pandas.read_excel"
]
] |
buzzer4mornin/CTMP-ThesisProject | [
"83e54700d0edd8dd141127998dacd7faf11be081"
] | [
"db-files/tables.py"
] | [
"import pandas as pd\nimport numpy as np\nimport time\nimport os\n\n# Change to Current File Directory\nos.chdir(os.path.dirname(__file__))\n\n# Get Current File Directory\ncurrdir = str(os.path.dirname(os.path.abspath(__file__)))\n\n\nuser_df = pd.read_pickle(\"./original-files/df_rating_NFLX\")\nprint(user_df)\ne... | [
[
"pandas.read_pickle",
"numpy.array",
"numpy.vectorize",
"pandas.merge",
"pandas.DataFrame",
"numpy.where"
]
] |
TejasAvinashShetty/qutip | [
"759759e85f61e3619b37253a6f981f71abc442d6",
"696a7f9095edccc964b175282bd0dd450cdcc337",
"759759e85f61e3619b37253a6f981f71abc442d6"
] | [
"qutip/correlation.py",
"qutip/tests/test_stochastic_me.py",
"qutip/bloch3d.py"
] | [
"# This file is part of QuTiP: Quantum Toolbox in Python.\n#\n# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are... | [
[
"numpy.array",
"numpy.asarray",
"numpy.linalg.pinv",
"numpy.ones",
"numpy.real",
"numpy.exp",
"numpy.diff",
"numpy.identity",
"numpy.where",
"numpy.prod",
"numpy.transpose",
"numpy.sqrt",
"numpy.size",
"numpy.linalg.solve"
],
[
"numpy.sin",
"nump... |
CnybTseng/JDE | [
"599bd6de74fc3794694bf1e3baca741d2b517e0e"
] | [
"tools/toonnx.py"
] | [
"# -*- coding: utf-8 -*-\n# file: toonnx.py\n# brief: Joint Detection and Embedding\n# author: Zeng Zhiwei\n# date: 2020/5/8\n\nimport os\nimport sys\nimport torch\nimport argparse\nimport collections\nimport torch.onnx as onnx\nimport onnxruntime as ort\nimport numpy as np\n\nsys.path.append('.')\n\nimport darknet... | [
[
"torch.rand",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.onnx.export",
"torch.load"
]
] |
morenoh149/Auto_ViML | [
"4aa34966267cdd32d8a7995d03c0a66404b96e2b"
] | [
"autoviml/QuickML_Stacking.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\nfrom sklearn.model_selection import cross_val_score, StratifiedShuffleSplit, TimeSeriesSplit\r\nfrom sklearn.model_selection import ShuffleSplit,StratifiedKFold,KFold\r\nfrom sklearn.discriminant_analysis import ... | [
[
"sklearn.discriminant_analysis.LinearDiscriminantAnalysis",
"sklearn.model_selection.StratifiedKFold",
"numpy.logspace",
"numpy.mean",
"sklearn.naive_bayes.GaussianNB",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.tree.DecisionTreeRegressor",... |
Rabscuttler/heat | [
"245a926d3b7983b533de109ffc6887cd8eef0e58"
] | [
"scripts/write.py"
] | [
"\nimport os\nimport sqlite3\nimport pandas as pd\nimport numpy as np\n\ndef shaping(demand, cop):\n\n # Merge demand and cop\n df = pd.concat([demand, cop], axis=1)\n df = df.sort_index(level=0, axis=1)\n\n # Timestamp\n index = pd.DatetimeIndex(df.index)\n df.index = pd.MultiIndex.from_tuples(zi... | [
[
"pandas.DatetimeIndex",
"pandas.concat"
]
] |
rgerkin/brian2 | [
"34761a58b0d4c2275194e648449419b3dd73286b",
"34761a58b0d4c2275194e648449419b3dd73286b",
"34761a58b0d4c2275194e648449419b3dd73286b"
] | [
"brian2/tests/test_synapses.py",
"brian2/devices/cpp_standalone/device.py",
"brian2/tests/test_memory.py"
] | [
"from __future__ import print_function\n\nfrom __future__ import absolute_import\nimport uuid\nimport logging\n\nfrom nose import with_setup, SkipTest\nfrom nose.plugins.attrib import attr\nfrom numpy.testing.utils import (assert_equal, assert_raises,\n assert_raises_regex, assert_ar... | [
[
"numpy.testing.utils.assert_equal",
"numpy.testing.utils.assert_raises",
"numpy.testing.utils.assert_array_equal"
],
[
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.arange",
"numpy.atleast_1d",
"numpy.fromfile",
"numpy.repeat"
],
[
"nu... |
psychopresley/COVID-19 | [
"9fbb07cab4300bc1e9352d81e51cd64c4b8c9e90"
] | [
"python/backup/pycovid.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis script\n\"\"\"\n\n__version__ = '0.0.1'\n__author__ = 'Márcio Garcia'\n__email__ = 'psycho.presley@gmail.com'\n__license__ = 'GPL'\n__status__ = 'Development'\n__date__ = '07/19/2020'\n\nif __name__ == '__main__':\n\timport os\n\timport sys\n\timport calenda... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
hotbaby/sentiment-analysis | [
"efb880870d905c4c02528d7d242ba06b90f0e259"
] | [
"senti_analysis/models/model_v5.py"
] | [
"# encoding: utf8\n\nimport os\nimport datetime\nimport logging\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nimport tensorflow_addons as tfa\nfrom tensorflow.keras.initializers import Constant\n\nfrom senti_analysis import config\nfrom senti_analysis import constants\nfrom senti_analysis.prepr... | [
[
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.MaxPooling1D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.keras.layers.GRU",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.keras.optimizers.Ad... |
viotemp1/Ax | [
"87e2f33a02c745b40b2ea1332e649f298347f35d"
] | [
"ax/benchmark/benchmark_result.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nfrom typing import Dict, List, NamedTuple, Optional\n\nimport numpy as np\nimport pandas as ... | [
[
"pandas.DataFrame",
"numpy.array",
"pandas.merge"
]
] |
pamelaosuna/Dendritic-Spine-Detection | [
"423f7d22588c6e5490648e922ac8d5b6e151733c"
] | [
"convert_data/split_csv_train_valid_test.py"
] | [
"import pandas as pd\nimport argparse\nimport os\nimport glob\nimport random\n\nparser = argparse.ArgumentParser(description=\"Convert one csv file to train, valid and test csv file\")\nparser.add_argument('-i', '--input', \\\n help=\"Path to original csv file\", default=\"data/annotations/\")\nparser.add_argume... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
tpike3/pygcam | [
"da0f11e373d4cd99125ce81c5de17d795d8f6d7e"
] | [
"pygcam/mcs/Database.py"
] | [
"# Created on Mar 9, 2012\n#\n# @author: Richard Plevin\n# @author: Sam Fendell\n# @author: Ryan Jones\n#\n# Copyright (c) 2012-2015. The Regents of the University of California (Regents)\n# and Richard Plevin. See the file COPYRIGHT.txt for details.\n'''\nThis module includes contributions by Sam Fendell and Ryan ... | [
[
"pandas.DataFrame.from_records"
]
] |
cclauss/hataripy | [
"7db7869f34b875c9f76d42b7a4801b0c23738448"
] | [
"hataripy/modflow/mfhob.py"
] | [
"import sys\nimport collections\nimport numpy as np\nfrom ..pakbase import Package\nfrom ..utils.recarray_utils import create_empty_recarray\n\n\nclass ModflowHob(Package):\n \"\"\"\n Head Observation package class\n\n Parameters\n ----------\n iuhobsv : int\n unit number where output is saved... | [
[
"numpy.reshape",
"numpy.array",
"numpy.isclose",
"numpy.dtype"
]
] |
pgniewko/deep-toxin | [
"fa61b06405749e5de7d74eedadb5de7c67981471"
] | [
"nb/experiment.py"
] | [
"import logging\nimport pickle\nimport numpy as np\n\nfrom collections import defaultdict\nfrom toxin import Toxin\n\n\nclass Experiment:\n \"\"\"\n :-P lazy Pawel\n \"\"\"\n\n def __init__(self, toxins, excludeOrganism=\"synthetic\", min_val=8):\n self.toxins = [toxin_.copy() for toxin_ in toxin... | [
[
"numpy.array"
]
] |
Syavaprd/sense-bert | [
"487b5cca594787ee7e510f3018fddc762c2bec1d"
] | [
"inference.py"
] | [
"import os\nimport pandas as pd\nfrom pathlib import Path\nfrom sensebert import SenseBert\nimport tensorflow as tf\nfrom tqdm import tqdm\nimport sys\nimport numpy as np\n\ndef idx_word2idx_ch(sent: str, idx_word: int):\n sent = sent.split(' ')\n start = sum(len(w) for w in sent[:idx_word]) + idx_word # + idx_w... | [
[
"tensorflow.compat.v1.Session",
"pandas.read_csv",
"numpy.argmax",
"pandas.read_json"
]
] |
MattAshman/pvi | [
"74322ac23efd2674e46c953e5573d19d8d6bce4c"
] | [
"pvi/models/sgp/kernels.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom abc import abstractmethod\nfrom typing import List\n\n\ndef _mul_broadcast_shape(*shapes, error_msg=None):\n \"\"\"\n Compute dimension suggested by multiple tensor indices (supports\n broadcasting).\n \"\"\"\n\n # Pad each shape so they have the same numb... | [
[
"torch.Size",
"torch.zeros",
"torch.cat",
"torch.stack",
"torch.is_tensor",
"torch.norm",
"torch.ones",
"torch.tensor",
"torch.ones_like",
"torch.as_tensor",
"torch.equal"
]
] |
OdedH/CLIP-ViL | [
"05180f64eef8365b9efae636eaaa88903ceb83f6"
] | [
"CLIP-ViL-VLN/r2r_src/agent.py"
] | [
"\nimport json\nimport os\nimport sys\nimport numpy as np\nimport random\nimport math\nimport time\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch import optim\nimport torch.nn.functional as F\n\nfrom env import R2RBatch\nfrom utils import padding_idx, add_idx, Tokenizer\nimp... | [
[
"torch.distributions.Categorical",
"torch.stack",
"torch.ones",
"torch.load",
"torch.nn.CrossEntropyLoss",
"numpy.concatenate",
"numpy.zeros_like",
"torch.autograd.Variable",
"numpy.argmax",
"torch.zeros",
"numpy.logical_or",
"numpy.array",
"numpy.zeros",
"t... |
sequoiap/gdslib | [
"3e6d081a2196e13e89fef45cae5c7de41b96a7fc"
] | [
"gdslib/mmi2x2.py"
] | [
"import pp\nfrom gdslib.load import load\n\n\ndef mmi2x2(c=pp.c.mmi2x2, **kwargs):\n m = load(c)\n return m\n\n\nif __name__ == \"__main__\":\n import matplotlib.pyplot as plt\n import numpy as np\n\n wav = np.linspace(1520, 1570, 1024) * 1e-9\n f = 3e8 / wav\n c = mmi2x2()\n s = c.s_paramet... | [
[
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.abs"
]
] |
dylan-campbell/Motionformer | [
"6c860614a3b252c6163971ba20e61ea3184d5291"
] | [
"slowfast/models/performer_helper.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nfrom einops import rearrange\nimport math\nimport numpy as np\nimport torch\n\nBIG_CONSTANT = 1e8\n\n\ndef create_projection_matrix(\n m, d, seed=0, scaling=0, struct_mode=False, device='cuda', dtype=torch.float32... | [
[
"numpy.random.choice",
"torch.einsum",
"torch.max",
"numpy.random.seed",
"numpy.eye",
"torch.abs",
"torch.manual_seed",
"torch.nn.functional.relu",
"numpy.random.uniform",
"torch.vstack",
"torch.tensor",
"torch.ones",
"torch.nn.functional.softmax",
"torch.di... |
aromaljosebaby/attendence-using-face-recognition-and-AI-and-kivymd | [
"8c2dfec34863ae00d32ace94e7c9b5d6c6965f6e"
] | [
"trying.py"
] | [
"from kivy.lang import Builder\r\nfrom kivy.uix.boxlayout import BoxLayout\r\nfrom kivy.properties import ObjectProperty\r\nfrom kivymd.app import MDApp\r\n#from opencvhelper import KV\r\nimport shutil\r\nfrom tkinter.filedialog import askdirectory, askopenfile\r\nfrom tkinter import Tk\r\nfrom kivymd.uix.dialog i... | [
[
"numpy.argmin"
]
] |
dirkgr/allennlp-semparse | [
"b417be8a434066a7e164c80c8ef656cd5e73af41"
] | [
"allennlp_semparse/models/nlvr/nlvr_coverage_semantic_parser.py"
] | [
"import logging\nimport os\nfrom functools import partial\nfrom typing import Any, Callable, List, Dict, Tuple, Union\n\nfrom overrides import overrides\n\nimport torch\n\nfrom allennlp.data.vocabulary import Vocabulary\nfrom allennlp.models.archival import load_archive, Archive\nfrom allennlp.models.model import M... | [
[
"torch.ones_like",
"torch.sum"
]
] |
GXU-GMU-MICCAI/PGGAN-Paddle | [
"f2ed210834c7f6434fdb01da960d6b37d5e4349d"
] | [
"models/networks/custom_layers.py"
] | [
"#encoding=utf8\n# Copyright (c) 2021 PaddlePaddle 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... | [
[
"numpy.prod"
]
] |
neurodata/m2g | [
"031db08fa7a4bf0088f739ebabea9181df7f09c3",
"031db08fa7a4bf0088f739ebabea9181df7f09c3"
] | [
"m2g/graph.py",
"m2g/utils/reg_utils.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nm2g.graph\n~~~~~~~~~~\n\nContains the primary functionality for connectome estimation after tractography has completed.\nUsed in the final stage of the pipeline.\n\"\"\"\n\n\n# standard library imports\nimport os\nimport time\nimport csv\nfrom itertools import combinations\nfrom fu... | [
[
"matplotlib.use",
"numpy.round",
"matplotlib.pyplot.savefig",
"numpy.sum",
"matplotlib.pyplot.close",
"numpy.shape",
"numpy.eye",
"numpy.arange",
"numpy.unique"
],
[
"numpy.max",
"numpy.zeros",
"numpy.min",
"numpy.where",
"numpy.unique"
]
] |
slac-lcls/lcls2 | [
"c89f61634005339ce409b06acedfa27708327b0f"
] | [
"psana/setup.py"
] | [
"import os\nimport sys\nimport numpy as np\nfrom setuptools import setup, Extension, find_packages\n\n# HIDE WARNING:\n# cc1plus: warning: command line option \"-Wstrict-prototypes\" is valid for C/ObjC but not for C++\nfrom distutils.sysconfig import get_config_vars\ncfg_vars = get_config_vars()\nfor k, v in cfg_v... | [
[
"numpy.get_include"
]
] |
igor0/gpt-neox | [
"3ad61952c290669d3741c01f767d41fdee5215c5",
"3ad61952c290669d3741c01f767d41fdee5215c5"
] | [
"megatron/__init__.py",
"megatron/model/word_embeddings.py"
] | [
"# coding=utf-8\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0... | [
[
"torch.distributed.is_initialized",
"torch.distributed.get_rank"
],
[
"torch.distributed.get_rank",
"torch.nn.Dropout",
"torch.cat",
"torch.Tensor"
]
] |
mrdrozdov/knnlm | [
"61419077eb7f79c3ba7a196b4cc7cf722f4ba8f4"
] | [
"setup.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nfrom setuptools import setup, find_packages, Extension\nimport sys\n\n\nif sys.version_info < (3,... | [
[
"numpy.get_include",
"torch.utils.cpp_extension.CppExtension"
]
] |
kbarkevich/RITnet | [
"5df66c656734aecd2987cf27d9359416b136af2e"
] | [
"Ellseg/models/RITnet_v2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: rakshit\n\"\"\"\nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..utils import normPts, regressionModule, linStack, convBlock\nfrom ..loss import conf_Loss, get_ptLoss, get_seg2ptLoss, get_segLoss, g... | [
[
"torch.cat",
"numpy.int",
"torch.stack",
"torch.nn.AvgPool2d",
"torch.nn.functional.interpolate",
"torch.nn.Conv2d",
"numpy.sqrt",
"numpy.append",
"torch.clone",
"torch.mean",
"torch.sum"
]
] |
UmairHabib/Machine-Learning-NanoDegree-Udacity | [
"1c4fe665db8f16e1a639209a63da0c9b670d6ebe"
] | [
"Deep Learning/b) Perceptron Algorithm/Or Perceptron/Solution OrPerceptron.py"
] | [
"import pandas as pd\n\n# TODO: Set weight1, weight2, and bias\nweight1 = 1.0\nweight2 = 1.0\nbias = -1.5\n\n\n# DON'T CHANGE ANYTHING BELOW\n# Inputs and outputs\ntest_inputs = [(0, 0), (0, 1), (1, 0), (1, 1)]\ncorrect_outputs = [False, False, False, True]\noutputs = []\n\n# Generate and check output\nfor test_inp... | [
[
"pandas.DataFrame"
]
] |
Aryalexa/LearnLanguage | [
"1cea6c6de370f581476a67934c5866dd0479b86a"
] | [
"python-tests/butterFilterOR.py"
] | [
"from scipy.signal import butter, lfilter\n'''\nExample\n\n1. Plot the frequency response for a few different orders.\n2. Filter a noisy signal. The signal is created by mathematical functions.\n\n'''\n\ndef butter_bandpass(lowcut, highcut, fs, order=5):\n nyq = 0.5 * fs\n low = lowcut / nyq\n high = highc... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"scipy.signal.butter",
"matplotlib.pyplot.legend",
"scipy.signal.freqz",
"matplotlib.pyplot.figure",
"scipy.signal.lfilter",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.cos"... |
wnourse05/SNS-Toolbox | [
"2fbb9332aadd6eb3a71f0519e69d7b0ad273b7b0"
] | [
"insect_motion_vision/retina_neuron_frequency_response.py"
] | [
"\"\"\"\nImplementation of a single retinal neuron, and measurement of the frequency response and critical flicker fusion point\nWilliam Nourse\nJanuary 6th, 2022\n\"\"\"\nimport numpy as np\nfrom scipy import signal\nimport matplotlib.pyplot as plt\n\nfrom sns_toolbox.design.neurons import NonSpikingNeuron\nfrom s... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.sin",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.semilogx",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.arange",
"scipy.signal.TransferFunction",
"matplotlib.pyplot.show",
"numpy... |
liyichao/vision | [
"53b062ca58932bbf387b96f2dd3397c4495b735b"
] | [
"torchvision/models/inception.py"
] | [
"from __future__ import division\n\nfrom collections import namedtuple\nimport warnings\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.jit.annotations import Optional\nfrom .utils import load_state_dict_from_url\n\n\n__all__ = ['Inception3', 'inception_v3', 'InceptionOutputs', '_I... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.avg_pool2d",
"torch.nn.init.constant_",
"torch.nn.functional.dropout",
"torch.nn.BatchNorm2d",
"scipy.stats.truncnorm",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.no_grad",
"torch.nn.functional.relu",
"torch.un... |
nnaabbcc/exercise | [
"255fd32b39473b3d0e7702d4b1a8a97bed2a68f8"
] | [
"python/PyQt5/21_matplotlib_test.py"
] | [
"\nfrom PyQt5.QtWidgets import QApplication, QMainWindow, QSizePolicy, QPushButton\n\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas\nfrom matplotlib.pyplot import Figure\n\n\nclass MyMainWindow(QMainWindow):\n\n def __init__(self):\n super(QMainWindow, self).__init__()\n... | [
[
"matplotlib.pyplot.Figure",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__"
]
] |
shunsukeaihara/pysas | [
"f6f147f3e76fdc7485069a879f2b138c6325bfea"
] | [
"test/test_mcep.py"
] | [
"# -*- coding: utf-8 -*-\nfrom unittest import TestCase\nfrom nose.tools import eq_\nimport numpy as np\n\nfrom pysas import waveread\nfrom pysas.mcep import estimate_alpha, spec2mcep, mcep2spec, mcep2coef, coef2mcep\nfrom pysas.mcep import mcep2spec_from_matrix, spec2mcep_from_matrix\nfrom pysas import World\n\n\n... | [
[
"numpy.log",
"numpy.fft.fft",
"numpy.blackman",
"numpy.sqrt"
]
] |
willreid95/keras | [
"7a7a76853e2af878c52afe7f9db88496f4a431b8"
] | [
"tests/keras/backend/backend_test.py"
] | [
"import pytest\nfrom numpy.testing import assert_allclose\nimport numpy as np\nimport scipy.sparse as sparse\nimport warnings\n\nfrom keras import backend as K\nfrom keras.backend import floatx, set_floatx, variable\nfrom keras.utils.conv_utils import convert_kernel\nimport reference_operations as KNP\n\n\nBACKENDS... | [
[
"numpy.testing.assert_allclose",
"numpy.random.choice",
"numpy.random.rand",
"numpy.array_equal",
"tensorflow.core.protobuf.config_pb2.RunOptions",
"numpy.min",
"numpy.mean",
"numpy.exp",
"numpy.alltrue",
"numpy.random.random",
"numpy.concatenate",
"numpy.max",
... |
ekwyss/baselines | [
"3ee276fd3be5d330aaacaa3d478929ead4cb1d34"
] | [
"baselines/her/her_sampler.py"
] | [
"import numpy as np\nimport pickle\n# TODO: have both sampler run on every episode and compare\n # also check place where it decides whether to update or not\n\ndef make_sample_her_transitions(replay_strategy, replay_k, reward_fun, policy_index):\n \"\"\"Creates a sample function that can be used for HER ex... | [
[
"numpy.concatenate",
"numpy.random.choice",
"numpy.sum",
"numpy.random.uniform",
"numpy.random.randint"
]
] |
mkhumtai/6CCS3PRJ | [
"c7d5bedf9529f6e2b7a57e102761716c11f961c8"
] | [
"app/dbscan.py"
] | [
"# Code adapted from Dr. Geoff Boeing's Urban Data Science Course (MIT License):\n# https://github.com/gboeing/urban-data-science/blob/master/15-Spatial-Cluster-Analysis/cluster-analysis.ipynb\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.cluster import DBSCAN\nfrom geopy.distance import great_circle\nfr... | [
[
"pandas.DataFrame",
"sklearn.metrics.silhouette_score",
"numpy.radians",
"sklearn.cluster.DBSCAN",
"numpy.unique"
]
] |
CristianPachacama/dowhy | [
"d11ef310d2c55848aa0db39f80581366d24fa9a8"
] | [
"dowhy/do_sampler.py"
] | [
"import logging\nimport numpy as np\nimport pandas as pd\n\n\nclass DoSampler:\n \"\"\"Base class for a sampler from the interventional distribution.\n\n \"\"\"\n\n def __init__(self, data, identified_estimand, treatments, outcomes, params=None, variable_types=None,\n num_cores=1, keep_orig... | [
[
"pandas.DataFrame"
]
] |
CORGI-lab/Learning_from_stories | [
"183791971272fd919822ab43fc11369d9098fc69"
] | [
"textworld/gym/spaces/text_spaces.py"
] | [
"import re\nimport string\nimport numpy as np\n\nimport gym\nimport gym.spaces\n\n\nclass VocabularyHasDuplicateTokens(ValueError):\n pass\n\n\nclass Char(gym.spaces.MultiDiscrete):\n \"\"\" Character observation/action space\n\n This space consists of a series of `gym.spaces.Discrete` objects all with\n ... | [
[
"numpy.array"
]
] |
unique-chan/SRGAN | [
"acf30b2034c24d2077ddacc6e774fa2e49efc867"
] | [
"2_SRGAN/SRGAN_test.py"
] | [
"import sys\n\nsys.path.append('../')\n\nfrom torch.utils.data import DataLoader\n\nfrom Dataset.dataset import LR_HR_PairDataset\nfrom Model.Generator import Generator\nfrom SRGAN_parser import Parser\nfrom SRGAN_utils import *\nfrom Metric.PSNR import PSNR\nimport Metric.pytorch_msssim as torch_SSIM\n\n\nif __nam... | [
[
"torch.utils.data.DataLoader"
]
] |
stillmatic/onnx | [
"8d5eb62d5299f6dcb6ac787f0ea8e6cf5b8331a7",
"8d5eb62d5299f6dcb6ac787f0ea8e6cf5b8331a7",
"8d5eb62d5299f6dcb6ac787f0ea8e6cf5b8331a7",
"8d5eb62d5299f6dcb6ac787f0ea8e6cf5b8331a7"
] | [
"onnx/backend/test/case/node/reversesequence.py",
"onnx/backend/test/case/node/reducesum.py",
"onnx/backend/test/case/node/bitshift.py",
"onnx/backend/test/case/node/scatterelements.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\n\nimport onnx\nfrom ..base import Base\nfrom . import expect\n\n\nclass ReverseSequence(Base):\n\n ... | [
[
"numpy.array"
],
[
"numpy.random.seed",
"numpy.sum",
"numpy.array",
"numpy.random.uniform"
],
[
"numpy.array"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.copy",
"numpy.prod",
"numpy.arange",
"numpy.indices"
]
] |
zf109/textacy | [
"103dd7e248ace0f3db1ef130e7f490f81a6c89df"
] | [
"textacy/viz/termite.py"
] | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport numpy as np\n\ntry:\n import matplotlib.pyplot as plt\nexcept ImportError:\n pass\n\n\nRC_PARAMS = {\n \"axes.axisbelow\": True,\n \"axes.edgecolor\": \".8\",\n \"axes.facecolor\": \"white\",\n \"axes.gri... | [
[
"numpy.max",
"matplotlib.pyplot.rc_context"
]
] |
inbo/niche_vlaanderen | [
"5b914811a3991fb1e91067579906283f92ecc217"
] | [
"tests/test_niche.py"
] | [
"from __future__ import division\nfrom unittest import TestCase\nimport pytest\n\nimport niche_vlaanderen\nfrom niche_vlaanderen.exception import NicheException\nfrom rasterio.errors import RasterioIOError\nimport numpy as np\nimport pandas as pd\n\nimport tempfile\nimport shutil\nimport os\nimport sys\n\nimport di... | [
[
"matplotlib.use",
"numpy.isnan",
"numpy.round",
"pandas.DataFrame",
"numpy.sum",
"numpy.any",
"numpy.all"
]
] |
duganwdobbs/BinaLab-DisCountNet | [
"2406a6e9bf9f6a8b881d33ac978d48a3efb78f99"
] | [
"Code/discnet.py"
] | [
"import tensorflow as tf\n\nimport numpy as np\n\nfrom Helpers import ops,util,generator\n\nfrom Helpers.util import Image_To_Patch,Patch_To_Image,ImSizeToPatSize,disc_label_gen\nfrom Helpers.ops import init_scope_vars\n\n# Import Flag globals\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\n# Segmentation Ne... | [
[
"tensorflow.reshape",
"tensorflow.assign_add",
"tensorflow.sqrt",
"tensorflow.control_dependencies",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.train.latest_checkpoint",
"tensorflow.argmax",
"tensorflo... |
locosoft1986/PyTorch-GAN | [
"c32001b2a23e7b364366497f16bdd84f31b1f46d"
] | [
"implementations/pix2pix/utils.py"
] | [
"import random\nimport time\nimport datetime\nimport sys\n\nfrom torch.autograd import Variable\nimport torch\nimport numpy as np\n\nfrom torchvision.utils import save_image\n\ndef tensor2image(tensor):\n image = 127.5*(tensor[0].cpu().float().numpy() + 1.0)\n if image.shape[0] == 1:\n image = np.tile(... | [
[
"torch.cat",
"torch.nn.init.constant_",
"numpy.tile",
"torch.unsqueeze",
"torch.nn.init.normal_"
]
] |
terryduo/Arkie | [
"1436301a77695fdbf523b731f2f84da469d67cdc"
] | [
"coughDetector.py"
] | [
"from cProfile import label\nfrom numpy import append\nimport pyaudio\nimport numpy\nimport warnings\nfrom datetime import datetime\nimport tensorflow as tf\nfrom pandas import DataFrame\n\ndef my_publish_callback(envelope, status):\n if status.is_error():\n ... #handle error here\n print(str(statu... | [
[
"numpy.fromstring",
"pandas.DataFrame",
"tensorflow.lite.Interpreter"
]
] |
amdhacks/Cirq | [
"49c256422bb2b05fb87a941b0b9aab180fb69a4b"
] | [
"cirq/ops/three_qubit_gates.py"
] | [
"# Copyright 2018 The Cirq Developers\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 o... | [
[
"numpy.array",
"numpy.diag"
]
] |
go2carter/keras_augtest | [
"2b9319f686495eac992a24fe3653dc230db0d305"
] | [
"tests/keras/test_callbacks.py"
] | [
"import os\nimport multiprocessing\n\nimport numpy as np\nimport pytest\nfrom csv import reader\nfrom csv import Sniffer\nimport shutil\nfrom keras import optimizers\nfrom keras import initializers\nfrom keras import callbacks\nfrom keras.models import Sequential, Model\nfrom keras.layers import Input, Dense, Dropo... | [
[
"numpy.isnan",
"numpy.random.seed",
"numpy.ones",
"numpy.where",
"numpy.random.randint",
"numpy.random.random"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.