repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
mscheltienne/pyprep
[ "82920228a1bfe46a8f8c04443547cc2726d3d189", "82920228a1bfe46a8f8c04443547cc2726d3d189" ]
[ "pyprep/removeTrend.py", "examples/run_ransac.py" ]
[ "\"\"\"High-pass filter and locally detrend the EEG signal.\"\"\"\nimport logging\n\nimport mne\nimport numpy as np\n\nfrom pyprep.utils import _eeglab_create_highpass, _eeglab_fir_filter\n\n\ndef removeTrend(\n EEG,\n sample_rate,\n detrendType=\"high pass\",\n detrendCutoff=1.0,\n detrendChannels=N...
[ [ "numpy.multiply", "numpy.transpose", "numpy.ceil", "numpy.zeros", "numpy.subtract", "numpy.reshape", "numpy.arange", "numpy.absolute", "numpy.round", "numpy.mean", "numpy.minimum" ], [ "numpy.random.default_rng", "numpy.arange", "numpy.array", "numpy...
FlorianBury/talos
[ "30f7af4d1f628364f8e8a2e983f72b2631cee6d9" ]
[ "talos/parameters/ParamGrid.py" ]
[ "from numpy import arange, unique, array, column_stack, concatenate\nfrom itertools import product\n\nfrom ..reducers.sample_reducer import sample_reducer\n\n\nclass ParamGrid:\n\n '''Suite for handling parameters internally within Talos\n\n Takes as input the parameter dictionary from the user, and\n retu...
[ [ "numpy.arange", "numpy.concatenate", "numpy.unique", "numpy.column_stack" ] ]
quasiben/bokeh
[ "738343bd18c851dfd1fdc82cf35fe3eb4cdfd475" ]
[ "bokeh/charts/stats.py" ]
[ "\"\"\" Statistical methods used to define or modify position of glyphs.\n\nReferences:\n Wilkinson L. The Grammer of Graphics, sections 7, 7.1\n\nMethod Types:\n - Bin: Partitions a space before statistical calculation\n - Summary: Produces a single value comprising a statistical summary\n - Region: Pr...
[ [ "numpy.sqrt", "pandas.Series", "numpy.array", "pandas.DataFrame", "pandas.cut", "numpy.round", "numpy.linspace" ] ]
floft/squeezeDet
[ "e7c0860eb1d141729cf02a2ec9cafc0cfb4a21aa" ]
[ "src/dataset/kitti.py" ]
[ "# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016\n\n\"\"\"Image data base class for kitti\"\"\"\n\nimport cv2\nimport os \nimport numpy as np\nimport subprocess\n\nfrom dataset.imdb import imdb\nfrom utils.util import bbox_transform_inv, batch_iou\n\nclass kitti(imdb):\n def __init__(self, image_set, data_pat...
[ [ "numpy.array", "numpy.max", "numpy.argmax" ] ]
ZhangShiqiu1993/CSCI-567-machine-learning
[ "07144b299aeb9f29c304798549ef2d44fe1f4083" ]
[ "Assignment-3/decision_tree_test.py" ]
[ "import numpy as np\nfrom sklearn.metrics import accuracy_score\nimport json\n\nimport data_loader\nimport decision_tree\n\n# load data\nX_train, X_test, y_train, y_test = data_loader.discrete_2D_iris_dataset()\n\n# set classifier\ndTree = decision_tree.DecisionTree()\n\n# training\ndTree.train(X_train, y_train)\ny...
[ [ "sklearn.metrics.accuracy_score" ] ]
ashwinb/pytorch-lightning
[ "89787947304a0db3a98a1ddd0e818a91a924e43f" ]
[ "tests/models/test_gpu.py" ]
[ "import os\n\nimport pytest\nimport torch\n\nimport tests.base.utils as tutils\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.core import memory\nfrom pytorch_lightning.trainer.distrib_parts import parse_gpu_ids, determine_root_gpu_device\nfro...
[ [ "torch.eq", "torch.cuda.device_count" ] ]
VITA-Group/Peek-a-Boo
[ "9290d4e5e3aee0dff994e1a664ec91bd6ec93176" ]
[ "main_imagenet.py" ]
[ "import argparse\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.optim\nimport torch.multiprocessing as mp\nimport torch.utils.data\nimport to...
[ [ "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.is_available", "torch.distributed.init_process_group", "torch.save", "torch.cuda.device_count", "torch.nn.DataParallel", "torch.cuda.set_device", "torch.optim.SGD", "torch.multiprocessing.spawn", "torch.load", ...
annagitel/ocs-ci
[ "284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5" ]
[ "ocs_ci/utility/utils.py" ]
[ "from functools import reduce\nimport io\nimport json\nimport logging\nimport os\nimport platform\nimport random\nimport re\nimport shlex\nimport smtplib\nimport string\nimport subprocess\nimport time\nimport traceback\nimport stat\nfrom copy import deepcopy\nfrom email.mime.multipart import MIMEMultipart\nfrom ema...
[ [ "scipy.stats.scoreatpercentile", "scipy.stats.tmean" ] ]
dcronqvist/restberry-api
[ "35a2698ae946fc392e5e7d56dbc22b0719d6f5b6" ]
[ "api_v1/namespaces/ai.py" ]
[ "from datetime import datetime\nfrom flask import request\nfrom flask_restx import Resource, Namespace, fields, reqparse\nfrom api_v1 import privilege_required\nimport pandas as pd\nimport pickle\nfrom db import coll_accounts\n\napi = Namespace(\"ai\", path=\"/ai\", description=\"Endpoints utilizing some of my trai...
[ [ "pandas.DataFrame" ] ]
mestagtx/deepimpute
[ "a6bb01f6d000d265557f7e681b10b9eaac458fdd" ]
[ "deepimpute/multinet.py" ]
[ "import os\nimport warnings\nimport tempfile\n\nimport pandas as pd\nimport numpy as np\nfrom scipy.stats import pearsonr\n\nimport tensorflow.keras as keras\nfrom keras import backend as K\nfrom keras.models import Model,model_from_json\nfrom keras.layers import Dense,Dropout,Input\nfrom keras.callbacks import Ear...
[ [ "numpy.sum", "tensorflow.keras.optimizer_v2.adam.Adam", "numpy.random.seed", "numpy.argsort", "tensorflow.config.threading.set_inter_op_parallelism_threads", "numpy.log1p", "numpy.random.choice", "numpy.isnan", "numpy.expm1", "tensorflow.random.set_seed", "numpy.unique"...
searchsolved/sentence-transformers-master
[ "50f345322d602ebab9e6d2b5e2a98e7e9d0cf9a3" ]
[ "sentence_transformers/models/Pooling.py" ]
[ "import torch\nfrom torch import Tensor\nfrom torch import nn\nfrom typing import Union, Tuple, List, Iterable, Dict\nimport os\nimport json\n\n\nclass Pooling(nn.Module):\n \"\"\"Performs pooling (max or mean) on the token embeddings.\n\n Using pooling, it generates from a variable sized sentence a fixed siz...
[ [ "torch.sum", "torch.sqrt", "torch.max", "torch.cat", "torch.clamp" ] ]
JanSchulz/statsmodels
[ "a160bbc790ef447ec365651ad01da3cf11e75f7f" ]
[ "statsmodels/stats/tests/test_multi.py" ]
[ "'''Tests for multipletests and fdr pvalue corrections\n\nAuthor : Josef Perktold\n\n\n['b', 's', 'sh', 'hs', 'h', 'fdr_i', 'fdr_n', 'fdr_tsbh']\nare tested against R:multtest\n\n'hommel' is tested against R stats p_adjust (not available in multtest\n\n'fdr_gbs', 'fdr_2sbky' I did not find them in R, currently test...
[ [ "numpy.array", "numpy.testing.assert_equal", "numpy.linspace", "numpy.testing.assert_almost_equal" ] ]
olantwin/zfit
[ "dae89fd95fc2158c0e7530664d8ca999db4802c5" ]
[ "zfit/core/loss.py" ]
[ "import abc\nfrom collections import OrderedDict\n\nimport tensorflow as tf\nfrom typing import Optional, Union, List\n\nfrom zfit import ztf\nfrom zfit.util import ztyping\nfrom zfit.util.cache import Cachable\nfrom zfit.util.graph import get_dependents_auto\nfrom .baseobject import BaseObject, BaseDependentsMixin...
[ [ "tensorflow.log", "tensorflow.get_collection", "tensorflow.reduce_sum" ] ]
HuangShiqing/Paddle-Lite
[ "061f94e4624c7cc657ff914c0e589bf1192d73c5" ]
[ "lite/tests/unittest_py/op/test_scale_op.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.random", "numpy.ones", "numpy.random.randint" ] ]
nuttamas/PycQED_py3
[ "1ee35c7428d36ed42ba4afb5d4bda98140b2283e" ]
[ "pycqed/measurement/CBox_sweep_functions.py" ]
[ "import numpy as np\nimport logging\nfrom pycqed.measurement import sweep_functions as swf\nfrom pycqed.measurement.sweep_functions import Soft_Sweep\nfrom pycqed.measurement.waveform_control_CC import waveform as wf\n\n# FIXME: Commented out as there is no module named Experiments.CLEAR.prepare_for_CLEAR.prepare_f...
[ [ "numpy.ones", "numpy.array", "numpy.zeros", "numpy.arange", "numpy.random.rand", "numpy.round", "numpy.linspace" ] ]
darya-chyzhyk/nilearn
[ "c2a597586314ee1fe9da260d7d7ee00ef8b4eef5" ]
[ "nilearn/decoding/tests/test_space_net.py" ]
[ "import itertools\nfrom functools import partial\nfrom nose import SkipTest\nfrom nose.tools import (assert_equal, assert_true, assert_false,\n assert_raises)\nimport numpy as np\nfrom sklearn.datasets import load_iris\nfrom sklearn.utils import extmath\nfrom sklearn.linear_model import Lasso...
[ [ "numpy.testing.assert_almost_equal", "numpy.ones", "sklearn.utils.check_random_state", "numpy.zeros", "numpy.dot", "numpy.abs", "numpy.arange", "numpy.random.RandomState", "sklearn.linear_model.LogisticRegression", "numpy.prod", "numpy.array", "numpy.where", "sk...
fmamashli/mne-python
[ "52f064415e7c9fa8fe243d22108dcdf3d86505b9", "52f064415e7c9fa8fe243d22108dcdf3d86505b9" ]
[ "examples/time_frequency/plot_source_power_spectrum.py", "mne/_digitization/base.py" ]
[ "\"\"\"\n======================================================\nCompute source power spectral density (PSD) in a label\n======================================================\n\nReturns an STC file containing the PSD (in dB) of each of the sources\nwithin a label.\n\"\"\"\n# Authors: Alexandre Gramfort <alexandre....
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ], [ "numpy.allclose" ] ]
dopplerchase/GewitterGefahr
[ "d819874d616f98a25187bfd3091073a2e6d5279e" ]
[ "gewittergefahr/scripts/convert_examples_myrorss_to_gridrad.py" ]
[ "\"\"\"Converts examples from MYRORSS to GridRad format.\"\"\"\n\nimport os.path\nimport argparse\nimport numpy\nfrom gewittergefahr.gg_utils import radar_utils\nfrom gewittergefahr.gg_utils import time_conversion\nfrom gewittergefahr.deep_learning import input_examples\nfrom gewittergefahr.deep_learning import tra...
[ [ "numpy.array", "numpy.stack", "numpy.concatenate", "numpy.full" ] ]
takuseno/configurable-control-gym
[ "9837e6c03c5a7fe6711b32dc70fe5e432e7d96c3" ]
[ "configurable_control_gym/envs/pendulum.py" ]
[ "import gym\nfrom gym import spaces\nfrom gym.utils import seeding\nimport numpy as np\nfrom os import path\n\nclass PendulumEnv(gym.Env):\n metadata = {\n 'render.modes' : ['human', 'rgb_array'],\n 'video.frames_per_second' : 30\n }\n\n def __init__(self, force=10.0, length=1.0, mass=1.0):\n...
[ [ "numpy.sign", "numpy.abs", "numpy.cos", "numpy.clip", "numpy.array", "numpy.sin" ] ]
tpeng/magnitude
[ "aec98628b5547773ca8c4114ec6d1ad51e21b230" ]
[ "pymagnitude/third_party/allennlp/semparse/worlds/atis_world.py" ]
[ "\nfrom __future__ import absolute_import\nfrom copy import deepcopy\n#typing\nimport numpy\n\nfrom parsimonious.grammar import Grammar\n\nfrom allennlp.semparse.contexts.atis_tables import * # pylint: disable=wildcard-import,unused-wildcard-import\nfrom allennlp.semparse.contexts.sql_table_context import\\\n ...
[ [ "numpy.array", "numpy.array_equal" ] ]
mdengler/pandas
[ "ca010142309076bf24a06ca83fb822915e49fa80" ]
[ "pandas/tests/arithmetic/test_datetime64.py" ]
[ "# Arithmetic tests for DataFrame/Series/Index/Array classes that should\n# behave identically.\n# Specifically for datetime64 and datetime64tz dtypes\nfrom datetime import (\n datetime,\n time,\n timedelta,\n)\nfrom itertools import (\n product,\n starmap,\n)\nimport operator\nimport warnings\n\nimp...
[ [ "pandas._testing.assert_numpy_array_equal", "pandas.timedelta_range", "pandas.tests.arithmetic.common.assert_invalid_comparison", "pandas.Series", "pandas._testing.box_expected", "pandas.array", "pandas.Period", "numpy.subtract", "pandas._testing.assert_series_equal", "nump...
jhuapl-boss/intern
[ "cd6513e9f3ef3af02d3a82e3dda5d905a4003d2c" ]
[ "intern/convenience/array.py" ]
[ "\"\"\"\nCopyright 2018-2021 The Johns Hopkins University Applied Physics Laboratory.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nU...
[ [ "numpy.array", "numpy.rollaxis" ] ]
annapasca/ephypype
[ "6dbacdd6913234a28b690b401862ff062accecc7" ]
[ "examples/plot_inverse.py" ]
[ "\"\"\"\n.. _source_reconstruction:\n\n========================\nCompute inverse solution\n========================\nThe inverse solution pipeline performs source reconstruction starting either\nfrom raw/epoched data (*.fif* format) specified by the user or from the output\nof the Preprocessing pipeline (cleaned ra...
[ [ "numpy.load", "matplotlib.pyplot.figure", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow", "numpy.array" ] ]
hanke/nilearn
[ "96a3f0f72b4f25af771116251324cbec4c0d2055" ]
[ "nilearn/_utils/cache_mixin.py" ]
[ "\"\"\"\nMixin for cache with joblib\n\"\"\"\n# Author: Gael Varoquaux, Alexandre Abraham, Philippe Gervais\n# License: simplified BSD\n\nimport json\nimport warnings\nimport os\nimport shutil\nfrom distutils.version import LooseVersion\n\nimport nibabel\nfrom sklearn.externals.joblib import Memory\n\nMEMORY_CLASSE...
[ [ "sklearn.externals.joblib.Memory" ] ]
m-novikov/hytra
[ "0dc28deaa2571fa8bea63ca178f0e53cc1cd7508" ]
[ "hytra/core/divisionfeatures.py" ]
[ "import numpy as np\nimport math\n\n\ndef dotproduct(v1, v2):\n return sum((a * b) for a, b in zip(v1, v2))\n\n\ndef length(v):\n return math.sqrt(dotproduct(v, v))\n\n\ndef angle(v1, v2):\n try:\n if length(v1) * length(v2) == 0:\n radians = 0\n else:\n radians = math.a...
[ [ "numpy.array", "numpy.ones", "numpy.linalg.norm", "numpy.unique" ] ]
mrsempress/transfer_learning
[ "217622ca3052b6c79a07792e627394c08440ec84" ]
[ "codes/JDA/JDA.py" ]
[ "# encoding=utf-8\n\"\"\"\n Created on 9:38 2019/07/16\n @author: Chenxi Huang\n It implements \"Transfer Feature Learning with Joint Distribution Adaptation\"\n Refer to Long Mingsheng's(the writer) code in Matlab\n\"\"\"\nimport numpy as np\nimport os\nimport scipy.io\nimport scipy.linalg\nimport skle...
[ [ "sklearn.neighbors.KNeighborsClassifier", "sklearn.preprocessing.minmax_scale", "numpy.linalg.norm" ] ]
zhengjian2322/soln-ml
[ "ceff6c432921df9809f9552aaa1b0bd5a1b7e8d2" ]
[ "solnml/components/models/object_detection/nn_utils/retinanet.py" ]
[ "\"\"\"\nRetinaNet code borrowed from\nhttps://github.com/yhenon/pytorch-retinanet/blob/master/retinanet/model.py\n\"\"\"\n\nimport torch.nn as nn\nimport torch\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom torchvision.ops import nms\nfrom .retinanet_utils import BasicBlock, Bottleneck, BBoxTransfor...
[ [ "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.max", "torch.zeros", "torch.utils.model_zoo.load_url", "torch.nn.Sigmoid", "torch.nn.ReLU" ] ]
cassinius/right-to-forget-data
[ "5aa3a480d93e66065118866f294f06e6cfd5d3a1" ]
[ "src/multi_class/gradient_boosting.py" ]
[ "from sklearn import ensemble\nfrom src.multi_class import input_preproc\nfrom src.multi_class import calculate_metrics\n\n\ndef runClassifier(X_train, X_test, y_train, y_test):\n # GRADIENT BOOSTING\n cls = ensemble.GradientBoostingClassifier(\n n_estimators=100,\n learning_rate=0.1,\n max_depth=5,\n ...
[ [ "sklearn.ensemble.GradientBoostingClassifier" ] ]
zhezherun/pandas
[ "1f02bf240c3d0d3da338af868d056bfc169b28c2", "36c1104b7ad9761e020f7e8198eb60da4045d169" ]
[ "pandas/tests/indexes/datetimes/test_indexing.py", "pandas/io/parsers.py" ]
[ "from datetime import datetime, time, timedelta\n\nimport numpy as np\nimport pytest\nimport pytz\n\nimport pandas.compat as compat\n\nimport pandas as pd\nfrom pandas import DatetimeIndex, Index, Timestamp, date_range, notna\nimport pandas.util.testing as tm\n\nfrom pandas.tseries.offsets import BDay, CDay\n\nSTAR...
[ [ "pandas.DatetimeIndex", "pandas.compat.iteritems", "pandas.date_range", "pandas.util.testing.assert_numpy_array_equal", "pandas.notna", "numpy.timedelta64", "pandas.bdate_range", "pandas.tseries.offsets.CDay", "numpy.int_", "pandas.Timedelta", "pandas.to_datetime", ...
zmlabe/ExtremeEvents
[ "701c274c074dd2c4ae7c7294ec20f35c64e6ea2b" ]
[ "Scripts/calc_LRP.py" ]
[ "\"\"\"\nFunctions are useful untilities for interpretation of ANN\n \nNotes\n-----\n Author : Zachary Labe\n Date : 22 July 2020\n \nUsage\n-----\n [1] deepTaylorAnalysis(model,XXt,YYt,biasBool,annType,classChunk,startYear)\n [2] def _gradient_descent_for_bwo(cnn_model_object, loss_tensor,\n ...
[ [ "numpy.nanmean", "numpy.abs", "numpy.mod", "numpy.arange", "numpy.percentile", "numpy.shape", "numpy.isnan", "numpy.round", "numpy.where", "numpy.unique" ] ]
hdelecki/alpha-zero-general-ut3
[ "1b38aad66c3ac38d815fbd21c34475bfa7573706" ]
[ "ut3/UT3Game.py" ]
[ "from __future__ import print_function\nimport sys\nsys.path.append('..')\nfrom Game import Game\nfrom .UT3Logic import Board\nimport numpy as np\n\n\"\"\"\nGame class implementation for the game of Ultimate TicTacToe.\n\nAuthor: Harrison Delecki, github.com/hdelecki\n\nBased on the OthelloGame by Surag Nair.\n\"\"...
[ [ "numpy.ravel_multi_index", "numpy.repeat", "numpy.copy", "numpy.rot90", "numpy.flip", "numpy.stack", "numpy.unravel_index" ] ]
AmericaGL/TrashTalk_Dapp
[ "401f17289261b5f537b239e7759dc039d53211e1" ]
[ "opencv-3.3.0/samples/python/mouse_and_match.py" ]
[ "#!/usr/bin/env python\n'''\nmouse_and_match.py [-i path | --input path: default ../data/]\n\nDemonstrate using a mouse to interact with an image:\n Read in the images in a directory one by one\n Allow the user to select parts of an image with a mouse\n When they let go of the mouse, it correlates (using matchTempl...
[ [ "numpy.abs" ] ]
slohani-ai/machine-learning-for-physical-sciences
[ "f10f04d768b8eb0966953d76e6a553d3b11af92f" ]
[ "mlphys/deepqis/Simulator/Distributions.py" ]
[ "\"\"\"\nauthor: Sanjaya Lohani\nemail: slohani@mlphys.com\nLicence: Apache-2.0\n\"\"\"\n\nimport numpy as np\nimport qiskit.quantum_info as qi\nimport tensorflow as tf\nimport tensorflow_probability as tfp\n\n\nclass Haar_State:\n\n def __init__(self, qs):\n self._qs = qs\n\n def pure_states(self, _):...
[ [ "numpy.random.uniform", "tensorflow.norm", "tensorflow.linalg.diag", "tensorflow.random.gamma", "tensorflow.reshape", "tensorflow.debugging.assert_equal", "tensorflow.multiply", "tensorflow.expand_dims", "tensorflow.repeat", "tensorflow.squeeze", "tensorflow.cast", ...
meichenfang/inferelator
[ "47f8ebcc5f303264a75814897c52026b47c57aef" ]
[ "inferelator/distributed/dask_functions.py" ]
[ "from inferelator.distributed.inferelator_mp import MPControl\nfrom inferelator.regression import base_regression\nfrom inferelator import utils\nimport copy\n\nimport numpy as np\nimport scipy.sparse as sps\nfrom dask import distributed\n\n\"\"\"\nThis package contains the dask-specific multiprocessing functions (...
[ [ "numpy.array", "scipy.sparse.isspmatrix" ] ]
sdss/coordio
[ "61f5c962b8e3f335259168c9f8e872b4d3fe25d8" ]
[ "coordio/sky.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# @Author: José Sánchez-Gallego (gallegoj@uw.edu)\n# @Date: 2020-08-17\n# @Filename: sky.py\n# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)\n\n# IAU-defined sky coordinate systems and transformations.\n\nimport ctypes\n\nimport numpy\n\...
[ [ "numpy.degrees", "numpy.radians", "numpy.rad2deg", "numpy.cos" ] ]
arpanmangal/coinaction
[ "488eb4fea833ecf5df65acdf12e55592099efc93" ]
[ "mmaction/models/tenons/backbones/resnet_s3d.py" ]
[ "import logging\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.checkpoint as cp\n\nfrom ....utils.misc import rgetattr, rhasattr\nfrom .resnet import ResNet \nfrom mmcv.cnn import constant_init, kaiming_init\nfrom mmcv.runner import load_checkpoint\n\nfrom ....ops.trajectory_conv_package.traj_conv impor...
[ [ "torch.utils.checkpoint.checkpoint", "torch.nn.MaxPool3d", "torch.nn.BatchNorm3d", "torch.split", "torch.zeros_like", "torch.nn.Sequential", "torch.cat", "torch.nn.ReLU", "torch.nn.Conv3d" ] ]
RJPenic/Orpheus
[ "1a795fa732a10d4f16b48cf00808a125548e00d5" ]
[ "orpheus/dataset.py" ]
[ "import torch\nfrom dataclasses import dataclass, field\nfrom typing import List\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nfrom torch.nn.utils.rnn import pad_sequence\nimport csv\n\nfrom nltk.corpus import stopwords\nimport random\n\nfrom tqdm import tqdm\n\n@dataclass\nclass Instance:\n la...
[ [ "torch.zeros", "torch.full", "torch.LongTensor", "torch.nn.Embedding.from_pretrained" ] ]
jdailey/solarpanelcount
[ "39643e97d628c9317aca398d28e37ed25472a7f6" ]
[ "train_classification.py" ]
[ "\"\"\"Train the inception-v3 model on Solar Panel Identification dataset.\"\"\"\n\nfrom datetime import datetime\nimport os.path\nimport time\nimport sys\n\nimport numpy as np\nimport tensorflow as tf\nimport skimage\nimport skimage.io\nimport skimage.transform\nimport random\nimport pickle\nfrom collections impor...
[ [ "tensorflow.summary.scalar", "tensorflow.app.flags.DEFINE_string", "tensorflow.app.flags.DEFINE_float", "tensorflow.all_variables", "tensorflow.identity", "tensorflow.summary.histogram", "tensorflow.train.ExponentialMovingAverage", "tensorflow.global_variables_initializer", "nu...
maheshacherrypick/MLAlgorithms
[ "829c74cf7d79307fc6ca1d849e65b959fb10e5de" ]
[ "mla/metrics/tests/test_metrics.py" ]
[ "from __future__ import division\n\nimport numpy as np\nimport pytest\nfrom numpy.testing import assert_almost_equal\n\nfrom mla.metrics.base import check_data, validate_input\nfrom mla.metrics.metrics import get_metric\n\n\ndef test_data_validation():\n with pytest.raises(ValueError):\n check_data([], 1)...
[ [ "numpy.array", "numpy.log", "numpy.exp" ] ]
wikfeldt/intro-to-dl
[ "7fb1fb6c520941143000c5e1b46c48c95db17ed6" ]
[ "day2/tf2-dvc-cnn-evaluate.py" ]
[ "\n# coding: utf-8\n\n# # Dogs-vs-cats classification with CNNs\n# \n# In this notebook, we'll train a convolutional neural network (CNN,\n# ConvNet) to classify images of dogs from images of cats using\n# TensorFlow 2.0 / Keras. This notebook is largely based on the blog\n# post [Building powerful image classifica...
[ [ "tensorflow.keras.models.load_model", "tensorflow.image.resize", "tensorflow.image.random_crop", "tensorflow.image.flip_left_right", "tensorflow.keras.backend.backend", "tensorflow.io.read_file", "tensorflow.image.decode_jpeg", "tensorflow.data.Dataset.from_tensor_slices" ] ]
msohaibalam/grove
[ "8c27a5d12923d6ace57956db6a249e8d01e33f35" ]
[ "grove/tests/jordan_gradient/test_gradient_utils.py" ]
[ "import numpy as np\n\nfrom grove.alpha.jordan_gradient.gradient_utils import binary_to_real, \\\n measurements_to_bf\n\n\ndef test_binary_to_real():\n for sign in [1, -1]:\n decimal_rep = sign * 0.345703125\n binary_rep = str(sign * 0.010110001)\n\n decimal_convert = binary_to_real(binar...
[ [ "numpy.isclose" ] ]
spatialucr/lne
[ "951df7334c1495a133f6fc982eaa1d366f08a68b" ]
[ "LNCE/python/INCS.py" ]
[ "\"\"\"\nIndicators of Neighborhood Change\n\"\"\"\n\nfrom collections import defaultdict\nimport numpy as np\n\ndef _labels_to_neighborhoods(labels):\n \"\"\"Convert a list of labels to neighborhoods dictionary\n Arguments\n ---------\n labels: list of neighborhood labels\n Returns\n -------\n ...
[ [ "numpy.zeros" ] ]
justinpak13/Watch-Analysis
[ "a7ce05c4fef859d66675d801e8a05f3f7e8e8d4e" ]
[ "dashboard.py" ]
[ "import dash\nfrom dash.dependencies import Input, Output\nfrom dash import dash_table\nfrom dash import dcc\nfrom dash import html\nimport pandas as pd\n\n# Import data into pandas\ndf = pd.read_csv(\"data.csv\")\ndf[\"Condition\"] = df[\"Condition Category\"]\ndf = df.drop([\"Condition Category\", \"Missed Prices...
[ [ "pandas.read_csv" ] ]
xsir317/AlphaRenju
[ "d5fdcf8d1442e4e43661a4cee88c95d5c25fd45a" ]
[ "policy_value_net.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nAn implementation of the policyValueNet in Tensorflow\nTested in Tensorflow 1.4 and 1.5\n\n@author: Xiang Zhong\n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\n\n\nclass PolicyValueNet():\n def __init__(self, model_file=None):\n self.model_file = model_file\n ...
[ [ "tensorflow.layers.conv2d", "tensorflow.placeholder", "tensorflow.reshape", "tensorflow.global_variables_initializer", "numpy.reshape", "tensorflow.train.checkpoint_exists", "tensorflow.train.AdamOptimizer", "numpy.exp", "tensorflow.trainable_variables", "tensorflow.multipl...
lsb-riken/CUBIC-informatics
[ "e7982072bb5d892f55e86cdf671376ab379b9b29" ]
[ "script/MergeBrain.py" ]
[ "#!/usr/bin/env python\n#-*- coding:utf-8 -*-\n\n\"\"\"Overview:\n Downscale images & cells for altas mapping\n\nUsage:\n MergeBrain.py images PARAM_FILE [-p NUM_CPUS] [--exec <path>]\n MergeBrain.py cells PARAM_FILE\n MergeBrain.py full PARAM_FILE [-p NUM_CPUS] [--exec <path>]\n\nOptions:\n -h --help S...
[ [ "numpy.zeros", "numpy.dtype", "numpy.count_nonzero", "numpy.empty_like", "numpy.nonzero", "numpy.array", "numpy.random.randint", "numpy.bitwise_and" ] ]
neulab/xnmt
[ "d93f8f3710f986f36eb54e9ff3976a6b683da2a4" ]
[ "xnmt/models/retrievers.py" ]
[ "import numpy as np\n\nfrom xnmt.settings import settings\nimport xnmt\nfrom xnmt import batchers, expression_seqs\nfrom xnmt.models import base as models\nfrom xnmt.persistence import serializable_init, Serializable\n\nif xnmt.backend_dynet:\n import dynet as dy\n\n##### A class for retrieval databases\n# This fi...
[ [ "numpy.stack", "numpy.dot", "numpy.argsort" ] ]
VamshikShetty/Neural-Style
[ "44806accdfb9bb98aa15d3145563bf6759e9e604" ]
[ "Fast Style Transfer/TensorFlow/train_fast_style_transfer.py" ]
[ "\nimport tensorflow as tf\ntf.reset_default_graph() \n\n\nfrom keras.applications.vgg19 import VGG19\nimport os \n\nfrom tensorflow.python.keras.preprocessing import image as kp_image\nfrom keras.models import Model\nfrom keras.layers import Dense, BatchNormalization,Dropout,concatenate \nfrom keras import backend...
[ [ "tensorflow.placeholder", "numpy.squeeze", "tensorflow.global_variables_initializer", "tensorflow.get_collection", "tensorflow.train.AdamOptimizer", "numpy.random.seed", "scipy.misc.imresize", "numpy.asarray", "numpy.expand_dims", "tensorflow.set_random_seed", "numpy.cl...
Aarthif-Nawaz/Home3Circuit
[ "3e2d71fe7a839a7fd820d18fbef9bb31fde608e0" ]
[ "homestayAdmin/FinancialForecasting.py" ]
[ "import pickle\r\nimport warnings\r\nimport itertools\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nwarnings.filterwarnings(\"ignore\")\r\nplt.style.use('fivethirtyeight')\r\nimport pandas as pd\r\nimport statsmodels.api as sm\r\nimport matplotlib\r\nimport mysql.connector\r\nimport os\r\nimport sys\r...
[ [ "matplotlib.pyplot.style.use", "pandas.Series", "numpy.append", "sklearn.metrics.mean_squared_error", "pandas.read_csv", "pandas.plotting.autocorrelation_plot" ] ]
eherr/anim_utils
[ "2274b86ff410c8f6feb588626cbf83664382abca" ]
[ "anim_utils/motion_editing/fabrik_chain.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright 2019 DFKI GmbH.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy...
[ [ "numpy.array_equiv", "numpy.zeros", "numpy.linalg.inv", "numpy.cross", "numpy.nonzero", "numpy.array", "numpy.dot", "numpy.linalg.norm" ] ]
apayeur/GIF-Ca
[ "7ba9e715d79aa3a733f417f7dfce81842041e7ec" ]
[ "Summary_DynamicIV.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport os\n\n# List separate experiments in separate folder\n# data_folders_for_separate_experiments = ['tenth_set']\ndata_folders_for_separate_experiments = ['seventh_set', 'eighth_set', 'ninth_set', 'tenth_set']\n\n# For all experiments, extract the cell names...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "numpy.array", "numpy.loadtxt" ] ]
jkochNU/scqubits
[ "9a405759665b96284e9a449188935cd06b42d580" ]
[ "scqubits/core/zeropi.py" ]
[ "# zeropi.py\n#\n# This file is part of scqubits.\n#\n# Copyright (c) 2019, Jens Koch and Peter Groszkowski\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n####################################...
[ [ "scipy.sparse.dia_matrix", "numpy.matmul", "scipy.sparse.kron", "scipy.sparse.linalg.eigsh", "numpy.cos", "numpy.asarray", "numpy.arange", "numpy.sort", "numpy.sin", "numpy.square", "scipy.sparse.identity", "numpy.outer" ] ]
MarcinKonowalczyk/scikit-learn
[ "8b18d4cbfc3a10ce85decec292d30470c69f40d7", "8b18d4cbfc3a10ce85decec292d30470c69f40d7" ]
[ "examples/miscellaneous/plot_isotonic_regression.py", "examples/ensemble/plot_bias_variance.py" ]
[ "\"\"\"\n===================\nIsotonic Regression\n===================\n\nAn illustration of the isotonic regression on generated data (non-linear\nmonotonic trend with homoscedastic uniform noise).\n\nThe isotonic regression algorithm finds a non-decreasing approximation of a\nfunction while minimizing the mean sq...
[ [ "sklearn.utils.check_random_state", "sklearn.isotonic.IsotonicRegression", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show", "numpy.full", "matplotlib.collections.LineCollection", "numpy.linspace" ], [ "matp...
weihaoxie/FaceX-Zoo
[ "db0b087e4f4d28152e172d6c8d3767a8870733b4" ]
[ "addition_module/DSDG/DUM/utils.py" ]
[ "import os\nimport numpy as np\nimport torch\nimport shutil\nimport torchvision.transforms as transforms\nfrom torch.autograd import Variable\nimport sklearn\nfrom sklearn import metrics\nfrom sklearn.metrics import roc_curve, auc\nimport pdb\n\n\nclass AvgrageMeter(object):\n\n def __init__(self):\n self...
[ [ "torch.load", "sklearn.metrics.roc_curve", "sklearn.metrics.auc", "torch.save", "numpy.abs", "numpy.argmax" ] ]
fancyerii/voicebook
[ "def82da8577086d0361643a05fec2463006533a9" ]
[ "chapter_2_collection/diarize.py" ]
[ "'''\n================================================ \n## VOICEBOOK REPOSITORY ## \n================================================ \n\nrepository name: voicebook \nrepository version: 1.0 \nrepository link: https://github.com/jim-schwoebel/voicebook \nauthor: Jim Schwoebel \nauthor co...
[ [ "numpy.array" ] ]
yliu1229/CPCTR
[ "66fcd336ee69fd18b322853f195c5b65b4a046b7" ]
[ "CPCTrans/main.py" ]
[ "import os\nimport sys\nimport time\nimport re\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\nfrom tensorboardX import SummaryWriter\nimport matplotlib.pyplot as plt\n\nplt.switch_backend('agg')\n\nsys.path.append('../Utils')\nfrom CPCTrans.dataset_3d import *\nfrom CPCTrans.model_3d import *\nfrom Ba...
[ [ "torch.utils.data.DataLoader", "matplotlib.pyplot.switch_backend", "torch.manual_seed", "numpy.random.seed", "torch.no_grad", "torch.optim.Adam", "torch.optim.lr_scheduler.StepLR", "torch.utils.data.RandomSampler", "torch.device" ] ]
AgnesYichenFeng/Attention
[ "b70b8882871cb74f1533265fc13ccfad7bea3550" ]
[ "text_eval.py" ]
[ "import numpy as np\n\ndef ids2str(encoder, ids, num_reserved):\n if num_reserved:\n if np.any(np.where(ids==1)[0]):\n eos = np.where(ids==1)[0]\n ids = ids[:eos[0]] \n reserved_tokens = np.where(ids < num_reserved)[0]\n \n if reserved_totkens.size > 0:\n ...
[ [ "numpy.where", "numpy.split", "numpy.unioj1d" ] ]
JoshuaEbenezer/cwgan
[ "5f6a9a0bb8760bf85a9a28e25b29a149f3a4a7ca" ]
[ "util/visualizer.py" ]
[ "import numpy as np\nimport os\nimport sys\nimport ntpath\nimport time\nfrom . import util, html\nfrom subprocess import Popen, PIPE\nfrom scipy.misc import imresize\n\nif sys.version_info[0] == 2:\n VisdomExceptionBase = Exception\nelse:\n VisdomExceptionBase = ConnectionError\n\n\ndef save_images(webpage, v...
[ [ "numpy.array" ] ]
pavlin-policar/ALRA
[ "fab8d7661bf2a2179b40e68fb4f022015c700252" ]
[ "ALRA/ALRA.py" ]
[ "import logging\nimport numpy as np\nfrom fbpca import pca\nfrom scipy.stats import norm\n\nfrom .sparseutils import nonzero_mean, nonzero_std, find_zeroed_indices\n\nlog = logging.getLogger(\"ALRA\")\n\n\ndef choose_k(X, k=100, pval_thresh=1e-10, noise_start=80, n_iter=2):\n if k > min(X.shape):\n raise ...
[ [ "numpy.ma.masked_array", "numpy.argwhere", "numpy.diff", "scipy.stats.norm.pdf", "numpy.min", "numpy.isnan", "numpy.std", "numpy.mean" ] ]
ChriPo92/tensorpack
[ "45d2155850d3870bbf110c94c73508c707e1ae42" ]
[ "examples/FasterRCNN/eval.py" ]
[ "# -*- coding: utf-8 -*-\n# File: eval.py\n\nimport itertools\nimport sys\nimport os\nimport json\nimport numpy as np\nfrom collections import namedtuple\nfrom concurrent.futures import ThreadPoolExecutor\nfrom contextlib import ExitStack\nimport cv2\nimport pycocotools.mask as cocomask\nimport tqdm\nimport tensorf...
[ [ "numpy.sqrt", "tensorflow.random_normal", "numpy.array", "numpy.zeros" ] ]
netoferraz/oeuanalitico-posts
[ "fc5799a2c77de1133f4f3f6b9f048b0fb3de6ba7" ]
[ "oeuanalitico-posts/nfe/preprocessing/functions.py" ]
[ "import pandas as pd\nfrom pathlib import Path\nfrom collections import Counter\nimport datetime\nfrom collections import defaultdict\nfrom faker import Factory\nimport faker\nfrom preprocessing.nfeProvider import Invoice\nimport csv\n\n\ndef convert_to_numeric(num):\n \"\"\"\n Converte strings que representa...
[ [ "pandas.read_csv", "pandas.read_excel" ] ]
turnergarrow/galpy
[ "7132eddbf2dab491fe137790e31eacdc604b0534" ]
[ "tests/test_actionAngleTorus.py" ]
[ "from __future__ import print_function, division\nimport os\nimport sys\nimport pytest\nimport warnings\nimport numpy\nfrom galpy.util import galpyWarning\nfrom test_actionAngle import reset_warning_registry\n_TRAVIS= bool(os.getenv('TRAVIS'))\nPY2= sys.version < '3'\n# Print all galpyWarnings always for tests of w...
[ [ "numpy.fabs", "numpy.nanmax", "numpy.linalg.det", "numpy.all", "numpy.array", "numpy.dot", "numpy.linspace" ] ]
abefukasawa/datascience_course
[ "ee0a505134383034e09020d9b1de18904d9b2665" ]
[ "03-machine-learning-tabular-crossection/05 - Data_Compression/05_Data_Compression/solutions/solution_01.py" ]
[ "# performing preprocessing part \nfrom sklearn.preprocessing import StandardScaler \nsc = StandardScaler() \n \nX_train = sc.fit_transform(X_train) \nX_test = sc.transform(X_test) " ]
[ [ "sklearn.preprocessing.StandardScaler" ] ]
Rupii/Machine-Learning
[ "2b00698815efb04346d5cb980b68af76f27a5ca6" ]
[ "Regression/multiple_linear_regression.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Feb 24 23:18:54 2018\n\n@author: Rupesh\n\"\"\"\n\n\n\n# Multiple Linear Regression\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nplt.style.use(\"ggplot\")\n# loading dependies\n\ndf = pd.read_csv(\"50_Startups.c...
[ [ "matplotlib.pyplot.style.use", "pandas.read_csv", "sklearn.linear_model.LinearRegression", "sklearn.cross_validation.train_test_split", "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.OneHotEncoder" ] ]
argonde/codeSkills
[ "939feb29102a2e47a8c2c3047d3f77dd75b1465d" ]
[ "py/webScrapper/getSyntax.py" ]
[ "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# auth: Ruben López Vázquez\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom IPython.core.display import clear_output\nfrom random import randint\nimport pandas as pd\nimport csv\nimport time as t\nimport sqlite3\nimport sys\nimport os\n\n\ndef is_digit(check_inp...
[ [ "pandas.DataFrame" ] ]
byronyi/tensor2tensor
[ "b93fc036fdbacfddcadad8fb781f5b670533384e" ]
[ "tensor2tensor/trax/layers/core.py" ]
[ "# coding=utf-8\n# Copyright 2019 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...
[ [ "numpy.true_divide", "numpy.subtract", "numpy.take", "numpy.maximum", "numpy.argsort", "numpy.delete", "numpy.sqrt" ] ]
PawelRosikiewicz/SkinDiagnosticAI
[ "7cc7b7a9ccd4103095a7548e7b99de4988858356" ]
[ "src/utils/image_augmentation.py" ]
[ "# ********************************************************************************** #\n# #\n# Project: FastClassAI workbecnch # \n#...
[ [ "numpy.array", "pandas.Series", "pandas.DataFrame", "tensorflow.keras.preprocessing.image.ImageDataGenerator" ] ]
Xlinford/ContrastiveSeg
[ "79eec700d2efdaad4da8cf0c07674107e72078da" ]
[ "lib/models/backbones/resnet/wide_resnet_models.py" ]
[ "from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport math\r\nimport torch.nn as nn\r\nfrom collections import OrderedDict\r\nfrom functools import partial\r\n\r\nfrom lib.models.tools.module_helper import ModuleHelper \r\n\r\n\r\n\r\nclass...
[ [ "torch.nn.MaxPool2d", "torch.nn.Conv2d" ] ]
bbreton3/glove_tf_21
[ "16b18bdb2d41c104dcd9159c0a760336bb5fd4d1" ]
[ "tests/test_preprocessing_glove.py" ]
[ "from glove_tf_21.utils.file_utils import save_labels\n\nimport numpy as np\nimport os\n\n\ndef test_cooc_count(preprocessing_glove, ix_sequences_full, cooc_dict):\n output_cooc = dict()\n for ix_seq in ix_sequences_full:\n output_cooc = preprocessing_glove.cooc_count(output_cooc, ix_seq)\n\n assert...
[ [ "numpy.allclose", "numpy.sum" ] ]
CitizenScienceInAstronomyWorkshop/pyIBCC
[ "35215648f3361689e374780182f39182eddda64f" ]
[ "python/tests/ibcc_test.py" ]
[ "'''\nCreated on 8 Apr 2015\n\n@author: edwin\n'''\nimport unittest\nimport ibcc\nimport logging\nimport numpy as np\nfrom dynibcc import DynIBCC\nfrom ibcc_balanced import BalancedIBCC\n\ndef check_accuracy(pT, target_acc, goldfile='./data/gold_verify.csv'):\n # check values are in tolerance range\n gold = n...
[ [ "numpy.abs", "numpy.nansum", "numpy.round", "numpy.genfromtxt", "numpy.isfinite" ] ]
klarman-cell-observatory/PowerAnalysisForSpatialOmics
[ "257e5663bb5476c7d9a22230741b5507fd621352" ]
[ "scripts/random_self_pref_cluster.py" ]
[ "from glob import glob\nimport numpy as np\nimport scipy.sparse as sparse\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport operator\nfrom spatialpower.tissue_generation import assign_labels\nfrom spatialpower.tissue_generation import visualization\n\nresults_dir = './results/motif_detection/'\nadj_ma...
[ [ "numpy.array", "numpy.ones", "numpy.load" ] ]
JiachengLi1995/UCTopic
[ "3875f2afbf6b99dfce2d5b5cd930976049746d41" ]
[ "topic_modeling/utils.py" ]
[ "import json\nimport torch\nfrom tqdm import tqdm\nfrom .consts import ARGS, DEVICE, TOKENIZER\n\n\ndef read_data(path):\n\tdata = []\n\twith open(path, encoding='utf8') as f:\n\t\tfor line in f:\n\t\t\tline = json.loads(line)\n\t\t\tdata.append(line)\n\n\treturn data\n\ndef batchify(sentence_dict, phrase_list_samp...
[ [ "torch.FloatTensor", "torch.no_grad", "torch.cat" ] ]
dquigley-warwick/matador
[ "729e97efb0865c4fff50af87555730ff4b7b6d91" ]
[ "matador/hull/phase_diagram.py" ]
[ "# coding: utf-8\n# Distributed under the terms of the MIT License.\n\n\"\"\" This submodule implements the base PhaseDiagram creator that interfaces\nwith QueryConvexHull and EnsembleHull.\n\n\"\"\"\n\n\nfrom traceback import print_exc\nimport bisect\n\nimport scipy.spatial\nimport numpy as np\n\nfrom matador.util...
[ [ "numpy.vstack", "numpy.linalg.inv", "numpy.linalg.det", "numpy.argsort", "numpy.asarray", "numpy.abs", "numpy.isnan", "numpy.where", "numpy.unique" ] ]
atlas-calo-ml/GraphNets4Pions_LLNL
[ "fb25259124711526cc4110461f09db1d03a669f9" ]
[ "train_multiOut_weightedRegress.py" ]
[ "import numpy as np\nimport os\nimport sys\nimport glob\nimport uproot as ur\nimport matplotlib.pyplot as plt\nimport time\nimport seaborn as sns\nimport tensorflow as tf\nfrom graph_nets import utils_np\nfrom graph_nets import utils_tf\nfrom graph_nets.graphs import GraphsTuple\nimport sonnet as snt\nimport argpar...
[ [ "tensorflow.keras.optimizers.Adam", "numpy.savez", "tensorflow.keras.losses.MeanAbsoluteError", "tensorflow.train.latest_checkpoint", "tensorflow.GradientTape", "tensorflow.keras.losses.BinaryCrossentropy", "tensorflow.math.sigmoid", "tensorflow.convert_to_tensor", "numpy.hstac...
gabrieldesousah/awsmetric2csv
[ "adcc8f42a8c1b5eba8a1f7413c24165d2e7d65ff" ]
[ "utils.py" ]
[ "import boto3\nimport datetime\nimport numpy as np\n\ncsv_headers = {\n 'ec2': [\n 'name',\n 'instance',\n 'type',\n 'hypervisor',\n 'virtualization_type',\n 'architecture',\n 'ebs_optimized',\n 'image_id',\n 'key_name',\n 'metric',\n '...
[ [ "numpy.median", "numpy.max", "numpy.min", "numpy.array", "numpy.average" ] ]
yzygitzh/tutel
[ "ca6f018bf7afae2e37a74f17deddd0f5f91ec2b2" ]
[ "tutel/examples/helloworld.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\n# Recommend to initialize NUMA status at the most program begining (before any other imports)\nfrom tutel import system_init\nsystem_init.init_affinity_at_program_beginning()\n\nimport os\nimport time\nimport tor...
[ [ "torch.sum", "torch.get_default_dtype", "torch.load", "torch.randn", "torch.nn.functional.nll_loss", "torch.manual_seed", "torch.cuda.synchronize", "torch.set_default_dtype", "torch.nn.functional.relu", "torch.distributed.all_reduce", "torch.numel", "torch.LongTenso...
ZYZMarshall/Twitter-Emotion-Radar
[ "9d6ebf2464dfa1864268a9cdf69991e6cef542a3" ]
[ "Tweet_Streamer_Using_Tweepy/tweepy_streamer.py" ]
[ "import sys\nfrom tweepy.streaming import StreamListener\nfrom tweepy import OAuthHandler\nfrom tweepy import Stream\nimport twitter_credentials\n\n\"\"\"Tweepy module is used to stream live tweets directly from Twitter in real-time. \nThe tweets are visualized and then the TextBlob module is used to do sentiment a...
[ [ "numpy.array", "pandas.DataFrame" ] ]
hilarioushappystar/SpiderSolitaireProject
[ "4fa04d41fbdb4d916919004966594f39ec619665" ]
[ "ai_module.py" ]
[ "###########################################\n# This is the ai_module class\n# This class handles the \"clever stuff\" such as working out best move(s) to play\n###########################################\n\n# achieves 10% win rate in 50 games (more thorough testing may be warranted)\n\nimport numpy as np\nfrom n...
[ [ "numpy.random.randint", "numpy.random.seed" ] ]
jwoos/python_digitrecognizer
[ "4a06cc7b7ee32aa6c66a391cd6595a2b5fbad38b" ]
[ "tests/unit/test_pool.py" ]
[ "from unittest import TestCase, mock\n\nimport layers\n\nimport numpy as np\nimport pytest\n\n\nclass TestPoolForward(TestCase):\n def test_max(self):\n pool = layers.pool.Pool(\n size=2,\n stride=2,\n operation=np.max,\n )\n\n data = np.zeros((4, 4, 3))\n ...
[ [ "numpy.array", "numpy.zeros" ] ]
Originofamonia/differential-privacy-library
[ "a889ba0f8d19c77e2b0369451ebc392969fac685" ]
[ "diffprivlib/models/naive_bayes.py" ]
[ "# MIT License\n#\n# Copyright (C) IBM Corporation 2019\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.sum", "numpy.zeros", "numpy.in1d", "numpy.argsort", "numpy.asarray", "numpy.all", "numpy.clip", "numpy.min", "sklearn.utils.multiclass._check_partial_fit_first_call", "numpy.max", "sklearn.utils.check_X_y", "numpy.unique" ] ]
hx89/FBGEMM
[ "03a04eb7ecea8ee0afea42eaae7b2c2119a38886" ]
[ "fbgemm_gpu/bench/split_table_batched_embeddings_benchmark.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport itertools\nimport logging\nimport math\nimport random\nimport statisti...
[ [ "torch.empty", "numpy.ones", "torch.as_tensor", "torch.rand", "numpy.random.seed", "torch.cuda.synchronize", "torch.classes.fb.PrunedMapCPU", "torch.cuda.Event", "torch.cuda.is_available", "torch.cat", "torch.ops.fbgemm.pruned_array_lookup", "torch.nn.EmbeddingBag",...
Moon-sung-woo/Tacotron2_korean
[ "cb503e212b6bcae7c7b732b50887b56d11cfd543" ]
[ "train.py" ]
[ "# *****************************************************************************\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redis...
[ [ "torch.utils.data.DataLoader", "torch.distributed.all_gather", "torch.stack", "torch.empty_like", "torch.load", "torch.cuda.set_rng_state", "torch.utils.data.distributed.DistributedSampler", "torch.random.get_rng_state", "torch.cuda.get_rng_state", "torch.distributed.init_p...
palminde/P9Project
[ "5df03d18b74585ce1d9feefce8c183225dd27f68" ]
[ "Code/Nets.py" ]
[ "import tensorflow as tf\nfrom tensorflow import keras\nimport numpy as np\n\nlayers = tf.keras.layers\n\n\n# Clip model weights to a given hypercube\nclass ClipConstraint(tf.keras.constraints.Constraint):\n # set clip value when initialized\n def __init__(self, clip_value):\n self.clip_value = clip_va...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.initializers.Constant", "tensorflow.keras.layers.Reshape", "tensorflow.keras.Sequential", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dense", "tensorflow.keras.Input", ...
oke-aditya/fashion_intel
[ "8add9a94c6a7f30cc1c70a99c2e83860b2204f11" ]
[ "fashion_intel/pytorch_cnn_trainer/utils.py" ]
[ "import numpy as np\nimport torch\nimport random\nimport matplotlib.pyplot as plt\nimport os\n\n__all__ = [\n \"seed_everything\",\n \"AverageMeter\",\n \"accuracy\",\n \"EarlyStopping\",\n \"matplotlib_imshow\",\n \"print_size_of_model\",\n]\n\n\ndef seed_everything(seed):\n \"\"\"\n Makes ...
[ [ "numpy.transpose", "torch.cuda.manual_seed", "torch.manual_seed", "numpy.random.seed", "matplotlib.pyplot.imshow" ] ]
zzing0907/Tensorflow
[ "f0d66b2674fecc0f2be1423cf696a7e6e7c7a39d" ]
[ "tensorflow/python/ops/structured/structured_tensor_test.py" ]
[ "# Copyright 2019 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.ragged.ragged_factory_ops.constant", "tensorflow.python.ops.ragged.ragged_factory_ops.constant_value", "tensorflow.python.platform.googletest.main", "tensorflow.python.ops.structured.structured_tensor.StructuredTensor.from_fields", "tensorflow.python.ops.ragged.ragged_te...
krsmith/DS-Unit-3-Sprint-2-SQL-and-Databases
[ "9617528ad5fd23354623926b819f98f9a063d252" ]
[ "demo_data.py" ]
[ "import sqlite3\nimport pandas as pd\n\nconn = sqlite3.connect('demo_data.sqlite3')\ncurs = conn.cursor()\n\ncreate_demo_table = \"\"\"\nCREATE TABLE demo (\n s varchar(5),\n x int,\n y int\n );\"\"\"\n\ncurs.execute(create_demo_table)\nconn.commit()\n\ncurs.execute(\"\"\"INSERT INTO demo (\n s, x, y) V...
[ [ "pandas.read_sql_query" ] ]
fpmosley/advent-of-code
[ "507bd89795ff6a0824284c3c8d2123cf19a932a3" ]
[ "2021/day09/part01/smoke_basin.py" ]
[ "#!/usr/bin/env python\n\n'''\nAdvent of Code 2021 - Day 9: Smoke Basin (Part 1)\nhttps://adventofcode.com/2021/day/9\n'''\n\nimport numpy as np\n\n\nclass HeightMap():\n def __init__(self) -> None:\n self._grid = np.array([])\n\n def add_row(self, row):\n np_row = np.array(row)\n if self...
[ [ "numpy.array", "numpy.ndenumerate", "numpy.vstack" ] ]
Mohammed-Abbass/DeepEI
[ "6466556e529afd9ef747105c21cba51cbac890fe", "6466556e529afd9ef747105c21cba51cbac890fe" ]
[ "Retention/multi_cnn.py", "Discussion/Reply_Comments/NEIMS_A_B_comparison.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 9 09:22:42 2020\n\n@author: hcji\n\"\"\"\n\n\nimport numpy as np\nimport tensorflow.keras.backend as K\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.layers...
[ [ "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Flatten", "matplotlib.pyplot.cla", "tensorflow.keras.models.Model", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.Dense", "numpy.isnan", "numpy.lo...
matthewclso/ivy
[ "b297fd89812ec96212ef6996a82c65fe3aab9d3c" ]
[ "ivy/functional/backends/mxnet/old/general.py" ]
[ "\"\"\"\nCollection of MXNet general functions, wrapped to fit Ivy syntax and signature.\n\"\"\"\n\n# global\nimport ivy\n_round = round\nimport logging\nimport mxnet as _mx\nimport numpy as _np\nimport math as _math\nfrom numbers import Number\nfrom operator import mul as _mul\nfrom functools import reduce as _red...
[ [ "numpy.array", "numpy.dtype", "numpy.cumsum" ] ]
datacrisis/BOBBY2
[ "0c88d7906acb9d46929a6f220b857d358518edf0" ]
[ "src/data_utils.py" ]
[ "import torch, torchvision\nimport os, PIL, random, csv\nimport numpy as np\nimport xml.etree.ElementTree as ET\nfrom PIL import Image, ImageDraw\nfrom matplotlib import pyplot as plt\nfrom torch.utils.data import Dataset\nfrom torchvision import transforms\nfrom pathlib import Path\n\n\n\ndef compile_imgs(root_dir...
[ [ "torch.stack", "torch.tensor", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.array" ] ]
Jumpst3r/mine-pytorch
[ "41c68d1388664561996300a15e43e8cc4d805ded" ]
[ "mine/utils/helpers.py" ]
[ "import numpy as np\nimport torch\n\ndef batch(x, y, batch_size=1, shuffle=True):\n assert len(x) == len(\n y), \"Input and target data must contain same number of elements\"\n if isinstance(x, np.ndarray):\n x = torch.from_numpy(x).float()\n if isinstance(y, np.ndarray):\n y = torch.f...
[ [ "torch.from_numpy", "torch.randperm" ] ]
guci314/Chatbot_CN
[ "a0f7194252a189f8bc2b62fd16eb2abe432c0bf9" ]
[ "Chatbot_Model/Question_Pairs_Matching/train.py" ]
[ "import tensorflow as tf\nfrom Chatbot_Model.Question_Pairs_Matching import data_prepare\nfrom tensorflow.contrib import learn\nimport numpy as np\nfrom Chatbot_Model.Question_Pairs_Matching import esim_model\nimport Chatbot_Model.Question_Pairs_Matching.config as config\nfrom tqdm import tqdm\nfrom sklearn.metrics...
[ [ "tensorflow.contrib.learn.preprocessing.VocabularyProcessor.restore", "tensorflow.global_variables_initializer", "tensorflow.variable_scope", "tensorflow.Session", "tensorflow.train.Saver", "numpy.array", "numpy.nonzero" ] ]
ValeriaTelles/Physics-Programs
[ "9fdd1b60ad5dd9c6750855bf63c2aa89383a0b1a" ]
[ "Scalar and Vector Fields/src/divCurl.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n\n# deriv computes 1D derivative, dF/dr, using central difference method\ndef deriv(F,r):\n\t# get the length of array F (assume same length for r)\n L = F.size\n\t\n\t# create empty array to store results\n result= np.empty(L)\n\t\n\t# use central diff...
[ [ "numpy.empty", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.meshgrid", "numpy.linspace", "numpy.loadtxt" ] ]
Ascend/pytorch
[ "39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc", "39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc", "39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc" ]
[ "test/test_npu/test_network_ops/test_norm_except_dim.py", "test/test_npu/test_network_ops/test_upsample_bicubic2d_backward.py", "test/test_npu/test_conv1d.py" ]
[ "# Copyright (c) 2020, Huawei Technologies.All rights reserved.\n#\n# Licensed under the BSD 3-Clause License (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://opensource.org/licenses/BSD-3-Clause\n#\n# Unless required by...
[ [ "numpy.random.uniform", "torch.from_numpy", "torch.norm_except_dim", "numpy.random.randint" ], [ "torch.ones_like", "torch._C._nn.upsample_bicubic2d" ], [ "torch.nn.Conv1d", "torch.npu.set_device" ] ]
NeuroDataDesign/kdg
[ "510e27973779a59cc310e1eb7497bc29699f5e4e" ]
[ "benchmarks/spiral_exp.py" ]
[ "#%%\nfrom kdg.utils import generate_spirals, generate_gaussian_parity\nfrom kdg import kdf,kdn\nfrom keras import layers\nimport keras\n# %%\nnetwork = keras.Sequential()\n#network.add(layers.Dense(2, activation=\"relu\", input_shape=(2)))\nnetwork.add(layers.Dense(3, activation='relu', input_shape=(2,)))\nnetwork...
[ [ "numpy.ones", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show", "numpy.meshgrid" ] ]
ChangHoon-Sung/streamlit
[ "d153db37d97faada87bf88972886cda5a624f8c8" ]
[ "lib/tests/streamlit/help_test.py" ]
[ "# Copyright 2018-2022 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 ...
[ [ "numpy.arange" ] ]
RobbiePerrone320/onnx-mlir
[ "2127e9177f4cbc28b7e860b0876af936ddae80bc" ]
[ "utils/gen_onnx_mlir.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom collections import defaultdict, OrderedDict\nfrom io import StringIO\nimport io\nimport os\nimport sys\nimport datetime\nimport argp...
[ [ "numpy.round" ] ]
YLFF/2004P_Pytorch-Networks
[ "2d84fe1d904b17d0c55aa2a7a7dba82dea3dae05" ]
[ "3DCNN.py" ]
[ "# --------------------------------------------------------------------------- #\n# ResNet, CVPR2016 bestpaper, https://arxiv.org/abs/1512.03385\n# pytorch implementation by Haiyang Liu (haiyangliu1997@gmail.com)\n# --------------------------------------------------------------------------- #\n\n\nimport torch\nimp...
[ [ "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d", "torch.ones", "torch.nn.MaxPool3d", "torch.nn.Linear", "torch.nn.Flatten", "torch.cuda.memory_cached", "torch.nn.init.kaiming_normal_", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.pad", "torch.nn.init.constant_", ...
ravinsinghd/opencv-basic
[ "b3b59b8808c739bc403b2ef7b499b03225bfab5f" ]
[ "draw.py" ]
[ "import numpy as np\nimport cv2\nimg=np.zeros((512,512,3),np.uint8)\ncv2.line(img,(0,0),(511,511),(255,0,0),5)\ncv2.rectangle(img,(384,0),(510,218),(0,255,0),3)\ncv2.circle(img,(447,63),63,(0,0,255),9)\ncv2.ellipse(img,(256,256),(100,50),0,0,180,255,-1)\npts = np.array([[10,5],[20,30],[70,20],[50,10]], np.int32)\np...
[ [ "numpy.array", "numpy.zeros" ] ]
w-kq/hhhh777
[ "1be3a333128edf7ab50ef2dc3b281d6f561d9fc0" ]
[ "SLME.py" ]
[ "from numpy import *\r\nimport matplotlib.pyplot as plt\r\nfrom io import BytesIO\r\n\r\ndata_am15 = open(\"AM15G.dat\",'r', encoding='utf-8') # solar spectrum\r\ndata_alpha = open(\"absorption.dat\", 'r',encoding='utf-8') #光吸收系数\r\nEg = 1.40 #带隙,单位eV\r\nL = 3 ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot" ] ]
WeiCheng302/image-segmentation-keras
[ "b34aef73f1a350cc0b4034eeb2dedd61642b9ccb" ]
[ "keras_segmentation/pretrained.py" ]
[ "import keras\nimport tensorflow as tf\nfrom .models.all_models import model_from_name\n\n\ndef model_from_checkpoint_path(model_config, latest_weights):\n\n model = model_from_name[model_config['model_class']](\n model_config['n_classes'], input_height=model_config['input_height'],\n input_width=m...
[ [ "tensorflow.keras.utils.get_file" ] ]