repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
hutao965/lightseq
[ "9a617306fa711a3d6a25ef3eab9bfbe408692189" ]
[ "lightseq/training/ops/pytorch/transformer_decoder_layer.py" ]
[ "import math\nfrom dataclasses import dataclass\n\nimport torch\nfrom torch import nn\nfrom torch.autograd import Function\n\nfrom lightseq.training.ops.pytorch import transformer_cuda_module\nfrom lightseq.training.ops.pytorch.builder import TransformerBuilder\nfrom lightseq.training.ops.pytorch.util import (\n ...
[ [ "torch.empty_like", "torch.cuda.set_device", "torch.cat", "torch.Tensor", "torch.zeros", "torch.nn.init._calculate_fan_in_and_fan_out", "torch.is_grad_enabled" ] ]
0mza987/azureml-examples
[ "2abb872f1278d4b4e65587e033f38a058512b2e3" ]
[ "cli/jobs/single-step/pytorch/word-language-model/src/generate.py" ]
[ "# Copyright (c) 2017 Facebook, Inc. All rights reserved.\n# BSD 3-Clause License\n#\n# Example adapted from: https://github.com/pytorch/examples/tree/master/word_language_model\n# ==============================================================================\n\n#####################################################...
[ [ "torch.randint", "torch.Tensor", "torch.load", "torch.cat", "torch.manual_seed", "torch.multinomial", "torch.no_grad", "torch.cuda.is_available", "torch.device" ] ]
Wolfgang9999/image-super-resolution
[ "6e22da94711e9fc95d012cf84b0944a1000faebf" ]
[ "modules/data.py" ]
[ "import os\r\nimport random\r\nimport tensorflow as tf\r\nimport numpy as np\r\n\r\n\r\n# DATA_PATH = \"/media/shareef/MLDev/Datasets/DIV2K/DIV2K_train_HR\"\r\nDATA_PATH=\"data/DIV2K_valid_HR/SampleDataISR\"\r\n\r\ndef scale_input_image(img):\r\n #img/ 255.\r\n return tf.image.convert_image_dtype(img, dtype=t...
[ [ "tensorflow.clip_by_value", "tensorflow.image.decode_jpeg", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.random.uniform", "tensorflow.equal", "tensorflow.image.decode_png", "tensorflow.image.flip_left_right", "tensorflow.data.Dataset.zip", "tensorflow.image.resize"...
sega-hsj/Video_Feature
[ "4cb6d9a91504df9877c73d3fa73ee1a5adce14c0" ]
[ "videocnn/TSD/mmdet/models/detectors/two_stage.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom mmdet.core import (\n bbox2result,\n bbox2roi,\n bbox_mapping,\n build_assigner,\n build_sampler,\n merge_aug_bboxes,\n multiclass_nms,\n)\nfrom .. import builder\nfrom ..registry import DETECTORS\nfrom .base import BaseDetector\nfrom .test_mixins im...
[ [ "torch.randn", "torch.zeros", "torch.ones", "torch.cat" ] ]
gmum/lcw-generator
[ "fde1128505194bd04f04bbddcbe7fcec453b0052" ]
[ "src/common/math.py" ]
[ "import torch\r\n\r\n\r\ndef pairwise_distances(x: torch.Tensor, y: torch.Tensor = None) -> torch.Tensor:\r\n if y is None:\r\n y = x\r\n return torch.cdist(x, y)**2\r\n\r\n\r\ndef euclidean_norm_squared(X: torch.Tensor, axis: int) -> torch.Tensor:\r\n return torch.linalg.norm(X, 2, axis)**2\r\n" ]
[ [ "torch.cdist", "torch.linalg.norm" ] ]
Rabbit1010/TensorFlow2.0-Tutorial-2019
[ "def2ec0a93d73d81b9d95e60639ebe6bed383579" ]
[ "Topic2/4_UNet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 8 20:13:52 2019\n\n@author: Wei-Hsiang, Shen\n\"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.keras import layers\n\n\ndef downsample(filters, size, apply_batchnorm=True):\n result = tf.keras.Sequential()\n result.add(layers.Conv2D(filters, size, stride...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.layers.ReLU", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.utils.plot_model", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Model", ...
maksym-taranukhin/lightning-transformers
[ "aa7202657973b5b65c3c36eb745621043859ebc4" ]
[ "lightning_transformers/core/callback.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.cuda.max_memory_allocated", "torch.cuda.synchronize", "torch.cuda.reset_peak_memory_stats" ] ]
Mistobaan/tensor2tensor
[ "91d4e1c83f9abb1ca8fcd94a65d6b74aaa3458da" ]
[ "tensor2tensor/layers/common_layers.py" ]
[ "# coding=utf-8\n# Copyright 2017 The Tensor2Tensor 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 requir...
[ [ "tensorflow.convert_to_tensor", "tensorflow.control_dependencies", "tensorflow.reduce_sum", "tensorflow.tanh", "tensorflow.image.random_flip_left_right", "tensorflow.summary.image", "tensorflow.layers.dense", "tensorflow.train.get_global_step", "tensorflow.square", "tensorf...
DXYyang/shenNeng_gasAnalysis
[ "d94e2451d1938c090d1377dfbd487d0c6a649188" ]
[ "app/main/analysis/gas_kmeans_plt.py" ]
[ "def gas_kmeans_pit(dist,list,clusters):\n import matplotlib.pyplot as plt\n from sklearn.manifold import MDS\n plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签\n plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号\n MDS()\n mds = MDS(n_components=2, dissimilarity=\"precomputed\", ran...
[ [ "sklearn.manifold.MDS", "matplotlib.pyplot.subplots" ] ]
GregHilston/Google-Trends-Scraper
[ "fa5ccd0443bccffa99299748759491acf040e561" ]
[ "google_trends_scraper/google_trends_scraper.py" ]
[ "import sys\nimport os\nimport time\nimport pandas as pd\nfrom selenium import webdriver\n\nprint(f\"before path: {sys.path}\")\n\n# Adding geckodriver to our path so whoever imports our library can run correctly\nsys.path.insert(0, \"google_trends_scraper\")\n\nprint(f\"after path: {sys.path}\")\n\nclass GoogleTre...
[ [ "pandas.concat", "pandas.read_csv", "pandas.Timedelta", "pandas.date_range" ] ]
dapatil211/Jacinle
[ "37117de4abf1774548786e9534c90977d67091d8" ]
[ "jaclearn/vision/coco/setup.py" ]
[ "from setuptools import setup, Extension\nimport numpy as np\n\n# To compile and install locally run \"python setup.py build_ext --inplace\"\n# To install library to Python site-packages run \"python setup.py build_ext install\"\n\next_modules = [\n Extension(\n 'pycocotools._mask',\n sources=['src...
[ [ "numpy.get_include" ] ]
cmla-psu/dpgen
[ "f9ba8bd140cc8978f20c52de175ed52cb870fe09" ]
[ "dpgen/algorithms/adaptive_svt_private.py" ]
[ "import time\n\nimport numba\nimport numpy as np\nimport pyswarms as ps\nimport sympy as sp\n\nLENGTH = 100\nEPSILON = 1\n\n\n@numba.njit\ndef my_assert(cond):\n if not cond:\n return 1\n else:\n return 0\n\n\n@numba.njit\ndef unpack_inputs(all_inputs):\n q, dq = all_inputs[:LENGTH], all_inpu...
[ [ "numpy.square", "numpy.abs", "numpy.asarray", "numpy.linalg.norm", "numpy.concatenate", "numpy.random.laplace", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
gdaisukesuzuki/cudf
[ "aa5c8b686b1513dba7bce168200c1259f1eda908" ]
[ "python/cudf/cudf/core/column/lists.py" ]
[ "# Copyright (c) 2020-2021, NVIDIA CORPORATION.\n\nimport pickle\nfrom typing import Sequence\n\nimport numpy as np\nimport pyarrow as pa\n\nimport cudf\nfrom cudf._lib.copying import segmented_gather\nfrom cudf._lib.lists import (\n concatenate_list_elements,\n concatenate_rows,\n contains_scalar,\n co...
[ [ "numpy.issubdtype" ] ]
netneurolab/markello_transcriptome
[ "3abbc85596a5baacd93e5e9e56c906c9dbb080f3" ]
[ "scripts/generate_parameters.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nGenerates CSVs containing all combinations of processing parameters to test\n\"\"\"\n\nimport itertools\nfrom pathlib import Path\nimport uuid\n\nimport pandas as pd\n\nDATA_DIR = Path('./data/derivatives').resolve()\n\n# generate giant list of lists of dict ...
[ [ "pandas.DataFrame" ] ]
AliGhadirzadeh/yumi_follow_trajectory
[ "d30b05c979d6dc4d79f92bb207da47d1d527f9f5" ]
[ "scripts/waypoint_to_trajectory.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nfrom time import sleep\nfrom scipy import interpolate\nimport argparse\nimport os\nimport matplotlib.pyplot as plt\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--file-name\", type=str, default=None, help=\"Filename of the waypoint file with .npy extention\...
[ [ "numpy.arange", "numpy.save", "matplotlib.pyplot.plot", "numpy.append", "matplotlib.pyplot.subplot", "scipy.interpolate.CubicSpline", "numpy.savetxt", "numpy.load", "matplotlib.pyplot.show", "numpy.zeros" ] ]
tranlethaison/NumpyNeuralNet
[ "8a22784348b07e9414c70bdc3674d9a51dd81641" ]
[ "numpynn/losses.py" ]
[ "import numpy as np\n\n\nclass MSE:\n @staticmethod\n def f(y, a):\n return np.mean(0.5 * np.sum(np.square(y - a), axis=0))\n\n @staticmethod\n def df_da(y, a):\n \"\"\"Return partial derivative wrt `a` (element-wise).\"\"\"\n return a - y\n\n\nclass CrossEntropy:\n @staticmethod...
[ [ "numpy.square", "numpy.log", "numpy.argmax", "numpy.mean", "numpy.zeros" ] ]
poc1673/ML-for-Networks
[ "201ca30ab51954a7b1471740eb404b98f1d26213" ]
[ "gcn-master/gcn-master/gcn/Forced Implementation.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Dec 6 16:45:47 2020\r\n\r\n@author: USER\r\n\"\"\"\r\n\r\nimport os \r\n\r\nos.chdir(\"C://Users//USER//Dropbox//Projects//Work on Graphs//gcn-master//gcn-master//gcn\")\r\n\r\nimport setup_for_forced_procedures\r\nfrom __future__ import division\r\nfrom __futur...
[ [ "tensorflow.sparse_placeholder", "tensorflow.constant", "tensorflow.placeholder_with_default", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.set_random_seed" ] ]
vaibhav02498/NumberPlateDetection
[ "043183f5e7c0cf31ddfcf5179799c4d99f413ed4" ]
[ "tools.py" ]
[ "\"\"\"\nAuthor : Vaibhav Goyal : Automatic licence plate detection and recognition\n\n\"\"\"\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.externals import joblib\nfrom matplotlib import pyplot as plt\nimport scipy.ndimage\nimport numpy as...
[ [ "matplotlib.pyplot.imshow", "numpy.arange", "matplotlib.pyplot.plot", "numpy.concatenate", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show" ] ]
jhonore/jesse
[ "5b54e7abd20e3d5d5461dc0714e00bd64da468ac" ]
[ "tests/test_indicators.py" ]
[ "import numpy as np\n\nimport jesse.indicators as ta\nfrom jesse.factories import fake_range_candle_from_range_prices\nfrom .data.test_candles_indicators import *\n\n\ndef test_acosc():\n candles = np.array(test_candles_19)\n single = ta.acosc(candles)\n seq = ta.acosc(candles, sequential=True)\n\n asse...
[ [ "numpy.array" ] ]
expeditiona/expeditiona.github.io
[ "85c6cbddf724d87ab1c7f924d717a6aadc23286e" ]
[ "Activity327Folder/327 q2.py" ]
[ "import matplotlib.pyplot as plt\nf = open(\"3.2.7 Investigating Data - Ques 2.csv\", 'r') #Open file\n\nspot = [] #Create empty lists\npct = []\nshotpct = []\ncombined = [] \n\nlineNumber = 1\n\nfor line in f: #Iterate through lines of file\n line = line.strip()\n if lineNumber > 1 and lineNumber < 9: \n ...
[ [ "matplotlib.pyplot.subplots" ] ]
ACasey13/senpy
[ "00b5403dc95a0741abfc56c3a3e2a1e6247f15d4" ]
[ "senpy/logistic_funcs.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 28 15:29:17 2020\n\n@author: alexc\n\"\"\"\n\nimport numpy as np\nfrom scipy.special import expit\n\nSTABILITY = 1E-8\n\ndef z(x, mu, sigma):\n \"\"\"\n Returns the z-location of the given stimulus levels\n \"\"\"\n return (x - mu) / sigma\n \ndef ...
[ [ "numpy.hstack", "numpy.log", "numpy.maximum", "scipy.special.expit", "numpy.min", "numpy.max", "numpy.exp", "numpy.array", "numpy.sum" ] ]
GT-AcerZhang/paddle-voice
[ "b243144a86e9d34cabe8a5def9e8a2dae013b3fa" ]
[ "src/train.py" ]
[ "get_ipython().system('pip install paddlex -i https://mirror.baidu.com/pypi/simple')\n\n#开始模型的训练\n\n# 设置使用0号GPU卡\nimport os\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\nimport paddlex as pdx\n\n# 图像预处理+数据增强\nfrom paddlex.det import transforms\ntrain_transforms = transforms.Compose([\n transforms.MixupImage(mixup_e...
[ [ "matplotlib.pyplot.imshow" ] ]
anotherjoshsmith/NovoNordisk_Capstone
[ "a39adb2ae68f001bdf0e4b2200d7b8f923f27c2f" ]
[ "ndac/predict.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import LSTM\nfrom keras.layers import Flatten\nfrom keras.layers import Dropout\nfrom keras.layers.embeddings import Embedding\nfrom keras.layers.convolutional import Conv1D\nfrom keras...
[ [ "sklearn.model_selection.GridSearchCV", "numpy.random.seed", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "numpy.isscalar" ] ]
alexjones85/aXeleRate
[ "52437fc0b1d6cd9de2ccd6071f5fb489dc84e99d" ]
[ "example_scripts/arm_nn/yolov2.py" ]
[ "# Copyright © 2020 Arm Ltd and Contributors. All rights reserved.\r\n# SPDX-License-Identifier: MIT\r\n\r\n\"\"\"\r\nContains functions specific to decoding and processing inference results for YOLO V3 Tiny models.\r\n\"\"\"\r\n\r\nimport cv2\r\nimport numpy as np\r\nfrom box import BoundBox, nms_boxes, boxes_to_a...
[ [ "numpy.max", "numpy.exp", "numpy.sum", "numpy.min" ] ]
fangyuchu/rethinking-network-pruning
[ "3d3726e1277b5d9bd12b2b26d3c9bf1730709a42", "3d3726e1277b5d9bd12b2b26d3c9bf1730709a42", "3d3726e1277b5d9bd12b2b26d3c9bf1730709a42", "3d3726e1277b5d9bd12b2b26d3c9bf1730709a42" ]
[ "cifar/soft-filter-pruning/pruning_cifar10_pretrain.py", "imagenet/l1-norm-pruning/main_finetune.py", "cifar/weight-level/cifar_finetune.py", "cifar/soft-filter-pruning/pruning_resnet_longer_scratch.py" ]
[ "from __future__ import division\n\nimport os, sys, shutil, time, random\nimport argparse\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torchvision.datasets as dset\nimport torchvision.transforms as transforms\nfrom utils import AverageMeter, RecorderMeter, time_string, convert_secs2time\nimport model...
[ [ "torch.nn.CrossEntropyLoss", "torch.norm", "numpy.abs", "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.backends.cudnn.version", "numpy.sort", "numpy.ones", "torch.autograd.Variable", "torch.FloatTensor", "torch.cuda.is_available", "torc...
devenxu1985/onnx-tensorflow
[ "4fe611422ad3236973c498c5bff51fdd55657a4e" ]
[ "onnx_tf/common/data_type.py" ]
[ "from numbers import Number\n\nimport numpy as np\nfrom onnx import mapping\nfrom onnx import TensorProto\nimport tensorflow as tf\n\n\ndef tf2onnx(dtype):\n if isinstance(dtype, Number):\n tf_dype = tf.as_dtype(dtype)\n elif isinstance(dtype, tf.DType):\n tf_dype = dtype\n elif isinstance(dtype, list):\n ...
[ [ "numpy.dtype", "tensorflow.as_dtype" ] ]
HansBug/dgdvapp
[ "f3142d2c265afda427bbeee46c8073e1126eeef5" ]
[ "app/process/log.py" ]
[ "import os\nfrom operator import itemgetter\nfrom typing import Tuple, Iterator\n\nimport numpy as np\nimport pandas as pd\n\nfrom .exp_center import find_expdata_in_directory, exp_center_file_in_directory, exp_center_trans\nfrom .simudata import find_simudata_in_directory, simudata_file_in_directory, simudata_tran...
[ [ "numpy.mean" ] ]
aspratyush/neural-structured-learning
[ "6cb6b22174ba5f5d6b621443eb2b147831be320d" ]
[ "neural_structured_learning/tools/pack_nbrs.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.io.TFRecordWriter", "tensorflow.data.TFRecordDataset", "tensorflow.compat.v1.enable_v2_behavior", "tensorflow.train.Example" ] ]
mhd53/ssd-from-torch
[ "1ae6eaab87afd6ef243b2fe444cbb5b15a12cfc7" ]
[ "trainer/trainer.py" ]
[ "import numpy as np\nimport torch\nfrom torchvision.utils import make_grid\nfrom base import BaseTrainer\nfrom utils import inf_loop, MetricTracker\n\n\nclass Trainer(BaseTrainer):\n \"\"\"\n Trainer class\n \"\"\"\n\n def __init__(\n self,\n model,\n criterion,\n metric_ftns...
[ [ "torch.no_grad", "numpy.sqrt" ] ]
Lnaden/openmmtools
[ "7a9c61cea5c657e333f433dabbd7c87624f8227f" ]
[ "openmmtools/multistate/sams.py" ]
[ "#!/usr/local/bin/env python\n\n# ==============================================================================\n# MODULE DOCSTRING\n# ==============================================================================\n\n\"\"\"\nSamsSampler\n===========\n\nSelf-adjusted mixture sampling (SAMS), also known as optimally...
[ [ "numpy.log", "numpy.sum", "numpy.abs", "numpy.unique", "numpy.random.choice", "numpy.arange", "numpy.ones", "numpy.all", "numpy.where", "numpy.random.rand", "numpy.exp", "numpy.array", "numpy.zeros", "scipy.special.logsumexp" ] ]
tu-rbo/concarne
[ "0e9ae1fa21e132bd240b23e116e7f21e8c45735b" ]
[ "example/simple_multiview.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nThis example illustrates how simple it is to train a classifier using\nside information.\n\nIt illustrates the exemplary use of the multi-view pattern; for more info\non how to use other patterns, check out synthetic.py.\n\nFor a realistic example with real data check out handwri...
[ [ "numpy.asarray", "numpy.random.randn", "sklearn.linear_model.LogisticRegression" ] ]
jacr20/pax
[ "d64d0ae4e4ec3e9bb3e61065ed92e9ea23328940" ]
[ "tests/test_posrec_neuralnet.py" ]
[ "import unittest\nimport numpy as np\n\nfrom pax import core, plugin\nfrom pax.datastructure import Event, Peak\n\n\nclass TestPosRecNeuralNet(unittest.TestCase):\n\n def setUp(self):\n self.pax = core.Processor(config_names='XENON100', just_testing=True, config_dict={'pax': {\n 'plugin_group_n...
[ [ "numpy.array", "numpy.zeros" ] ]
drholera/olx-parser
[ "837166bca48b39e03bc1987c9ebb2511697fe3fd" ]
[ "parser.py" ]
[ "import requests\nfrom bs4 import BeautifulSoup\nimport pandas as pd\nimport webbrowser\nimport os\nimport io\n\n\nclass Parser(object):\n __url = ''\n __results = []\n\n def __init__(self):\n search_query = input(\"Please, enter your search query \\n\")\n self.__url = 'https://www.olx.ua/lis...
[ [ "pandas.DataFrame" ] ]
gdevenyi/gabriel.devenyi.ca
[ "cc001f1dc6ed07ff46c3b5cca66865b977710acc" ]
[ "markdown_generator/talks.py" ]
[ "# coding: utf-8\n\n# # Talks markdown generator for academicpages\n#\n# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest...
[ [ "pandas.read_csv" ] ]
saegersven/robocup
[ "3ce18d68d99da43ab12c19417c988bdad38d7373" ]
[ "scripts/calibrate_camera.py" ]
[ "import numpy as np\r\nimport cv2\r\nimport glob\r\nimport array\r\nimport time\r\nimport json\r\n\r\nimage_folder = \"img\" # str(input(\"Input image folder: \"))\r\nout_file = \"test.json\" # str(input(\"Input output file: \"))\r\n\r\nX = 5\r\nY = 7\r\n# Termination criteria\r\ncriteria = (cv2.TERM_CRITERIA_EPS +...
[ [ "numpy.zeros" ] ]
DavidDePauw1/dairlib
[ "3c75c8f587927b12a58f2e88dda61cc0e7dc82a3" ]
[ "bindings/pydairlib/dircon_trajectory_plotter.py" ]
[ "import sys\nimport matplotlib.pyplot as plt\nimport pydairlib.lcm_trajectory\nfrom pydairlib.common import FindResourceOrThrow\nfrom pydrake.trajectories import PiecewisePolynomial\nimport numpy as np\n\n\ndef main():\n # Default filename for the example\n filename = FindResourceOrThrow(\"examples/Cassie/saved_t...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
jason-sunjiankang/tensorflow_object_detection
[ "dd53b458cb8809b9ec804f31aabdf04c76893977" ]
[ "generate_tfrecord.py" ]
[ "\"\"\"\nUsage:\n # From tensorflow/models/\n # Create train data:\n python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=train.record\n\n # Create test data:\n python generate_tfrecord.py --csv_input=data/test_labels.csv --output_path=test.record\n\"\"\"\nfrom __future__ import divisi...
[ [ "tensorflow.app.run", "pandas.read_csv", "tensorflow.python_io.TFRecordWriter" ] ]
HashGehlot03/HeartDiseasePrediction
[ "22a24b113d26e2fd776d28fc3c038474fb93741f" ]
[ "model.py" ]
[ "import pandas as pd\r\nfrom sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.tree import DecisionTreeClassifier\r\nfrom sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier, GradientBoostingClassifier...
[ [ "pandas.read_csv", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.tree.DecisionTreeClassifier", "sklearn.ensemble.AdaBoostClassifier", "sklearn.svm.SVC", "sklearn.ens...
feloundou/safe-experts
[ "9592bd48ce7eed721a36cb688dd10dc7f527a13b", "9592bd48ce7eed721a36cb688dd10dc7f527a13b" ]
[ "algos/train_expert_ppo_penalized.py", "algos/training_regimes.py" ]
[ "# Main entrance of GAIL\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom adabelief_pytorch import AdaBelief\nimport gym\nimport safety_gym\nimport time\n\n\nfrom neural_nets import ActorCritic, count_vars\n\nfrom utils import BufferActor\nfrom utils import mpi_fork, proc_id, num_procs, Epoc...
[ [ "numpy.random.seed", "torch.Tensor", "torch.manual_seed", "torch.min", "torch.exp", "torch.nn.functional.mse_loss", "torch.clamp", "numpy.exp" ], [ "torch.Tensor", "numpy.random.seed", "torch.load", "torch.manual_seed", "numpy.ones", "torch.nn.functional...
Johannes0Horn/Cooperative-Deep-RL-Multi-Agents
[ "fd30246d33a91ae488c3c093a0de55825a43f8b9" ]
[ "SingleAgentProfiling/TD3.py" ]
[ "# Library Imports\nimport numpy as np\nimport tensorflow as tf\n\nclass ReplayBuffer:\n \"\"\"Defines the Buffer dataset from which the agent learns\"\"\"\n def __init__(self, max_size, input_shape, dim_actions):\n self.mem_size = max_size\n self.mem_cntr = 0\n self.state_memory = np.zer...
[ [ "tensorflow.convert_to_tensor", "tensorflow.clip_by_value", "tensorflow.concat", "numpy.random.choice", "tensorflow.random.normal", "tensorflow.keras.layers.Dense", "tensorflow.keras.losses.MSE", "tensorflow.math.reduce_mean", "tensorflow.keras.optimizers.Adam", "numpy.zero...
czielinski/facerecognition
[ "2ddd9b74a96e3e7eef3dbab52e5eaf7669d33dc4" ]
[ "facerecognition/facerecognition.py" ]
[ "#!/usr/bin/python\n\n# The MIT License (MIT)\n#\n# Copyright (c) 2015 Christian Zielinski\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without l...
[ [ "numpy.hstack" ] ]
michaelhall28/clone-competition-simulation
[ "deaa68ce020fa3c1b8fa499c91c829bad4f0def6", "deaa68ce020fa3c1b8fa499c91c829bad4f0def6" ]
[ "clone_competition_simulation/general_sim_class.py", "clone_competition_simulation/fitness_classes.py" ]
[ "import numpy as np\nimport math\n# import matplotlib as mpl\n# mpl.use('Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport itertools\nimport bisect\nfrom collections import Counter\nimport pickle\nfrom clone_competition_simulation.useful_functions import mean_clone_size, mean_clone_size_fit...
[ [ "numpy.cumsum", "numpy.any", "numpy.searchsorted", "numpy.where", "matplotlib.pyplot.gca", "numpy.unique", "numpy.arange", "numpy.full", "numpy.random.set_state", "numpy.diff", "matplotlib.pyplot.close", "numpy.zeros", "numpy.isnan", "matplotlib.pyplot.ylim"...
samyoo78/NearPy
[ "1b534b864d320d875508e95cd2b76b6d8c07a90b" ]
[ "tests/distances_tests.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2013 Ole Krause-Sparmann\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n#...
[ [ "scipy.sparse.rand", "numpy.random.randn" ] ]
Csinclair0/fairseq
[ "6d9cf6a850c31d12a3ac63e89b005756b09cebeb" ]
[ "fairseq/models/fairseq_model.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\"\"\"\nBase classes for various fairseq models.\n\"\"\"\n\nimport logging\nfrom argparse import Namespace\nfrom typing import Dict, L...
[ [ "torch.nn.functional.log_softmax", "torch.is_tensor", "torch.nn.utils.remove_weight_norm", "torch.nn.functional.softmax" ] ]
willcanniford/python-notes
[ "1c2a33ab976e589fc6f801de2b6bd740d3aca2d7" ]
[ "machine_learning/sklearn-polynomial.py" ]
[ "# Import the libraries and functions that we are going to need\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.preprocessing import PolynomialFeatures\n\n# Load in some fake data for comparison\ndata = pd.read_csv('./data/po...
[ [ "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "sklearn.preprocessing.PolynomialFeatures", "matplotlib.pyplot.plot", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.show" ] ]
BlinkCreator/Machinelearning_MINIST
[ "02ccefa92c9fd794d7fc1cbc0e2b7767c931c563" ]
[ "main.py" ]
[ "from __future__ import print_function\nimport torch\nimport torch.optim as optim\nimport torchvision\nfrom torchvision import datasets, transforms\nfrom torch.optim.lr_scheduler import StepLR\nfrom models.conv import Net\nfrom models.rnn_conv import ImageRNN\nimport torch.nn.functional as F\nimport matplotlib.pypl...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.functional.nll_loss", "torch.manual_seed", "torch.no_grad", "torch.cuda.is_available", "numpy.transpose", "torch.device", "torch.optim.lr_scheduler.StepLR" ] ]
alumae/audiomentations
[ "275347fcfcf14ea395d228c192efa57496addf8f" ]
[ "audiomentations/augmentations/transforms.py" ]
[ "import functools\nimport os\nimport random\nimport sys\nimport tempfile\nimport uuid\nimport warnings\n\nimport librosa\nimport numpy as np\nfrom scipy.signal import butter, sosfilt, convolve\n\nfrom audiomentations.core.audio_loading_utils import load_sound_file\nfrom audiomentations.core.transforms_interface imp...
[ [ "numpy.amax", "numpy.ones_like", "numpy.minimum", "numpy.linspace", "numpy.clip", "numpy.amin", "scipy.signal.sosfilt", "numpy.abs", "numpy.percentile", "numpy.concatenate", "scipy.signal.butter", "numpy.std", "numpy.zeros_like", "scipy.signal.convolve", ...
benjeffery/tsconvert
[ "a7d68389fedf269d45387ecc44842f6ffe24b2cc" ]
[ "tests/test_newick.py" ]
[ "#\n# MIT License\n#\n# Copyright (c) 2019 Tskit Developers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use,...
[ [ "numpy.allclose", "numpy.linalg.norm", "numpy.ones" ] ]
rafmudaf/dash-slicer
[ "e959f1ea94f3bb1d061acd3f18727227a08144ed" ]
[ "tests/test_utils.py" ]
[ "from dash_slicer.utils import (\n img_as_ubyte,\n img_array_to_uri,\n get_thumbnail_size,\n shape3d_to_size2d,\n mask_to_coloured_slices,\n)\n\nimport numpy as np\nfrom pytest import raises\n\n\ndef test_img_as_ubyte():\n\n im = np.zeros((100, 100), np.float32)\n im[0, 0] = 100\n\n # Anythi...
[ [ "numpy.random.uniform", "numpy.zeros" ] ]
pji/pjinoise
[ "3967d69fa57be1136cdeb8f4a5d187ee455fa783" ]
[ "tests/test_sources.py" ]
[ "\"\"\"\ntest_sources\n~~~~~~~~~~~~\n\nUnit tests for the pjinoise.generator module.\n\"\"\"\nfrom copy import deepcopy\nimport unittest as ut\nfrom unittest.mock import call, patch\n\nimport numpy as np\n\nfrom pjinoise import sources as s\nfrom pjinoise.common import grayscale_to_ints_list, print_array\nfrom pjin...
[ [ "numpy.around", "numpy.array", "numpy.zeros" ] ]
richford/qsiprep
[ "7499a1479691394775eeab571f36a86c1dac4b54" ]
[ "qsiprep/interfaces/reports.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"\nInterfaces to generate reportlets\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n\"\"\"\n\nimport os\nimport os.path as op\nimport time\nimport json\n...
[ [ "numpy.sqrt", "pandas.DataFrame", "numpy.concatenate", "numpy.zeros_like", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "numpy.ones_like", "numpy.unique", "numpy.diff", "matplotlib.pyplot.close", "numpy.column_stack", "numpy.load", "numpy.zeros", "pa...
olzhaskabdolov/bot
[ "ea4bd182affe9e607ddb06cf1d7001d6474f10aa" ]
[ "drqa/pipeline/drqa.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"Full DrQA pipeline.\"\"\"\n\nimport torch\nimport regex\nimport heapq\nimport math\nimport tim...
[ [ "torch.utils.data.DataLoader" ] ]
zampie/GAN_framework
[ "8e2ff764b08b9199916fef66e49332ef7d21ae32" ]
[ "refer/train_cartoon_wgan.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport glob\nimport utils\nimport traceback\nimport numpy as np\nimport tensorflow as tf\nimport models_64x64 as models\n\n\n\"\"\" param \"\"\"\nepoch = 100\nbatch_size = 64\nlr = 0.0002\nz_dim = 100\...
[ [ "tensorflow.clip_by_value", "tensorflow.device", "tensorflow.summary.FileWriter", "tensorflow.control_dependencies", "tensorflow.reduce_mean", "tensorflow.train.RMSPropOptimizer", "tensorflow.image.resize_images", "tensorflow.placeholder", "tensorflow.global_variables_initializ...
DiddiZ/donk.ai
[ "ccf9a00fb22203a8ab351a5d559d927e6ebfc318" ]
[ "tests/samples_test.py" ]
[ "import unittest\r\n\r\nimport numpy as np\r\nfrom numpy.testing import assert_array_equal\r\n\r\n\r\nclass Test_TransitionPool(unittest.TestCase):\r\n\r\n def test_add(self):\r\n \"\"\"Test TransitionPool.add().\"\"\"\r\n from donk.samples import TransitionPool\r\n\r\n N, T, dX, dU = 3, 10,...
[ [ "numpy.random.default_rng" ] ]
shanbs/home-assistant
[ "818776d2b4f11e4f51992dc88bc0a6f9055833b2" ]
[ "homeassistant/components/sensor/pollen.py" ]
[ "\"\"\"Support for Pollen.com allergen and cold/flu sensors.\"\"\"\nfrom datetime import timedelta\nimport logging\nfrom statistics import mean\n\nimport voluptuous as vol\n\nfrom homeassistant.components.sensor import PLATFORM_SCHEMA\nfrom homeassistant.const import (\n ATTR_ATTRIBUTION, ATTR_STATE, CONF_MONITO...
[ [ "numpy.array", "numpy.cumsum" ] ]
fpirovan/NoiseInjection
[ "d1a8c90aaf45d435d40c476a2d2e74258920ff22" ]
[ "dart/experiments/tools/noise.py" ]
[ "import numpy as np\nimport statistics\n\ndef sample_covariance_lnr(env, lnr, sup, samples, T):\n\n cov = np.zeros(env.action_space.shape[0])\n for s in range(samples):\n states, tmp_actions, _, _ = statistics.collect_traj(env, lnr, T)\n sup_actions = np.array([sup.intended_action(s) for s in st...
[ [ "numpy.dot", "numpy.identity", "numpy.array", "numpy.zeros", "numpy.trace" ] ]
dftbplus/phonopy
[ "32d3d52902c314c7f00192d10f7a156d0a8341c9" ]
[ "phonopy/cui/collect_cell_info.py" ]
[ "# Copyright (C) 2018 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of phonopy.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyr...
[ [ "numpy.eye" ] ]
nielsuit227/AutoML
[ "51e2076d52d76dc84a190293b5bb59da2833df89" ]
[ "Amplo/Pipeline.py" ]
[ "import re\nimport os\nimport time\nimport copy\nimport json\nimport Amplo\nimport joblib\nimport shutil\nimport warnings\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nfrom datetime import datetime\nfrom shap import TreeExplainer\n\nfrom sklearn import metrics\nfrom sklearn.model_selection import...
[ [ "pandas.read_csv", "sklearn.model_selection.StratifiedKFold", "sklearn.model_selection.KFold", "pandas.DataFrame", "numpy.std", "numpy.mean", "sklearn.metrics.SCORERS.keys", "numpy.logical_and", "numpy.where" ] ]
I-love-lamp/ml-apps
[ "71f65fc284bc68794acd4a39df3a5791fcba7c46" ]
[ "classifier_tuning.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\nimport streamlit as st\r\nfrom sklearn import datasets\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.neighbors import KNeighborsClassifier\r\nfrom sklearn.svm import SVC\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nfrom sklearn.model_selection import train...
[ [ "sklearn.metrics.plot_confusion_matrix", "sklearn.datasets.load_breast_cancer", "numpy.unique", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.accuracy_score", "sklearn.datasets.load_iris", "sklearn.model_selection.train_test_split", "sklearn.metrics.confusion_matrix",...
FrancisCrickInstitute/hatchet
[ "a92992f3464f4df566ac4e9ff69069e736821b4b" ]
[ "src/hatchet/utils/BBeval.py" ]
[ "#!/usr/bin/python3\n\nimport os\nimport sys\nimport argparse\nimport shutil\nimport subprocess\nimport shlex\nimport sys, os\nimport math\nimport warnings\nimport numpy as np\nimport matplotlib as mpl\nmpl.use('Agg')\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport matplotlib.co...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "matplotlib.use", "pandas.DataFrame", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.close",...
asbe/PoseCNN
[ "0dc7f4f1d63908a43d5afc1ac4cf327ae88c658c" ]
[ "lib/datasets/ycb.py" ]
[ "__author__ = 'yuxiang'\n\nimport os\nimport datasets\nimport datasets.ycb\nimport datasets.imdb\nimport pickle\nimport numpy as np\nimport cv2\nfrom fcn.config import cfg\nfrom utils.pose_error import *\nfrom transforms3d.quaternions import quat2mat, mat2quat\n\nclass ycb(datasets.imdb):\n def __init__(self, im...
[ [ "numpy.diag", "numpy.amax", "numpy.reshape", "numpy.linalg.norm", "numpy.stack", "numpy.nanmean", "numpy.array", "numpy.zeros", "numpy.where", "numpy.loadtxt" ] ]
RafalStaszak/TensorflowCourse
[ "af0d7f6d367d078dd8d36ec1e48d0a20f65a90ab" ]
[ "tensorflow/3_regression.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n\nx_data = np.random.rand(20).astype(np.float32)\ny_data = x_data*1+3+np.random.uniform(0, 0.2, size=[20])\n\nplt.plot(x_data, y_data, 'ro', label='Produced data')\nplt.legend()\nplt.show()\n\na=tf.Variable([0], dtype=tf.float32)\nb=...
[ [ "matplotlib.pyplot.legend", "tensorflow.Variable", "matplotlib.pyplot.plot", "tensorflow.initialize_all_variables", "tensorflow.train.GradientDescentOptimizer", "numpy.random.rand", "tensorflow.Session", "tensorflow.square", "numpy.random.uniform", "matplotlib.pyplot.show" ...
lpkirwin/pandas
[ "bb929a637ca9d4f24ea78ee4cca9ee17b65a5c1e" ]
[ "pandas/core/internals/blocks.py" ]
[ "from datetime import datetime, timedelta\nimport inspect\nimport re\nfrom typing import TYPE_CHECKING, Any, List, Optional, Type, Union, cast\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import NaT, algos as libalgos, internals as libinternals, lib, writers\nfrom pandas._libs.internals import BlockP...
[ [ "pandas.util._validators.validate_bool_kwarg", "pandas.core.dtypes.cast.maybe_box_datetimelike", "pandas.core.arrays.DatetimeArray._simple_new", "pandas.core.missing.clean_interp_method", "pandas.core.dtypes.common.is_datetime64_dtype", "numpy.place", "numpy.where", "pandas.core.dt...
sw32-seo/GTA
[ "86b102a14b78f6c8b50d742a56445c748e59b51e" ]
[ "onmt/utils/stats_manager.py" ]
[ "import numpy as np\n\n\nclass StatsManager(object):\n def __init__(self, stat_names=['step', 'acc', 'ppl']):\n self.stat_names = stat_names\n self.train_stats = {}\n self.val_stats = {}\n\n for name in stat_names:\n self.train_stats[name] = []\n self.val_stats[n...
[ [ "numpy.array", "numpy.argmin", "numpy.argmax" ] ]
pik-copan/pycopanpbcc
[ "3fcf0a895cd444f445e1a36f0373fefa4eefe786" ]
[ "scripts/plot_fig8.py" ]
[ "# -*- coding: utf-8 -*-\n# Author: Vera Heck <heck@pik-potsdam.de>\n# Script generates Fig. 8 of Heck et al. 2016 (ESD)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom pylab import *\n\narray = np.array\n\nnstep = 128 # steps of parameter variation \npar1='alpha_max'\npar...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots_adjust", "numpy.load", "matplotlib.pyplot.show", "matplotlib.cm.get_cmap" ] ]
robgon-art/music-generator
[ "88a681bef5ee53fcd764e8c156ee97c892f0caf3" ]
[ "program/GANs/data_generator.py" ]
[ "import random\nfrom random import randint\nfrom numpy import array\nimport numpy\nNOTE_SPACE = 24\t\t#two octaves of notes are valid here.\nTRUE_CHORD_FALSE_MAX = 0.0\n\ndef get_three_notes_and_is_chord(all_major=False):\n\tanswer = [0] * NOTE_SPACE\n\tif(randint(0, 1) == 0 or all_major):\t\t#make half major, half...
[ [ "numpy.random.uniform", "numpy.array" ] ]
ruizca/xmmpzcat
[ "03938e96ff7cbb44adca6362f1b4492822d7e857" ]
[ "bin/binning.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nFunctions for the creation of bins based on\ndensity of optical and X-ray sources.\n\"\"\"\nimport os\n\nfrom tqdm import tqdm\nfrom astropy.table import Table, vstack\nfrom astropy.coordinates import SkyCoord\nfrom astropy import units as u\nimport numpy as np\n\n#import matplotli...
[ [ "numpy.abs", "numpy.min", "numpy.unique", "numpy.isnan", "numpy.median", "numpy.full", "numpy.logical_or", "numpy.max", "numpy.array", "numpy.logical_and", "numpy.sum" ] ]
gnouveau/birdsonganalysis
[ "58032538c63e9506d386e5fff5c2e8321c1d2983" ]
[ "birdsonganalysis/plot.py" ]
[ "\"\"\"Plotting function for birdsonganalysis.\"\"\"\n\nimport numpy as np\n\n\nimport seaborn as sns\n\nimport matplotlib.patches as p\nimport matplotlib.pyplot as plt\n\nfrom .songfeatures import spectral_derivs\nfrom .constants import FREQ_RANGE\n\n\ndef spectral_derivs_plot(spec_der, contrast=0.1, ax=None, freq...
[ [ "numpy.nanmax", "matplotlib.patches.Rectangle", "numpy.nanmin", "matplotlib.pyplot.subplots", "numpy.flip" ] ]
llecaroz/multihead_joint_entity_relation_extraction
[ "6cef17bb88700eda336d106b761352e65d8e4bea" ]
[ "tf_utils.py" ]
[ "import utils\nimport time\nimport eval\n\nclass model:\n \"\"\"Set of classes and methods for training the model and computing the ner and head selection loss\"\"\"\n\n\n def __init__(self,config,emb_mtx,sess):\n \"\"\"\"Initialize data\"\"\"\n self.config=config\n self.emb_mtx=emb_mtx\n...
[ [ "tensorflow.cond", "tensorflow.compat.v1.nn.dropout", "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.tanh", "tensorflow.compat.v1.nn.bidirectional_dynamic_rnn", "tensorflow.compat.v1.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.compat.v1.train.AdamOptimizer"...
gitter-badger/galaxy2galaxy
[ "1374a32a6be252c1eb426ce21bf1e26ffb253bb9" ]
[ "galaxy2galaxy/models/gan_utils.py" ]
[ "\"\"\" Spectral Norm GAN \"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport tensorflow_gan as tfgan\nimport tensorflow_hub as hub\n\nfrom tensorflow_gan.python.estimator.gan_estimator import Optimizers, get_gan...
[ [ "tensorflow.get_variable_scope", "tensorflow.random.normal", "tensorflow.placeholder", "tensorflow.compat.v1.train.AdamOptimizer" ] ]
simeoncarstens/ensemble_hic
[ "abaec8972866b593e689e39419d1c2d7ab6788dc", "abaec8972866b593e689e39419d1c2d7ab6788dc" ]
[ "scripts/plots/nora2012/distance_distributions_SI.py", "ensemble_hic/sphere_prior.py" ]
[ "import os\nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\n\nprobes = (\n ('pEN1', 100423573, 100433412, 'Linx'),\n ('pEN2', 100622909, 100632521, 'Xite'),\n ('pLG1', 100456274, 100465704, 'Linx'),\t\n ('pLG10', 100641750, 100646253, 'Dxpas34'),\...
[ [ "numpy.sqrt", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.load", "numpy.array" ], [ "numpy.zeros", "numpy.sum" ] ]
outlk/read-cryosat-2
[ "3ca032969f4cf5e9edde1e651d2c900bd84fba09" ]
[ "cryosat_toolkit/read_cryosat_L2I.py" ]
[ "#!/usr/bin/env python\nu\"\"\"\nread_cryosat_L2I.py\nWritten by Tyler Sutterley (05/2021)\n\nReads CryoSat Level-2 Intermediate data products from baselines A, B, BC and C\nReads CryoSat Level-2 netCDF4 data products from baseline D\nSupported CryoSat Modes: LRM, SAR, SARin, FDM, SID, GDR\n\nINPUTS:\n full_file...
[ [ "numpy.fromfile", "numpy.array", "numpy.zeros", "numpy.int32" ] ]
PhMueller/TrajectoryParser
[ "9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f" ]
[ "HPOBenchExperimentUtils/optimizer/fabolas_optimizer.py" ]
[ "import logging\nfrom pathlib import Path\nfrom typing import Union, Dict, Tuple, Sequence\nimport sys\nimport numpy as np\nfrom math import log2\nimport enum\n\nfrom HPOBenchExperimentUtils.optimizer.base_optimizer import SingleFidelityOptimizer\nfrom HPOBenchExperimentUtils.core.bookkeeper import Bookkeeper\nfrom...
[ [ "numpy.expand_dims", "numpy.abs", "numpy.clip", "numpy.asarray", "numpy.arange", "numpy.tile", "numpy.concatenate", "numpy.searchsorted", "numpy.array" ] ]
mananeau/ALBERT
[ "4409420b7aa3cd355078689e4963d8ad11000ee3" ]
[ "tokenization.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Team 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 requi...
[ [ "tensorflow.compat.v1.gfile.GFile", "tensorflow.compat.v1.Graph", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.Session" ] ]
cmccully/astro-scrappy
[ "3ed58dd537e40efed983ca049602af6e3e9f5ce7" ]
[ "astroscrappy/tests/test_utils.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom ..utils import (median, optmed3, optmed5, optmed7, optmed9, optmed25,...
[ [ "scipy.ndimage.filters.convolve", "numpy.random.random", "numpy.ascontiguousarray", "numpy.median", "numpy.ones", "numpy.all", "numpy.float32", "numpy.testing.assert_allclose", "numpy.array", "scipy.ndimage.filters.median_filter", "numpy.zeros" ] ]
ccuetom/devito
[ "3bd907bed50eff8608e36d83b92c706685a7d275" ]
[ "tests/test_derivatives.py" ]
[ "import numpy as np\nimport pytest\nfrom sympy import simplify, diff, Float\n\nfrom devito import (Grid, Function, TimeFunction, Eq, Operator, NODE, cos, sin,\n ConditionalDimension, left, right, centered, div, grad)\nfrom devito.finite_differences import Derivative, Differentiable\nfrom devito.f...
[ [ "numpy.allclose", "numpy.linspace", "numpy.arange", "numpy.ones", "numpy.mean", "numpy.isclose" ] ]
Fra98/fed-learning-AML
[ "13a4cb3f240ea6ef4340aaf07cf352c7fe075d89" ]
[ "src/fedAVG/server.py" ]
[ "from copy import deepcopy\nimport random\nimport numpy\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom .client import Client\nfrom ..models import *\nfrom ..utils import get_class_priors, load_cifar, run_accuracy, generate_clients_sizes\nfrom ..splits import indexes_split_IID, indexes_spl...
[ [ "torch.utils.data.Subset", "numpy.sum", "numpy.random.choice" ] ]
cihuang123/Next-simulation
[ "e8552a5804184b30022d103d47c8728fb242b5bc" ]
[ "utilities/plot_landing_point.py" ]
[ "import csv\nimport argparse\nimport matplotlib.pyplot as plt\n\ndef toFloat(str):\n try:\n return float(str)\n except ValueError:\n return str\n\nparser = argparse.ArgumentParser(\n description='Read some csv and output landing point.'\n)\nparser.add_argument('golden', help='Input the file p...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
snehasish069/tensorflow-mnist-dataset
[ "9f22235d52c66f37a07359056d5c9ef75a1ccf1a" ]
[ "mnist_tensorflow.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Dec 7 11:19:20 2017\r\n\r\n@author: Snehasish\r\n\"\"\"\r\n\r\nimport tensorflow as tf\r\nfrom tensorflow.examples.tutorials.mnist import input_data\r\n\r\ndata = input_data.read_data_sets(\"/tmp/data/\", one_hot = True)\r\n\r\n#learning rate\r\nLR = 0.001\r\n\r...
[ [ "tensorflow.nn.relu", "tensorflow.matmul", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.train.AdamOptimizer", "tensorflow.argmax", "tensorflow.exa...
cortex-lab/phylib
[ "563afac3a7df9ec585fab63b6fe4fc0700f48b7c" ]
[ "phylib/stats/ccg.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Cross-correlograms.\"\"\"\n\n#------------------------------------------------------------------------------\n# Imports\n#------------------------------------------------------------------------------\n\nimport numpy as np\n\nfrom phylib.utils._types import _as_array\nfrom phylib.i...
[ [ "numpy.maximum", "numpy.ones_like", "numpy.clip", "numpy.asarray", "numpy.dstack", "numpy.ravel_multi_index", "numpy.bincount", "numpy.diff", "numpy.transpose", "numpy.zeros" ] ]
SamarthMM/cs769-assignments
[ "bac2ad57c50043608276df8e0f21181ef62696c7" ]
[ "assignment2/classifier.py" ]
[ "import time, random, numpy as np, argparse, sys, re, os\nfrom types import SimpleNamespace\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom sklearn.metrics import classification_report, f1_score, recall_score, accuracy_score\n\n# change it with respect to the...
[ [ "numpy.random.get_state", "torch.nn.Dropout", "torch.LongTensor", "torch.cuda.manual_seed", "numpy.random.seed", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.random.get_rng_state", "torch.load", "torch.utils.data.DataLoader", "torch.nn.Linear", "nu...
AgusQuintanar/DesignOfAnElectricCircuit
[ "35dd0b96fc4722d6ec5b3c5173ae5cf2147c83d9" ]
[ "graph.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\ndef plot(fun, start, end):\n x = np.arange(float(start), float(end), 0.1)\n \n n_fun = np.vectorize(fun)\n plt.plot(x, n_fun(x))\n\n plt.show()\n\n\nif __name__ == \"__main__\":\n fun = lambda x: x**2 - 1\n plot(fun, -5, 5)" ]
[ [ "numpy.vectorize", "matplotlib.pyplot.show" ] ]
jiangwenj02/Meta-weight-net_class-imbalance
[ "5f7cdb3e0b66336a44695a9b8d240de0e3a3a2c8" ]
[ "meta-weight-net-class-imbalance.py" ]
[ "import os\nos.environ[\"CUDA_DEVICE_ORDER\"]=\"PCI_BUS_ID\"\n# os.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\n\nimport time\nimport argparse\nimport random\nimport copy\nimport torch\nimport torchvision\nimport numpy as np\nimport pandas as pd\nimport sklearn.metrics as sm\nimport torch.nn.functional as F\nfrom torch...
[ [ "torch.manual_seed", "torch.nn.functional.cross_entropy", "torch.sum", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.autograd.Variable" ] ]
jchen0506/molecool
[ "dc931c165c34edeae4a38e67976138c017c5857c" ]
[ "molecool/visualize.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom mpl_toolkits.mplot3d import Axes3D # noqat: F401\n\nfrom .atom_data import (\n atom_colors,\n) # .atome_data relative import, . check the same folder\n\n\ndef bond_histogram(bond_list, save_location=None, dpi=300, graph_min=0, graph_max=2):\n # Dr...
[ [ "numpy.linspace", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.ylabel" ] ]
iwonasob/DCASE_rare
[ "3f9f55a1958602ac61e2e5ab02866d7215a5d131" ]
[ "src/dataset.py" ]
[ "'''\nDownload, extract and partition the datasets\n'''\nimport config as cfg\nimport os\nimport sys\nimport requests\nimport zipfile\nfrom clint.textui import progress\nimport numpy as np\nnp.random.seed(1515)\nimport pandas as pd\n\n\nclass DatasetCreator:\n def __init__(self,\n dataset_name):\...
[ [ "pandas.read_csv", "numpy.random.seed" ] ]
Luoyadan/ddpg_power
[ "9f1bcd0c3874229933070b47f96e554738a72a77" ]
[ "ddpg.py" ]
[ "# -----------------------------------\n# Deep Deterministic Policy Gradient\n# Author: Flood Sung\n# Date: 2016.5.4\n# -----------------------------------\n\nimport tensorflow as tf\nimport numpy as np\nfrom ou_noise import OUNoise\nfrom critic_network import CriticNetwork \nfrom actor_network_bn import ActorNetwo...
[ [ "numpy.asarray", "numpy.resize", "tensorflow.InteractiveSession" ] ]
Croydon-Brixton/gedi-biomass-mapping
[ "bd6021a8515597d5ce14221afa47758803b4864a" ]
[ "src/data/gedi_query_tools.py" ]
[ "\"\"\"Module to conveniently query GEDI v002 data (primarily L1B and L2A) locally\"\"\"\nimport pathlib\nfrom dataclasses import dataclass\n\nimport folium\nimport folium.features\nimport folium.plugins\nimport geopandas as gpd\nimport pandas as pd\nimport shapely\nimport shapely.geometry\n\nfrom src.constants imp...
[ [ "pandas.to_datetime" ] ]
awesome-archive/urh
[ "c8c3aabc9d637ca660d8c72c3d8372055e0f3ec7" ]
[ "src/urh/dev/native/HackRF.py" ]
[ "import numpy as np\nimport time\n\nfrom urh.dev.native.Device import Device\nfrom urh.dev.native.lib import hackrf\nfrom urh.util.Logger import logger\n\n\nclass HackRF(Device):\n BYTES_PER_SAMPLE = 2 # HackRF device produces 8 bit unsigned IQ data\n\n def __init__(self, bw, freq, gain, srate, is_ringbuffer...
[ [ "numpy.frombuffer", "numpy.empty" ] ]
johnson1228/g2p-seq2seq
[ "2fac457e066df48038a7682be69f3bd8b9fff916" ]
[ "g2p_seq2seq/g2p.py" ]
[ "# Copyright 2016 AC Technologies LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless require...
[ [ "numpy.split", "tensorflow.gfile.GFile", "tensorflow.python.util.compat.as_text", "tensorflow.python.estimator.estimator.ops.Graph", "tensorflow.get_default_graph", "tensorflow.py_func", "tensorflow.python.estimator.estimator._check_hooks_type", "tensorflow.Graph", "tensorflow....
sebastiengilbert73/synthetic_heatmap
[ "8a1f21f4eaf5a56374b77a4238be97a7005cdb58" ]
[ "src/synthetic_heatmap/generators/stop_sign.py" ]
[ "from synthetic_heatmap.generator import Generator, RegularPolygonVertices, WarpAffinePoints, DownloadRandomImage\nimport cv2\nimport numpy as np\nimport random\nimport math\nimport urllib.request\nimport os\n\nclass StopSign(Generator):\n def __init__(self, octogon_diameter_range=(1.3, 1.3),\n f...
[ [ "numpy.random.random", "numpy.nonzero", "numpy.ones", "numpy.mean", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
giaba90/python-thesis
[ "8a6d951fc3a1e58b510b7f3f9d1df6ef109711e3" ]
[ "algoritmo2.py" ]
[ "from itertools import combinations\n\nimport numpy as np\nimport utility\n\ndef sol2(vet1, indice, vet_in):\n out = []\n while indice >= 1:\n # converto in lista la combinations\n vet2 = list(combinations(vet1, indice))\n for riga in vet2:\n # trasformo il vettore in input in ...
[ [ "numpy.array" ] ]
Jingqiao-Zhao/DCASE2020-Task1-SubtaskB
[ "b9474ad68751a7201323364de34bd9630f76f74c" ]
[ "utilities/sparse_image_warp_pytorch.py" ]
[ "# Copyright 2019 RnD at Spoon Radio\r\n\r\n#\r\n\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n\r\n# you may not use this file except in compliance with the License.\r\n\r\n# You may obtain a copy of the License at\r\n\r\n#\r\n\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n...
[ [ "torch.transpose", "torch.max", "numpy.linspace", "torch.cat", "torch.zeros", "torch.pow", "torch.ones", "numpy.reshape", "torch.solve", "torch.reshape", "torch.randn", "torch.sqrt", "numpy.stack", "torch.tensor", "torch.mul", "torch.square", "to...
DrewRust/lambdata2-drewrust
[ "c2fcd57bf898f5564225e06f465a1b11671b08cf" ]
[ "my_lambdata/ds_utilities.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\n# from sklearn.datasets import load_wine\n# from pdb import set_trace as breakpoint\n# from IPython.display import display\n\ndef enlarge(n):\n ''' \n This function will multiple the input by 100 \n '''\n ret...
[ [ "pandas.read_csv", "pandas.to_datetime", "sklearn.model_selection.train_test_split", "pandas.Series" ] ]
saxenam06/Approximate-Dynamic-Programming
[ "de613c10e087ae6b4a87a1730104c59442b33797" ]
[ "plot.py" ]
[ "from config import GeneralConfig, DynamicsConfig, PlotConfig\nimport numpy as np\nimport torch\nimport time\nimport os\nfrom network import Actor, Critic\nfrom solver import Solver\nfrom utils import idplot, numpy2torch, step_relative, recover_absolute_state, cm2inch\nimport matplotlib.pyplot as plt\n\nimport dyna...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "numpy.expand_dims", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylim", "torch.from_numpy", "matplotlib.pyplot.savefig", "torch.tensor", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyp...
schackv/shapewarp
[ "36c69a641fc06239eda48b9e7011e3e86f9f7da0" ]
[ "shapewarp/ASM.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 18 11:18:20 2014\n\n@author: schackv\n\"\"\"\n\nfrom . import GPA\nimport numpy as np\n\n\nclass ASM:\n \n def build(self,landmarks):\n \"\"\"Build an active shape model from the landmarks given.\n Landmarks are expected to be a numpy N x 2*p ...
[ [ "numpy.abs", "numpy.sqrt", "numpy.linalg.eig", "numpy.argsort", "numpy.array", "numpy.sum" ] ]
anilgeorge04/learn-ds
[ "f1a9c638e29270d4d72fc3aed0af3ccea8c53350" ]
[ "python-play/hackerstat.py" ]
[ "# Hacker Statistics\r\n# In a 100 storey building, move up and down floors on the roll of dice\r\n# Move up +1 on getting a 3 or 4 or 5\r\n# Move down -1 on getting 1 or 2\r\n# On 6, roll die again and move +n steps (n is the number on second roll)\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nnp...
[ [ "numpy.random.seed", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "numpy.random.rand", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.hist", "numpy.random.randint" ] ]
erykoff/redmapper_duster
[ "9058d84905535230c330803de18575670da03bf4" ]
[ "duster/pdfs.py" ]
[ "import numpy as np\n\n\ndef p_dust(rho_0, b, rho_min, rho_vals):\n \"\"\"Compute p_dust(rho | rho_0, b, rho_min)\n\n Parameters\n ----------\n rho_0 : `float`\n The value of rho_0\n b : `float`\n The value of b\n rho_min : `float`\n The value of rho_min\n rho_vals : `np.nd...
[ [ "numpy.exp", "numpy.zeros" ] ]
zehuilu/Learning-from-Directional-Corrections
[ "762a05b0d169c0db12932b8bc3f5b4abfa5d6fb9" ]
[ "experiments/run_quad_realtime.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport sys\nsys.path.append(os.getcwd()+'/LFC')\nsys.path.append(os.getcwd()+'/JinEnv')\nsys.path.append(os.getcwd()+'/lib')\nimport numpy as np\nfrom casadi import *\nimport transforms3d\nfrom QuadAlgorithmRealtime import QuadAlgorithmRealtime\nfrom QuadStates import QuadStates\...
[ [ "numpy.array" ] ]
AndySrb/ProracunOsvetljenjaUlica
[ "1eeeb5f92c24889819594646ee22639943035dd9" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\n\nimport json\nimport math\n\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nclass vector2F:\n def __init__(self,x,y):\n self.x=x\n self.y=y\n\nclass vector3F:\n def __init__(self,x,y,z):\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
dibyajit30/Course-Works
[ "f8c275a61651a757cdac562d07d373f15d27f05c" ]
[ "Deep Reinforcement Learning/immitation learning/utils.py" ]
[ "import numpy as np\nfrom torch import argmax\n\nLEFT =1\nRIGHT = 2\nSTRAIGHT = 0\nACCELERATE =3\nBRAKE = 4\n\ndef one_hot(labels):\n \"\"\"\n this creates a one hot encoding from a flat vector:\n i.e. given y = [0,2,1]\n it creates y_one_hot = [[1,0,0], [0,0,1], [0,1,0]]\n \"\"\"\n classes = np....
[ [ "numpy.dot", "numpy.unique", "numpy.array", "numpy.zeros", "torch.argmax" ] ]