repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
TakumaE/TorusE
[ "80056fc6f2602219e4b84c16b0c3fb2108d702dd" ]
[ "models.py" ]
[ "import math\nimport tensorflow as tf\n\n\nclass BasicModel(object):\n def __init__(self, config, nent, nrel):\n super(BasicModel, self).__init__()\n self.config = config\n self.pos_h = tf.placeholder(tf.int32, [None])\n self.pos_t = tf.placeholder(tf.int32, [None])\n self.pos_...
[ [ "tensorflow.cos", "tensorflow.minimum", "tensorflow.floor", "tensorflow.placeholder", "tensorflow.add", "tensorflow.square", "tensorflow.random_uniform", "tensorflow.nn.embedding_lookup", "tensorflow.abs" ] ]
JonasDHomburg/LAMARCK
[ "0e372c908ff59effc6fd68e6477d04c4d89e6c26" ]
[ "LAMARCK_ML/architectures/variables/variables_test.py" ]
[ "import unittest\n\nimport numpy as np\n\nfrom LAMARCK_ML.architectures.variables import Variable\nfrom LAMARCK_ML.architectures.variables.initializer import GlorotUniform, Constant\nfrom LAMARCK_ML.architectures.variables.regularisation import L1, L2\nfrom LAMARCK_ML.data_util.dataType import DDouble, DFloat\n\n\n...
[ [ "numpy.random.random" ] ]
tkerola/chainer-trt
[ "4e1adc0370e11ad7736a5fafdfd5aeca168c700e" ]
[ "test/test_model_retriever/inputs_test.py" ]
[ "import chainer\nimport numpy as np\n\nfrom helper import ModelRetrieverHelper\n\n\nclass TestInputs(ModelRetrieverHelper):\n\n @ModelRetrieverHelper.case\n def test_input_order(self):\n xs = [chainer.Variable(np.ones((1, 3, 32, 32))) for _ in range(5)]\n y = xs[0]\n for x in xs[1:]:\n ...
[ [ "numpy.zeros", "numpy.ones" ] ]
keshavchandra/Baroda-Finathon-Challenge
[ "af9bfe6e38165eccfe466f9edeb92480115ae40d" ]
[ "BarodaFinathon/branchevaluation/views.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.http import HttpResponse\nfrom django.shortcuts import render\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\nfrom rest_framework import status\nfrom rest_framework.permissions import (\n\tAllowAn...
[ [ "numpy.radians", "numpy.zeros_like", "sklearn.cluster.KMeans", "sklearn.cluster.DBSCAN" ] ]
luizhsalazar/no-show-ml
[ "bbe3a2ecc93b14197147ce399008beef28be7a14" ]
[ "api/app/main.py" ]
[ "from typing import Optional\n\nimport pandas as pd\nfrom fastapi import FastAPI\n\nfrom app.model import Model\n\napp = FastAPI()\nmodel = Model(\"xgboost\", \"Production\")\n\n@app.get(\"/\")\ndef read_root():\n data = pd.read_csv('casas_X.csv')\n\n return { \"model_name\" : model.make_predictions(data) }\n...
[ [ "pandas.read_csv" ] ]
greenfrogs/FHIR-Parser
[ "1408da63e93eff753d4cba82f4fef9e2c177c8c9" ]
[ "examples/graph_marital_status.py" ]
[ "import matplotlib.pyplot as plt\nfrom fhir_parser import FHIR\n\nfhir = FHIR()\npatients = fhir.get_all_patients()\n\nmarital_status = {}\nfor patient in patients:\n if str(patient.marital_status) in marital_status:\n marital_status[str(patient.marital_status)] += 1\n else:\n marital_status[str...
[ [ "matplotlib.pyplot.show" ] ]
suomitekai/fairing
[ "9ca6a1138529b3f0b21979d62c7cb1f303bc52e0" ]
[ "examples/distributed-training/main.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 requir...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.RunMetadata", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.Variable", "tensorflow.summary.image", "tensorflow.name_scope", "tensorflow.square", "tensorflow.argmax...
Jumperkables/tvqa_modality_bias
[ "d753ad679e6a53f2be38e1b882164e33e991b0e6" ]
[ "tools/violin_plot_old.py" ]
[ "import sys, os\n#sys.path.insert(1, os.path.expanduser(\"~/kable_management/mk8+-tvqa\"))\n#sys.path.insert(1, os.path.expanduser(\"~/kable_management/projects/tvqa_modality_bias\"))\nsys.path.insert(1, \"..\")\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport argparse\nimport os...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "numpy.stack", "pandas.DataFrame", "matplotlib.pyplot.show" ] ]
nokia/zigzag
[ "67c00b9ccd5df7ccecf6e8fc0fc8d1214056b8b3" ]
[ "classes/spatial_loop.py" ]
[ "\"\"\"\nSpatial loop information extraction and integration.\n\nAlways note that the first level in spatial loops is MAC level (pure logic), not a memory level.\nThus the spatial loops always have one more level than temporal loops.\n\"\"\"\n\nimport numpy as np\n\n\nclass SpatialLoop(object):\n\n def __init__(...
[ [ "numpy.prod" ] ]
linesd/tabular-methods
[ "05ee6488feffc64d3bb7335f26b2e9688d90a57b" ]
[ "examples/example_qlearning.py" ]
[ "import sys\nsys.path.append(\"..\")\nimport numpy as np\nfrom env.grid_world import GridWorld\nfrom algorithms.temporal_difference import qlearning\nfrom utils.plots import plot_gridworld\nnp.random.seed(1)\n\n###########################################################\n# Run Q-Learning on cliff walk ...
[ [ "numpy.array", "numpy.random.seed" ] ]
kidpaul94/masknet
[ "f70324cfecd9c91dce532284efec02636c04af65" ]
[ "evaluation/evaluate_stats.py" ]
[ "import open3d as o3d\nimport argparse\nimport os\nimport sys\nimport logging\nimport numpy\nimport numpy as np\nimport torch\nimport torch.utils.data\nimport torchvision\nfrom torch.utils.data import DataLoader\nfrom tensorboardX import SummaryWriter\nfrom tqdm import tqdm\nimport transforms3d.euler as t3d\nimport...
[ [ "numpy.square", "numpy.dot", "torch.load", "torch.utils.data.DataLoader", "torch.is_tensor", "numpy.matmul", "torch.tensor", "numpy.std", "numpy.mean", "torch.cuda.is_available", "torch.device", "numpy.array" ] ]
JinsuRhee/TreeFrog
[ "ce876d78564f39de75df4bb65364c31a8c2c8fd0" ]
[ "examples/example_produce_walkabletree.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 16 11:05:33 2017\n\nExample of loading a raw tree, building the head/tail, root head/ root tail info writing a walkable tree.\n@author: Pascal Jahan Elahi\n\n\"\"\"\n\nimport sys\nimport os\nimport glob\nimport time\nimport numpy as np\nimport copy\nimport h5py\n...
[ [ "numpy.array", "numpy.zeros", "numpy.loadtxt" ] ]
spokestack/spokestack-python
[ "95e451f9ab6ab1af2370d3e1007ebf6739e4765f" ]
[ "tests/tts/test_tts_client.py" ]
[ "\"\"\"\nThis module contains the tests for the TTSClient class\n\"\"\"\nfrom unittest import mock\n\nimport numpy as np\nimport pytest\nfrom requests import Response\n\nfrom spokestack.tts.clients.spokestack import TextToSpeechClient, TTSError\n\n\ndef test_graphql():\n client = TextToSpeechClient(\"\", \"\", \...
[ [ "numpy.ones" ] ]
odavalos/ACTINN-PyTorch
[ "1bc8b127968c2aec9e3d52c949f923434a4d189a" ]
[ "ACTINN/utils.py" ]
[ "# std libs\nimport os\nimport numpy as np\nfrom sklearn.metrics import f1_score\nfrom sklearn.metrics import classification_report as class_rep\n\n\n# torch libs\nimport torch\n\n\ndef load_model(model, pretrained_path):\n \"\"\"\n Loading pre-trained weights of a model\n INPUTS:\n model -> a pytor...
[ [ "torch.load", "torch.no_grad", "torch.cuda.is_available", "sklearn.metrics.f1_score", "numpy.array", "sklearn.metrics.classification_report", "torch.save" ] ]
vivarium-collective/vivarium-cell
[ "c504704a63ee8211f5f11e7fe486287dbc7553c3" ]
[ "vivarium_cell/library/lattice_utils.py" ]
[ "'''\n==================================\nUtilities for Lattice Environments\n==================================\n'''\n\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\nfrom scipy import constants\n\nfrom vivarium.library.units import units, Quantity\n\n\nAVOGADRO = constants...
[ [ "numpy.array", "numpy.floor" ] ]
arv1997/Mask_RCNN
[ "648eb10c57427d61704a0be8d50c9e77d7c0c2ce" ]
[ "mrcnn/visualize_cv.py" ]
[ "import cv2\nimport numpy as np\n\n\ndef random_colors(N):\n np.random.seed(1)\n colors = [tuple(255 * np.random.rand(3)) for _ in range(N)]\n return colors\n\n\ndef apply_mask(image, mask, color, alpha=0.5):\n \"\"\"apply mask to image\"\"\"\n for n, c in enumerate(color):\n image[:, :, n] = ...
[ [ "numpy.random.rand", "numpy.where", "numpy.any", "numpy.random.seed" ] ]
gperkz12/PhysioNet_2020
[ "953651c5354ee698302ba65a3cc55ca98b77e0ae" ]
[ "data_features.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os\nimport sys\nimport scipy.io as sio\nimport pickle as pk\nfrom scipy.signal import butter, lfilter\nfrom scipy import stats\n\n\ndef detect_peaks(ecg_measurements,signal_frequency,gain):\n\n \"\"\"\n Method responsible for extracting peaks from loade...
[ [ "numpy.hstack", "numpy.logical_and", "numpy.ediff1d", "scipy.stats.tvar", "numpy.median", "numpy.argwhere", "numpy.ones", "scipy.signal.butter", "numpy.std", "numpy.mean", "scipy.stats.skew", "scipy.stats.kurtosis", "scipy.signal.lfilter", "numpy.array", ...
dustrider/python_ai
[ "16d9806a06ed0f4ba1fe638458caa37343482e0a" ]
[ "unsupervised_learning/est_cluster_silhouette_score/app.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import metrics\nfrom sklearn.cluster import KMeans\n\n# Load data from input file\nx = np.loadtxt('data_quality.txt', delimiter=',')\n# Initialize variables\nscores = []\nvalues = np.arange(2, 10)\n# Iterate through the defined range\nfor num_cluste...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "sklearn.cluster.KMeans", "numpy.arange", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "numpy.argmax", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show...
KendallPark/buster
[ "27d996b383cc2e0ccfcc8d237aa0fdb8a2499400" ]
[ "buster/sampler.py" ]
[ "from typing import Callable\n\nfrom IPython import embed\n\nimport pandas as pd\nimport numpy.typing as npt\n\nfrom buster.metrics import gowers\nfrom skopt import sampler, optimizer\n\nimport skopt.space as sp\n\nfrom typing import Optional, Text, Union\n\nfrom sklearn.utils import check_random_state\n\nfrom skle...
[ [ "numpy.max", "numpy.append", "numpy.shape", "numpy.argsort", "numpy.array" ] ]
Khoronus/researchM-lightweight-human-pose-estimation.pytorch
[ "8a66f5fd4c21205fc2e47451fc3e06daeeb77408" ]
[ "test-dataset.py" ]
[ "import argparse\nimport cv2\nimport os\n\nimport torch\nfrom torch.nn import DataParallel\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\n\nfrom datasets.coco import CocoTrainDataset\nfrom datasets.transformationsV3 import ConvertKeypoints, Scale, Rotate, ...
[ [ "numpy.moveaxis" ] ]
sethupavan12/tensorflow
[ "505f62290840d952397340a98967ed1889caf5ab" ]
[ "tensorflow/python/keras/saving/saved_model/utils.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.keras.utils.tf_inspect.ismethod", "tensorflow.python.util.tf_decorator.make_decorator", "tensorflow.python.keras.backend.learning_phase", "tensorflow.python.keras.utils.tf_inspect.FullArgSpec", "tensorflow.python.eager.context.executing_eagerly", "tensorflow.python.keras...
TomBourgeade/allennlp
[ "357691546bf65fc464bd0b564749bfa97e6db9aa" ]
[ "allennlp/modules/token_embedders/pretrained_transformer_embedder.py" ]
[ "import logging\nimport math\nfrom typing import Optional, Tuple, Dict, Any\n\nfrom overrides import overrides\n\nimport torch\nimport torch.nn.functional as F\nfrom transformers import XLNetConfig\n\nfrom allennlp.data.tokenizers import PretrainedTransformerTokenizer\nfrom allennlp.modules.scalar_mix import Scalar...
[ [ "torch.zeros_like", "torch.arange", "torch.nn.functional.pad", "torch.cat" ] ]
alan-turing-institute/WimbledonPlanner
[ "ff73f2a52425d7855ebf224f6acc59fa99ff664b" ]
[ "wimbledon/wimbledon.py" ]
[ "import pandas as pd\nimport holidays\nfrom copy import deepcopy\nimport numpy as np\nimport warnings\n\nimport wimbledon.config\nimport wimbledon.harvest.db_interface\nfrom wimbledon.sql import query_db\n\n\ndef get_business_days(start_date, end_date):\n \"\"\"Get a daily time series between start_date and end_...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.Series", "numpy.isnan", "pandas.DataFrame", "pandas.date_range", "pandas.tseries.offsets.BDay" ] ]
CyrilCadoux/dsp-labs
[ "8ef53fccb87ad842051d9032d127a86c1172155f" ]
[ "scripts/filter_design/iir_comparison.py" ]
[ "\"\"\"\nCompare various IIR filters\n\"\"\"\n\nimport numpy as np\nfrom scipy import signal\nimport matplotlib.pyplot as plt\n\n\ndef freq2rad(freq, fs):\n return freq * np.pi / (fs/2)\n\n\ndef rad2freq(rad, fs):\n return rad * (fs/2) / np.pi\n\n\n# MAIN PARAMETER\npole_coef = 0.95\nfs = 16000\n\n# prepare f...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "scipy.signal.freqz", "matplotlib.pyplot.margins", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplo...
virajmehta/differentiable_grasp_quality
[ "3d22a5420ceac7bdd9104670f56b755787a677e6" ]
[ "src/gq_gradient_descent.py" ]
[ "import os\nimport sys\nimport numpy as np\nimport tensorflow as tf\nfrom tf_grasp_quality import grasp_quality\nfrom ipdb import set_trace as db\n\nkEpsilon = 1e-5\nkMaxIterations = 1000 #probably way too big\nkLearningRate = 0.1\noutput_grasp_dir = 'test_data/outputs/'\nlog_dir = output_grasp_dir + 'logdir/'\n\n\...
[ [ "tensorflow.get_variable", "numpy.expand_dims", "tensorflow.constant", "tensorflow.summary.scalar", "tensorflow.summary.FileWriter", "tensorflow.train.AdagradOptimizer", "numpy.linalg.norm", "numpy.save", "tensorflow.placeholder", "numpy.concatenate", "tensorflow.squeez...
liuwell/srat
[ "7ee7e69bac1aaef70ba436e6c002c102bb4a6fc7" ]
[ "srat/corr_heatmap.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport argparse\n\n\n# Reference\n# Ref links: https://matplotlib.org/gallery/images_contours_and_fields/image_annotated_heatmap.html\n\n# The usage of the following functions and methods is shown i...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.ticker.StrMethodFormatter", "numpy.log2", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close" ] ]
bdmckean/woot_math_analysis
[ "d3308e413da2e41fff5060f10339b5ab4d01d690" ]
[ "working/EDA_WM-BrianMc.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\nimport pymongo\nimport pandas as pd\nimport numpy as np\n\nfrom pymongo import MongoClient\nfrom bson.objectid import ObjectId\n\nimport datetime\n\nimport matplotlib.pyplot as plt\n\nfrom collections import defaultdict\n\n\nget_ipython().magic(u'matplotlib inline')\nimport json\np...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.hist", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel" ] ]
gvellut/rastachimp
[ "9c3e58e80f95d73322b0f8b323cd341574451373" ]
[ "tests/test_rastachimp.py" ]
[ "import fiona\nimport numpy as np\nfrom pytest import approx\nfrom rasterio import features\nfrom shapely.geometry import LineString, mapping\n\nfrom rastachimp import as_shapely, simplify_dp, smooth_chaikin\nfrom rastachimp.rastachimp import _densify_edges, _point_distance\n\n\ndef test_simplify_basic():\n shap...
[ [ "numpy.arange", "numpy.array" ] ]
sneaxiy/DALI
[ "9692aacc14d43a9e0b2fec3369c4a9266f5eab8b" ]
[ "dali/test/python/test_utils.py" ]
[ "# Copyright (c) 2019-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2....
[ [ "numpy.fromfile", "numpy.minimum", "numpy.abs", "numpy.array_equal", "numpy.min", "numpy.save", "numpy.max", "numpy.mean", "numpy.iinfo", "numpy.array", "numpy.sum", "numpy.random.default_rng" ] ]
g1910/webdataset
[ "7519b372777e3a0dac7be7f0ecfeb1b7535351e3" ]
[ "webdataset/dataset.py" ]
[ "#!/usr/bin/python\n#\n# Copyright (c) 2017-2019 NVIDIA CORPORATION. All rights reserved.\n# This file is part of the WebDataset library.\n# See the LICENSE file for licensing terms (BSD-style).\n#\n\n\n\"\"\"Train PyTorch models directly from POSIX tar archive, locally\nor over HTTP connections.\n\"\"\"\n\n__all__...
[ [ "torch.utils.data.DataLoader", "torch.utils.data.get_worker_info", "torch.distributed.is_initialized", "torch.distributed.is_available", "torch.distributed.get_rank", "torch.distributed.get_world_size" ] ]
china-aqi/rim
[ "0e1de286c8debec952ed57e2ce1e1d75ec09745e" ]
[ "src/aqi_db.py" ]
[ "from functools import lru_cache\nimport datetime\nfrom typing import Tuple, List, Callable, NamedTuple\nfrom collections import namedtuple\n\nimport sqlalchemy\nimport pandas as pd\n\n\ndef get_securities():\n return pd.read_sql('securities', con=sqlalchemy.create_engine('sqlite:///../data/jq.db'))\n\n\n@lru_ca...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
TexasInstruments/tvm
[ "c78ea878a05e262a30c3ffa250c1479a695ecf33" ]
[ "tests/python/frontend/tflite/test_forward.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "tensorflow.python.ops.array_ops.space_to_batch_nd", "tensorflow.python.ops.array_ops.strided_slice", "numpy.asarray", "tensorflow.python.ops.array_ops.split", "numpy.squeeze", "tensorflow.python.ops.nn_ops.conv2d_transpose", "tensorflow.python.ops.nn_ops.pool", "tensorflow.lite.TF...
apoorv2904/fairseq
[ "d60eb45f09721d04e14791eb184770234324e3d8" ]
[ "fairseq/tasks/fairseq_task.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nimport os\nimport warnings\nfrom argparse import Namespace\n\nimport torch\nfrom fairseq import metrics, search, tok...
[ [ "torch.autograd.profiler.record_function", "torch.no_grad" ] ]
algotradingsoc/generative_modelling
[ "c08fc241a82e959d29e3fc8e9566b06e016f6131" ]
[ "genmodels/gpvae/gp_vae.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom tensorflow_probability import distributions as tfd\nfrom collections import defaultdict\nimport time\nfrom sklearn import preprocessing\n\nfrom genmodels.gpvae.kernels import *\nfrom genmodels.gpvae.encoder import *\nfrom genmodels.gpvae.decoder import *\n\n\"\"\"\...
[ [ "tensorflow.device", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.cast", "numpy.concatenate", "tensorflow.random.set_seed", "tensorflow.math.is_finite", "numpy.ceil", "tensorflow.square", "tensorflow.tile", "numpy.multiply", "numpy.random.choice", "t...
fenglsuc/PatCit
[ "6f2585dac156a69ff94f002d387c75bd723529df" ]
[ "bin/prep-npl-class.py" ]
[ "import os\nfrom glob import glob\n\nimport pandas as pd\nimport spacy\nimport typer\nfrom tqdm import tqdm\nfrom wasabi import Printer\n\nVAR = [\"npl_publn_id\", \"npl_class\"]\nmsg = Printer()\n\n\n# Could certainly do better in terms of efficiency. Still OK -> takes around 4:30 to process\n# the full db\n\n\n...
[ [ "pandas.read_csv" ] ]
TripleEss/TDALayer
[ "25a2da5eab50fad2d006167c2d1c97ec5efb53e0" ]
[ "nn/levelset_dionysus.py" ]
[ "from ..functional.levelset_dionysus import Diagramlayer as levelsetdgm\r\nfrom ..util.process import remove_filler\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport numpy as np\r\nfrom scipy.spatial import Delaunay\r\nimport dionysus as d\r\n\r\ndef init_freudenthal_2d(width, height):\r\n \"\"\"\r\n Fre...
[ [ "numpy.arange", "numpy.meshgrid", "numpy.transpose" ] ]
gevaertlab/DAPL
[ "afa5f52a6e638df056747db089c8ff2b0b9783b9" ]
[ "predict_random_missing.py" ]
[ "import os\nimport tensorflow as tf\nimport pandas as pd\nimport time\nfrom autoencoder import *\nimport random\nimport numpy as np\n\n \ndef reconstruct_loss(dataset_test_uncorrutped,dataset_test,autoencoder_fun,checkpoint_file='default.ckpt',missing_ind=None):\n input_image, reconstructed_image = autoen...
[ [ "pandas.read_csv", "numpy.random.seed", "numpy.asarray", "numpy.set_printoptions", "numpy.random.binomial", "tensorflow.global_variables_initializer", "numpy.append", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.train.Saver", "numpy.where", "n...
anonymouscontributor/cnr
[ "f0c793baddf67b8540ea90617e82d27269d367b9" ]
[ "cnr/utils.py" ]
[ "'''\nCollection of utility functions\n\n@date May 25, 2015\n'''\n\nimport numpy as np\nimport pickle, os\nfrom matplotlib import pyplot as plt\nfrom matplotlib import cm\nimport mpl_toolkits.mplot3d.axes3d as p3\nfrom .Domains import nBox, DifferenceOfnBoxes\n\n\ndef plot_results(results, offset=500, directory=Non...
[ [ "matplotlib.pyplot.legend", "numpy.linspace", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.plot", "numpy.max", "numpy.exp", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.log", "matplotlib.pyplot.t...
wild-flame/rafiki
[ "08f44bc2f2f036183658366889b9513cc967c39d" ]
[ "examples/models/image_classification/TfFeedForward.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.python.client import device_lib\nimport json\nimport os\nimport tempfile\nimport numpy as np\nimport base64\n\nfrom rafiki.config import APP_MODE\nfrom rafiki.model import BaseModel, InvalidModelParamsException, test_model_class, \\\n ...
[ [ "tensorflow.keras.models.load_model", "tensorflow.Graph", "tensorflow.keras.callbacks.LambdaCallback", "tensorflow.python.client.device_lib.list_local_devices", "numpy.asarray", "tensorflow.keras.layers.Dense", "tensorflow.keras.Sequential", "tensorflow.ConfigProto", "tensorflo...
SmartChemDesign/gcnn_mol_transfer
[ "ba6908d79c3da442e73ba17cc5025eb7fb5fb570" ]
[ "run_train.py" ]
[ "import os\r\nimport tensorflow as tf\r\nfrom keras import backend\r\nimport sys\r\n\r\nsys.path.append(\"./Source\")\r\nfrom Keras_graphconv import GraphConvModelMod\r\nfrom TransferTrainer import TransferTrainer\r\n\r\nconfig = tf.ConfigProto(log_device_placement=True)\r\nconfig.gpu_options.allow_growth = True\r\...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
anguyen8/sam
[ "6f9525adacb65b4f5e00bbea23a1e37c9008db27" ]
[ "Sensitivity_Analysis_Basic_Occlusion_Comp_With_Default_Settings.py" ]
[ "import argparse, time, os, sys, glob, warnings, ipdb, math\nfrom RISE_evaluation import CausalMetric, auc, gkern\nfrom skimage.measure import compare_ssim as ssim\nfrom scipy.stats import spearmanr, pearsonr\nfrom skimage.transform import resize\nfrom itertools import combinations\nfrom skimage.feature import hog\...
[ [ "numpy.expand_dims", "numpy.abs", "numpy.isnan", "scipy.stats.pearsonr", "numpy.load", "numpy.var", "numpy.concatenate", "numpy.std", "numpy.mean", "numpy.savetxt", "scipy.stats.spearmanr", "numpy.array" ] ]
lxjlu/highway-env
[ "b360ed3f4f7fca950294c82b04c55464624d5626" ]
[ "Pre-skills/data_collect.py" ]
[ "import gym\nimport highway_env\nimport time\nimport pprint\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nenvs = {\n 0: \"myenv-c1-v0\", # 直线\n 1: \"myenv-c2-v0\", # 中度弯曲\n 2: \"myenv-c3-v0\", # 大量弯曲\n}\nN = 50\n\n# 1保持 0减速 2加速 lon\n# -1左 0保持 1右 latral\n\"\"\"\n | 0 1 2\n-1 |\n 0 |\n 1 ...
[ [ "numpy.arange", "numpy.clip", "numpy.random.choice" ] ]
Bartolo1024/RL-Local-Path-Planning
[ "c00824f54d7a2210cf26be5635e3c78233bf4a24" ]
[ "utils/__init__.py" ]
[ "import re\nimport numpy as np\nfrom .session import get_new_session_id\nfrom .loger import Logger\nfrom .saver import NetSaver\n\n\ndef _generate_action_space(speed_range=(.05, 0.3), speed_steps=2, rot_range=(-.3, .3), rot_steps=3):\n _speeds = np.linspace(*(speed_range + (speed_steps,)))\n _rots = np.linspa...
[ [ "numpy.linspace" ] ]
norgon1123/AugSenseTF
[ "4f8b22dfc8c9f7a4e07ec4f1d41a05b6967364be" ]
[ "scripts/label_image.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.Graph", "tensorflow.image.resize_bilinear", "tensorflow.import_graph_def", "tensorflow.read_file", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.cast", "tensorflow.image.decode_png", "tensorflow.expand_dims", "tensorflow.image.decode_bmp", "tensorfl...
shijiale0609/Python_Data_Analysis
[ "c18b5ed006c171bbb6fcb6be5f51b2686edc8f7e" ]
[ "PythonDAdata/3358OS_06_Code/code6/pd_plotting.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n\ndf = pd.read_csv('transcount.csv')\ndf = df.groupby('year').aggregate(np.mean)\n\ngpu = pd.read_csv('gpu_transcount.csv')\ngpu = gpu.groupby('year').aggregate(np.mean)\n\ndf = pd.merge(df, gpu, how='outer', left_index=True, right_index=T...
[ [ "pandas.merge", "pandas.read_csv", "matplotlib.pyplot.show" ] ]
RobotJud2019/atmt-1
[ "3966ec45b12a8512e8629266ccc3bcf5ece8bb3c" ]
[ "translate_beam.py" ]
[ "import os\nimport logging\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\n\nimport torch\nfrom torch.serialization import default_restore_location\n\nfrom seq2seq import models, utils\nfrom seq2seq.data.dictionary import Dictionary\nfrom seq2seq.data.dataset import Seq2SeqDataset, BatchSampler\nfrom s...
[ [ "torch.softmax", "torch.ones", "torch.cat", "torch.manual_seed", "torch.serialization.default_restore_location", "torch.no_grad", "torch.where", "torch.stack", "numpy.where" ] ]
suryaabhi/ray
[ "112ef075632c0815beb9838b91a83331fe649f0b" ]
[ "python/ray/worker.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport atexit\nimport cloudpickle as pickle\nimport collections\nimport colorama\nimport copy\nimport hashlib\nimport inspect\nimport json\nimport numpy as np\nimport os\nimport redis\nimport signal\ni...
[ [ "numpy.random.bytes", "numpy.random.get_state", "numpy.random.set_state", "numpy.random.seed" ] ]
PranavEranki/BayesianSuperResolution
[ "ca983f814061b04c35b71d921acdfed1e30cddb6" ]
[ "main.py" ]
[ "from __future__ import print_function\nimport argparse\nfrom math import log10\nimport os\nimport math\nimport torch\n#import torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom model import BBBNet\nfrom utils.BBBlayers import GaussianVariationalInference\nfrom data import ge...
[ [ "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.nn.MSELoss", "torch.save" ] ]
srinathos/swa
[ "147a7e8aa780952a2ac680919661b71740b96833" ]
[ "activations.py" ]
[ "import torch\nimport torch.nn.functional as F\n\n\ndef chabanne_2(x):\n # x = x/2\n return 0.1992 + 0.5002 * x + 0.1997 * x ** 2\n\n\ndef chabanne_3(x):\n return 0.1995 + 0.5002 * x + 0.1994 * x ** 2 - 0.0164 * x ** 3\n\n\ndef chabanne_4(x):\n return 0.1500 + 0.5012 * x + 0.2981 * x ** 2 - 0.0004 * x *...
[ [ "torch.abs", "torch.nn.functional.sigmoid", "torch.nn.Softplus", "torch.cos" ] ]
sangyi92/alphago_zero
[ "6acd092e9b904eb725da031f8c5f8b4e1bdae111" ]
[ "AlphagoZero/mcts.py" ]
[ "\"\"\"Monte Carlo Tree Search, as described in Silver et al 2017.\n\nThis is a \"pure\" implementation of the AlphaGo MCTS algorithm in that it is not specific to the\ngame of Go; everything in this file is implemented generically with respect to some state, actions,\npolicy function, and value function.\n\"\"\"\n...
[ [ "numpy.sqrt", "numpy.sum", "numpy.random.choice", "numpy.power" ] ]
EricCousineau-TRI/ravens
[ "d7f9db3214ed730c6d16e5c248684688555c6d23" ]
[ "ravens/tasks/block_insertion.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Ravens 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 a...
[ [ "numpy.int32", "numpy.random.rand" ] ]
ThomasAldheimerFCG/continued-functions
[ "3285c570cfffd6fa6bc7e5264e843b85602b0487" ]
[ "continued_functions.py" ]
[ "import numpy as np\r\nimport cmath as cm\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.patches as mpatches\r\nimport os\r\n\r\ncolor_codes = {1: 'red', 2: 'yellow', 3: 'blue', 4: 'green', 5: 'magenta', 6: 'crimson', 7: 'violet', 8: 'gold',\r\n 9: 'palegreen', 10: 'orange', 11: 'skyblue', 12...
[ [ "matplotlib.pyplot.legend", "matplotlib.patches.Patch", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure" ] ]
guanghaoyin/CVRKD-IQA
[ "b596a53c064d5472feb63fc61abe0b100e40606f" ]
[ "models/DCNN_NARIQA.py" ]
[ "import torch\nimport torchvision\nimport torch.nn.functional as F\nimport torch.nn as nn\n\nclass DCNN_NARIQA(nn.Module):\n def __init__(self):\n super().__init__()\n #ref path\n self.block1_ref = nn.Sequential(\n nn.Conv2d(in_channels=3, out_channels=64, kernel_size=7, stride=4)...
[ [ "torch.cat", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.rand", "torch.nn.ReLU" ] ]
Shen0000/Huggingface-DeBERTa
[ "b8553e57d722c3364ba5f940e7e8a5c95f13880d" ]
[ "examples/tensorflow/multiple-choice/run_swag.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. 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# ...
[ [ "tensorflow.keras.metrics.SparseCategoricalAccuracy", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.ragged.constant", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.data.Options", "numpy.array" ] ]
sgraetzer/HearingLossSimulator
[ "26fc199b95b10fa97b7fda643595f1d37c419b33" ]
[ "hearinglosssimulator/pyacqnodes.py" ]
[ "from pyqtgraph.Qt import QtCore\nimport pyqtgraph as pg\nimport numpy as np\n\ntry:\n import pyacq\n HAS_PYACQ = True\nexcept ImportError:\n HAS_PYACQ = False\n\n\n\n\nclass Mutex(QtCore.QMutex):\n def __exit__(self, *args):\n self.unlock()\n\n def __enter__(self):\n self.lock()\n ...
[ [ "numpy.dtype" ] ]
andrewcistola/fracture-proof
[ "d67f8f4f688fe4168d7eae3a3f991463ee112324" ]
[ "version_2/v2-1/mrfp_code.py" ]
[ "# Information\nname = 'mrfpsctwc_fldm2_code' # Inptu file name with topic, subtopic, and type\npath = 'fracture-proof/version_2/v2-1/' # Input relative path to file \ndirectory = '/home/drewc/GitHub/' # Input working directory\ntitle = 'FractureProof v2.1 - Mr. Fracture Proofs Contemplative Woodcarving for Diabete...
[ [ "sklearn.ensemble.RandomForestRegressor", "pandas.merge", "pandas.read_csv", "pandas.concat", "sklearn.impute.SimpleImputer", "pandas.DataFrame", "sklearn.linear_model.LinearRegression", "sklearn.preprocessing.StandardScaler", "sklearn.decomposition.PCA" ] ]
DarthThomas/vedadet
[ "6c50f7b497d9c24c391539b41498551cc20940a6" ]
[ "vedadet/assembler/trainval.py" ]
[ "import torch\n\nfrom vedacore.hooks import HookPool\nfrom vedacore.loopers import EpochBasedLooper\nfrom vedacore.parallel import MMDataParallel, MMDistributedDataParallel\nfrom vedadet.datasets import build_dataloader, build_dataset\nfrom vedadet.engines import build_engine\n\n\ndef trainval(cfg, distributed, log...
[ [ "torch.cuda.current_device" ] ]
jetyey/Texte
[ "933121f8a79af0db7f7e7fd5d56685a18cd45423" ]
[ "data/util.py" ]
[ "import numpy as np\nimport pandas as pd\n\ndef data_set(path=\"./data/stanfordSentimentTreebank\", drop_neutral=True, cut_off=3, binary=False):\n \"\"\"\n\n :param str path: path to the `stanfordSentimentTreebank`\n :param bool drop_neutral: if ignore neutral label or not\n :param cut_off: cut off the ...
[ [ "pandas.read_csv", "numpy.median", "numpy.sort", "numpy.mean", "numpy.array", "numpy.sum" ] ]
OpenMDAO/OpenMDAO
[ "5c53061decba3bcef63ed7fab73ed1fa52064355" ]
[ "openmdao/components/explicit_func_comp.py" ]
[ "\"\"\"Define the FuncComponent class.\"\"\"\n\ntry:\n import jax\n from jax import jvp, vjp, vmap, random, jit\n import jax.numpy as jnp\nexcept ImportError:\n jax = None\n\nimport re\nimport numpy as np\nfrom numpy import asarray, isscalar, imag, complex as npcomplex\nfrom itertools import product\nfr...
[ [ "numpy.asarray", "numpy.isscalar" ] ]
Zahlii/shap
[ "28010d77f40141aaf8c69534f9c0878448cd1e49" ]
[ "shap/explainers/tf_utils.py" ]
[ "tf = None\nimport warnings\n\ndef _import_tf():\n \"\"\" Tries to import tensorflow.\n \"\"\"\n global tf\n if tf is None:\n import tensorflow as tf\n\ndef _get_session(session):\n \"\"\" Common utility to get the session for the tensorflow-based explainer.\n\n Parameters\n ----------\n...
[ [ "tensorflow.get_default_session", "tensorflow.keras.backend.get_session", "tensorflow.compat.v1.keras.backend.get_session", "tensorflow.executing_eagerly" ] ]
biosustain/croissance
[ "284d08499efa37dd52069c390e1a9612f2496531" ]
[ "croissance/formats/input.py" ]
[ "import pandas\n\n\nclass TSVReader:\n def __init__(self, filepath):\n self._filepath = filepath\n\n def read(self):\n with open(self._filepath, \"rt\") as handle:\n data = pandas.read_csv(handle, sep=\"\\t\", header=0, index_col=0)\n\n return [(name, data[name].dropna()) for n...
[ [ "pandas.read_csv" ] ]
enisbelgacem/montepython_public
[ "e829e8bb1185a166e6a02e013cf419469288947e" ]
[ "montepython/likelihoods/HLV_gauss_opt/__init__.py" ]
[ "import os\nimport numpy as np\nfrom montepython.likelihood_class import Likelihood\n\n\nclass HLV_gauss_opt(Likelihood):\n\n # initialization routine\n\n def __init__(self, path, data, command_line):\n\n Likelihood.__init__(self, path, data, command_line)\n\n # define array for values of z and ...
[ [ "numpy.array", "numpy.shape" ] ]
km1562/detectron2
[ "b69418fcde39f84f6900d77a2c9649503b845ed7" ]
[ "tests/test_export_caffe2.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# -*- coding: utf-8 -*-\n\nimport copy\nimport os\nimport tempfile\nimport unittest\nimport torch\n\nfrom detectron2 import model_zoo\nfrom detectron2.utils.logger import setup_logger\nfrom detectron2.utils.testing import get_sample_coco_image\n\n\n@unittest.skip...
[ [ "torch.cuda.is_available" ] ]
dapengchen123/code_v1
[ "101dd339d9225e740962974754a7bb1b869b9e72" ]
[ "reid/models/resnetlstm_btfu.py" ]
[ "from __future__ import absolute_import\nimport torch.nn.functional as F\nimport torch.nn.init as init\n\nfrom torch import nn\nfrom torch.autograd import Variable\n\nfrom torchvision.models import resnet18, resnet34, resnet50, resnet101, \\\n resnet152\n\nfrom torch import zeros as t_zeros\n\nLSTM_hidden = 128\...
[ [ "torch.nn.init.kaiming_normal", "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.nn.LSTM", "torch.zeros", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.init.constant" ] ]
carlosejimenez/leaf
[ "a9507358358bbf12829183cf368bc48586121b99" ]
[ "models/graph.py" ]
[ "import seaborn as sns\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nINFILE = './my_metrics/test-accuracy.csv'\nTITLE = 'Testing Accuracy for Baseline'\nX_LABEL = 'round'\nY_LABEL = 'accuracy'\n\nif __name__ == '__main__':\n\n sns.set(style='darkgrid')\n\n data = pd.read_csv(INFILE, header=0)\n\n ...
[ [ "pandas.read_csv", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
marinakiseleva/NADE
[ "69ea890fad1e775dfff2db6dad4dd9d11b6a343e" ]
[ "deepnade/buml/Model/Model.py" ]
[ "import numpy as np\nimport theano\nimport theano.tensor as T\nfrom Utils.theano_helpers import floatX\n\n\nclass Model(object):\n\n def __init__(self):\n self.parameters = dict()\n self.parameters_to_optimise = list()\n self.parameters_to_regularise = list()\n\n def add_parameter(self, p...
[ [ "numpy.abs", "numpy.asarray", "numpy.zeros_like", "numpy.prod", "numpy.exp", "numpy.ndenumerate", "numpy.array", "numpy.zeros" ] ]
rampasek/SAN
[ "6e38329957afa6f5d5d1ce911f7725ca6f385ca4" ]
[ "nets/molhiv_graph_regression/SAN.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nimport dgl\n\nfrom ogb.graphproppred.mol_encoder import AtomEncoder, BondEncoder\n\n\"\"\"\n Graph Transformer with edge features\n \n\"\"\"\nfrom layers.graph_transformer_layer import GraphTransformerLayer\nfrom laye...
[ [ "torch.nn.Dropout", "torch.nn.BCELoss", "torch.nn.Sigmoid" ] ]
adeandrade/bayesian-optimizer
[ "30427943d69130179f7ccb32f63a08a1c57462f8" ]
[ "bayesian_optimizer.py" ]
[ "import warnings\nfrom typing import Sequence, Tuple\n\nimport numpy as np\nimport scipy.optimize as sp_optimize\nimport scipy.special as sp_special\n\nfrom .gaussian_process import GaussianProcess\nfrom .kernel import Kernel\nfrom .sobol import new_sobol_sequence_generator\n\n\nclass BayesianOptimizer:\n def __...
[ [ "numpy.diag", "numpy.sqrt", "scipy.optimize.fmin_l_bfgs_b", "numpy.min", "numpy.squeeze", "numpy.stack", "numpy.argmax", "numpy.shape", "numpy.exp", "numpy.argsort", "numpy.array", "numpy.diagonal", "numpy.sum" ] ]
oruebel/ndx-icephys-meta
[ "c97ea4f0ff60ad05e173cca30b0c46b809727f89" ]
[ "src/pynwb/ndx_icephys_meta/icephys.py" ]
[ "from pynwb import register_class\nfrom pynwb.file import NWBFile\nfrom pynwb.icephys import IntracellularElectrode, PatchClampSeries\nfrom pynwb.base import TimeSeries\nimport numpy as np\ntry:\n from pynwb.core import DynamicTable, DynamicTableRegion, VectorIndex, VectorData # pragma: no cover\nexcept Import...
[ [ "pandas.concat", "numpy.array", "pandas.MultiIndex.from_tuples", "pandas.DataFrame" ] ]
XINZHANG-ops/OwnUtilities
[ "50a4be781706082e2f50705c16be3fc54a6d9e06" ]
[ "model_trainingtime_prediction/model_level_utils.py" ]
[ "\"\"\"\n****************************************\n * @author: Xin Zhang\n * Date: 5/22/21\n****************************************\n\"\"\"\nimport time\nimport tensorflow.keras as keras\nimport pandas as pd\nfrom tqdm import tqdm\nimport numpy as np\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow...
[ [ "matplotlib.pyplot.legend", "pandas.DataFrame", "matplotlib.pyplot.plot", "sklearn.preprocessing.MinMaxScaler", "numpy.random.randint", "pandas.concat", "matplotlib.pyplot.title", "numpy.random.choice", "numpy.median", "numpy.array", "matplotlib.pyplot.show", "numpy...
Kursula/Color_palette
[ "4eae43845caae3a5a43337b38097ff4f54787d42" ]
[ "som.py" ]
[ "\"\"\"\n2-D Self-Organizing Map with Gaussian Neighbourhood function\nand linearly decreasing learning rate.\n\nThis is mostly using code from SACHIN JOGLEKAR'S blog:\nhttps://codesachin.wordpress.com/2015/11/28/self-organizing-maps-with-googles-tensorflow/\n\nThe code has been ported to Tensorflow v 1.6.0 by Mikk...
[ [ "tensorflow.Graph", "tensorflow.multiply", "tensorflow.pow", "tensorflow.assign", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.cast", "tensorflow.divide", "numpy.linalg.norm", "tensorflow.global_variables_initializer", "tensorflow.add", "tensorflow.Se...
jhonatheberson/artificial-intelligence
[ "8dfe70385bd3721b47a85411be21d9f1846c8ad3" ]
[ "researchMethods/src/fffit/pso.py" ]
[ "\"\"\"Algorithm optimization of particle swarm (PSO).\n\nThe particle optimization algorithm is a metaheuristic, it attempts to optimize\na problem interactively with a swarm of particles percoorendo to a mathematical\nfunction or search space.\n\nthe algorithm has the following steps:\n 1 - Creates a sample sp...
[ [ "numpy.abs", "numpy.clip", "numpy.linalg.norm", "numpy.random.normal", "numpy.savetxt", "numpy.array", "numpy.isclose" ] ]
INASIC/npl
[ "d1ee8ca557e7ab5df8a3a724bf41068c36406cd5" ]
[ "npl/bootstrap_gmm.py" ]
[ "\"\"\"function for NPL posterior bootstrap sampler for GMM\n\nParameters\n----------\nB_postsamples : int \n Number of posterior samples to generate\n\nalph_conc : float\n Concentration parameter for DP prior\n\nT_trunc: int > 0 \n Number of prior pseudo-samples from DP base measure for truncated sampling...
[ [ "numpy.zeros", "numpy.random.dirichlet", "numpy.ones" ] ]
Sangyeob-Kim/tensorpack_rev
[ "bf4020892edc123a09e08de784da0448464529b2" ]
[ "tensorpack/models/regularize.py" ]
[ "# -*- coding: UTF-8 -*-\n# File: regularize.py\n\n\nimport tensorflow as tf\nimport re\n\nfrom ..utils import logger\nfrom ..utils.argtools import graph_memoized\nfrom ..tfutils.tower import get_current_tower_context\nfrom .common import layer_register\n\n__all__ = ['regularize_cost', 'regularize_cost_from_collect...
[ [ "tensorflow.constant", "tensorflow.get_collection", "tensorflow.layers.dropout", "tensorflow.name_scope", "tensorflow.trainable_variables", "tensorflow.add_n" ] ]
Rasend-dev/aprendizaje_reforzado
[ "eb1def49f8c439f461d54ca95b1f9eb918a05bab" ]
[ "model.py" ]
[ "from collections import deque\nimport torch \nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport os # this is for save our model\n\nclass Linear_QNet(nn.Module):\n def __init__(self,input_size,hidden_size,output_size):\n super().__init__()\n self.linear1 = ...
[ [ "torch.unsqueeze", "torch.tensor", "torch.nn.Linear", "torch.nn.MSELoss", "torch.argmax" ] ]
TeemooHuang/2048-api
[ "ddea840d3236fa0601ea7b38de5ddc5edddc6fa9" ]
[ "RNNs_vote/RNNs_vote10_add.py" ]
[ "from game2048.game import Game\nfrom game2048.displays import Display, IPythonDisplay\nfrom game2048.agents import Agent, RandomAgent, ExpectiMaxAgent\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.data as data\nimport torchvision\nimport torchvision.transforms as transforms\nfrom t...
[ [ "torch.LongTensor", "torch.nn.CrossEntropyLoss", "torch.Tensor", "torch.nn.LSTM", "torch.utils.data.DataLoader", "torch.nn.Linear", "numpy.load", "numpy.zeros", "numpy.vstack", "torch.autograd.Variable" ] ]
TheSignPainter/CausalDiscoveryToolbox
[ "073b13a5076390147e95763bab73775c59e6d891" ]
[ "cdt/causality/pairwise/RCC.py" ]
[ "\"\"\"Randomized Causation Coefficient Model.\n\nAuthor : David Lopez-Paz\nRef : Lopez-Paz, David and Muandet, Krikamol and Schölkopf, Bernhard and Tolstikhin, Ilya O,\n \"Towards a Learning Theory of Cause-Effect Inference\", ICML 2015.\n\n.. MIT License\n..\n.. Copyright (c) 2018 Diviyan Kalainathan\n..\n.. ...
[ [ "sklearn.ensemble.RandomForestClassifier", "numpy.random.seed", "numpy.ones", "numpy.random.randn", "numpy.random.rand", "numpy.vstack" ] ]
ptsagkis/UGLab
[ "2ef1cdd0927152c763f6b36154b0a7b6c4ca2d54" ]
[ "Model/FeaturesImpact.py" ]
[ "from matplotlib.pyplot import xticks\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.linear_model import LogisticRegression\nfrom matplotlib import pyplot\nfrom Config.Constants import Constants\nfrom Services.FileUtils import FileUtils\n\n\nclass FeaturesImpact:\n \"\"\"\n couple of method...
[ [ "sklearn.ensemble.RandomForestRegressor", "sklearn.linear_model.LogisticRegression", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show" ] ]
stevezhangz/BERT-pytorch
[ "86e1d9f20c48306eeb8b6790977a575fc97bed77" ]
[ "train_demo.py" ]
[ "# encode utf-8\n# code by steve zhang z\n# Time: 4/22/2021\n# electric address: stevezhangz@163.com\nfrom bert import *\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom Config_load import *\nfrom data_process import *\nimport random\n\n\nnp.random.seed(random_seed)\n\n\n# transform json to l...
[ [ "torch.cuda.device", "torch.nn.CrossEntropyLoss" ] ]
maxguy2001/datafest2021
[ "2258651b763f258ea6c2ab9c19950cdc8ee8d75a" ]
[ "wordcloud/cal.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\ndf = pd.read_csv(\"data/uk.csv\")\n\ncols_drug_use = [\n 'FENT_USE',\n 'BUP_USE',\n 'METH_USE',\n 'MORPH_USE',\n 'OXY_USE',\n 'TRAM_USE',\n 'TAP_USE',\n 'COD_USE',\n 'DIHY_USE',\n 'HYDM_...
[ [ "pandas.read_csv", "numpy.triu_indices_from", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.zeros_like" ] ]
phankiewicz/aem
[ "61a9b502bb713413b916d82e7247fb6e9c41bc06" ]
[ "src/greedy.py" ]
[ "import math\nfrom collections import defaultdict\n\nimport numpy as np\n\n\ndef get_regret(insertion_costs):\n if len(insertion_costs) >= 2:\n return insertion_costs[1][0] - insertion_costs[0][0]\n return insertion_costs[0][0] * -1\n\n\ndef nn_greedy_tsp(distance_matrix, starting_vertex, *args, **kwar...
[ [ "numpy.zeros" ] ]
chrisprobert/genomelake
[ "11eb1d9dce41a07d0cdf13049789983b972ef937" ]
[ "tests/test_extractors.py" ]
[ "from genomelake import backend\nfrom genomelake.extractors import ArrayExtractor, BigwigExtractor, FastaExtractor\nimport numpy as np\nfrom pybedtools import Interval\nimport pyBigWig\nimport pytest\n\narray_extractor_fasta_params = [\n (\"numpy\", True),\n (\"numpy\", False),\n (\"bcolz\", True),\n (\...
[ [ "numpy.array", "numpy.stack" ] ]
owkin/MONAI
[ "a1c50211c916ee8d7c18d72f4e8a0721b403418a" ]
[ "monai/data/utils.py" ]
[ "# Copyright 2020 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to i...
[ [ "numpy.diag", "torch.max", "torch.zeros", "numpy.any", "numpy.square", "numpy.ones_like", "numpy.allclose", "torch.ones", "numpy.eye", "torch.utils.data.get_worker_info", "torch.utils.data._utils.collate.default_collate", "numpy.min", "numpy.linalg.inv", "nu...
Haddy1/glacier_bayes_unet
[ "dad1bf79e5384404c2de9765027e499487dbb24d" ]
[ "utils/metrics.py" ]
[ "import numpy as np\nimport tensorflow.keras.backend as K\nimport tensorflow as tf\nfrom scipy.spatial.distance import cdist\n\ndef dice_coefficient(u,v):\n \"\"\"\n For binary vectors the Dice cooefficient can be written as\n 2 * |u * v| / (|u**2| + |v**2|)\n\n | u * v | gives intersecting set\n |u*...
[ [ "tensorflow.reduce_sum", "scipy.spatial.distance.cdist", "numpy.argmin", "tensorflow.keras.backend.epsilon", "numpy.where", "numpy.sum" ] ]
kulkarnisp/data-driven-discretisation
[ "1819bfeb934978abd31e66fb096741029ea8b901" ]
[ "pydisc/loader.py" ]
[ "import os\r\n# import xarray\r\nimport scipy.io\r\nimport torch\r\nfrom torch.utils.data import Dataset,DataLoader,TensorDataset\r\n\r\ndatapath__ = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'datasets'))\r\n\r\n# matdata1 = scipy.io.loadmat('up.mat')\r\nmatdata2 = scipy.io.loadmat(os.path.joi...
[ [ "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.squeeze", "torch.tensor" ] ]
ericangelokim/sagemaker-inference-toolkit
[ "24db871b1b193ac1a924c21be8c3ec48853b3263" ]
[ "test/unit/test_encoder.py" ]
[ "# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the 'License'). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the 'lice...
[ [ "numpy.testing.assert_equal", "numpy.array" ] ]
QiangZiBro/compass
[ "30c3d89a69e496185488dd5f596de517f59624fc" ]
[ "utils/geometry.py" ]
[ "import open3d as o3d\nfrom spherical_voxel import spherical_voxel as sv\nfrom lie_learn.spaces import S2\nfrom typing import Tuple\nimport numpy as np\nimport math\nimport copy\nimport torch\n\n\ndef get_rotation_matrix(alfa, beta, gamma, hom_coord=False):\n \"\"\"\n Create a rotation matrix with an optional...
[ [ "numpy.diag", "numpy.dot", "numpy.expand_dims", "numpy.sqrt", "numpy.asarray", "numpy.max", "numpy.trace", "numpy.random.randint", "numpy.clip", "numpy.linalg.eig", "numpy.arange", "numpy.sin", "numpy.real", "numpy.outer", "numpy.multiply", "numpy.mi...
digital-idiot/sbnet
[ "cf8ea06430c8d8c8d7c5af266a6f926fdde12312" ]
[ "sbnet_tensorflow/benchmark/tf_conv_dims_tests.py" ]
[ "\"\"\"\n\n Sparse Blocks Network\n Copyright (c) 2017, Uber Technologies, Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENS...
[ [ "tensorflow.zeros", "tensorflow.shape", "tensorflow.stack", "tensorflow.ones", "tensorflow.test.main", "numpy.testing.assert_array_equal", "numpy.array", "tensorflow.nn.conv2d" ] ]
ahama92/outlier-detection
[ "60a723d07ea71ac312c474c007c20e6b46106d7b" ]
[ "test.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom matplotlib import animation\n\n# First set up the figure, the axis, and the plot element we want to animate\nfig = plt.figure()\nax = plt.axes(xlim=(0, 2), ylim=(-2, 2))\nline, = ax.plot([], [], lw=2)\n\n# initialization function: plot the background o...
[ [ "numpy.linspace", "numpy.sin", "matplotlib.pyplot.axes", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
ShichengChen/wavenet-generate-music
[ "cbba2264a83a44bfad964e3161769b5b5fa22536" ]
[ "readx.py" ]
[ "import datetime\n\nimport h5py\nimport numpy as np\nimport torch\nfrom torch.utils import data\nimport torch.nn.functional as F\nfrom transformData import mu_law_encode, mu_law_encode\n\nsampleSize = 16000\nsample_rate = 16000 # the length of audio for one second\n\n\nclass Dataset(data.Dataset):\n def __init_...
[ [ "numpy.random.uniform", "numpy.random.seed", "torch.zeros" ] ]
lolrudy/GPV_pose
[ "f326a623b3e45e6edfc1963b068e8e7aaea2bfff" ]
[ "engine/train.py" ]
[ "import os\nimport random\n\nimport mmcv\nimport torch\nfrom absl import app\n\nfrom config.config import *\nfrom tools.training_utils import build_lr_rate, get_gt_v, build_optimizer\nfrom network.GPVPose import GPVPose\n\nFLAGS = flags.FLAGS\nfrom datasets.load_data import PoseDataset\nimport numpy as np\nimport t...
[ [ "torch.autograd.set_detect_anomaly", "torch.load", "tensorflow.compat.v1.summary.FileWriter", "tensorflow.compat.v1.Summary.Value", "torch.utils.data.DataLoader", "torch.utils.data.sampler.SubsetRandomSampler", "tensorflow.compat.v1.disable_eager_execution" ] ]
mslapek/ray
[ "425edb5cd99417f00aed5bca5bca6a6d9e8292a2" ]
[ "python/ray/tests/test_basic.py" ]
[ "# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nfrom concurrent.futures import ThreadPoolExecutor\nimport glob\nimport io\nimport json\nimport logging\nimport os\nimport random\nimport re\nimport setproctitle\nim...
[ [ "numpy.testing.assert_equal", "numpy.uint32", "numpy.arange", "numpy.uint8", "numpy.int32", "numpy.int8", "pandas.DataFrame", "numpy.ones", "numpy.int64", "numpy.random.normal", "numpy.random.permutation", "numpy.uint64", "numpy.float64", "numpy.float32", ...
luansouzasilva31/desafio_icts
[ "3bdebf1cbab0f73b07dc5b96cebd55239cf79a73" ]
[ "categorical_classification/pyscripts/a_preprocessingDataset.py" ]
[ "import os, numpy as np, matplotlib.pyplot as plt\nfrom keras.preprocessing.image import load_img, img_to_array\n\n\ndir_images = '../cats_and_dogs_dataset/images/images'\ndir_save = '../cats_and_dogs_dataset/npz'\nif not os.path.exists(dir_save): os.mkdir(dir_save)\n\n\nnames = os.listdir(dir_images);\nnames = [i ...
[ [ "numpy.asarray", "numpy.savez_compressed", "numpy.save" ] ]
coastalcph/seq2sparql
[ "96ef08da86860d0802b9bcebac9ccceefde43b4a" ]
[ "sgnr_new.py" ]
[ "\n# -*- coding: utf-8 -*-\n\"\"\"systematicity-experiment-data-generation-v2.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1R7smQachUTswGMFNgsETtb8Zh3nZGIiZ\n\"\"\"\n\nimport json\n# Commented out IPython magic to ensure Python compati...
[ [ "pandas.concat", "pandas.read_csv", "sklearn.model_selection.train_test_split" ] ]
simona-mircheva/deep-learning-udacity
[ "d697fedd6829b715faf742be4d985fd4c2d9c664" ]
[ "finetune-a-cnn-2/finetune_a_cnn_solution.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nimport torchvision\nfrom torchvision import datasets, models, transforms\nimport time # for measuring time for testing, remove for students\n\ndef test(model, test_loader, criterion, device):\n print(\"Testin...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "torch.utils.data.DataLoader", "torch.sum", "torch.nn.Linear", "torch.cuda.is_available" ] ]
batizty/pyfm
[ "80484adbf6e990e2f2981776e66f010254151cf9" ]
[ "pyfm/example/ml-1m.py" ]
[ "#!/usr/bin/env python2.7\n# -*- coding:utf-8 -*-\n\n__author__ = 'tuoyu'\n__desc__ = \"\"\"This file is to gererate libfm format for later trainning\"\"\"\n\nimport logging\nimport sys\nimport numpy as np\n\nfrom ..reader.pandas_reader import PandasReader\n\nlogging.basicConfig(stream=sys.stdout, level=logging.INF...
[ [ "numpy.unique" ] ]
saraivaufc/Mask_RCNN
[ "a440e957c47598727bcc5e9f550f083e739e1d14" ]
[ "mrcnn/model.py" ]
[ "\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport datetime\nimport re\nimport math\nfrom collections import OrderedDict\nimport multiprocessing\nimpor...
[ [ "tensorflow.control_dependencies", "tensorflow.reduce_sum", "tensorflow.image.non_max_suppression", "tensorflow.minimum", "tensorflow.keras.layers.Conv2DTranspose", "numpy.where", "tensorflow.keras.optimizers.SGD", "tensorflow.keras.layers.Lambda", "tensorflow.keras.backend.int...
cherreggy/vq-vae-2-pytorch-master
[ "3dc4f814daeeccdc3111f18ec404e01c1f712abc" ]
[ "vqvae.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nimport distributed as dist_fn\n\n\n# Copyright 2018 The Sonnet 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...
[ [ "torch.nn.Sequential", "torch.nn.ConvTranspose2d", "torch.cat", "torch.zeros", "torch.randn", "torch.nn.Conv2d", "torch.nn.functional.one_hot", "torch.nn.ReLU" ] ]
FarshidNooshi/CI_ANN_Fruit_Detector
[ "e027ab95e744f6421dee1ca9a96cac80ff89f881" ]
[ "Implementation/ANN/section_two/main.py" ]
[ "import time\n\nimport numpy as np\n\nfrom ANN.section_one.credentials import get_path_of_Datasets\nfrom ANN.section_one.utils.utilsV1 import load_data\nfrom ANN.section_two.utils.utilsV2 import L_layer_model\n\npath = get_path_of_Datasets()\ntrain_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig = lo...
[ [ "numpy.zeros" ] ]
mkeguida/Open3D_2019-02-13
[ "264a9bf79615d7a2143c0afed68cc83cf586e1cb" ]
[ "examples/Python/Basic/rgbd_tum.py" ]
[ "# Open3D: www.open3d.org\n# The MIT License (MIT)\n# See license file or visit www.open3d.org for details\n\n# examples/Python/Tutorial/Basic/rgbd_tum.py\n\nfrom open3d import *\nimport matplotlib.pyplot as plt\n\n\nif __name__ == \"__main__\":\n print(\"Read TUM dataset\")\n color_raw = read_image(\"../../T...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.title" ] ]