repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
MagoPT/40hspeech
[ "72f561a2ca7fcee8184b1d88aeb07887aafbb59d" ]
[ "long_speech_random.py" ]
[ "from sklearn.utils import shuffle\n\ntab1 = [\"Caros colegas\", \"Por outro lado\", \"Assim mesmo\", \"Não poderemos esquecer que\", \"Do mesmo modo\",\n \"A prática mostra que\", \"Nunca é demais insistir, uma vez que\", \"A experiência mostra que\",\n \"É fundamental ressaltar que\", \"O incentivo ...
[ [ "sklearn.utils.shuffle" ] ]
lirhea/pythia
[ "e942e94fae8ef3fe5d93f4bb3d25daf6b9e0eaa2" ]
[ "top_down_bottom_up/post_combine_transform.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\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#\n\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.weight_norm import weight_norm\...
[ [ "torch.nn.Conv2d", "torch.unsqueeze", "torch.nn.Linear", "torch.nn.functional.relu", "torch.squeeze" ] ]
Ke-Coding/pose-adv-aug
[ "4dd21970db874f6d49bb33c62d6ed0807c460490" ]
[ "collect-scale-ditri.py" ]
[ "# python train-stacked-residual-aug-pretrain.py --exp_id test --resume_prefix_pose stacked-8-lr-0.00025-10.pth.tar\n# Zhiqiang Tang, May 2017\n# import sys, warnings, traceback, torch\n# def warn_with_traceback(message, category, filename, lineno, file=None, line=None):\n# sys.stderr.write(warnings.formatwarni...
[ [ "torch.LongTensor", "torch.cat", "torch.zeros", "torch.utils.data.DataLoader", "torch.stack", "torch.nn.DataParallel", "torch.autograd.Variable" ] ]
alhamzah/batch_rl
[ "7f8d9ea0ba330cc0642515dcc44c2ad687c3a927" ]
[ "batch_rl/fixed_replay/train.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google Research 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 requ...
[ [ "tensorflow.logging.set_verbosity" ] ]
luyang1210/PPRL
[ "3e59ab82c4474efbcc88ab5c13b562d7e5a7ff87" ]
[ "anonlink/network_flow.py" ]
[ "\"\"\"\nSolves pairwise matches for the entire network at once.\n\nGiven a sparse, weighted, bipartite graph determine the matching.\n\"\"\"\n\nimport logging\nimport networkx as nx\nfrom networkx.algorithms import bipartite\n\nlogging.basicConfig(level=logging.WARNING)\n\n\ndef calculate_network(similarity, cutof...
[ [ "numpy.linspace" ] ]
nycu-ece-learn/ece-learn
[ "564097d3312fc0c7721e2d0eb96b4aaee39704ef" ]
[ "request.py" ]
[ "import pandas as pd\nimport requests\n\nbase_url = \"<base_url>\"\ncsv_file = pd.read_csv(\"<csv_file>\")\n\nfor idx in range(len(csv_file)):\n total_url = f\"{base_url}/{csv_file.iloc[idx, 6]}\"\n req = requests.get(total_url)\n if req.status_code != requests.codes.ok:\n print(idx + 2)\n" ]
[ [ "pandas.read_csv" ] ]
lyhyl/Ax
[ "44384a0cb1a622c9e395c95f683cfee25c7b61f6" ]
[ "ax/utils/testing/core_stubs.py" ]
[ "#!/usr/bin/env python3\n# 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\n\nfrom collections import OrderedDict\nfrom datetime import timedelta, datetime\nfrom typing import Set, A...
[ [ "pandas.DataFrame.from_records", "torch.device", "numpy.random.rand", "numpy.random.seed" ] ]
MichaelChuai/modelzoo
[ "4744f555784873192168c65e2c10b49b982cb1f1" ]
[ "enas_ori/model.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport collections\nfrom ..model import average_grad\nfrom ..misc import delete_and_make_dir, create_op_graph\nfrom ..tftrain import load_ckpt, load_ckpt_path, create_init_op\nfrom ..metrics import get_metric_name\nfrom tqdm import trange\n\n__all__ = ['ENASModelTensors...
[ [ "tensorflow.device", "tensorflow.summary.FileWriter", "tensorflow.constant", "tensorflow.reduce_mean", "numpy.reshape", "tensorflow.get_collection", "numpy.concatenate", "tensorflow.ConfigProto", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.train.Saver", ...
ultracoldYEG/tof-analysis
[ "b14d699952260e25a860358ac3f33828afa0aae5" ]
[ "mock_mv.py" ]
[ "import numpy as np\nimport time\n\n\ndef guass2D(x,y, A, sigx = 1000., sigy = 1000.):\n return A* 250. * np.exp(-(x-100.)**2 / sigx - (y-250.)**2 / sigy)\n\nclass setting(object):\n def __init__(self, value):\n self.value = value\n\n def __str__(self):\n return str(self.value)\n\n def __f...
[ [ "numpy.exp", "numpy.zeros", "numpy.random.rand" ] ]
TUMCREATE-ESTL/FLEDGE.jl
[ "1da549b52eb5e9f12984a111cbccd0fe291b97de" ]
[ "examples/development/plot_electric_grid.py" ]
[ "\"\"\"Script to generate an network plot of the electric grid for given scenario.\n\n- This script depends on `contextily`, which is not included in the package dependencies, but can be installed\n under `conda install -c conda-forge contextily`.\n\"\"\"\n\nimport contextily as ctx\nimport numpy as np\nimport os\...
[ [ "numpy.array", "numpy.log2", "pandas.DataFrame", "numpy.min" ] ]
NikhilKumarM/pandas
[ "faab956f7ea0f5c3e8ad8483904a8897d2632701" ]
[ "pandas/tests/scalar/period/test_period.py" ]
[ "import pytest\n\nimport pytz\nimport numpy as np\nfrom datetime import datetime, date, timedelta\n\nimport pandas as pd\nimport pandas.util.testing as tm\nimport pandas.core.indexes.period as period\nfrom pandas.compat import text_type, iteritems\nfrom pandas.compat.numpy import np_datetime64_compat\n\nfrom pandas...
[ [ "pandas.Series", "pandas._libs.tslibs.timezones.maybe_get_tz", "pandas.offsets.Day", "pandas.util.testing.assert_produces_warning", "pandas.compat.iteritems", "pandas.util.testing.round_trip_pickle", "pandas.offsets.Hour", "pandas.Period._from_ordinal", "pandas.Period.now", ...
SantamRC/awkward-1.0
[ "18ba84ec7101e89fbdadb63b4683ff0025e85d71" ]
[ "tests/test_0014_v2-finish-up-getitem.py" ]
[ "# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE\n\nfrom __future__ import absolute_import\n\nimport itertools\n\nimport pytest # noqa: F401\nimport numpy as np # noqa: F401\nimport awkward as ak # noqa: F401\n\nfrom awkward._v2.tmp_for_testing import v1_to_v2\n\ncontent =...
[ [ "numpy.arange" ] ]
cmu-snap/unfair
[ "3e1011c983f5815dfecc10eb0df1f6dde6f24751" ]
[ "model/models.py" ]
[ "\"\"\" Models. \"\"\"\n\nimport copy\nimport math\nimport os\nfrom os import path\nimport random\n\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport sklearn\nfrom sklearn import ensemble\nfrom sklearn import linear_model\nfrom sklearn import metrics\nfrom sklearn import svm\nfrom sklearn.experiment...
[ [ "torch.mean", "numpy.take", "torch.zeros", "sklearn.ensemble.HistGradientBoostingClassifier", "torch.sum", "matplotlib.pyplot.plot", "sklearn.svm.LinearSVC", "torch.logical_and", "sklearn.metrics.classification_report", "matplotlib.pyplot.tight_layout", "numpy.unique", ...
HarveyYan/RNAonGraph
[ "0056cc465f7bc4a89c4955d2cee88d6a858cef71" ]
[ "Joint-MRT.py" ]
[ "import os\nimport sys\nimport shutil\nimport inspect\nimport datetime\nimport functools\nimport numpy as np\nimport tensorflow as tf\nfrom importlib import reload\nimport multiprocessing as mp\nimport lib.plot, lib.graphprot_dataloader, lib.rgcn_utils, lib.logger, lib.ops.LSTM, lib.rna_utils\nfrom lib.general_util...
[ [ "tensorflow.app.flags.DEFINE_list", "tensorflow.app.flags.DEFINE_bool", "tensorflow.app.flags.DEFINE_integer", "numpy.max", "numpy.std", "tensorflow.app.flags.DEFINE_string", "tensorflow.logging.set_verbosity", "tensorflow.app.flags.DEFINE_float", "numpy.random.rand", "nump...
jhamrak/instrument-recognition-lab
[ "a2fab13b854a3650c437ec65e1cf078067827415" ]
[ "melspec.py" ]
[ "import numpy as np\nimport librosa as lb\nimport os\n\nDATA_DIR = \"openmic-2018/\"\nDATA_FILE = \"openmic-2018.npz\"\nOPENMIC = np.load(os.path.join(DATA_DIR, DATA_FILE), allow_pickle=True)\nY_true, Y_mask, sample_key = OPENMIC['Y_true'], OPENMIC['Y_mask'], OPENMIC['sample_key']\nMEL = []\nfor i in range(sample_k...
[ [ "numpy.asarray", "numpy.savez_compressed" ] ]
fwilliams/neural-splines
[ "e94b4f0c9ba4c75585bd6bdbef43d65a25efac2b" ]
[ "neural_splines/geometry.py" ]
[ "import torch\nimport numpy as np\nfrom scipy.interpolate import RegularGridInterpolator\n\n\ndef normalize_pointcloud_transform(x):\n \"\"\"\n Compute an affine transformation that normalizes the point cloud x to lie in [-0.5, 0.5]^2\n :param x: A point cloud represented as a tensor of shape [N, 3]\n :...
[ [ "torch.norm", "torch.ones", "torch.max", "torch.cat", "torch.zeros", "torch.min", "numpy.ravel", "scipy.interpolate.RegularGridInterpolator", "torch.round", "torch.tensor", "numpy.isscalar", "torch.logical_and", "numpy.array", "numpy.zeros" ] ]
visaVita/mmaction2
[ "2d7107a2d79b990b7facd3d6f7ac0b6ad974c153", "2d7107a2d79b990b7facd3d6f7ac0b6ad974c153" ]
[ "mmaction/datasets/pipelines/loading.py", "mmaction/models/common/tranST.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport copy as cp\nimport io\nimport os\nimport os.path as osp\nimport shutil\nimport warnings\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.fileio import FileClient\nfrom torch.nn.modules.utils import _pair\n\nfrom ...utils import get_random_string, g...
[ [ "numpy.linspace", "torch.zeros", "numpy.squeeze", "numpy.cumsum", "numpy.concatenate", "numpy.max", "numpy.random.randint", "numpy.pad", "numpy.clip", "numpy.arange", "numpy.copy", "numpy.diff", "numpy.load", "numpy.zeros", "numpy.random.choice", "nu...
khmkii/random_walks
[ "469d29b71f74d5c5033d18255bb15f5bc3255733" ]
[ "random_walks.py" ]
[ "import matplotlib.pyplot as plt\nimport random\n\n\ndef shift_axis(shift):\n fig = plt.figure()\n ax = fig.add_subplot(1,1,1)\n if shift == 'x':\n ax.spines['bottom'].set_position('center')\n ax.xaxis.set_label_coords(1.05, 0.5)\n else:\n ax.spines['left'].set_position(('data', 0.0...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Christian-B/my_spinnaker
[ "b19f4025878bc4fbd6d81d78cec8c284929e148b" ]
[ "neo_test.py" ]
[ "import numpy as np\nfrom quantities import Hz\nfrom neo import AnalogSignal as AnalogSignal\n\nn = np.array([[0.1, 0.1, 0.1, 0.1],\n [-2.0, -2.0, -2.0, -4.0],\n [0.1, 0.1, 0.1, 0.1],\n [-0.1, -0.1, -0.1, -0.1],\n [-0.1, -0.1, -0.1, -0.1],\n [-3.0, -3...
[ [ "numpy.array" ] ]
MSREnable/GazeCapture
[ "54f00ab428a7dbb51f8f0c37f22bba6b3cb54726" ]
[ "utility_functions/face_utilities.py" ]
[ "import cv2\nimport dlib\nimport numpy as np\nfrom imutils import face_utils\nimport imutils\nfrom PIL import Image\nfrom skimage import exposure\nfrom skimage import feature\n\nimport os\n\nfile_dir_path = os.path.dirname(os.path.realpath(__file__))\nlandmarks_path = os.path.join(file_dir_path, '../metadata/shape_...
[ [ "numpy.zeros", "numpy.stack" ] ]
awe777/keras-yolo3
[ "43c3455db5090782b0cd8dbaf4ca34f983b16a32" ]
[ "convert.py" ]
[ "#! /usr/bin/env python\n\"\"\"\nReads Darknet config and weights and creates Keras model with TF backend.\n\n\"\"\"\n\nimport argparse\nimport configparser\nimport io\nimport os\nfrom collections import defaultdict\nimport math\nimport numpy as np\nfrom keras import backend as K\nfrom keras.layers import (Conv2D, ...
[ [ "numpy.product", "numpy.transpose" ] ]
anon-42/ANN-PONR-Python3
[ "4b7e290c768a9e3cafb19b8b3a786c1f99670c0c" ]
[ "history.py" ]
[ "'''\r\nCreated on 22.02.2017\r\n\r\n@author: StrategeX\r\n@version: 1.0\r\n\r\nSaves the data of the markov decision process and the error function of the ANN.\r\n'''\r\n\r\nimport sqlite3\r\nimport numpy as np\r\nimport io\r\nimport atexit\r\nimport datetime\r\nimport uuid\r\n\r\nclass NoTurnLeftException(Excepti...
[ [ "numpy.load", "numpy.array", "numpy.save" ] ]
bamf-health/MONAI
[ "6a2086d21baf4b60c2ab3d400ed5c97cf24a0da9" ]
[ "monai/transforms/utility/array.py" ]
[ "# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre...
[ [ "torch.max", "numpy.min", "numpy.squeeze", "torch.min", "numpy.stack", "torch.tensor", "numpy.concatenate", "numpy.logical_or", "numpy.copy", "numpy.max", "numpy.place", "numpy.zeros" ] ]
jvmcgovern/pyroms_MI
[ "7a9a1552fda4debe8a0682172919f7cd81aaf60b" ]
[ "pyroms_toolbox/setup.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\npyroms_toolbox is a suite of tools for working with ROMS.\n\nRequires:\n pyroms (https://github.com/ESMG/pyroms)\n\nContains:\n many things...\n\n\"\"\"\n\n# Joe McGovern, Marine Institute 17.08.2021\n# Needed to replace forward slash / with r and backwards slash \\ for windo...
[ [ "numpy.distutils.core.Extension", "numpy.distutils.misc_util.Configuration" ] ]
vmarkovtsev/fastdtw
[ "4825483e68fb2a7da3f825775a9f42ca3c65abbd" ]
[ "setup.py" ]
[ "import os.path\nfrom setuptools import setup, find_packages, Extension\nfrom setuptools.command.build_ext import build_ext as _build_ext\nimport warnings\n\ntry:\n from Cython.Build import cythonize\n USE_CYTHON = True\nexcept ImportError:\n USE_CYTHON = False\n\n# numpy path is needed for building with a...
[ [ "numpy.get_include" ] ]
Open-Speech-EkStep/crowdsource-dataplatform
[ "cf2a6c36717cb06f75de7b097959c59699564ad0", "cf2a6c36717cb06f75de7b097959c59699564ad0" ]
[ "utils/localization/modules/locale_generator/generator.py", "utils/localization/all_keys_excel_generator.py" ]
[ "from modules.locale_generator.excel_input import ExcelInput\nfrom modules.locale_generator.processor import LocaleProcessor\nfrom pandas import notnull\n\n\nclass LocaleGenerator:\n\n def __init__(self, excel_input: ExcelInput, languages):\n self.languages = languages\n self.excel_input = excel_in...
[ [ "pandas.notnull" ], [ "pandas.merge" ] ]
tansey/tensorflow-wavenet
[ "1b1cd1f0fce6413efe0dbee7b133d379b53dba49" ]
[ "plot_results.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pylab as plt\nimport numpy as np\nimport seaborn as sns\n\nsizes = [256, 512, 1024, 2048]\nsoftmax = [ 2.5780, 3.2630, 3.9440, 4.7100 ]\nunsmoothed = [ 2.4750, 3.1990, 4.0300, 4.6710 ]\nsmoothed = [ 2.4820, 3.2970, 3.8730, 4.6240]\n\nwith sns.axes_style('...
[ [ "matplotlib.pylab.clf", "matplotlib.use", "matplotlib.pylab.legend", "matplotlib.pylab.figure", "matplotlib.pylab.ylabel", "matplotlib.pylab.plot", "matplotlib.pylab.rc", "matplotlib.pylab.savefig", "matplotlib.pylab.xlabel", "matplotlib.pylab.close" ] ]
SinaMohseni/Text-classification-explanation-evaluation
[ "b923693bd7499275971a42f311a537e80afe8970" ]
[ "Python/evaluate.py" ]
[ "# -*- coding: utf-8 -*- \n\n\nimport re\nimport glob\nimport copy\nimport operator\n\nimport math\nimport json\nimport csv\n\nimport os\n\nimport codecs\n\nimport sys\nimport time\nfrom datetime import datetime\nfrom collections import Counter\n\n# import urllib2,urllib\n# import urllib3\n\nfrom collections import...
[ [ "numpy.array", "numpy.zeros" ] ]
digiexchris/WQ7Tpanadapter
[ "339c55c1f8c775a9413339a504f11a4b90386565" ]
[ "FreqShow_Large/views.py" ]
[ "# FreqShow application views.\n# These contain the majority of the application business logic.\n# Author: Tony DiCola (tony@tonydicola.com)\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2014 Adafruit Industries\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software...
[ [ "numpy.tile", "numpy.max", "numpy.floor", "numpy.copyto", "numpy.average" ] ]
programmer-666/Codes
[ "fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b", "fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b" ]
[ "Python/MachineLearning/RegPred/SVR/synd_nmodel.py", "Python/MachineLearning/RegPred/GDST/data_an.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 24 00:02:48 2021\n\n@author: suhar\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.svm import SVR\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.metr...
[ [ "pandas.read_csv", "sklearn.metrics.mean_absolute_error", "pandas.DataFrame", "sklearn.metrics.mean_squared_error", "sklearn.svm.SVR", "sklearn.preprocessing.MinMaxScaler" ], [ "pandas.read_csv" ] ]
ferdiwo/corex_topic
[ "0f1c66c2c3639d09734832dc54236578b0360b35" ]
[ "corextopic/corextopic.py" ]
[ "\"\"\"CorEx Hierarchical Topic Models\n\nUse the principle of Total Cor-relation Explanation (CorEx) to construct\nhierarchical topic models. This module is specially designed for sparse count\ndata and implements semi-supervision via the information bottleneck.\n\nGreg Ver Steeg and Aram Galstyan. \"Maximally Inf...
[ [ "sklearn.externals.joblib.dump", "numpy.einsum", "numpy.seterr", "numpy.max", "numpy.mean", "numpy.any", "sklearn.externals.joblib.load", "numpy.exp", "numpy.where", "numpy.clip", "scipy.sparse.diags", "numpy.argmax", "numpy.log1p", "numpy.zeros", "numpy...
s1846118/satflow
[ "0d11c801be61fe978b0f24fcb3ba7999be5f20d8" ]
[ "satflow/models/gan/discriminators.py" ]
[ "import functools\n\nimport antialiased_cnns\nimport torch\nfrom torch import nn as nn\n\nfrom satflow.models.gan.common import get_norm_layer, init_net\nfrom satflow.models.utils import get_conv_layer\n\n\ndef define_discriminator(\n input_nc,\n ndf,\n netD,\n n_layers_D=3,\n norm=\"batch\",\n in...
[ [ "torch.nn.Sequential", "torch.nn.LazyLinear", "torch.nn.Flatten", "torch.tensor", "torch.nn.MaxPool2d", "torch.nn.Identity", "torch.nn.BCEWithLogitsLoss", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.MSELoss" ] ]
robert-DL/lettuce
[ "d899f748e3b890e7b40881bdc87a7fba8afeb182", "d899f748e3b890e7b40881bdc87a7fba8afeb182" ]
[ "lettuce/cli.py", "examples/Simulation_and_outputs.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Console script for lettuce.\nTo get help for terminal commands, open a console and type:\n\n>>> lettuce --help\n\n\"\"\"\n\nimport sys\nimport cProfile\nimport pstats\n\nimport click\nimport torch\nimport numpy as np\n\nfrom lettuce import BGKCollision, StandardStreaming, Lattice,...
[ [ "torch.device", "numpy.abs", "torch.cuda.is_available" ], [ "matplotlib.pyplot.tight_layout", "numpy.asarray", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot", "torch.device", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show",...
LRY0111/SensitivityAnalysis-python
[ "b48607fafb818f6d90490cd71dfc6f9f39f65d95" ]
[ "SALib/sample/morris/brute.py" ]
[ "\"\"\"\n\"\"\"\nfrom SALib.sample.morris.strategy import Strategy\nfrom scipy.misc import comb as nchoosek\nfrom itertools import combinations, islice\nimport sys\nimport numpy as np\n\n\nclass BruteForce(Strategy):\n \"\"\"Implements the brute force optimisation strategy\n \"\"\"\n\n def _sample(self, in...
[ [ "numpy.array", "numpy.zeros", "numpy.einsum", "scipy.misc.comb" ] ]
don-tpanic/CostsBenefitsAttention
[ "7221b873283c210cafd54fa895ba10b418d8ca67" ]
[ "top_down_attention/keras_custom/engine/training_generator.py" ]
[ "\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport functools\nimport math\n\nimport numpy as np\n\nfrom tensorflow.python.data.ops import dataset_ops\nfrom tensorflow.python.data.ops import iterator_ops\nfrom tensorflow.python.eager import con...
[ [ "tensorflow.python.keras.utils.data_utils.is_generator_or_sequence", "tensorflow.python.data.ops.dataset_ops.make_one_shot_iterator", "tensorflow.python.eager.context.executing_eagerly", "tensorflow.python.keras.engine.training_utils.OutputsAggregator", "tensorflow.python.keras.engine.training...
lcharlin/modl
[ "24605d7f6b1184a56cec2899232c7661b8337a32" ]
[ "modl/datasets/adhd.py" ]
[ "from os.path import join\n\nfrom modl.datasets import get_data_dirs\nfrom nilearn.datasets.utils import _fetch_file\nfrom sklearn.datasets.base import Bunch\n\nfrom nilearn.datasets import fetch_adhd as nilearn_fetch_adhd\n\nimport pandas as pd\nimport os\n\n\ndef fetch_adhd(n_subjects=40, data_dir=None,\n ...
[ [ "sklearn.datasets.base.Bunch", "pandas.to_numeric", "pandas.DataFrame" ] ]
Cli212/VirtualHuman
[ "3cbc4e2ae0f15c3dbe9123dea407f379d932c692" ]
[ "Noah/socketio_connector.py" ]
[ "import logging\nimport uuid\nfrom sanic import Blueprint, response\nfrom sanic.request import Request\nfrom socketio import AsyncServer\nfrom typing import Optional, Text, Any, List, Dict, Iterable\n\nfrom rasa.core.channels.channel import InputChannel\nfrom rasa.core.channels.channel import UserMessage, OutputCha...
[ [ "numpy.abs" ] ]
zhupengyang/tensorflow
[ "584cd92f6a2ff3ba63e653e2e3d0c6f78e3d15eb", "584cd92f6a2ff3ba63e653e2e3d0c6f78e3d15eb" ]
[ "tensorflow/python/ops/ragged/ragged_shape.py", "tensorflow/python/summary/summary.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.shape", "tensorflow.python.ops.ragged.row_partition.RowPartition.from_row_splits", "tensorflow.python.ops.array_ops.zeros", "tensorflow.python.ops.control_flow_ops.cond", "tensorflow.python.ops.ragged.row_partition.RowPartition.from_row_lengths", "tensorflo...
yongfengxuemei/NLP
[ "ee50b8220579fb07ec2807cb10303830fd0f6bbb" ]
[ "CNN_ChineseTextBinaryClassify/train.py" ]
[ "# coding:utf-8\n# ! /usr/bin/env python\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport time\nimport datetime\nimport data_helpers\nfrom text_cnn import TextCNN\nfrom tensorflow.contrib import learn\n\n# 训练数据的赋值,文件的名字不建议用中文\ntf.flags.DEFINE_float(\"dev_sample_percentage\", .2, \"Percentage of the t...
[ [ "tensorflow.flags.DEFINE_boolean", "tensorflow.Graph", "tensorflow.train.global_step", "tensorflow.summary.FileWriter", "tensorflow.summary.scalar", "numpy.random.seed", "tensorflow.Variable", "tensorflow.flags.DEFINE_string", "tensorflow.global_variables", "tensorflow.Conf...
ajnalook/Machine-Learning-Code-References
[ "31049856ebc65795d0865b3988035a6436841eb6" ]
[ "Classification/k Nearest neighbor/knn_classifier.py" ]
[ "from sklearn.neighbors import KNeighborsClassifier\n\n\nclass KNN_CLASSIFIER:\n def __init__(self):\n self.clf = KNeighborsClassifier(n_neighbors=3)\n\n def fit(self, X, Y):\n self.clf.fit(X, Y)\n\n def predict(self, X):\n predictions = self.clf.predict(X)\n return predictions\...
[ [ "numpy.array", "sklearn.neighbors.KNeighborsClassifier" ] ]
HormCodes/socialclusters
[ "dd9f67dd79daad73f31b89817dc26f0b135613cf" ]
[ "topic_analysis_service/src/prototype.py" ]
[ "import time\n\nimport pandas as pd\nfrom nltk import collections\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.naive_bayes import Multin...
[ [ "pandas.read_csv", "sklearn.naive_bayes.MultinomialNB", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.feature_extraction.text.TfidfVectorizer", "sklearn.metrics.accuracy_score" ] ]
MacHu-GWU/learn_pandas-project
[ "86d51d11d6f0a50ffcffbf743da197f4a7b12d61" ]
[ "tests/concat/test_duplicate_index.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport pytest\nimport pandas as pd\nfrom learn_pandas import assert_value_equal\n\n\ndef test():\n \"\"\"\n 将两个Column相同的DataFrame连接起来,对于有相同的Index,使用 前面/后面 的哪一个。\n \"\"\"\n df1 = pd.DataFrame({\"v\": [1, 1]}, index=[0, 1])\n \"\"\"\n v\n 0 ...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
saraswat/tensor2tensor
[ "ef1ace4852952315f8bc775e2e4079069d07f60c" ]
[ "tensor2tensor/models/research/autoencoders.py" ]
[ "# coding=utf-8\n# Copyright 2018 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.concat", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.tanh", "tensorflow.layers.conv2d_transpose", "tensorflow.where", "tensorflow.to_int32", "tensorflow.layers.batch_normalization", "tensorflow.layers.dense", "tensorflow.squeeze", "tensorflow.st...
boooooogey/ProDy
[ "109a2516af64b1a2b1b1499f76e986288fed6948" ]
[ "prody/proteins/compare.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"This module defines functions for comparing and mapping polypeptide chains.\n\"\"\"\n\nfrom numbers import Integral\n\nimport numpy as np\nfrom numpy import arange\nPW2 = None\n\nfrom prody.atomic import AtomMap as AM\nfrom prody.atomic import Chain, AtomGroup, Selection\nfrom prody....
[ [ "numpy.array" ] ]
locuslab/lml
[ "cf8251e56332bfe89d2078b06c92d8d489352266" ]
[ "smooth-topk/src/losses/entr.py" ]
[ "import torch\nfrom torch import nn\n\nclass EntrLoss(nn.Module):\n def __init__(self, n_classes, k=5, tau=1.0):\n super(EntrLoss, self).__init__()\n self.n_classes = n_classes\n self.k = k\n self.tau = tau\n\n def forward(self, x, y):\n n_batch = x.shape[0]\n\n x = x...
[ [ "torch.clamp" ] ]
zbarge/FRB
[ "d0d5ec612a8c4d92311431962253996bf5791449" ]
[ "fred/helpers/__init__.py" ]
[ "from sys import version_info\nif version_info[0] >= 3:\n from urllib.parse import urlencode\n from urllib.request import Request, urlopen\n import ssl\nelse:\n from urllib import urlencode\n from urllib2 import Request, urlopen\n import ssl\n\nimport fred.config as c\nfrom json import loads\n\ntr...
[ [ "pandas.DataFrame" ] ]
sanallen/incubator-mxnet
[ "56f6e77ae505d742c004fd875a0d9612dd9a7434" ]
[ "example/ctc/ctc_decoder.py" ]
[ "# -*-coding:utf-8 -*-\n\"\"\"\nAuthor: Awni Hannun\n\nThis is an example CTC decoder written in Python. The code is\nintended to be a simple example and is not designed to be\nespecially efficient.\n\nThe algorithm is a prefix beam search for a model trained\nwith the CTC loss function.\n\nFor more details checkou...
[ [ "numpy.log", "numpy.sum", "numpy.random.rand", "numpy.random.seed" ] ]
fastso/deep-learning-from-scratch
[ "efc8a0069697e76399e896ac4d593af86e57ad1e" ]
[ "ch04/train_neuralnet.py" ]
[ "import sys\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom dataset.mnist import load_mnist\nfrom ch04.two_layer_net import TwoLayerNet\n\nsys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定\n\n# データの読み込み\n(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, one_hot_label=True...
[ [ "matplotlib.pyplot.legend", "numpy.random.choice", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ehneilsen/skybright
[ "b0e2d7e6e25131393ee76ce334ce1df1521e3659" ]
[ "skybright/skybright.py" ]
[ "#!/usr/bin/env python\n\"\"\"A model for the sky brightness\n\"\"\"\nfrom functools import partial\nfrom math import pi, cos, acos, sin, sqrt, log10\nfrom datetime import datetime, tzinfo, timedelta\nfrom time import strptime\nfrom calendar import timegm\nfrom copy import deepcopy\nfrom sys import argv\nfrom colle...
[ [ "numpy.radians", "numpy.unique", "numpy.isnan", "numpy.empty_like", "numpy.degrees", "numpy.arccos", "numpy.cos", "numpy.sin", "numpy.vectorize", "numpy.zeros_like", "numpy.shape", "numpy.log10", "numpy.array", "numpy.where" ] ]
mfkasim91/idcovid19
[ "3e51b16354581a4e0defc635f837f93faff26afc" ]
[ "idcovid19/utils/maxeig.py" ]
[ "import torch\n\nclass maxeig(torch.autograd.Function):\n @staticmethod\n def forward(ctx, A):\n # A: (nr, nr)\n # normalize the shape to be batched\n nr = A.shape[0]\n assert A.shape[0] == A.shape[1], \"The matrix must be a square matrix\"\n\n # get the right and left eigen...
[ [ "torch.enable_grad", "torch.max", "torch.sign", "torch.pinverse", "torch.eye", "torch.tensor", "torch.matmul", "torch.dot", "torch.no_grad", "torch.eig", "torch.allclose", "torch.autograd.grad", "torch.ger" ] ]
TharinduDR/HateSpans
[ "d21bcbe9e079954cff073cd72c23f1c00f08d4da" ]
[ "hatespans/algo/evaluation.py" ]
[ "from sklearn.metrics import f1_score\n\ndef f1(predictions, gold):\n \"\"\"\n F1 (a.k.a. DICE) operating on two lists of offsets (e.g., character).\n >>> assert f1([0, 1, 4, 5], [0, 1, 6]) == 0.5714285714285714\n :param predictions: a list of predicted offsets\n :param gold: a list of offsets servin...
[ [ "sklearn.metrics.f1_score" ] ]
deepylt/VSUA-Captioning
[ "ae4ed4fd478c88764f24ccea6aefb3c76c4f0eac" ]
[ "utils/load_save.py" ]
[ "import os\nimport torch\nimport cPickle\nimport logging\n\ndef save_nets_structure(nets, opt):\n path = os.path.join(opt.checkpoint_path, 'models.txt')\n if type(nets) is list:\n nets = { 'Net_'+str(i): net for i, net in enumerate(nets)}\n with open(path, 'w') as f:\n for name, net in nets.i...
[ [ "torch.load", "torch.save" ] ]
PGM-Lab/InferPy
[ "a9530ff7cde1894d54c393b69ea176d44dba7670" ]
[ "examples/probzoo/nlpca_mnist_mcmc.py" ]
[ "# required pacakges\nimport inferpy as inf\nimport numpy as np\nimport tensorflow as tf\n\nimport matplotlib.pyplot as plt\nfrom inferpy.data import mnist\n\n\n# number of components\nk = 2\n# size of the hidden layer in the NN\nd0 = 100\n# dimensionality of the data\ndx = 28 * 28\n# number of observations (datase...
[ [ "tensorflow.nn.relu", "matplotlib.pyplot.legend", "tensorflow.nn.softmax", "numpy.sqrt", "matplotlib.pyplot.title", "numpy.min", "numpy.meshgrid", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "matplotlib.pyplot.get_cmap", "tensorflow.ones", "numpy.max", ...
PiaCuk/KD_Lib
[ "153299d484e4c6b33793749709dbb0f33419f190", "153299d484e4c6b33793749709dbb0f33419f190" ]
[ "KD_Lib/Quantization/common/base_class.py", "KD_Lib/KD/vision/noisy/messy_collab.py" ]
[ "import torch\nimport os\nimport time\n\n\nclass Quantizer:\n \"\"\"\n Basic Implementation of Quantization for PyTorch models.\n\n :param model: Model that needs to be pruned\n :type model: torch.nn.Module\n :param qconfig: Configuration used for quantization\n :type qconfig: Qconfig\n :param ...
[ [ "torch.device", "torch.no_grad" ], [ "torch.nn.functional.softmax", "torch.nn.KLDivLoss", "torch.nn.functional.log_softmax", "torch.nn.functional.cross_entropy", "matplotlib.pyplot.plot" ] ]
eshanking/fears-figures
[ "19416737a92a5931b8c91afd9044fd6f22d1a501", "19416737a92a5931b8c91afd9044fd6f22d1a501" ]
[ "figure_code/ecoli_seascape.py", "figure_code/example_landscape.py" ]
[ "from seascapes_figures.classes.population_class import Population\nfrom seascapes_figures.utils import results_manager\nimport matplotlib.pyplot as plt\nimport numpy as np\n\np = Population(fitness_data='estimate')\n\nfig,ax = plt.subplots(figsize=(6,4))\n\nfig,ax = p.plot_fitness_curves()\n\nvert_lines_ydata = np...
[ [ "numpy.arange", "matplotlib.pyplot.subplots" ], [ "matplotlib.pyplot.subplots" ] ]
mathilda0902/sqlanalyzer
[ "3512174068ae4125a78d578202a4bae845acb464" ]
[ "build/lib/sqlanalyzer/unnest_query.py" ]
[ "from sqlanalyzer import column_parser\nimport sqlparse\nimport re\nimport json\nimport pandas as pd\n\n\ndef get_joins_pos(query_list):\n\n pos_delete, pos_where = [len(query_list)-1], len(query_list)\n pos_join = []\n for i, line in enumerate(query_list):\n if line.startswith('ORDER') or line.star...
[ [ "pandas.DataFrame" ] ]
ramcn/gemmx
[ "e23ab5358322a293110b642962b478bc92580636" ]
[ "gemx/host/tests/benchmark_gemm.py" ]
[ "# Copyright (c) 2017-2019, Xilinx, Inc.\r\n# All rights reserved.\r\n# \r\n# Redistribution and use in source and binary forms, with or without modification, \r\n# are permitted provided that the following conditions are met:\r\n# \r\n# 1. Redistributions of source code must retain the above copyright notice, \r\n...
[ [ "numpy.random.seed", "numpy.max", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
lightwell64646/cylindricalsfmlearner
[ "2291d30eaa8318961e4e9eeed616e2aa9b22583c" ]
[ "data/prepare_train_data.py" ]
[ "from __future__ import division\nimport argparse\nimport cv2\nimport numpy as np\nfrom glob import glob\nfrom joblib import Parallel, delayed\nimport os\n\n# Command-line Interface\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--dataset_dir\", type=str, required=True,\n help=\"Whe...
[ [ "numpy.hstack", "numpy.random.random", "numpy.random.seed" ] ]
c-bata/gp-parallel-ts
[ "369b084a2cfe00c2efb971f200485098cc977564" ]
[ "bo/gpb_utils.py" ]
[ "\"\"\"\n Some utilities for GP Bandit Optimisation.\n -- kandasamy@cs.cmu.edu\n\"\"\"\n# pylint: disable=import-error\n# pylint: disable=no-member\n# pylint: disable=invalid-name\n# pylint: disable=relative-import\n# pylint: disable=super-on-old-class\n\nimport numpy as np\n# Local imports\n\n# For initialisatio...
[ [ "numpy.random.random", "numpy.linspace", "numpy.clip", "sklearn.cluster.KMeans", "numpy.ones", "numpy.repeat", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
Leticia07/algorithm-analysis
[ "a15592f9b26a63937bb4dadf7a3e1f1183359bed" ]
[ "executionTimeCalculation/calculation.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport math\n\nclass Calculation:\n\n def __init__(self, elements, processing):\n self.elements = elements\n self.processing = processing\n\n def sortCalculation(self, complexity):\n try:\n return complexity / self.processi...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.gcf", "pandas.DataFrame", "matplotlib.pyplot.subplots_adjust" ] ]
TheAutumnOfRice/skorch
[ "6d778fc38d797644c847a9c87dd23299eea63087" ]
[ "skorch/helper.py" ]
[ "\"\"\"Helper functions and classes for users.\n\nThey should not be used in skorch directly.\n\n\"\"\"\nfrom collections import Sequence\nfrom functools import partial\n\nimport numpy as np\nfrom sklearn.base import BaseEstimator\nfrom sklearn.base import TransformerMixin\nimport torch\n\nfrom skorch.cli import pa...
[ [ "numpy.issubdtype", "torch.unique", "numpy.stack", "numpy.flatnonzero" ] ]
bing1zhi2/chinese_ocr
[ "d5b70457079e9ae5c965588c940020da742ea9c1" ]
[ "chinese_ocr/densenet_common/change_h52tensorflow.py" ]
[ "#-- coding:utf-8 --\n\nfrom keras import backend as K\nimport os\nimport shutil\nfrom imp import reload\nimport tensorflow as tf\nfrom . import keys\nfrom . import densenet\nfrom keras.layers import Input\nfrom keras.models import Model\n\nfrom keras.utils import multi_gpu_model\n\n\nK.set_learning_phase(0)\n\ndef...
[ [ "tensorflow.constant", "tensorflow.saved_model.signature_def_utils.build_signature_def", "tensorflow.concat", "tensorflow.shape", "tensorflow.image.resize_images", "tensorflow.saved_model.builder.SavedModelBuilder", "tensorflow.cast", "tensorflow.reshape", "tensorflow.compat.as...
agoswam/Simulator
[ "3507b697aab134022cfab61b6231979795bb9115", "3507b697aab134022cfab61b6231979795bb9115" ]
[ "src/vehicle_simulator1.py", "src/Ultrasound_xy_sim1.py" ]
[ "#!/usr/bin/env python\n\n# --------------------------------------------------------------------------------------\\n\n# Original Authors: BARC Project, Berkely MPC Laboratory -> https://github.com/MPC-Berkeley/barc\n# Modified by: Angshuman Goswami, Graduate Student, Clemson University\n# Date Create: 20/5/2016, L...
[ [ "numpy.tan", "numpy.zeros" ], [ "numpy.matrix", "scipy.spatial.distance.cdist" ] ]
gwdgithubnom/ox-patient
[ "cddf4fe381cb4506db8e0d62803dd2044cf7ad92" ]
[ "src/main/python/test.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: UTF-8 -*-\r\nimport sys\r\nimport math\r\nfrom tools import logger\r\nimport numpy as np\r\nfrom PIL import Image\r\n# from PIL.Image import core as image\r\nimport os, random, string, shutil\r\nfrom scipy import *\r\nfrom scipy import misc\r\nfrom pandas import DataFrame\r\n...
[ [ "pandas.Series", "numpy.asarray", "numpy.isnan", "pandas.DataFrame", "numpy.std", "scipy.misc.imread", "numpy.array", "numpy.sum" ] ]
phil-fradkin/enformer-pytorch
[ "15099609081a537ef1cc6e9148bba1b4a98d9b7a" ]
[ "enformer_pytorch/enformer_pytorch.py" ]
[ "import math\nimport torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\nfrom torch.utils.checkpoint import checkpoint_sequential\n\nfrom einops import rearrange, reduce\nfrom einops.layers.torch import Rearrange\n\nfrom enformer_pytorch.data import str_to_one_hot, seq_indices_to_one_hot\n\n# cons...
[ [ "torch.mean", "torch.cat", "torch.zeros", "torch.sign", "torch.lgamma", "torch.finfo", "torch.nn.Dropout", "torch.ones", "torch.nn.Softplus", "torch.amax", "torch.einsum", "torch.randn", "torch.eye", "torch.arange", "torch.nn.functional.pad", "torch....
ildarlomov/dlcourseproject
[ "35c9666b983937a850ffe9acf459f18f52e9b9a0" ]
[ "src/data/read_dataset.py" ]
[ "from __future__ import print_function, division\nimport os\nimport torch\nimport pandas as pd\nfrom skimage import io, transform\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\nfrom src.data.baseline_transformers imp...
[ [ "matplotlib.pyplot.ion", "numpy.random.randn", "pandas.read_csv", "numpy.unique" ] ]
takedarts/skipresnet
[ "d6f1e16042f8433a287355009e17e4e5768ad319", "d6f1e16042f8433a287355009e17e4e5768ad319" ]
[ "src/models/modules/split_attention.py", "src/models/downsamples/nfnet.py" ]
[ "import torch.nn as nn\nimport collections\n\n\nclass SplitAttentionModule(nn.Module):\n def __init__(self, out_channels, radix, groups,\n normalization, activation, reduction=4):\n super().__init__()\n\n channels = max(out_channels * radix // reduction, 32)\n channels = (cha...
[ [ "torch.nn.Conv2d" ], [ "torch.nn.AvgPool2d" ] ]
mikami520/vedo
[ "1a3abcf3f1e495287e8934d9b5bb07b511ab8be5" ]
[ "vedo/addons.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport numpy as np\nimport vedo\nimport vedo.shapes as shapes\nimport vedo.utils as utils\nimport vtk\nfrom vedo import settings\nfrom vedo.assembly import Assembly\nfrom vedo.colors import getColor\nfrom vedo.colors import printc\nfrom vedo.mesh import merge\nfrom ...
[ [ "numpy.dot", "numpy.sqrt", "numpy.min", "numpy.sign", "numpy.max", "numpy.ceil", "numpy.arctan2", "numpy.flip", "numpy.cross", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
jtrauer/AuTuMN_framework
[ "4de3c2ebe0b0e24e42943004aab90394d1e5187b" ]
[ "autumn_model/spreadsheet.py" ]
[ "\nfrom xlrd import open_workbook\nfrom numpy import nan\nimport numpy\nimport os\nimport tool_kit\n\n\n#######################################\n### Individual spreadsheet readers ###\n#######################################\n\nclass GlobalTbReportReader:\n \"\"\"\n Reader object for the WHO's Global TB Repo...
[ [ "numpy.isnan" ] ]
ccasimiro88/OpenNMT-py
[ "5e87e4960462d6cde77d460e2e919b6327eb2c72" ]
[ "tools/embeddings_to_torch.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import division\nimport six\nimport sys\nimport argparse\nimport torch\nimport torch.nn as nn\nfrom onmt.utils.logging import init_logger, logger\nfrom onmt.inputters.inputter import _old_style_vocab\n\n\ndef get_vocabs(dict_path):\n fields = torch...
[ [ "torch.Tensor", "torch.load", "torch.nn.init.constant_", "torch.nn.init.normal_", "torch.save" ] ]
BUAA-BDA/FedShapley
[ "bfc12da88f8f9ae04f1a1bb6da2a8835d70c66de" ]
[ "TensorflowFL/NoiseX_Def.py" ]
[ "import tensorflow_federated as tff\r\nimport tensorflow.compat.v1 as tf\r\nimport numpy as np\r\nimport time\r\nimport random\r\nnp.random.seed(42)\r\nimport os\r\n\r\nfrom scipy.special import comb, perm\r\n\r\n\r\n# tf.compat.v1.enable_v2_behavior()\r\n# tf.compat.v1.enable_eager_execution()\r\n\r\nNUM_EXAMPLES_...
[ [ "tensorflow.compat.v1.nn.softmax", "numpy.random.seed", "tensorflow.compat.v1.keras.datasets.mnist.load_data", "numpy.asarray", "tensorflow.compat.v1.argmax", "tensorflow.compat.v1.control_dependencies", "tensorflow.compat.v1.one_hot", "tensorflow.compat.v1.matmul", "numpy.rand...
CoinAlpha/pnl-analysis
[ "2e38b497fa139a5f8869d860a32f5a234b5bcf96" ]
[ "src/abstract/ExchangeClientWrapper.py" ]
[ "from abc import ABC, abstractmethod\nfrom requests import get\nfrom requests.models import PreparedRequest\nimport json\nimport pandas as pd\n\n\nclass ExchangeClientWrapper(ABC):\n\n def __init__(self, client):\n self.client = client\n\n @staticmethod\n @abstractmethod\n def createInstance():\n...
[ [ "pandas.DataFrame" ] ]
jcrudy/sklearntools
[ "6cb87edcb501440266622fe4c738be3f9015a859" ]
[ "sklearntools/gb.py" ]
[ "from .sklearntools import fit_predict, shrinkd, LinearCombination, BaseDelegatingEstimator, \\\n STSimpleEstimator, AlreadyFittedEstimator, growd\nfrom sklearn.base import clone\nfrom toolz.dicttoolz import valmap, dissoc\nfrom .line_search import golden_section_search, zoom_search, zoom\nimport numpy as np\nfr...
[ [ "sklearn.ensemble.gradient_boosting.QuantileEstimator", "sklearn.ensemble.gradient_boosting.ScaledLogOddsEstimator", "sklearn.exceptions.NotFittedError", "sklearn.base.clone", "numpy.zeros_like", "numpy.exp", "numpy.sum", "sklearn.linear_model.base.LinearRegression" ] ]
jf20541/BERT-NLP
[ "ab4ce67f004203d6e37910569292b79a9e3e6828" ]
[ "src/engine.py" ]
[ "import torch\nimport torch.nn as nn\nfrom tqdm import tqdm\n\n\nclass Engine:\n def __init__(self, optimizer, model, device):\n self.optimizer = optimizer\n self.model = model\n self.device = device\n\n def loss_fn(self, outputs, targets):\n # Binary Cross Entropy loss combines wi...
[ [ "torch.sigmoid", "torch.nn.BCEWithLogitsLoss", "torch.no_grad" ] ]
Utkarsh007-Singh/olympic-hero
[ "9d3818e521d3d51a081f9926b5072644db81ce9b" ]
[ "code.py" ]
[ "# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#Path of the file\r\ndata=pd.read_csv(path)\r\ndata.rename(columns={'Total':'Total_Medals'},inplace=True)\r\ndata.head(10)\r\n\r\n#Code starts here\r\n\n\n\n# --------------\n#Code start...
[ [ "pandas.read_csv", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "numpy.where", "matplotlib.pyplot.ylabel" ] ]
Sirish07/LegoFormer
[ "c2173cd107a8e29ed45b086d3956d240fc394d6c" ]
[ "legoformer/model/legoformer_m.py" ]
[ "from omegaconf import DictConfig\n\nfrom legoformer import BackboneMultiView\nfrom legoformer.model.legoformer_base import LegoFormer\nfrom legoformer.util.utils import init_weights\nimport torch.nn as nn\nimport torch\nfrom einops import rearrange\n\n\nclass LegoFormerM(LegoFormer):\n \"\"\"\n Multi-Vie...
[ [ "torch.nn.Linear", "torch.diagonal", "torch.ones" ] ]
ibraaaa/news-credibility
[ "cae1009d9def17c058342c3dee969f2babcd0c9e" ]
[ "src/python/signals/source_signal/feature_extractor.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nfrom collections import Counter\nimport gensim.utils as gutils\nimport math\nimport numpy as np\nimport util.const as const\nimport util.helper as helper\nfrom sklearn.base import BaseEstimator\nfrom scipy.sparse.coo import coo_matrix\nfrom pydoc import doc\n\nclass Fe...
[ [ "scipy.sparse.coo.coo_matrix" ] ]
ZihengJiang/tvm
[ "90809381e1ec0ef10ec9f246366f6808bdf12af4" ]
[ "tests/python/integration/test_reduce.py" ]
[ "import tvm\nimport numpy as np\n\ndef test_reduce_prims():\n def test_prim(reducer, np_reducer):\n # graph\n n = tvm.var('n')\n m = tvm.var('m')\n A = tvm.placeholder((n, m), name='A')\n k = tvm.reduce_axis((0, m))\n B = tvm.compute((n,), lambda i: reducer(A[i, k], axis...
[ [ "numpy.arange", "numpy.argmax", "numpy.testing.assert_allclose", "numpy.random.uniform", "numpy.zeros" ] ]
solaaa/deep_learning_util
[ "d0339334ae66fbf70a88b879ea24797739ab64e2" ]
[ "deep_learning_util/audio_analysis_lib.py" ]
[ "\"\"\"\n audio analysis tool set\n\"\"\"\n\nimport numpy as np\nfrom scipy.io import wavfile\nfrom pathlib import Path\nimport os\nimport matplotlib.pyplot as plt\nimport scipy.io as sio\n\n\nFs=16000\n\n\nframe_len=int((6.25*5/1000)*Fs) # 100 len\nerg_TH=frame_len*15 # energy threshold used to seperate noise and ...
[ [ "numpy.convolve", "numpy.array", "scipy.io.wavfile.read", "numpy.abs", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylim", "scipy.io.loadmat", "numpy.ones", "matplotlib.pyplot.plot", "numpy.floor", "numpy.fix", "matplotlib.pyplot.sho...
mtpain/corpus
[ "bde4a5ddf42d68f2ed7e9652325b3be975c119ac" ]
[ "projects/common/export_project.py" ]
[ "#! venv/bin/python\n'''\nexport_project_csv.py\n\nConvert `project` collections in MongoDB to a CSV for downstream analysis.\n\nBy default includes all the columns as listed in the global DEFAULT_COLUMNS\nvariable.\n\nAuthor: Matthew Turner\nDate: February 27, 2017\n'''\nimport csv\nimport pandas as pd\n\nfrom app...
[ [ "pandas.DataFrame" ] ]
zigonk/IndicSynthText
[ "80bea159a1d6e5010a6e70a1f8234d0dbd191320" ]
[ "draw.py" ]
[ "from PIL import Image, ImageFont, ImageDraw\nimport numpy as np\n\n\nclass BaselineState(object):\n A = [0.50, 0.05]\n\n def __init__(self, a) -> None:\n self.a = a\n\n def curve(self, x):\n return self.a*x**2\n\n def differential(self, x):\n return 2*self.a*x\n\n @staticmethod\...
[ [ "numpy.random.randn", "numpy.random.rand" ] ]
SrivastavaKshitij/TRTorch
[ "cbe186603e21a7e6cb51a4e8182d6e397b33c7ab" ]
[ "tests/py/test_trt_intercompatability.py" ]
[ "import unittest\nimport trtorch\nimport torch\nimport torchvision.models as models\nimport tensorrt as trt\n\nfrom model_test_case import ModelTestCase\n\n\nclass TestPyTorchToTRTEngine(ModelTestCase):\n\n def setUp(self):\n self.input = torch.randn((1, 3, 224, 224)).to(\"cuda:0\")\n self.ts_model...
[ [ "torch.jit.script", "torch.randn", "torch.cuda.current_stream" ] ]
yetinater/Prediction-of-Steering-Angle-using-Throttle-and-Road-Angle-Values-for-Vehicle-Control
[ "a62ebe3edfc970357d02b5223cb248a870bbe1a5" ]
[ "join_csv.py" ]
[ "# script to join master_beta_csv and road_angle to prepare finaldataset file \n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np \n\ndef combine( df1, df2):\n\treturn pd.concat([df1, df2], axis=1, sort=False)\n\nif __name__ == \"__main__\":\n\tdf1 = pd.read_csv(\"master_beta_csv2.csv\")\n\...
[ [ "pandas.concat", "pandas.read_csv" ] ]
rjazevedo/dados-unicamp
[ "4b77906d5348647dcdba1b8cb09f46d2cac53457" ]
[ "comvest/extract_cities/extrair_cidades.py" ]
[ "import pandas as pd\nfrom comvest.utilities.io import files, read_from_db, write_result\nfrom comvest.utilities.logging import progresslog, resultlog\nfrom unidecode import unidecode\n\n\ndef cleandata(cities, date):\n '''\n Desc: Data wrangling for cities' sheets\n Args: Cities df, date\n Returns: Clean...
[ [ "pandas.concat" ] ]
williamclot/PrivacyPreservingRidgeRegression
[ "5e0379162bdf114d862982a5ac438f076aa3c81b" ]
[ "Modules/regression/cpu.py" ]
[ "#!/usr/bin/env python3\n\n'''Ridge Regression on CPU dataset test using Python (pandas & numpy)'''\n\n__author__ = \"William CLOT, www.github.com/williamclot; Camille PLAYS, www.github.com/camilleplays\"\n__license__ = \"MIT\"\n__date__ = \"12/11/2018\"\n\nimport pandas as pd\nimport numpy as np\nimport math\nimpo...
[ [ "pandas.read_table" ] ]
lmlima/DropoutRL
[ "00db2e901c320cf12c60c5039561999d45591bd1" ]
[ "scripts_ufes/visualization.py" ]
[ "import argparse\nimport os\nimport re\nfrom pathlib import Path\n\nimport pandas as pd\nimport json\nimport matplotlib.pyplot as plt\n\n\ndef lastmatch_file(log, match_str):\n lastmatch = None\n for line in log:\n if match_str in line:\n lastmatch = line\n\n return lastmatch\n\n\ndef loa...
[ [ "pandas.concat", "pandas.read_pickle", "matplotlib.pyplot.savefig", "pandas.DataFrame.from_dict" ] ]
Tagrand/we-predicted-that
[ "13b5d07833fa116c3db2554896e90162f0d2874f" ]
[ "ml-models/pokemon/model_all_data.py" ]
[ "import pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import train_test_split\n\n\ndef load_csv(path):\n return pd.read_csv(path)\n\n\ndef add_suffix_to(dataframe, suffix):\n return dataframe.add_suffix(suffix)\n\n\ndef important_features(feature_data, classif...
[ [ "pandas.concat", "pandas.merge", "pandas.read_csv", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.train_test_split", "pandas.DataFrame" ] ]
domSB/natural_language_processing
[ "45bc1475c9ad5238b507a6ed5652b1f43e570674" ]
[ "nlp/spam_detection.py" ]
[ "#%%\n\n\"\"\"\nData from Lazyprogrammer TF2.0 Course\n\"\"\"\nimport tensorflow as tf\nimport pandas as pd\nimport altair as alt\n\nfrom sklearn.model_selection import train_test_split\n\ndf = pd.read_csv('../data/spam.csv', encoding='ISO-8859-1')\ndf.drop(columns=['Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4'], inplac...
[ [ "tensorflow.keras.preprocessing.text.Tokenizer", "pandas.read_csv", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.GlobalMaxPooling1D", "tensorflow.keras.layers.Dense", "tensorflow.keras.callbacks.ReduceLROnPlateau", "sklearn.model_selection.train_test_split", "panda...
Nosbielc/DoNotDoze
[ "62038d401d13bf9ece1ecc5ef070a744b83d176d" ]
[ "sleep_detection.py" ]
[ "import sys\nimport dlib\nfrom skimage import io\nimport numpy as np\nfrom scipy.spatial import distance\n\n#https://github.com/tahaemara/sleep-detection\n\n# Developed by: Taha Emara\n# Website : http://www.emaraic.com\n# Email : taha@emaraic.com\n\n# This code is built on Eye Aspect Ratio formula by Ter...
[ [ "numpy.empty", "scipy.spatial.distance.euclidean" ] ]
epwalsh/pytorch-crf
[ "561e00ebcfdc678e46cc878c1cb91293539c26b0" ]
[ "pycrf/modules/char_embedding.py" ]
[ "\"\"\"Character embedding module.\"\"\"\n\nimport torch\nfrom torch import nn\nfrom torch.nn import Dropout, Embedding\n\n\nclass CharEmbedding(nn.Module):\n \"\"\"\n Dense character embedding.\n\n Parameters\n ----------\n n_chars : int\n The number of characters in the vocabularly, i.e. the...
[ [ "torch.nn.Dropout", "torch.nn.Embedding" ] ]
naspert/pygsp
[ "361f0258a210193f482c6197ea879765a9041e91" ]
[ "pygsp/graphs/difference.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom pygsp import utils\n\n\nlogger = utils.build_logger(__name__)\n\n\nclass GraphDifference(object):\n\n @property\n def D(self):\n r\"\"\"Differential operator (for gradient and divergence).\n\n Is computed by :func:`...
[ [ "scipy.sparse.csc_matrix", "numpy.arange", "numpy.sqrt", "numpy.empty" ] ]
DAMONYLY/General_detection
[ "c6aa16a4369c12771c392abb297f1bb5fbb7f6de" ]
[ "model/metrics/change_metrics.py" ]
[ "# Modification 2020 RangiLyu\n# Copyright 2018-2019 Open-MMLab.\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...
[ [ "torch.stack" ] ]
hart-lab/bagel
[ "53388adbb4fb0931e5c9dda135502be19e4555f0" ]
[ "pipeline-script-example/qc_ess_dist.py" ]
[ "#!/usr/bin/python\n\n# a script for run BAGEL and CRISPRcleanR\n# usage) python3 run_bagel_crisprcleanr.py -i [readcount table] -o [output file tag] -c [control columns] -x [experiment columns]\n\nimport sys\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n\nimport numpy as np\nimport ...
[ [ "pandas.read_csv", "matplotlib.use", "matplotlib.pyplot.subplots", "numpy.mean", "matplotlib.pyplot.subplots_adjust", "numpy.var" ] ]
JoeBrody/Caravel
[ "fc1e63761cc86a5673433b0e2efc0081325684d3" ]
[ "caravel/sql_lab.py" ]
[ "import celery\nfrom datetime import datetime\nimport pandas as pd\nimport logging\nfrom caravel import app, db, models, utils\nimport time\n\nQueryStatus = models.QueryStatus\n\n\ncelery_app = celery.Celery(config_source=app.config.get('CELERY_CONFIG'))\n\n\ndef is_query_select(sql):\n return sql.upper().start...
[ [ "pandas.DataFrame" ] ]
nkapchenko/HW
[ "92f51d1ac4fc009e24350844172a1fb3b111ea27" ]
[ "src/hw/.ipynb_checkpoints/Jamshidian-checkpoint.py" ]
[ "import numpy as np\nfrom numpy import exp, sqrt\nfrom functools import partial\nfrom scipy import optimize\nfrom scipy.stats import norm\nimport scipy.integrate as integrate\nfrom fox_toolbox.utils import rates\nfrom hw.hw_helper import _B, _V, _A, sign_changes\nfrom hw import hw_helper\nfrom hw.hw_helper import g...
[ [ "numpy.array", "numpy.sqrt", "scipy.stats.norm.pdf", "numpy.negative", "scipy.optimize.bisect", "numpy.exp" ] ]
MedZghal/models
[ "7a4ed44bc52aace1130df848a812cb696560d1e3" ]
[ "official/resnet/resnet_run_loop.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.cond", "tensorflow.cast", "tensorflow.map_fn", "tensorflow.estimator.RunConfig", "tensorflow.group", "tensorflow.contrib.data.python.ops.threadpool.PrivateThreadPool", "tensorflow.estimator.export.PredictOutput", "tensorflow.compat.v1.summary.image", "tensorflow.com...
cheng-chi/glplotlib
[ "7129953d1130f2a1fed8e9b32c5e526fbbaa51dc" ]
[ "examples/line_example.py" ]
[ "import time\nimport numpy as np\nimport glplotlib.glplot as plt\nimport pyqtgraph as pg\n\n\ndef fn(x, y):\n return np.cos((x ** 2 + y ** 2) ** 0.5)\n\n\ndef add_grid():\n gx = plt.grid_generic()\n gx.rotate(90, 0, 1, 0)\n gx.translate(-10, 0, 0)\n gy = plt.grid_generic()\n gy.rotate(90, 1, 0, 0)...
[ [ "numpy.vstack", "numpy.array", "numpy.cos", "numpy.linspace" ] ]
zangke/handwriting
[ "da4ec05598ce0b5b6590b62f24dabc133ad77607" ]
[ "python/beitiesplit/row_col_show.py" ]
[ "import wx\nimport numpy as np\nimport threading\nimport time\nfrom pil import image, imagedraw\n\n\ndef draw_line(dir, a, b):\n im = image.open(dir)\n draw = imagedraw.draw(im) # 实例化一个对象\n # a #行 图像的宽:im.size[0]\n # b #列 图像的高:im.size[1]\n a = int(a)\n b = int(b)\n c = im.size[0]\n d = im.s...
[ [ "numpy.load", "numpy.savez" ] ]
gcruzgar/trdiff
[ "b38659227178d7e08de10c1347b5601b61ebe291" ]
[ "scripts/histograms.py" ]
[ "import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom scripts.utils import remove_outliers\n\nes_df = pd.read_csv(\"data/un-parallel/es-mt-score.txt\", header=None, sep='\\n')\nes_df.columns=['score']\n\nes_df = remove_outliers(es_df, 'score', lq=0.05, uq=0.95)\n\nfr_df = pd.read_csv(\"...
[ [ "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ] ]
mipt-npm-study/sciprog-python
[ "09a0d99254fcd559ec8d13bedd5521e98e86b3ce" ]
[ "files/native_extensions/mandelbrot.py" ]
[ "import numpy as np\n\ndef mandelbrot():\n pmin, pmax, qmin, qmax = -2.5, 1.5, -2, 2\n ppoints, qpoints = 200, 200\n max_iterations = 400\n infinity_border = 100\n image = np.zeros((ppoints, qpoints))\n for ip, p in enumerate(np.linspace(pmin, pmax, ppoints)):\n for iq, q in enumerate(np.li...
[ [ "numpy.zeros", "numpy.linspace" ] ]