repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
yyx1994/pytorch.repmet
[ "847a2b71fa751e6d381c233df0107a53592d8ce5", "847a2b71fa751e6d381c233df0107a53592d8ce5" ]
[ "losses/magnet_loss.py", "model_definitions/cnns/basics/protonet.py" ]
[ "\"\"\"\nTaken from vithursant's repo:\nhttps://github.com/vithursant/MagnetLoss-PyTorch/blob/master/magnet_loss/magnet_loss.py\n\"\"\"\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\n\nclass MagnetLoss(nn.Module):\n \"\"\"\n ...
[ [ "numpy.max", "torch.zeros", "torch.arange", "torch.from_numpy", "torch.sort", "torch.tensor", "torch.log", "torch.exp", "torch.mean", "torch.chunk", "torch.sum" ], [ "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d" ]...
JaGeo/emmet
[ "db01498d1136fc499961277f0b0edce3b9ddf386" ]
[ "emmet-core/emmet/core/vasp/validation.py" ]
[ "from datetime import datetime\nfrom typing import Dict, List, Union\n\nimport numpy as np\nfrom pydantic import Field, PyObject\nfrom pymatgen.core.structure import Structure\nfrom pymatgen.io.vasp.sets import VaspInputSet\n\nfrom emmet.core.settings import EmmetSettings\nfrom emmet.core.base import EmmetBaseModel...
[ [ "numpy.prod", "numpy.gradient" ] ]
kornosk/transformers
[ "4ce6bcc31095ddb8d4cdd79831217f200c53e801" ]
[ "examples/pytorch/text-classification/run_glue.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright 2020 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# http://www.apache....
[ [ "numpy.squeeze", "numpy.argmax" ] ]
brightgeng/reportgen
[ "ef299686e974c4064b5552a3beeb4e5dc0c1b48a" ]
[ "reportgen/questionnaire/questionnaire.py" ]
[ "# -*- coding: utf-8 -*\n'''问卷数据分析工具包\nCreated on Tue Nov 8 20:05:36 2016\n@author: JSong\n\n1、针对问卷星数据,编写并封装了很多常用算法\n2、利用report工具包,能将数据直接导出为PPTX\n\n该工具包支持一下功能:\n1、编码问卷星、问卷网等数据\n2、封装描述统计和交叉分析函数\n3、支持生成一份整体的报告和相关数据\n'''\n\n\n\n\nimport os\nimport re\nimport sys\nimport math\nimport time\n\n\n\nimport pandas as pd\ni...
[ [ "numpy.dot", "pandas.read_excel", "numpy.exp", "numpy.where", "scipy.linalg.diagsvd", "numpy.cumsum", "numpy.outer", "pandas.concat", "pandas.read_csv", "matplotlib.font_manager.FontProperties", "numpy.log", "pandas.DataFrame", "matplotlib.pyplot.subplots", ...
lucijabrezocnik/NiaPy
[ "1582d1af835c022c77224ea0234178a399efc106", "1582d1af835c022c77224ea0234178a399efc106" ]
[ "NiaPy/benchmarks/cosinemixture.py", "NiaPy/algorithms/basic/cso.py" ]
[ "# encoding=utf8\n\n\"\"\"Implementations of Cosine mixture functions.\"\"\"\n\nfrom numpy import cos, pi\nfrom NiaPy.benchmarks.benchmark import Benchmark\n\n__all__ = ['CosineMixture']\n\nclass CosineMixture(Benchmark):\n\tr\"\"\"Implementations of Cosine mixture function.\n\n\tDate: 2018\n\n\tAuthor: Klemen Berk...
[ [ "numpy.cos" ], [ "numpy.max", "numpy.full", "numpy.zeros", "numpy.argmin", "numpy.min", "numpy.where", "numpy.arange", "numpy.abs", "numpy.cumsum" ] ]
altonelli/tensorflow-fast-style-transfer
[ "5046164c7702982d2d6b308d75555888549c0d0a", "5046164c7702982d2d6b308d75555888549c0d0a" ]
[ "style_transfer_tester.py", "style_transfer_trainer.py" ]
[ "from transform import Transform\n\nimport tensorflow as tf\n\n\nclass StyleTransferTester:\n\n def __init__(self, session, content_image, model_path):\n # session\n self.sess = session\n\n # input images\n self.x0 = content_image\n\n # input model\n self.model_path = mo...
[ [ "tensorflow.expand_dims", "tensorflow.train.Saver", "tensorflow.squeeze", "tensorflow.placeholder", "tensorflow.clip_by_value", "tensorflow.global_variables_initializer" ], [ "tensorflow.matmul", "tensorflow.train.get_checkpoint_state", "tensorflow.gradients", "tensorfl...
zlheui/rafiki
[ "f9a3d01ad1620bd91bd5d4d758fedac54e09a803" ]
[ "rafiki/predictor/ensemble.py" ]
[ "import numpy as np\n\nfrom rafiki.constants import TaskType\n\ndef ensemble_predictions(predictions_list, predict_label_mappings, task):\n # TODO: Better ensembling of predictions based on `predict_label_mapping` & `task` of models\n\n if len(predictions_list) == 0 or len(predictions_list[0]) == 0:\n ...
[ [ "numpy.argmax" ] ]
michellefli/EverybodyDanceNow_reproduce_pytorch
[ "50bae6478cd23661397cc38c164e366fd475967e" ]
[ "train_pose2vid.py" ]
[ "import os\nimport numpy as np\nimport torch\nimport time\nimport sys\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nfrom pathlib import Path\nimport warnings\n\nwarnings.filterwarnings('ignore')\nmainpath = os.getcwd()\npix2pixhd_dir = Path(mainpath+'/src/pix2pixHD/')\nsys.path.append(s...
[ [ "numpy.savetxt", "torch.autograd.Variable", "torch.cuda.empty_cache", "torch.mean", "torch.multiprocessing.set_sharing_strategy" ] ]
donnel2-cooper/drone_control
[ "3bb3a1c1f768916ac41d4b78692e2edab0776c07", "3bb3a1c1f768916ac41d4b78692e2edab0776c07" ]
[ "Lectures/MAV_Dynamics/mav_dynamics.py", "Lectures/dirk_drone_code/gravity.py" ]
[ "\"\"\"\nmavDynamics \n - this file implements the dynamic equations of motion for MAV\n - use unit quaternion for the attitude state\n \npart of mavPySim \n - Beard & McLain, PUP, 2012\n - Update history: \n 12/20/2018 - RWB\n 2/24/2020\n\"\"\"\nimport sys\nsys.path.append('..')\nimpo...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.zeros", "numpy.arcsin", "numpy.exp", "numpy.sign", "numpy.arctan2", "numpy.sqrt", "numpy.cos", "numpy.power", "numpy.linalg.inv" ], [ "numpy.array" ] ]
PennLINC/xcp_abcd
[ "983ca22febc6cbb59b54076b0638a246bafc59b4" ]
[ "xcp_abcd/utils/dcan2fmriprep.py" ]
[ "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\nimport os,json,glob,re\nimport numpy as np \nimport pandas as pd\nimport nibabel as nb \nfrom nilearn.input_data import NiftiMasker\n\ndef dcan2fmriprep(dcandir,outdir,sub_id=None):\n dcandir = os...
[ [ "numpy.float", "pandas.DataFrame", "numpy.mean", "numpy.eye", "numpy.loadtxt", "pandas.concat", "pandas.read_csv" ] ]
davide-belli/deep-learning-labs
[ "1acd37a527711dccdc00c1935724cc5de7c10955" ]
[ "assignment_2/part3/model.py" ]
[ "# MIT License\n#\n# Copyright (c) 2017 Tom Runia\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, copy, mod...
[ [ "torch.nn.Linear", "torch.nn.LSTM" ] ]
MagaliDrumare/How-to-learn-Keras-Deep-Learning-with-Python-book-
[ "bbea1f3422d61baa8463c777d9a98c6eca16ffa1", "bbea1f3422d61baa8463c777d9a98c6eca16ffa1" ]
[ "08_PreTrainedConvNet.py", "10_RNN.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 23 10:11:14 2018\n\n@author: magalidrumare\n@ copyright https://github.com/fchollet/deep-learning-with-python-notebooks\n\"\"\"\n\n# Use of a pre-trained convnet : VGG16\n\n# An effective approach to deep learning on small image dataset i...
[ [ "numpy.reshape", "numpy.zeros" ], [ "numpy.concatenate", "numpy.random.random", "numpy.dot", "numpy.zeros" ] ]
miroslavradojevic/python-snippets
[ "753e1c15dc077d3bcf5de4fd5d3a675daf0da27c" ]
[ "pointcloud/pcl_conv.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport open3d as o3d\nimport numpy as np\nimport os\nimport time\nfrom os.path import join, dirname, basename, splitext, exists, isdir, isfile\nfrom os import listdir\nfrom numpy import linalg as LA\nimport math\nimport cv2\nfrom pathlib import Path\n\n\ndef pcd_to_bin(pcd_p...
[ [ "numpy.divide", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros", "numpy.round", "numpy.amax", "numpy.arctan2", "numpy.fromfile", "numpy.amin", "numpy.around" ] ]
jjavier-bm/conkit
[ "9888e40caa1720a9905c551b963ffd4f99f9c913" ]
[ "setup.py" ]
[ "\"\"\"Python Interface for Residue-Residue Contact Predictions\"\"\"\nimport os\nimport sys\n\nfrom distutils.command.build import build\nfrom distutils.util import convert_path\nfrom setuptools import setup, Extension\n\nfrom Cython.Distutils import build_ext\nimport numpy as np\n\n\n# ===========================...
[ [ "numpy.get_include" ] ]
vuhe/LearnPython
[ "0a081a85456557ae542925cce950b23313c3c9b9" ]
[ "artificial_intelligence/experiment_7.py" ]
[ "# 导入需要的包\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport sklearn.datasets\nimport sklearn.linear_model\nimport matplotlib\n\n# Display plots inline and change default figure size\nmatplotlib.rcParams['figure.figsize'] = (10.0, 8.0) # 生成数据集并绘制出来\nnp.random.seed(0)\nX, y = sklearn.datasets.make_moons(2...
[ [ "numpy.square", "numpy.dot", "matplotlib.pyplot.contourf", "numpy.zeros", "numpy.random.seed", "numpy.sum", "matplotlib.pyplot.title", "numpy.random.randn", "numpy.exp", "numpy.tanh", "matplotlib.pyplot.show", "numpy.argmax", "numpy.arange", "numpy.sqrt", ...
sjs1178/jandichatbot
[ "bdb20e6f671a2a133c8ad7ea73caefb3c8818fd8" ]
[ "createpickles.py" ]
[ "# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Default module to train a xor classifier and write weights to disk.\"\"\"\n\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Activation\nimport keras.optimizers as kop\nimport numpy as np\nimport os\nfrom sklearn.preprocessing import...
[ [ "numpy.array", "sklearn.preprocessing.StandardScaler" ] ]
camall3n/focused-macros
[ "113b13cbcf1e2c5ea2817113fa57869cc856b01e" ]
[ "experiments/npuzzle/solve.py" ]
[ "import argparse\nimport copy\nimport os\nimport pickle\nimport random\nimport sys\nfrom types import SimpleNamespace\n\nimport numpy as np\n\nfrom domains.npuzzle import NPuzzle, macros\nfrom experiments import search, iw, bfws\n\ndef parse_args():\n \"\"\"Parse input arguments\n\n Use --help to see a pretty...
[ [ "numpy.random.seed" ] ]
Kexin-Wei/spinnup
[ "36e56b1f91538df7dd58ce42f82f809e85b2317d" ]
[ "env_pyrep/utils.py" ]
[ "import os\r\nimport json\r\nimport numpy as np\r\nimport itertools\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits.mplot3d.art3d import Line3DCollection\r\nfrom mpl_toolkits import mplot3d\r\n\r\ndef liver_dump_init(env, name = None):\r\n liver = {'x':[],'Fes':[],'Fis':[],'Ficp':[],'volume':[],'col_p_n'...
[ [ "numpy.tile", "numpy.mean", "matplotlib.pyplot.draw", "numpy.cos", "numpy.deg2rad", "numpy.sin", "numpy.linalg.norm", "numpy.sqrt", "numpy.cross", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.intersect1d", "numpy.argwhere", "numpy.hst...
steffenvan/IMPALA-PopArt
[ "3cd086e85f8d48a4d3d5a3491fde007e1c9ee29d" ]
[ "popart/build_learner.py" ]
[ "import tensorflow as tf\nimport sys\nsys.path.insert(0,'..')\nimport vtrace_popart as vtrace\nnest = tf.contrib.framework.nest\n\nfrom .flags import *\n\ndef compute_baseline_loss(advantages):\n # Loss for the baseline, summed over the time dimension.\n # Multiply by 0.5 to match the standard update rule:\n # d...
[ [ "tensorflow.gradients", "tensorflow.clip_by_value", "tensorflow.to_float", "tensorflow.control_dependencies", "tensorflow.stop_gradient", "tensorflow.nn.softmax", "tensorflow.tanh", "tensorflow.gather", "tensorflow.trainable_variables", "tensorflow.summary.histogram", "...
gelareh1985/GraphSAGE
[ "1d90a5c4168c44494dd58fc5dd25f90e566d49af" ]
[ "graphsage/metrics.py" ]
[ "import tensorflow as tf\r\n\r\n# DISCLAIMER:\r\n# Parts of this code file were originally forked from\r\n# https://github.com/tkipf/gcn\r\n# which itself was very inspired by the keras package\r\ndef masked_logit_cross_entropy(preds, labels, mask):\r\n \"\"\"Logit cross-entropy loss with masking.\"\"\"\r\n l...
[ [ "tensorflow.argmax", "tensorflow.nn.l2_loss", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.reduce_mean", "tensorflow.stop_gradient", "tensorflow.cast" ] ]
shinianzhihou/ClassyVision
[ "b3f714ef94275b3e9753ab3f3c8256cb852b96fc" ]
[ "classy_vision/tasks/classification_task.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport contextlib\nimport copy\nimport enum\nimport json\nimport logging\nimport math\nimport multiprocessin...
[ [ "torch.cuda.amp.autocast", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.no_grad", "torch.enable_grad", "torch.cuda.device_count", "torch.cuda.is_available", "torch.tensor", "torch.cuda.amp.GradScaler", "torch.distributed.broadcast" ] ]
varun123455/containermicroservices
[ "04bb2ab4dc8303969caf1047872059436a8c4e7d" ]
[ "load_balancer/docker_acts/app.py" ]
[ "def is_sha1(maybe_sha):\n if len(maybe_sha) != 40:\n return False\n try:\n sha_int = int(maybe_sha, 16)\n except ValueError:\n return False\n return True\n\ndef validate(date_text):\n try:\n datetime.datetime.strptime(date_text, '%d-%m-%Y:%S-%M-%H')\n return True\n...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_csv" ] ]
vishalbelsare/FEDOT
[ "3a6f06b29cf2f173008d119f7cb5dc705a45f695" ]
[ "cases/industrial/multivariate_forecasting.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom pylab import rcParams\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error\n\n# Additional custom functions\nfrom cases.industrial.processing import multi_automl_fit_forecast, plot_results\nfrom fedot.core.constants import BEST_QUALITY_PRESET_NAME\nfrom...
[ [ "numpy.array", "pandas.read_csv", "sklearn.metrics.mean_squared_error", "sklearn.metrics.mean_absolute_error" ] ]
KiLJ4EdeN/CV_PYTHON
[ "95d17306d2af3ac596429639c1fee99cd4bbe263" ]
[ "CV_PYTHON/IMG_2.py" ]
[ "import cv2\r\nimport numpy as np\r\n\r\ngreen = np.uint8([[[255,0,0]]])\r\nhsv_green = cv2.cvtColor(green,cv2.COLOR_BGR2HSV)\r\nprint(hsv_green)\r\n" ]
[ [ "numpy.uint8" ] ]
Agoric/testnet-notes
[ "4072ead3e4b0339a4ef2068a253975f460b1afe8" ]
[ "nb4/slogfiles.py" ]
[ "# -*- coding: utf-8 -*-\n# # How long does a Computron take?\n#\n# - [build model of computron\\-to\\-wallclock relationship · Issue \\#3459 · Agoric/agoric\\-sdk](https://github.com/Agoric/agoric-sdk/issues/3459)\n\n# ## Preface: Python Data Tools\n#\n# See also [shell.nix](shell.nix).\n\n# +\nimport pandas as p...
[ [ "pandas.to_datetime", "pandas.DataFrame.from_records", "pandas.merge", "matplotlib.cm.get_cmap", "numpy.where", "numpy.polyfit", "numpy.poly1d", "pandas.read_sql", "pandas.read_sql_table", "pandas.read_csv" ] ]
mmargenot/edward
[ "e9ed2cdc26ca9146c23b77784c98dd882a587dd8" ]
[ "edward/inferences/sghmc.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport six\nimport tensorflow as tf\n\nfrom edward.inferences.monte_carlo import MonteCarlo\nfrom edward.models import RandomVariable, Empirical\nfrom edward.util import copy\n\ntry:\n from edward.mod...
[ [ "tensorflow.convert_to_tensor", "tensorflow.zeros", "tensorflow.assign", "tensorflow.get_default_graph", "tensorflow.group", "tensorflow.ones", "tensorflow.constant", "tensorflow.sqrt", "tensorflow.maximum", "tensorflow.scatter_update" ] ]
TonyMTH/Resume-Ranking
[ "6f560f7219848ddc7ee4bdbfabbd980905af4642", "6f560f7219848ddc7ee4bdbfabbd980905af4642" ]
[ "training/train.py", "training/playground.py" ]
[ "import numpy as np\nimport pandas as pd\nimport torch\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn import svm\nfrom torch.utils.data import DataLoader\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom parameters import *\nfrom trainin...
[ [ "sklearn.svm.SVR", "torch.utils.data.DataLoader", "numpy.unique" ], [ "numpy.array" ] ]
Daz-Riza-Seriog/Transport_Phenomena
[ "822b89556fa56ef57494a318cbb03524e3a4d237" ]
[ "Heat_Transfer/3.3-Wire_Isolation_Base__Fin.py" ]
[ "# Code made for Sergio Andrés Díaz Ariza\n# 23 March 2021\n# License MIT\n# Transport Phenomena: Python Program-Assesment 3.3\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport numpy as np\n\nsns.set()\n\n\nclass Wire_Param:\n\n def Power_from_volt(self, V, R_Km, Dis_insul, Diameter_mm):\n ...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.exp", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "numpy.linalg.solve", "numpy.sqrt", "matplotlib.pyplot.show" ] ]
distributed-systems-group-7/TUD-DistributedSystems
[ "8de84791a7f721d8d5487693da4dcc63eb141132" ]
[ "Conflict-free_Replicated_Data_Types/src/benchmarking/OperationTestsGenerator.py" ]
[ "\nimport numpy as np\nimport math \n# number will be decreased by a small amount when some deletions happen \nnumber_of_vertices = 5_000 \n# probability of an arc between any two instances \nprobability_of_an_arc = 0.001 \n# number of reads in the read-heavy test \nread_test_operations = 20_000 \n# probability of ...
[ [ "numpy.random.normal", "numpy.random.randint", "numpy.random.ranf" ] ]
thinkmoore/das
[ "d9faabf3de987b890a5079b914f5aba597215b14" ]
[ "programs/engine/unit_tests/json_nodes_test.py" ]
[ "#\n#\n# Needs to be expanded to accommodate the common occurrence of sparse.multiSparse objects in the geounitNode class vs pure numpy arrays\n#\n#\n\nimport os\nimport sys\n# If there is __init__.py in the directory where this file is, then Python adds das_decennial directory to sys.path\n# automatically. Not sur...
[ [ "numpy.array" ] ]
slowbull/leaf
[ "a2eda2b551fb0db8ddf88ae8c9e60adf965c7e85" ]
[ "models/metrics/writer.py" ]
[ "\"\"\"Writes the given metrics in a csv.\"\"\"\n\nimport numpy as np\nimport os\nimport pandas as pd\nimport sys\n\nmodels_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nsys.path.append(models_dir)\n\nfrom baseline_constants import CLIENT_ID_KEY, NUM_ROUND_KEY, NUM_SAMPLES_KEY\n\n\nCOLUMN_NAMES...
[ [ "pandas.DataFrame" ] ]
Tacha-S/perception
[ "7a715477b066528b67a8246f28fa8bac79180051" ]
[ "sbpl_perception/src/scripts/tools/fat_dataset/lib/utils/symbol.py" ]
[ "# --------------------------------------------------------\n# Deep Iterative Matching Network\n# Licensed under The Apache-2.0 License [see LICENSE for details]\n# Written by Yi Li\n# --------------------------------------------------------\nfrom __future__ import print_function, division\nimport numpy as np\n\n\n...
[ [ "numpy.prod", "numpy.sqrt" ] ]
dkurt/NiftyNet
[ "3a4d54544c0886751bacfdbddb42eb90fe0d5b54" ]
[ "niftynet/network/simulator_gan.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom niftynet.layer.activation import ActiLayer\nfrom niftynet.layer.convolution import ConvolutionalLayer\nfrom niftynet.layer.deconvolution import DeconvolutionalLayer\nfrom...
[ [ "tensorflow.constant_initializer", "tensorflow.concat", "tensorflow.reshape", "numpy.prod", "tensorflow.name_scope", "tensorflow.image.resize_images", "tensorflow.random_normal", "tensorflow.random_normal_initializer" ] ]
SebastianVeile/PreSumm
[ "780c340e04fd5911badb4a8b2af2284c5cdbb8b5" ]
[ "src/models/predictor.py" ]
[ "#!/usr/bin/env python\n\"\"\" Translator Class and builder \"\"\"\nfrom __future__ import print_function\nimport codecs\nimport os\nimport math\n\nimport torch\n\nfrom tensorboardX import SummaryWriter\n\nfrom others.utils import rouge_results_to_str, test_rouge, tile\nfrom translate.beam import GNMTGlobalScorer\n...
[ [ "torch.no_grad", "torch.full", "torch.arange" ] ]
aemerick/yt
[ "984484616d75c6d7603e71b9d45c5d617705a0e5", "984484616d75c6d7603e71b9d45c5d617705a0e5", "984484616d75c6d7603e71b9d45c5d617705a0e5" ]
[ "yt/frontends/gdf/io.py", "yt/frontends/athena_pp/data_structures.py", "yt/geometry/particle_geometry_handler.py" ]
[ "import numpy as np\nfrom yt.utilities.on_demand_imports import _h5py as h5py\nfrom yt.funcs import \\\n mylog\nfrom yt.geometry.selection_routines import GridSelector\nfrom yt.utilities.io_handler import \\\n BaseIOHandler\n\n\ndef _grid_dname(grid_id):\n return \"/data/grid_%010i\" % grid_id\n\n\ndef _fi...
[ [ "numpy.empty" ], [ "numpy.max", "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.sqrt", "numpy.all", "numpy.indices" ], [ "numpy.vstack", "numpy.arange", "numpy.empty", "numpy.zeros" ] ]
YeongHyeon/ReXNet-TF2
[ "a391f4372d628044be7cc49641d096cb3f320255" ]
[ "source/layers.py" ]
[ "import tensorflow as tf\n\nclass Layers(object):\n\n def __init__(self):\n\n self.name_bank, self.params_trainable = [], []\n self.num_params = 0\n self.initializer_xavier = tf.initializers.glorot_normal()\n\n def elu(self, inputs): return tf.nn.elu(inputs)\n def relu(self, inputs): r...
[ [ "tensorflow.nn.swish", "tensorflow.nn.batch_normalization", "tensorflow.initializers.glorot_normal", "tensorflow.nn.relu", "tensorflow.nn.conv2d", "tensorflow.math.reduce_std", "tensorflow.matmul", "tensorflow.nn.relu6", "tensorflow.Variable", "tensorflow.nn.depthwise_conv2...
b-safwat/multi_action_recognition
[ "1a85da64cf236b9fb7c9a58ae75bdd092d05fab8", "1a85da64cf236b9fb7c9a58ae75bdd092d05fab8" ]
[ "c3d_model/predict_c3d_ucf101.py", "Miscillanious/random_split_train_val.py" ]
[ "# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ...
[ [ "tensorflow.trainable_variables", "tensorflow.truncated_normal_initializer", "tensorflow.concat", "tensorflow.train.import_meta_graph", "tensorflow.reset_default_graph", "tensorflow.train.Saver", "tensorflow.nn.l2_loss", "tensorflow.ConfigProto", "tensorflow.variable_scope", ...
RonSherfey/data-act-broker-backend
[ "d287abda2cac06dd479ecf0127e789cb8e59387d" ]
[ "tests/integration/error_warning_file_tests.py" ]
[ "import os\nimport csv\nimport logging\nimport itertools\nimport pandas as pd\nimport psutil as ps\nfrom _pytest.monkeypatch import MonkeyPatch\n\nfrom dataactcore.interfaces.db import GlobalDB\nfrom dataactcore.config import CONFIG_SERVICES\nfrom dataactcore.models.domainModels import concat_tas_dict\nfrom dataact...
[ [ "pandas.read_csv" ] ]
zzheng93/code_uhws
[ "37e9c992066ad77c9c028c84d5f231ef442ca207" ]
[ "3_model_valid/pred/apply_model_members.py" ]
[ "import xarray as xr\nimport pandas as pd\nimport numpy as np\nimport xgboost as xgb\nimport time\nimport pickle\nimport sys\n\nfrom xgboost import XGBRegressor\n\n# load dataframe with maximal temp\ndef load_df_max_TREFHT(member, start_date, end_date):\n path = \"/glade/scratch/zhonghua/CESM-LE-members-csv/\"\n...
[ [ "pandas.to_datetime", "pandas.read_csv", "pandas.concat" ] ]
shiyipaisizuo/tensorflow-project
[ "ce111d2def54bce4f1777f7a8921d60bdd0c668c" ]
[ "cats_dogs/base.py" ]
[ "\"\"\"\n Training data and validation accuracy.\n\"\"\"\n\n# Author: Changyu Liu <Shiyipaisizuo@gmail.com>\n# Last modified: 2018-07-06\n# LICENSE: MIT\n\nimport os\nimport numpy as np\nimport tensorflow as tf\nfrom PIL import Image\n\nimport train_test_split\nimport cnn\n\n\nN_CLASSES = 2 # dogs and cats\nIMG...
[ [ "tensorflow.train.start_queue_runners", "numpy.array", "tensorflow.train.Coordinator", "tensorflow.Graph", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.train.get_checkpoint_state", "tensorflow.reshape", "numpy.random.randint", "numpy.arange", "tensorflow....
tmsick/deep-learning-from-scratch
[ "96c52aeb74eb77bbfce505a47bbdcdba70e47559", "96c52aeb74eb77bbfce505a47bbdcdba70e47559" ]
[ "ch05/two_layer_net.py", "ch04/gradient_simplenet.py" ]
[ "# coding: utf-8\nimport sys, os\n\nsys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定\nimport numpy as np\nfrom common.layers import *\nfrom common.gradient import numerical_gradient\nfrom collections import OrderedDict\n\n\nclass TwoLayerNet:\n def __init__(self, input_size, hidden_size, output_size, weig...
[ [ "numpy.sum", "numpy.random.randn", "numpy.argmax", "numpy.zeros" ], [ "numpy.array", "numpy.dot", "numpy.random.randn" ] ]
gidden/cyclopts
[ "e346b1721c8d8722af2862823844ab2e7864141b" ]
[ "cyclopts/functionals.py" ]
[ "\"\"\"A module for useful functions. \n\n:author: Matthew Gidden <matthew.gidden _at_ gmail.com>\n\"\"\"\nimport numpy as np \n\nrms = lambda a, axis=None: np.sqrt(np.mean(np.square(a), axis=axis))\n" ]
[ [ "numpy.square" ] ]
samstern/MSc-Project
[ "79e38803589d4169a11ae96e6bb90f373e8ed1db" ]
[ "pybrain/rl/environments/timeseries/performanceEvaluation.py" ]
[ "import pandas as pd\nfrom math import exp, log,sqrt\nfrom numpy import cumsum,std,sum, mean\n\ndef outData(ts,actionHist,indx,startIndex=0):\n out=pd.DataFrame(ts,index=indx,columns=['ts']).applymap(lambda x: x/100)\n out=out[startIndex:]\n out['cum_log_ts']=cumsum([log(1+i) for i in out['ts']])\n out[...
[ [ "numpy.std", "pandas.DataFrame", "numpy.sum", "pandas.Series" ] ]
whilemind/subtitle
[ "f911d97232c602b091f5eabb643667e9b72199df" ]
[ "src/subtitle.py" ]
[ "import time\nimport scipy.io.wavfile as wavfile\nimport numpy as np\nimport speech_recognition as sr\nimport librosa\nimport argparse\nimport os\nfrom glob import glob\n\nfrom pydub import AudioSegment\nfrom pydub.silence import split_on_silence, detect_nonsilent\nfrom pydub.playback import play\nimport pysrt\nimp...
[ [ "numpy.abs", "numpy.iinfo", "scipy.io.wavfile.write" ] ]
facebookresearch/beanmachine
[ "225114d9964b90c3a49adddc4387b4a47d1b4262", "225114d9964b90c3a49adddc4387b4a47d1b4262" ]
[ "src/beanmachine/ppl/diagnostics/common_plots.py", "src/beanmachine/ppl/compiler/special_function_caller.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and 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\nfrom typing import Callable, List, NamedTuple, Tuple\n\nimport numpy as np\nimport plotly.graph_objs as go\nimport torch\nfrom tor...
[ [ "numpy.unravel_index", "torch.var" ], [ "torch.__dict__.items", "torch.tensor" ] ]
richarai9/FastSpeech2
[ "d044c00a44cbfa3e1c89a22c8285a374a00e27a9", "d044c00a44cbfa3e1c89a22c8285a374a00e27a9" ]
[ "model/optimizer.py", "transformer/Layers.py" ]
[ "import torch\r\nimport numpy as np\r\n\r\n\r\nclass ScheduledOptim:\r\n \"\"\" A simple wrapper class for learning rate scheduling \"\"\"\r\n\r\n def __init__(self, model, train_config, model_config, current_step):\r\n\r\n self._optimizer = torch.optim.Adam(\r\n model.parameters(),\r\n ...
[ [ "numpy.power" ], [ "torch.nn.BatchNorm1d", "torch.nn.ModuleList", "torch.nn.Conv1d" ] ]
xxworkspace/Paddle
[ "74ad4b6a700795d5edce8dd49d6c2df6f15e8935", "74ad4b6a700795d5edce8dd49d6c2df6f15e8935" ]
[ "python/paddle/fluid/trainer_factory.py", "python/paddle/fluid/dataloader/worker.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.array" ], [ "numpy.dtype" ] ]
Viktour19/adversarial-robustness-toolbox
[ "96ba28170d0de1b5db6a16330a312248cc3b8972" ]
[ "art/attacks/elastic_net.py" ]
[ "# MIT License\n#\n# Copyright (C) IBM Corporation 2018\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, ...
[ [ "numpy.square", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.ones", "numpy.min", "numpy.mean", "numpy.argmax", "numpy.abs", "numpy.clip", "numpy.maximum" ] ]
kothiga/N-Smallest
[ "6e46fe1e4872449c1c918bae41dfa5e17008cda0" ]
[ "main.py" ]
[ "import numpy as np\n\nimport os\nimport time\n\nimport argparse\nimport PruneAndSearch as algs\n\ndef get_args():\n parser = argparse.ArgumentParser (\n prog='PruneAndSearch', \n description='Implementation of the Prune and Search Algorithm. ',\n usage='python main.py { --rand RAND | --file...
[ [ "numpy.asarray", "numpy.random.seed", "numpy.sum", "numpy.mean", "numpy.std", "numpy.loadtxt", "numpy.random.randint" ] ]
4uiiurz1/kaggle-tgs-salt-identification-challenge
[ "aad93eeaac0f04d80428e098d582008205d1e99c" ]
[ "losses.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom LovaszSoftmax.pytorch.lovasz_losses import lovasz_hinge\n\n\nclass SoftDiceLoss(nn.Module):\n def __init__(self):\n super(SoftDiceLoss, self).__init__()\n\n def forward(self, input, target):\n smoot...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.nn.functional.sigmoid", "torch.sum" ] ]
HiroshiKERA/monomial-agnostic-vanishing-ideal
[ "ddfb53ded0ee87f129ec029603e8245565f653d2" ]
[ "mavi/jax/util/plot.py" ]
[ "import jax.numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef plot(vi, X, \n target='vanishing', \n n=1000, scale=1.5, x_max=1.0, y_max=1.0,\n z_func=lambda x_, y_: 0.0,\n show=False, splitshow=False):\n\n nvars = X.shape[-1]\n if nvars == 2:\n _plot2d(vi, X, target=target, \n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.gca", "matplotlib.pyplot.plot" ] ]
coresresearch/p2d_li_ion_battery
[ "7ea1a2332eb885bea65e47e82ea231f80d28ca18" ]
[ "li_ion_battery_p2d_functions.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Dec 6 11:37:06 2018\n\n@author: dkorff\n\"\"\"\n\nimport numpy as np\nimport cantera as ct\nfrom assimulo.problem import Implicit_Problem\n\nfrom li_ion_battery_p2d_init import anode as an\nfrom li_ion_battery_p2d_init import cathode as cat\nfrom li_ion_battery_p2d_...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.dot", "numpy.zeros", "numpy.sum", "numpy.arange" ] ]
nayyarv/CodeANet
[ "30c8d95fff96bdca72b49de551f38e33cd59a5f6" ]
[ "tests/test_layers4.py" ]
[ "#!/usr/bin/env py.test\n# -*- coding: utf-8 -*-\n__author__ = \"Varun Nayyar <nayyarv@gmail.com>\"\n\nimport numpy as np\nimport pytest\n\nimport NN.layerversions.layers4 as layer\n\n\ndef test_fc():\n l1 = layer.FullyConnected(5, 10)\n x = np.ones((100, 5))\n y, c = l1.forward(x)\n assert y.shape == ...
[ [ "numpy.all", "numpy.tanh", "numpy.ones", "numpy.random.randn" ] ]
ryflect/CS683-xcom
[ "37db4ab3bc8996780de6485a79898dd1395bddd0" ]
[ "helper.py" ]
[ "import numpy as np\nimport math\nfrom arena import Arena\nfrom agent import HAgent, AAgent\nimport random\n# np.random.seed(1234)\n\n\n# place the humans on the arena\ndef place_soldiers(n, arena, agents):\n x = 0\n y = 0\n\n for i in range(n):\n agents[i + 1] = HAgent([x, y])\n arena.arena[...
[ [ "numpy.linalg.norm", "numpy.random.randint", "numpy.random.rand" ] ]
RogelioHiguera/Python-2.0
[ "af4e471da86d132c5bece8c93756e29a6bc6d437" ]
[ "IibreriaNumpy2.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Oct 26 20:21:07 2019\nTecnológico Nacional de México (TECNM)\nTecnológico de Estudios Superiores de Ixtapaluca (TESI)\nDivisión de ingeniería electrónica\nIntroducción a la librería Numpy 2\nM. en C. Rogelio Manuel Higuera Gonzalez\n\"\"\"\nimport numpy as np\n######...
[ [ "numpy.array", "numpy.sort", "numpy.argsort" ] ]
zijiewu3/mbuild
[ "dc6a1053ddec7b5682b0413bd5b2d2a187cd24e8" ]
[ "mbuild/coordinate_transform.py" ]
[ "\"\"\"Coordinate transformation functions.\"\"\"\nfrom warnings import simplefilter, warn\n\nsimplefilter(\"always\", DeprecationWarning)\n\nimport numpy as np\nfrom numpy.linalg import inv, norm, svd\n\nfrom mbuild.utils.exceptions import RemovedFuncError\n\n__all__ = [\n \"force_overlap\",\n \"x_axis_trans...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.dot", "numpy.zeros", "numpy.clip", "numpy.asarray", "numpy.ones", "numpy.mean", "numpy.eye", "numpy.shape", "numpy.vstack", "numpy.transpose", "numpy.cos", "numpy.linalg.svd", "numpy.expand_dims...
CompassMentis/practical_python_in_10_lines
[ "4821d5f813f99abe41bbe4fcac558114333f93eb" ]
[ "read_csv_and_plot/read_and_plot.py" ]
[ "# Data from https://www.kaggle.com/crawford/80-cereals/version/2\nimport pandas, matplotlib\ndata = pandas.read_csv('http://www.compassmentis.com/wp-content/uploads/2019/04/cereal.csv')\ndata = data.set_index('name')\ndata = data.calories.sort_values()[-10:]\nax = data.plot(kind='barh')\nax.set_xlabel('Calories pe...
[ [ "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.subplots_adjust" ] ]
gaog94/GDAN_QC_CopyNumber
[ "668089f4122bfd1df51954977183bf0615a21f1f" ]
[ "scripts/AnalysisCode.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Feb 22 17:28:54 2018\n\n@author: galengao\n\nThis is the original analysis code as it exists in the environment where it was writen and initially run.\nPortions and modifications of this script constitute all other .py scripts in this director...
[ [ "pandas.read_table", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.xlabel", "numpy.std", "matplotlib.pyplot.hist", "matplotlib.pyplot.gcf", "matplotlib.pyplot.ylabel", "numpy.sort", "numpy.average", "matplotlib.pyplot...
shanky97/tensorflow
[ "0f2192d6439bf6826d71f2ca46dbe44d585883af" ]
[ "tensorflow/python/ops/math_ops.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.identity", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops.gen_math_ops.batch_mat_mul", "tensorflow.python.ops.gen_math_ops.cumsum", "tensorflow.python.ops.gen_math_ops._abs", "tensorflow.python.ops.gen_math_ops.angle", "numpy.prod", ...
anathnathphy67/geopandas
[ "07a8f4cc7ef3eac0a2f2d272feb95a0887077072" ]
[ "geopandas/tools/sjoin.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom shapely import prepared\n\nfrom geopandas import GeoDataFrame\nfrom geopandas import _compat as compat\nfrom geopandas.array import _check_crs, _crs_mismatch_warn\n\n\ndef sjoin(\n left_df, right_df, how=\"inner\", op=\"intersects\", lsuffix=\"left\", rsuffix=\"ri...
[ [ "numpy.concatenate", "numpy.empty", "numpy.vectorize", "pandas.DataFrame", "numpy.column_stack" ] ]
BPMJG/annotated-F-pointnet
[ "c14f1aea38ab22b4a17e0b0f0bfc371c488a641a" ]
[ "models/frustum_pointnets_v1.py" ]
[ "''' Frsutum PointNets v1 Model.\n'''\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport tensorflow as tf\nimport numpy as np\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(BASE_DIR)\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(ROOT_DIR, 'utils'))...
[ [ "tensorflow.zeros", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.Graph", "tensorflow.ones", "tensorflow.constant", "tensorflow.squeeze", "tensorflow.tile" ] ]
treuds/statsmodels
[ "6b4aa33563ab639d168525dde0ef86c8e5c83d68" ]
[ "statsmodels/othermod/betareg.py" ]
[ "# -*- coding: utf-8 -*-\n\nu\"\"\"\nBeta regression for modeling rates and proportions.\n\nReferences\n----------\nGrün, Bettina, Ioannis Kosmidis, and Achim Zeileis. Extended beta regression\nin R: Shaken, stirred, mixed, and partitioned. No. 2011-22. Working Papers in\nEconomics and Statistics, 2011.\n\nSmithson...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "scipy.special.gammaln", "numpy.asarray", "numpy.log", "scipy.special.polygamma", "numpy.zeros", "numpy.block", "numpy.abs", "numpy.clip", "numpy.all", "numpy.column_stack", "scipy.stats.beta" ] ]
kguarian/Classification-Algorithms
[ "e9847760041f712c827778142d581529530ef93e" ]
[ "knn/main.py" ]
[ "import pandas as pd\nimport plotly.graph_objects as go\nimport plotly.express as px\nimport plotly.figure_factory as ff\nimport numpy as np\n\nfrom plotly.subplots import make_subplots\nfrom tqdm import tqdm\n\nfrom sklearn.preprocessing import StandardScaler\n\nfrom sklearn.decomposition import PCA\n\nfrom sklear...
[ [ "pandas.read_csv" ] ]
DFrolova/human-rl
[ "c54ec02a48aba53a6e90d64570ebb7f62dfdea8e" ]
[ "universe-starter-agent/run.py" ]
[ "import os\nimport go_vncdriver\nimport tensorflow as tf\nimport argparse\nimport json\nimport envs\nfrom model import policies\nimport checkpoint_utils\n\nparser = argparse.ArgumentParser(description=\"Run commands\")\nparser.add_argument('logdir', type=str, help=\"Log directory path\")\n\nargs = parser.parse_args...
[ [ "tensorflow.Session", "tensorflow.global_variables_initializer" ] ]
nicolewang97/AICAPI_YW3760
[ "ce49c375acf35e86ca0878b2df56a562b3a3ad05" ]
[ "src/aicapi_yw3760/aicapi_yw3760.py" ]
[ "import pandas as pd\nimport numpy as np\nimport os\nimport json\nimport requests\nfrom dotenv import load_dotenv\nfrom PIL import Image\nfrom io import BytesIO\nfrom IPython.core.display import display, HTML\n\ndef art_search(art):\n '''\n Function to retrieve the information about collections in the Art ins...
[ [ "pandas.DataFrame" ] ]
alecone/ROS_project
[ "5de01433d177fde5cac4423f05fd554e3c00794e" ]
[ "g2opy/python/examples/ba_anchored_inverse_depth_demo.py" ]
[ "# https://github.com/RainerKuemmerle/g2o/blob/master/g2o/examples/ba_anchored_inverse_depth/ba_anchored_inverse_depth_demo.cpp\n\nimport numpy as np\nimport g2o \n\nfrom collections import defaultdict\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--noise', dest='pixel_noise', type=fl...
[ [ "numpy.array", "numpy.random.seed", "numpy.sum", "numpy.random.randn", "numpy.identity", "numpy.random.random" ] ]
BIT-ENGD/OpenPrompt
[ "f4f0159943afab0c0ce158628092bd28404d5017" ]
[ "openprompt/prompts/one2one_verbalizer.py" ]
[ "import json\nfrom transformers.tokenization_utils import PreTrainedTokenizer\nfrom yacs.config import CfgNode\nfrom openprompt.data_utils import InputFeatures\nimport re\nfrom openprompt import Verbalizer\nfrom typing import *\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom openprompt.u...
[ [ "torch.log", "torch.tensor", "torch.nn.Parameter" ] ]
Ashymad/praca.inz
[ "dbb1fba10e421c3610bb66a06b7601d2ca4366c6" ]
[ "tests/python/tests/conv/test.py" ]
[ "# pass test\nimport numpy as np\n\ndef prepare_input(input_size):\n return [np.random.rand(input_size), np.random.rand(input_size)]\n\ndef test_function(input_data):\n return np.convolve(input_data[0], input_data[1])\n" ]
[ [ "numpy.random.rand", "numpy.convolve" ] ]
byanofsky/tensorboard
[ "42368f5be4611eac2b4206a00a322f79083b1aa8" ]
[ "tensorboard/data/experimental/experiment_from_dev_test.py" ]
[ "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "pandas.DataFrame", "pandas.testing.assert_frame_equal", "numpy.arange" ] ]
tlangfor/ProPCA
[ "e94c9729f5ff9e1c4b70864fd9cb3dc85e4aebe1" ]
[ "misc/selection/galinsky.py" ]
[ "#!/bin/env python3\n\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom pandas_plink import read_plink\nimport argparse\n\nif __name__=='__main__':\n\n\tparser = argparse.ArgumentParser(description=\"Calculate chi-squared selection statistics based on principal components from Galinsky et al. 2016\")\n\tpa...
[ [ "numpy.ceil", "numpy.dot", "numpy.savetxt", "numpy.nan_to_num", "numpy.nansum", "numpy.nanmean", "numpy.loadtxt", "numpy.sqrt" ] ]
Circumstellar/MichaelJordan
[ "23c2442e83310866ce7bb57cff13e106845cd839" ]
[ "deredden.py" ]
[ "#==============================================================================\n# DEREDDEN.py Sean Andrews's deredden.pro ported to python3\n#\n# A simple function to provide the de-reddening factor in either magnitudes\n# (with keyword /mags set) or flux density at a range of input wavelengths,\n# given a visual...
[ [ "scipy.interpolate.interp1d", "matplotlib.pyplot.savefig", "numpy.save", "matplotlib.pyplot.figure", "numpy.linspace" ] ]
budakn/INDRA
[ "393958b2ca7bc1ca5d054885c0634f434ff7496e" ]
[ "indra/tools/reading/submit_reading_pipeline.py" ]
[ "from __future__ import absolute_import, print_function, unicode_literals\n\nimport pickle\nfrom builtins import dict, str\n\nimport os\nimport re\nimport boto3\nimport logging\nimport botocore.session\nfrom time import sleep\nimport matplotlib as mpl\nfrom numpy import median, arange, array\n\nfrom indra.tools.rea...
[ [ "matplotlib.use", "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.GridSpec", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot" ] ]
yamamototakas/fxtrading
[ "955d247b832de7180b8893edaad0b50df515809f" ]
[ "agents/tensorflow_iris.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\n\nimport numpy as np\nimport tensorflow as tf\n\ntf.logging.set_verbosity(tf.logging.INFO)\n\n# Data sets\nIRIS_TRAINING = os.path.join(os.path.dirname(__file__), \"iris_training.csv\")\nIRI...
[ [ "tensorflow.logging.set_verbosity", "numpy.array", "tensorflow.contrib.learn.datasets.base.load_csv_with_header", "tensorflow.contrib.layers.real_valued_column", "tensorflow.contrib.learn.RunConfig", "tensorflow.contrib.learn.monitors.ValidationMonitor", "tensorflow.app.run" ] ]
huamichaelchen/streamlit
[ "02041f6726d3e98b8f872365bd8129c9f4cb31f4" ]
[ "lib/streamlit/DeltaGenerator.py" ]
[ "# Copyright 2018-2020 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ...
[ [ "pandas.RangeIndex" ] ]
bnusss/tensorflow_learning
[ "0db541bc1bf1255d9d548eb1e5256fb397be192e" ]
[ "08_midi_generate/test.py" ]
[ "import tensorflow as tf\nimport numpy as np\n \ndef body(x):\n a = tf.random_uniform(shape=[2, 2], dtype=tf.int32, maxval=100)\n b = tf.constant(np.array([[1, 2], [3, 4]]), dtype=tf.int32)\n c = a + b\n return tf.nn.relu(x + c)\n \ndef condition(x):\n return tf.reduce_sum(x) < 100\n \nx = tf.Variabl...
[ [ "numpy.array", "tensorflow.nn.relu", "tensorflow.random_uniform", "tensorflow.Session", "tensorflow.while_loop", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.global_variables_initializer" ] ]
Daniel1586/Initiative_recommender_system
[ "28d3be65266cba808fea2df5ed4405fae09cb549" ]
[ "tutorials/chapter_05_ProductNN/ProductNN.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom time import time\nimport tensorflow as tf\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.metrics import roc_auc_score\n\n\nclass ProductNN(BaseEstimator, TransformerMixin):\n def __init__(self, feature_size, field_si...
[ [ "tensorflow.matmul", "tensorflow.train.AdagradOptimizer", "tensorflow.reshape", "tensorflow.losses.log_loss", "tensorflow.nn.embedding_lookup", "tensorflow.global_variables_initializer", "tensorflow.random_normal", "tensorflow.train.GradientDescentOptimizer", "tensorflow.set_ra...
javierconcha/hypernets_tools
[ "bf15e343841d31262a402c0ad628e0f5e8c30441" ]
[ "hypernets/reader/spectra.py" ]
[ "from hypernets.reader.spectrum import Spectrum\nimport matplotlib.pyplot as plt\nfrom matplotlib.widgets import Button\n\n\n\ndef show_interactive_plots(spectra):\n\n # Next Button\n axnext = plt.axes([0.81, 0.05, 0.1, 0.075])\n bnext = Button(axnext, 'Next')\n bnext.on_clicked(spectra.next_spectrum)\n...
[ [ "matplotlib.pyplot.show", "matplotlib.widgets.Button", "matplotlib.pyplot.axes" ] ]
hellpanderrr/twint
[ "05e5995dcc81e987e1cbb7b92b7cd707d5d73e23" ]
[ "twint/storage/panda.py" ]
[ "import datetime, pandas as pd, warnings\nfrom time import strftime, localtime\nfrom twint.tweet import Tweet_formats\n\nTweets_df = None\nFollow_df = None\nUser_df = None\n\n_object_blocks = {\n \"tweet\": [],\n \"user\": [],\n \"following\": [],\n \"followers\": []\n}\n\nweekdays = {\n \"Monday...
[ [ "pandas.HDFStore", "pandas.DataFrame", "pandas.read_pickle", "pandas.concat" ] ]
ydiller/BalancedGroupSoftmax
[ "6fecf9fbb8ed1f54540787188e212ab39cd2b501" ]
[ "tools/test_lvis.py" ]
[ "import argparse\nimport os\nimport os.path as osp\nimport shutil\nimport tempfile\nimport json\nimport pdb\nimport numpy as np\nimport pickle\nimport pandas as pd\nimport mmcv\nimport torch\nimport torch.distributed as dist\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner impo...
[ [ "numpy.array", "numpy.zeros", "torch.norm", "torch.no_grad", "torch.pow", "torch.full", "numpy.sqrt", "torch.distributed.barrier", "torch.distributed.broadcast" ] ]
asizemore/multilayer_network_examples
[ "9c3fe3cd0320145d7d9695ea8de19dc064b485b5" ]
[ "mx_viz.py" ]
[ "# Functions for visualization\nimport numpy as np\nimport networkx as nx\nimport multinetx as mx\nfrom jinja2 import Environment, FileSystemLoader, Template\nimport json\nfrom networkx.readwrite import json_graph\n\n\ndef write_mx_to_json(filename, mg, nNodes, pos, nLayers, nodes_to_remove = []):\n \n # file...
[ [ "numpy.concatenate", "numpy.array", "numpy.arange", "numpy.delete" ] ]
rabaniten/qiskit-terra
[ "68da37be74d133faef530c42d1fd11d696a80c12" ]
[ "qiskit/tools/visualization/_matplotlib.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2018, IBM.\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n# pylint: disable=invalid-name,anomalous-backslash-in-string,missing-docstring\n\n\"\"\"mpl circuit visualization...
[ [ "numpy.sin", "matplotlib.patches.Polygon", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.patches.Circle", "numpy.abs", "numpy.cos", "matplotlib.patches.Rectangle", "matplotlib.patches.Arc" ] ]
lufuhao/jcvi
[ "7b6f7c80d3bd034d492021b6114ac453ac19fd52" ]
[ "jcvi/assembly/kmer.py" ]
[ "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\n\"\"\"\nDeals with K-mers and K-mer distribution from reads or genome\n\"\"\"\nfrom __future__ import print_function\n\nimport os.path as op\nimport sys\nimport logging\nimport math\nimport numpy as np\n\nfrom collections import defaultdict\n\nfrom jcvi.graphics.ba...
[ [ "scipy.stats.binom.pmf", "numpy.linspace", "scipy.stats.poisson.pmf", "numpy.polyfit" ] ]
ricardoprins/pennylane
[ "e0928abb1e413356848499cf0799037fc2082518" ]
[ "pennylane/devices/tests/test_gates.py" ]
[ "# Copyright 2018-2021 Xanadu Quantum 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/LICENSE-2.0\n\n# Unless required by ap...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.random.seed", "scipy.linalg.block_diag", "numpy.exp", "numpy.eye", "numpy.identity", "numpy.complex", "numpy.abs", "numpy.cos", "numpy.ravel_multi_index", "numpy.diag" ] ]
yhisaki/pfrl
[ "d89ddf66201bcfaaae6130bdee704d56ee4b7b76" ]
[ "examples/mujoco/reproduction/td3/train_td3.py" ]
[ "\"\"\"A training script of TD3 on OpenAI Gym Mujoco environments.\n\nThis script follows the settings of http://arxiv.org/abs/1802.09477 as much\nas possible.\n\"\"\"\n\nimport argparse\nimport logging\nimport sys\n\nimport gym\nimport gym.wrappers\nimport numpy as np\nimport torch\nfrom torch import nn\n\nimport ...
[ [ "torch.nn.Linear", "torch.nn.Tanh", "numpy.random.uniform", "torch.nn.ReLU" ] ]
cohenimhuji/HARK
[ "bb8549105ab979f853bd413d694f4a9b6572554e" ]
[ "HARK/interpolation.py" ]
[ "'''\nCustom interpolation methods for representing approximations to functions.\nIt also includes wrapper classes to enforce standard methods across classes.\nEach interpolation class must have a distance() method that compares itself to\nanother instance; this is used in HARK.core's solve() method to check for so...
[ [ "numpy.ones_like", "numpy.isclose", "numpy.argmin", "numpy.minimum", "numpy.exp", "numpy.max", "numpy.zeros_like", "numpy.log", "numpy.nanmin", "numpy.logical_and", "numpy.argmax", "numpy.arange", "numpy.sqrt", "numpy.nanmax", "numpy.logical_or", "nu...
xwyzsn/solo-learn
[ "16d021d8053439a3de205337ab2a11d191500b09", "16d021d8053439a3de205337ab2a11d191500b09" ]
[ "tests/utils/test_gather.py", "solo/methods/deepclusterv2.py" ]
[ "# Copyright 2021 solo-learn development team.\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to use,\n# copy, modify,...
[ [ "torch.randn", "torch.mm" ], [ "torch.nn.Linear", "torch.zeros", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.randn" ] ]
yunndlalala/MCS-project
[ "3fa066fd8e3a3c9578560e11c10b1516f4a23430" ]
[ "nn_model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.utils.data import TensorDataset, DataLoader\nimport torch.nn.functional as F\n\nclass MLP(nn.Module):\n def __init__(self, input_size, hidden_layers, out_size):\n super(MLP, self).__init__()\n self.sizes = [input_size] + hidden_layers + [out_size]\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MSELoss", "torch.nn.ModuleList", "torch.nn.init.xavier_uniform", "torch.nn.BatchNorm1d", "torch.utils.data.DataLoader", "torch.nn.init.zeros_", "torch.Tensor" ] ]
Z7Gao/InverseRenderingOfIndoorScene
[ "f245d20dcbe05b1de766c2e53af79fd489f58d74" ]
[ "nyuDataLoader.py" ]
[ "import glob\nimport numpy as np\nimport os.path as osp\nfrom PIL import Image\nimport random\nimport struct\nfrom torch.utils.data import Dataset\nimport scipy.ndimage as ndimage\nimport cv2\nfrom skimage.measure import block_reduce\nimport json\nimport scipy.ndimage as ndimage\n\n\nclass ConcatDataset(Dataset ):\...
[ [ "numpy.round", "numpy.ascontiguousarray", "numpy.sum", "numpy.logical_and", "numpy.transpose", "numpy.random.random", "numpy.squeeze" ] ]
sdwfrost/covid19uk
[ "ffd59342d9daee2d819d2f7211afbe9713880612" ]
[ "covid19uk/data/util.py" ]
[ "\"\"\"Utility functions for COVID19 UK data\"\"\"\n\nimport os\nimport re\nimport datetime\nimport numpy as np\nimport pandas as pd\n\n\ndef prependDate(filename):\n now = datetime.now() # current date and time\n date_time = now.strftime(\"%Y-%m-%d\")\n return date_time + \"_\" + filename\n\n\ndef prepen...
[ [ "pandas.to_datetime", "numpy.datetime64" ] ]
gengala/Random-Probabilistic-Circuits
[ "8871a9f1e6ace9d8ea7604b69abcc270c7792620" ]
[ "utils.py" ]
[ "from spn.structure.Base import Product, Sum, get_nodes_by_type\nfrom spn.structure.leaves.cltree.CLTree import CLTree\nfrom spn.algorithms.Validity import is_consistent\n\nfrom scipy.sparse.csgraph import minimum_spanning_tree\nfrom scipy.sparse.csgraph import depth_first_order\n\nfrom error import RootVarError\n\...
[ [ "scipy.sparse.csgraph.depth_first_order", "numpy.dot", "numpy.random.choice", "numpy.fill_diagonal", "numpy.zeros", "numpy.log", "numpy.ones", "numpy.arange", "scipy.sparse.csgraph.minimum_spanning_tree", "numpy.outer", "numpy.diag" ] ]
bt3gl/Resources-Numerical_Methods_for_Physics
[ "8668215f107230fafd9bdeb0061d353328cf03e8" ]
[ "homework5_elliptic_PDES/part_c.py" ]
[ "\"\"\"\n We recover the original divergence-free velocity field via \n Ud,new = Ustar - Gphi\n\"\"\" \n\nimport numpy\nimport pylab\nimport operator\n\n\ndef do_plots_c(Ud, Unew):\n \"\"\" plot Ud,new and Ud with zoom on the bug \"\"\" \n pylab.clf()\n pylab.cla()\n \n f = pylab.figure() \...
[ [ "numpy.gradient" ] ]
ShAlireza/ML-Tries
[ "4516be7a3275c9bdedd7bd258800be384b6b34f0" ]
[ "O3/_14_kernel_methods_linearly_inseparable_data/rbf_kernel_iris_dataset.py" ]
[ "import numpy as np\n\nimport matplotlib.pyplot as plt\n\nfrom sklearn.svm import SVC\n\nfrom O3 import prepare_data\n\nfrom utils import plot_decision_regions\n\nX_train, X_test, y_train, y_test = prepare_data(standardize=True,\n split=True)\n\nsvm = SVC(kernel='rbf',...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "sklearn.svm.SVC", "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "numpy.hstack", "numpy.vstack" ] ]
yaramohajerani/dynamic_mascons
[ "e893ca16df76fdaacf5b312650d6c9516870395b" ]
[ "combine_kernels.py" ]
[ "#!/usr/bin/env python\nu\"\"\"\ncombine_kernels.py\nby Yara Mohajerani\n\nCombine the sensitivity kernels of the sum of the 'fixed points'\nand produce netcdf and png outputs\n\nLast Update 12/2020\n\"\"\"\n#-- load required modules\nimport os\nimport sys\nimport numpy as np\nimport geopandas as gpd\nimport matplo...
[ [ "numpy.max", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.min", "matplotlib.pyplot.tight_layout", "numpy.abs", "numpy.linspace" ] ]
zhuxinqimac/DisentanglementICML19
[ "703a8ae2e263b387d49ddae122054d5e77a52832", "703a8ae2e263b387d49ddae122054d5e77a52832" ]
[ "Dsprites_exp/VAE-VC/local_nets.py", "Dsprites_exp/GroupVAE/main.py" ]
[ "import os\nimport sys\nsys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..'))\n\nimport tensorflow as tf\n\nslim = tf.contrib.slim\n\ndef disc_net_64(img1, img2, target_dim, scope=\"DISC\", reuse=False):\n nets_dict = dict()\n nets_dict['input1'] = img1\n nets_dict['input2'] = img...
[ [ "tensorflow.zeros_initializer", "tensorflow.contrib.slim.variance_scaling_initializer", "tensorflow.concat", "tensorflow.reshape", "tensorflow.variable_scope" ], [ "numpy.random.seed" ] ]
zlxy9892/chatbot-retrieval-based-smn
[ "65ae5391f0a01b84f998cbbec1e04eda30ddd569" ]
[ "retrieval_model.py" ]
[ "# coding:utf-8\n\nimport time\nimport datetime\nimport os\nimport tensorflow as tf\nimport pickle\nimport utils\nfrom keras.preprocessing.sequence import pad_sequences\nimport numpy as np\nimport evaluate\nfrom utils import Utils\n\n\nclass SMN():\n def __init__(self,\n device_name='/cpu:0',\n ...
[ [ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.matmul", "tensorflow.nn.embedding_lookup", "tensorflow.stack", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.contrib.layers.flatten", "tensorflow.einsum", "tensorflow.cast", "tenso...
MD2Korg/CerebralCortex-2.0
[ "8dfcef1ba96fb8653980d1cd3eee7ed3d7f28b60" ]
[ "cerebralcortex/markers/brushing/features.py" ]
[ "from typing import List\n\nimport numpy as np\nimport pandas as pd\nfrom pyspark.sql.functions import pandas_udf, PandasUDFType\nfrom pyspark.sql.types import *\n# from pyspark.sql.functions import pandas_udf,PandasUDFType\nfrom pyspark.sql.types import StructType\n\nfrom cerebralcortex.core.datatypes import DataS...
[ [ "numpy.concatenate", "numpy.fft.rfft", "numpy.asarray", "pandas.set_option", "numpy.sum", "numpy.nonzero", "numpy.float64", "numpy.fft.fft", "numpy.bitwise_and", "numpy.cumsum", "pandas.Series", "numpy.log2", "numpy.floor" ] ]
ReginaPeralta/ReginaPeralta
[ "68ab1462083d40d7efb4af77d6fa915ad73de2b8" ]
[ "src/pygaps/modelling/temkinapprox.py" ]
[ "\"\"\"Temkin Approximation isotherm model.\"\"\"\n\nimport numpy\nimport scipy\n\nfrom ..utilities.exceptions import CalculationError\nfrom .base_model import IsothermBaseModel\n\n\nclass TemkinApprox(IsothermBaseModel):\n r\"\"\"\n Asymptotic approximation to the Temkin isotherm.\n\n .. math::\n\n ...
[ [ "scipy.optimize.root", "numpy.log" ] ]
SHSongs/ETF
[ "3bfdebc37e3956648e71094b54f5674e132a6aca" ]
[ "client/main.py" ]
[ "import urllib.request as ul\nimport json\nimport pandas as pd\n\n\ndef get_chart(ticker, period1, period2):\n url = f\"http://localhost:9000/chart/{ticker}?period1={period1}&period2={period2}\"\n\n request = ul.Request(url)\n response = ul.urlopen(request)\n\n rescode = response.getcode()\n if resco...
[ [ "pandas.json_normalize" ] ]
tudo-spect/plot_spect_images
[ "ccd472f463777703328a07c9f6b03dd3d58a8b5e" ]
[ "plot_spect_image.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport argparse\n\nfrom camera import add_pmts\n\nparser = argparse.ArgumentParser()\nparser.add_argument('inputfile', help='A datafile created by the old SPECT camera')\nparser.add_argument(\n '--outputfile', '-o', required=False,\n dest='outputfile',\n ...
[ [ "numpy.array", "matplotlib.pyplot.subplots", "numpy.sqrt", "numpy.fromfile", "matplotlib.pyplot.show" ] ]
MS44neuro/drtest
[ "9e17105f39338cef7d65e541996c70f2c2731ab4" ]
[ "examples/scripts/data_reduction_ex1.py" ]
[ "\"\"\"This code demonstrates how to perform the tested data reduction module.\r\n\"\"\"\r\n\r\nimport os\r\nimport sys\r\nimport glob\r\nimport pyabf\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\npathToHere = os.path.abspath(os.path.dirname(__file__))\r\npathToData = os.path.abspath(pathToHere + \"/../data/\")\r\n...
[ [ "matplotlib.pyplot.draw", "matplotlib.pyplot.pause", "matplotlib.pyplot.figure" ] ]