repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
nolanliou/spark
[ "20750a3f9e13a2f02860859f87bbc38a18cba85e" ]
[ "python/pyspark/pandas/tests/test_typedef.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.BooleanDtype", "pandas.StringDtype", "pandas.Float32Dtype", "pandas.DataFrame", "pandas.Categorical", "pandas.api.types.CategoricalDtype", "pandas.Int16Dtype", "pandas.Int64Dtype", "pandas.Float64Dtype", "pandas.Int32Dtype", "numpy.dtype", "pandas.Int8Dtype"...
warwick-machine-learning-group/pywmlg
[ "03fb908d1622cef556406f88e9d29f43f91c2e9e" ]
[ "pywmlg/preprocessing.py" ]
[ "\"\"\"Functions for preprocessing datasets\"\"\"\n\nimport numpy as np\nimport numpy.typing as npt\n\n\ndef remove_rows_with_nans(data: npt.NDArray) -> npt.ArrayLike:\n \"\"\"Remove NaNs\"\"\"\n return data[~np.isnan(data).any(axis=1)]\n" ]
[ [ "numpy.isnan" ] ]
elmirador/LearningBasedSamplingMatting
[ "b846eda767e7cbb5f157ca79da43fe89db62e99d" ]
[ "models/resnet_models.py" ]
[ "import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nfrom .aspp import ASPP\n\naffine_par = True\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"3x3 convolution with padding\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)\n\nclass BasicBl...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
Jammy2211/PyAutoGalaxy
[ "d64f4fd56d3b7cd10b6fd6219015047465ab1dfa" ]
[ "test_autogalaxy/plane/test_plane.py" ]
[ "import numpy as np\r\nimport pytest\r\nfrom skimage import measure\r\n\r\nimport autogalaxy as ag\r\n\r\nfrom autoarray.inversion.pixelizations.abstract import AbstractPixelization\r\nfrom autoarray.inversion.regularization.abstract import AbstractRegularization\r\n\r\nfrom autoarray.mock.mock import MockPixelizat...
[ [ "numpy.array", "numpy.stack", "numpy.arange", "numpy.zeros" ] ]
vishalbelsare/mulearn
[ "9a794abe8788b17993cfd58a17ca44f5de6984cf" ]
[ "mulearn/distributions.py" ]
[ "\n\"\"\"Mulearn distributions.\n\nThis module implements the kernel and fuzzifier distributions used in\nrandomized model selection.\n\"\"\"\n\nfrom scipy.stats import uniform\nfrom scipy.stats import rv_continuous\n\nfrom mulearn.kernel import GaussianKernel\nfrom mulearn.fuzzifier import ExponentialFuzzifier\n\n...
[ [ "scipy.stats.uniform" ] ]
LukaszMalucha/Ireland-Geocoder
[ "6b8a2b1ffb13f36cfc213281eb9b318b0bce00b3" ]
[ "data_prep/Datasets/address_cleaner.py" ]
[ "# -*- coding: utf-8 -*-\n\n\nimport pandas as pd\n\n\n#### Uploading dataset\ndataset = pd.read_csv(\"addresses_for_task.csv\")\n\n\n### Separating parts of the address going backwards\n\n\n######################################################################## COUNTY #############################################...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
jmilleralpine/hadrian
[ "6a438e0370487bbbac5e64a4d6d7a2728902d153" ]
[ "titus/test/prettypfa/testClustering.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (C) 2014 Open Data (\"Open Data\" refers to\n# one or more of the following companies: Open Data Partners LLC,\n# Open Data Research LLC, or Open Data Capital LLC.)\n# \n# This file is part of Hadrian.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you...
[ [ "numpy.percentile", "numpy.array", "numpy.seterr", "numpy.empty_like" ] ]
lukeandshuo/IR2CVI_journal
[ "3a7c0a469269535cd7050d5461759f9f8b538697" ]
[ "models/networks.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.autograd import Variable\nfrom torch.optim import lr_scheduler\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom util.visualizer import util\nimport cv2\n###########################################################...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.nn.init.constant", "torch.nn.LeakyReLU", "torch.nn.init.kaiming_normal", "torch.cuda.is_available", "torch.nn.parallel.data_parallel", "torch.autograd.Variable", "torch.nn.ConvTranspose2d", "torch.nn.ReflectionPad2d", "torch.nn.BCEL...
DZ9/tianshou
[ "4f843d3f51789f488169131a5b5decba8bab2b31" ]
[ "tianshou/policy/a2c.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nfrom tianshou.data import Batch\nfrom tianshou.policy import PGPolicy\n\n\nclass A2CPolicy(PGPolicy):\n \"\"\"docstring for A2CPolicy\"\"\"\n\n def __init__(self, actor, critic, optim,\n dist_fn=torch.distributions.Categor...
[ [ "torch.nn.functional.mse_loss", "torch.tensor" ] ]
quanganh1999/speech_processing_course
[ "26d7bf9adfa67c661256b73465e337ca9769b66b" ]
[ "homework2/test_mic.py" ]
[ "import sounddevice as sd\nimport soundfile as sf\nfrom pydub.playback import play\nimport os\nfrom pydub import AudioSegment, silence\nimport keyboard # using module keyboard\nimport joblib\nimport hmmlearn.hmm as hmm\nfrom sklearn.cluster import KMeans\nimport librosa\nimport math\nimport numpy as np\nimport tim...
[ [ "numpy.concatenate", "numpy.mean" ] ]
dongzizhu/GraphGallery
[ "c65eab42daeb52de5019609fe7b368e30863b4ae", "c65eab42daeb52de5019609fe7b368e30863b4ae" ]
[ "graphgallery/functional/network/transform.py", "graphgallery/gallery/nodeclas/dgl/mixhop.py" ]
[ "import numpy as np\r\nimport networkx as nx\r\nimport scipy.sparse as sp\r\nfrom .property import is_directed, is_weighted\r\nfrom ..decorators import multiple\r\n\r\n__all__ = [\"from_networkx\", \"to_networkx\", \"to_directed\",\r\n \"to_undirected\", \"to_unweighted\"]\r\n\r\n\r\n@multiple()\r\ndef fr...
[ [ "numpy.ones_like", "scipy.sparse.triu" ], [ "torch.optim.lr_scheduler.StepLR" ] ]
Hoseung/pyRamAn
[ "f9386fa5a9f045f98590039988d3cd50bc488dc2" ]
[ "scripts/Rotation/lambda_mp_GM.py" ]
[ "\"\"\"\n MODIFICATIONS\n \n 2015.12.03 \n final_gal is removed as non-main-progenitors are also analized,\n there is no 1:1 correlation between final galaxies and earlier galaxies.\n \n 2015.12.21\n Galaxies are saved in HDF format at selected nouts.\n (for example, ...
[ [ "matplotlib.use", "numpy.concatenate", "numpy.array", "numpy.square", "numpy.empty", "numpy.zeros", "pandas.DataFrame", "matplotlib.pyplot.close", "numpy.linspace", "numpy.diff", "numpy.where", "numpy.sort", "numpy.argsort", "numpy.sqrt", "numpy.log10", ...
dinalzein/alphacsc
[ "dab672c4da54ed1b89f2364f552cf9b0707fcaeb" ]
[ "alphacsc/tests/test_update_z_multi.py" ]
[ "import pytest\nimport numpy as np\n\nfrom alphacsc.update_z_multi import update_z_multi\nfrom alphacsc.update_z_multi import compute_DtD, _coordinate_descent_idx\nfrom alphacsc.loss_and_gradient import compute_X_and_objective_multi\nfrom alphacsc.utils import construct_X_multi\n\nfrom alphacsc.utils.compute_consta...
[ [ "matplotlib.pyplot.plot", "numpy.isclose", "matplotlib.pyplot.show", "numpy.random.RandomState" ] ]
TihonkovSergey/pd-model-logreg
[ "baa6447198f5f89a43b1091413d3199192230ce1" ]
[ "tests/test_validate_logreg.py" ]
[ "import pytest\nimport numpy as np\nfrom sklearn.datasets import make_regression\nfrom sklearn.model_selection import train_test_split\n\nfrom src.models.parameter_selection import validate_logreg\n\n\nclass TestThreshold:\n @pytest.mark.parametrize(\"seed\",\n [np.random.randint(0, 1...
[ [ "sklearn.model_selection.train_test_split", "numpy.mean", "numpy.random.randint", "sklearn.datasets.make_regression" ] ]
1079931505/ME336-Yellow-Team-SUSTech
[ "f4e5391d7be3f7983692457d30c2bdc697dcb76d" ]
[ "deepclaw/modules/end2end/yolov5/train.py" ]
[ "import argparse\nimport math\nimport os\nimport random\nimport time\nimport logging\nfrom pathlib import Path\n\nimport numpy as np\nimport torch.distributed as dist\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nimport torch.utils.data\nimport yaml\...
[ [ "numpy.concatenate", "numpy.array", "torch.cuda.amp.autocast", "numpy.zeros", "torch.distributed.destroy_process_group", "torch.distributed.init_process_group", "torch.nn.functional.interpolate", "torch.optim.SGD", "torch.optim.Adam", "torch.nn.parallel.DistributedDataParal...
kadc87/ga-learner-dsmp-repo
[ "d943fcca546a0463744fe8d076aec9c5e5d408c4", "d943fcca546a0463744fe8d076aec9c5e5d408c4" ]
[ "Moving-to-Melbourne---Housing-Again!-/code.py", "Banking-Inferences/code.py" ]
[ "# --------------\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# path- variable storing file path\r\n\r\n#Code starts here\r\n\r\ndf = pd.read_csv(path)\r\n\r\ndf.head(5)\r\n\r\nX = df.loc[:, df.columns != 'Price']\r\n\r\ny = df.loc[:, 'Price']\r\n\r\nX_t...
[ [ "sklearn.linear_model.Lasso", "sklearn.linear_model.LinearRegression", "sklearn.metrics.r2_score", "sklearn.preprocessing.PolynomialFeatures", "sklearn.linear_model.Ridge", "numpy.mean", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.model_selection.cro...
jaysarva/Automatic-License-Plate-Search
[ "ccf008a06a7c89e53017079e5f60bba2f336a004" ]
[ "digit_classification.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import Sequential\nfrom tensorflow.keras.layers import Dense, Conv2D, Conv2DTranspose, Reshape, LeakyReLU, BatchNormalization\nfrom tensorflow.math import log\n\n## generator\nclass DigitClassifier(tf.keras.Model):\n def __init__(self):\n ...
[ [ "tensorflow.concat", "tensorflow.ones_like", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.optimizers.Adam", "te...
wangheda/ImageCaption-UnderFitting
[ "ca98807d3a35a40a35446678d7e7b43242767a63" ]
[ "im2txt/test_inference_in_graph_model.py" ]
[ "# Copyright 2016 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.gfile.IsDirectory", "tensorflow.logging.set_verbosity", "tensorflow.flags.DEFINE_string", "tensorflow.train.latest_checkpoint", "tensorflow.gfile.Glob", "tensorflow.Graph", "tensorflow.train.Saver", "tensorflow.logging.info", "tensorflow.gfile.GFile", "tensorflo...
chengenbao/euler
[ "c45225119c5b991ca953174f06c2f223562f34c9" ]
[ "tf_euler/python/aggregators.py" ]
[ "# Copyright 2018 Alibaba Group Holding Limited. 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# Unle...
[ [ "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.reduce_max", "tensorflow.add", "tensorflow.reduce_mean" ] ]
Jiung-Wen/q2-gcn-norm
[ "90a756c98a0fb5defd06afb2d7bbbd95de9df5c4" ]
[ "q2_gcn_norm/tests/test_gcn_norm.py" ]
[ "import unittest\nimport pandas.util.testing as pdt\nimport pandas as pd\n\nfrom qiime2 import Artifact\nfrom qiime2.plugin.testing import TestPluginBase\nfrom qiime2.plugins import gcn_norm\n\n\nclass GcnNormTests(TestPluginBase):\n package = 'q2_gcn_norm.tests'\n\n def test_gcn_norm_silva(self):\n fe...
[ [ "pandas.DataFrame", "pandas.util.testing.assert_frame_equal" ] ]
icaros-usc/dqd-rl
[ "83e3da62df37b45c4b8fc549c07f566797b5f685" ]
[ "src/emitters/gradient_improvement_emitter.py" ]
[ "\"\"\"Provides the GradientImprovementEmitter used in CMA-MEGA and its variants.\"\"\"\nimport itertools\nimport logging\n\nimport gin\nimport numpy as np\nfrom ribs.archives import AddStatus\nfrom ribs.emitters import EmitterBase\n\nfrom src.emitters.opt.cma_es import CMAEvolutionStrategy\nfrom src.emitters.opt.g...
[ [ "numpy.concatenate", "numpy.full", "numpy.array", "numpy.linalg.norm", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.log", "numpy.max", "numpy.sum", "numpy.random.default_rng", "numpy.min", "numpy.multiply", "numpy.arange", "numpy.argsort", "...
HannaRiver/ocr-psenet
[ "1a862e4b3b1be51fb64f42719060e510ae6aaa3a" ]
[ "test_ocr_general_text_det_1.py" ]
[ "\r\n#coding:utf-8\r\nimport os\r\nimport cv2\r\nimport sys\r\nimport time\r\nimport collections\r\nimport torch\r\nimport torchvision\r\nimport argparse\r\nimport numpy as np\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom torch.autograd import Variable\r\nfrom torch.utils import data\r\n\r...
[ [ "numpy.concatenate", "torch.sigmoid", "numpy.max", "numpy.empty", "torch.cuda.synchronize", "numpy.zeros", "numpy.mean", "torch.sign", "numpy.where", "torch.utils.data.DataLoader", "torch.load", "numpy.int0" ] ]
Lossfull/2019_IT
[ "14c6129ba010aea5e6ab6c8057424e80e1fc4537" ]
[ "solution2.py" ]
[ "import matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport math\r\n\r\n\r\ndef add_noise(img, rate=5):\r\n img[::rate, ::rate, :] = 1\r\n return\r\n\r\ndef gauss(x,y,sigm):\r\n return math.exp(-(x**2+y**2)/(2*sigm**2))/(2*math.pi*sigm**2)\r\n\r\ndef get_kernel(windos_size):\r\n sigm=1\r\n kerne...
[ [ "numpy.zeros_like", "numpy.zeros", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.imread" ] ]
JiangZehua/control-pcgrl
[ "e4fd1bf9670e5855f04941ebca34170517c451b4" ]
[ "gym_pcgrl/envs/reps/turtle_rep.py" ]
[ "from gym_pcgrl.envs.reps.representation import Representation\nfrom PIL import Image\nfrom gym import spaces\nimport numpy as np\nfrom collections import OrderedDict\n\n\"\"\"\nThe turtle representation where the agent is trying to modify the position of the\nturtle or the tile value of its current location simila...
[ [ "numpy.array" ] ]
KwiatQIM/Quantum-Tomography
[ "e10d03b9dc5c8c1bb61a081db1aef70a4b2bb6ca", "e10d03b9dc5c8c1bb61a081db1aef70a4b2bb6ca" ]
[ "Plots/purity_of_rand_density.py", "src/QuantumTomography/cli.py" ]
[ "import QuantumTomography as qLib\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nnumSamples = 100000\nnumBins = 40\n\n\n\npurities1 = np.zeros(numSamples)\npurities2 = np.zeros(numSamples)\nfor i in range(numSamples):\n state1 = qLib.random_density_state(1)\n purities1[i] = qLib.purity(state1)\n ...
[ [ "numpy.zeros_like", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.hist", "matplotlib.pyplot.subplots_adjust" ], [ "matplotlib.pyplot.show" ] ]
matherm/python-data-science
[ "bdb49b18c5ef6044f8a9e6f95c81d5f7bb1d511f" ]
[ "novelty-detection/train_mnist.py" ]
[ "import argparse\nimport sys\nimport torch\nimport numpy as np\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets import MNIST\nfrom torchvision.datasets import CIFAR10\nimport torchvision.transforms as transforms\nparser = argparse.ArgumentParser(description='PyTorch Novelty...
[ [ "torch.manual_seed", "torch.cat", "numpy.asarray", "numpy.vstack" ] ]
wjlei1990/nnodes
[ "f305ca59b914427693f4a0420c1656cf2da3f0c6" ]
[ "examples/gaussian/functions/model.py" ]
[ "import os\nimport numpy as np\n\n\ndef write_model(m, outdir, it, ls=None):\n \"\"\"Takes in model vector, modldirectory, iteration and linesearch number\n and write model to modl directory.\n\n Parameters\n ----------\n m : ndarray\n modelvector\n modldir : str\n model directory\n ...
[ [ "numpy.load", "numpy.save" ] ]
Bobobert/aflow
[ "7d28e362f757397c0c5303bc495b10ed597e03d5" ]
[ "flow/envs/base.py" ]
[ "\"\"\"Base environment class. This is the parent of all other environments.\"\"\"\n\nfrom abc import ABCMeta, abstractmethod\nfrom copy import deepcopy\nimport os\nimport atexit\nimport time\nimport traceback\nimport numpy as np\nimport random\nimport shutil\nimport subprocess\nfrom flow.renderer.pyglet_renderer i...
[ [ "numpy.copy", "numpy.asarray", "numpy.clip" ] ]
rameshbalan/pythoncourse.github.io
[ "1def1b85ddff7f0f09a3efdb919135c5686658d7" ]
[ "Day4/z-score-for-fun/z-score.py" ]
[ "#!/usr/bin/python\n\n# Importing pandas library\nimport pandas as pd\n\n# Getting the file from the user\nfile = input(\"Enter your csv file name:\\n\")\n\n# Reading the file from the user and saving it as data frame in 'df'\ndf = pd.read_csv(file)\n\n# Getiing the list of columns form the data frame\ncols = list(...
[ [ "pandas.read_csv" ] ]
piamarlene/flair
[ "4f72d538fa49649aac88c7b5130250180ba64e43" ]
[ "flair/data.py" ]
[ "import logging\nimport re\nimport typing\nfrom abc import ABC, abstractmethod\nfrom collections import Counter, defaultdict\nfrom functools import lru_cache\nfrom operator import itemgetter\nfrom pathlib import Path\nfrom typing import Callable, Dict, List, Optional, Union, cast\n\nimport torch\nfrom deprecated im...
[ [ "torch.cat", "torch.utils.data.dataset.ConcatDataset", "torch.tensor", "torch.utils.data.dataset.Subset", "torch.empty" ] ]
napoler/pytorch-loss
[ "36a599d868844491633f3e0091f73759922a4557" ]
[ "tkitLoss/mish.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\n\nimport torch\nimport torch.cuda.amp as amp\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n##\n# version 1: use pytorch autograd\nclass MishV1(nn.Module):\n\n def __init__(self):\n super(MishV1, self).__init__()\n\n def forward(self, feat)...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.functional.softplus", "torch.nn.BatchNorm2d", "torch.abs", "torch.randn", "torch.nn.Conv2d", "torch.randint", "torch.mean", "torch.nn.CrossEntropyLoss", "torch.pow" ] ]
arghosh/noisy_label_pretrain
[ "5731ea2f3bf99391d68b5eb2f488897ce3b2fdfb" ]
[ "utils/logger.py" ]
[ "import os\nimport sys\nimport random\nimport numpy as np\n\nfrom collections import OrderedDict\nfrom tabulate import tabulate\nfrom pandas import DataFrame\nfrom time import gmtime, strftime\nimport time\n\n\nclass Logger:\n def __init__(self, name='name', fmt=None, base='./logs'):\n self.handler = True...
[ [ "numpy.max", "pandas.DataFrame" ] ]
pengsongyou/idr
[ "b496ea43b6a45e2a29408c89ec4cb63c0a379efa" ]
[ "code/training/idr_train.py" ]
[ "import os\nfrom datetime import datetime\nfrom pyhocon import ConfigFactory\nimport sys\nimport torch\n\nimport utils.general as utils\nimport utils.plots as plt\nfrom ipdb import set_trace as st\n\nclass IDRTrainRunner():\n def __init__(self,**kwargs):\n torch.set_default_dtype(torch.float32)\n t...
[ [ "torch.optim.lr_scheduler.MultiStepLR", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.set_default_dtype", "torch.nn.Embedding", "torch.set_num_threads" ] ]
xptree/coref
[ "2249165a92a5c28e8f2385090d39dc0b0c5f3084" ]
[ "bert/modeling_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.constant", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.test.main" ] ]
AjinkyaIndulkar/lightning-flash
[ "e65020c7e5bd779d477a198865b0a84ac4f39720" ]
[ "tests/core/data/utilities/test_classification.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.is_tensor", "numpy.array", "torch.tensor", "numpy.repeat" ] ]
lisa-wilkinson/threezerozeroeight
[ "b5de230c9a5a3c78e5f52ef6dc9dbed861a0c8cd" ]
[ "main.py" ]
[ "#! /usr/bin/env python3\n\nimport numpy as np\nimport h5py\nimport note_decompose as nde\nimport note_recompose as nre\nimport noisegate as ngate\nimport note_utils as note\nimport sys\nimport math_fun\n\ndef main():\n\t\n\tprint(\"decomposing\")\n\tnde_class = nde.decompose('test.wav')\n\tnde_class.octaves = (2,1...
[ [ "numpy.copy" ] ]
BioinfoTongLI/imagepy
[ "b86f33f20e872ee8b86471a9ddfbd5ad064fd64d" ]
[ "imagepy/menus/Kit3D/Binary 3D/binary3d_plgs.py" ]
[ "# -*- coding: utf-8 -*\nimport scipy.ndimage as ndimg\nfrom imagepy.core.engine import Simple\nfrom skimage.morphology import skeletonize_3d\nfrom imagepy.ipyalg import find_maximum, watershed\nfrom skimage.filters import apply_hysteresis_threshold\nfrom imagepy.ipyalg import distance_transform_edt\nimport numpy a...
[ [ "scipy.ndimage.binary_closing", "scipy.ndimage.binary_erosion", "numpy.zeros", "numpy.ones", "scipy.ndimage.binary_opening", "scipy.ndimage.binary_dilation", "scipy.ndimage.binary_fill_holes", "numpy.clip" ] ]
AndreAngelucci/analises
[ "86c86f536aab30ea8d4517530b1ac229252bc9b0" ]
[ "scripts/contracheque_to_csv.py" ]
[ "import argparse\nimport sys\nfrom pathlib import Path\n\nimport pandas as pd\nfrom scripts.parsers import currency_to_float\nfrom unidecode import unidecode\n\n\n\"\"\"\nOs arquivos precisam ser salvos no formato `ano_mes_entidade.xls`.\nExemplo: `2020_04_prefeitura.xls`\n\nO script funciona em arquivos `.xls` ond...
[ [ "pandas.read_excel", "pandas.concat" ] ]
athn-nik/cognitive_nlp
[ "289619ce3746df47d4ff65165add847f43a6ac60" ]
[ "mapping.py" ]
[ "'''\nWe have\nX source space\nY target space\nWe want the \"mapping\" matrix\n'''\n\nfrom numpy.linalg import svd\nimport numpy as np\n\nh = np.matmul(x, y.T, out=None)\n\nU,S,V = svd(h, full_matrices=True, compute_uv=True)\n#U,_,V=svd(X*Y')\n\nS = np.eye(U.shape[1], V.shape[0]) * S\n#U*V'\ntr_m = np.matmul(U, V.T...
[ [ "numpy.matmul", "numpy.linalg.svd", "numpy.eye" ] ]
Tiamat-Tech/SkinDeep
[ "e407fa11978f4cf5d96caaaa279ee51612171792" ]
[ "app.py" ]
[ "import streamlit as st\nimport fastai\nfrom fastai.vision import *\nfrom fastai.utils.mem import *\nfrom fastai.vision import open_image, load_learner, image, torch\nimport numpy as np4\nimport urllib.request\nimport PIL.Image\nfrom io import BytesIO\nimport torchvision.transforms as T\nfrom PIL import Image\nimpo...
[ [ "numpy.array" ] ]
marinegor/reciprocalspaceship
[ "6a5ef478cea85183d178c35963016bdbe2c582bf" ]
[ "reciprocalspaceship/utils/cell.py" ]
[ "import numpy as np\n\ndef compute_dHKL(H, cell):\n \"\"\"\n Compute the real space lattice plane spacing, d, associated with\n miller indices and cell. \n\n Parameters\n ----------\n H : array\n An nx3 array of numerical miller indices. \n cell : gemmi.UnitCell\n The gemmi UnitCe...
[ [ "numpy.array", "numpy.linalg.inv", "numpy.unique" ] ]
MaestroGraph/quicksort
[ "54e1aba3b8a1acf3cd5326f5efab2b0a853f4b40" ]
[ "tests/test_util.py" ]
[ "import _context\n\nimport unittest\nimport torch, sys\n#import sparse.layers.densities\n\nimport util\n\nclass TestLayers(unittest.TestCase):\n\n def test_unique(self):\n r = util.unique(torch.tensor( [[1,2,3,4],[4,3,2,1],[1,2,3,4]] ))\n\n self.assertEqual((3, 1), r.size())\n self.assertEqu...
[ [ "torch.tensor" ] ]
kevinchoy/oct-schlemm-seg
[ "e8b78695521dc65a7bbd1bcdb65b0a6200af25b3" ]
[ "metrics.py" ]
[ "import csv\nimport glob\nimport os\nfrom pathlib import Path\n\n\"\"\"Code for \"K. C. Choy, G. Li, W. D. Stamer, S. Farsiu, Open-source deep learning-based automatic segmentation of\nmouse Schlemm’s canal in optical coherence tomography images. Experimental Eye Research, 108844 (2021).\"\nLink: https://www.scienc...
[ [ "torch.sum" ] ]
studytutorials/transformers
[ "08a5f57567d8a975d900b66658bfd3c28c9dbec5" ]
[ "examples/pytorch/speech-recognition/run_speech_recognition_ctc.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache....
[ [ "numpy.argmax" ] ]
brinkar/distributed
[ "4b881ee011e1e16dd1a64e197a38e5a09106a8e9" ]
[ "distributed/protocol/numpy.py" ]
[ "from __future__ import print_function, division, absolute_import\n\nimport sys\n\nimport numpy as np\nfrom numpy.lib import stride_tricks\n\ntry:\n import blosc\n n = blosc.set_nthreads(2)\nexcept ImportError:\n blosc = False\n\nfrom .compression import byte_sample\nfrom .utils import frame_split_size\nfr...
[ [ "numpy.lib.stride_tricks.as_strided", "numpy.ascontiguousarray", "numpy.isfortran", "numpy.ndarray", "numpy.prod" ] ]
HashSplat/np_rw_buffer
[ "95f936ebfc21c659983dbb387564ce3bb0a74028" ]
[ "np_rw_buffer/circular_indexes.py" ]
[ "\"\"\"\nFast method to get the proper indexes for a circular buffer.\n\nSee history of version control. Python C tuple '_circular_indexes.c' building a tuple was much slower.\n\"\"\"\nimport numpy as np\n\n\n__all__ = ['get_indexes']\n\n\ndef get_indexes(start, length, maxsize):\n \"\"\"Return the indexes from ...
[ [ "numpy.arange" ] ]
sangharshbyss/online_FIRs
[ "564eeccf045f0a7462e859221c7b2d93b7331c89" ]
[ "district_FIRs.py" ]
[ "\"\"\"This file is not fully ready, coz, selection act is not going well.\"\"\"\nimport base64\nfrom typing import List\nfrom selenium import webdriver\nfrom selenium.webdriver.support.expected_conditions import staleness_of\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support....
[ [ "pandas.DataFrame", "pandas.concat" ] ]
newcodevelop/DL-Adventures
[ "76d4fcaf7c7b53cb1a2241a03d6d32bcd4406e92" ]
[ "mnist_autograd.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"mnist_autograd.ipynb\n\nAutomatically generated by Colaboratory.\n\n\n\"\"\"\n\nclass Value:\n \"\"\" stores a value and its gradient \"\"\"\n\n def __init__(self, data, _children=(), _op=''):\n self.data = data\n self.grad = 0\n # internal variables used f...
[ [ "numpy.array", "numpy.dot", "numpy.matmul", "numpy.asarray", "numpy.log", "numpy.reshape", "numpy.sum", "numpy.random.permutation", "numpy.random.randn", "numpy.tile", "numpy.exp", "numpy.where", "numpy.argmax" ] ]
xiaogangw/VE-PCN
[ "f47e9528bac9bfb2db090616c863d2d190bd67c9" ]
[ "test_edge.py" ]
[ "import argparse\nimport os\nimport random\nimport numpy as np\nimport torch\nimport shapenet_edge as shapenet_dataset\nimport model_edge as models\nimport util_edge as util\nimport ops\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--remove_point_num', type=int, default=512)\nparser.add_argument('--ca...
[ [ "torch.sqrt", "numpy.random.seed", "torch.no_grad", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.mean", "torch.nn.DataParallel", "torch.sum" ] ]
gaabrielfranco/ia-moba-tcc
[ "3f4b4e5be3e09619d1e893ee9234c835f21ecb83" ]
[ "pipeline/metric_startplot.py" ]
[ "from joblib import load\nimport pandas as pd\nfrom modules.plots import radarplot\n\n\ndef main():\n df = pd.read_csv(\"create_database/df_database_all.csv\", index_col=0)\n folder = \"all\"\n\n clf = load(\"kmeans.joblib\")\n\n df_centroids = pd.DataFrame(clf.cluster_centers_, columns=df.columns)\n\n ...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
duburcqa/tianshou
[ "26fb87433de0d2604078ecbc99502efe0a815d5d" ]
[ "examples/atari.py" ]
[ "import cv2\nimport gym\nimport numpy as np\nfrom gym.spaces.box import Box\nfrom tianshou.data import Batch\n\nSIZE = 84\nFRAME = 4\n\n\ndef create_atari_environment(name=None, sticky_actions=True,\n max_episode_steps=2000):\n game_version = 'v0' if sticky_actions else 'v4'\n name...
[ [ "numpy.array", "numpy.empty", "numpy.reshape", "numpy.moveaxis", "numpy.asanyarray", "numpy.maximum" ] ]
amsabour/GRAN
[ "75169775c1ce76dc171e7f4403d2ede280b34d10" ]
[ "custom_dataset_generators/generators.py" ]
[ "import os\nimport numpy as np\nimport networkx as nx\nfrom tqdm import tqdm\n\n\ndef generate_dataset(generators, size, name):\n assert type(generators) == list\n\n all_node_labels = []\n all_edges = []\n all_graph_indicators = []\n all_graph_labels = []\n\n counter = 0\n num_nodes = 0\n fo...
[ [ "numpy.array", "numpy.random.uniform", "numpy.savetxt" ] ]
waealobidallah/Machine-Learning-and-AI-Foundations
[ "d30fbaa8bc08b24ab5a27af62bc25af059c486e1" ]
[ "Chapter 5/train_model pt4 final.py" ]
[ "import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import ensemble\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.externals import joblib\n\n# Load the data set\ndf = pd.read_csv(\"ml_house_data_set.csv\")\n\n# Remove the fields from the data set that we don't w...
[ [ "sklearn.ensemble.GradientBoostingRegressor", "sklearn.externals.joblib.dump", "sklearn.model_selection.train_test_split", "pandas.read_csv", "pandas.get_dummies" ] ]
Samguyette/CryptoTwitterBot
[ "60d95421816e93e351ca05a658acbf574202143a" ]
[ "tweepy_streamer.py" ]
[ "from tweepy import API\nfrom tweepy import Cursor\nfrom tweepy.streaming import StreamListener\nfrom tweepy import OAuthHandler\nfrom tweepy import Stream\n\nimport twitter_credentials\n\nfrom collections import Counter\nfrom itertools import repeat, chain\n\nimport re\nimport sys\n\nimport pandas as pd\nimport nu...
[ [ "pandas.DataFrame", "numpy.array" ] ]
jamesrobertlloyd/python-ardrone
[ "c323867b31e2ab43f776d221df8bf96587a075e2" ]
[ "libardrone/h264decoder.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2013 Adrian Taylor\n# Inspired by equivalent node.js code by Felix Geisendörfer\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without r...
[ [ "numpy.frombuffer" ] ]
Hemanthhh/aipnd-project
[ "193a1dedbc392a73ef484ed6c8df2ea16f3944fa" ]
[ "train.py" ]
[ "# Filename : train.py\n# Author : Rahul Mannepally\n# Course : Udacity - The AI Programming with Python Nanodegree\n# Date : 15-09-2018\n\n#!/usr/bin/env python3\n# Train - Inputs tested with my code.\n# python train.py ../aipnd-project/flowers --arch vgg --gpu\n# python train.py ../aipnd-project/flowers -...
[ [ "torch.nn.NLLLoss", "torch.nn.Linear", "torch.nn.LogSoftmax", "torch.autograd.Variable", "torch.FloatTensor", "torch.optim.Adam", "torch.nn.ReLU", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.exp" ] ]
Darklanx/rl-baselines3-zoo
[ "b04c52c0532f3b474f43078db235896f3167b50a" ]
[ "plot_sign.py" ]
[ "\nimport matplotlib.pyplot as plt\nimport matplotlib\nmatplotlib.use('Agg')\nimport numpy as np\nfrom scipy.signal import savgol_filter\n\nFILE = \"./sign.txt\"\ncorrects = []\nincorrects = []\nwith open(FILE, 'r') as f:\n for i, l in enumerate(f):\n correct, incorrect = l.strip().split(',')\n cor...
[ [ "matplotlib.use", "scipy.signal.savgol_filter", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.arange" ] ]
sandyz1000/deepinsight-iqa
[ "1be15ba4bdb005d05d01eddd247de1dafbf3d256" ]
[ "deepinsight_iqa/data_pipeline/nima_gen/schema/LIVE/get_labels.py" ]
[ "import os\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport json\nfrom maxentropy.skmaxent import MinDivergenceModel\n\n\ndef load_json(file_path):\n with open(file_path, 'r') as f:\n return json.load(f)\n\n\ndef save_json(data, target_file, prefix=\"\"):\n with open(f\"{prefix}_{targe...
[ [ "numpy.array", "numpy.arange", "numpy.random.shuffle", "pandas.read_csv" ] ]
liuwen-ts/Speech_emotion_recognition_BLSTM
[ "4a40968c130f81e80612f4aafcf5dcc56539e020" ]
[ "find_best_model.py" ]
[ "from optparse import OptionParser\n\nfrom utility import globalvars\nfrom utility.audio import extract_dataset\nfrom dataset import Dataset\n\nfrom keras.layers import Input, Dense, Masking, Dropout, LSTM, Bidirectional, Activation\nfrom keras.layers.merge import dot\nfrom keras.models import Model, load_model\nfr...
[ [ "numpy.full", "numpy.array", "numpy.savetxt", "numpy.asarray", "sklearn.model_selection.train_test_split", "numpy.column_stack" ] ]
hgl71964/PET
[ "4cedb25c5dce0c49eebb693125235fc4ad1e26f8", "4cedb25c5dce0c49eebb693125235fc4ad1e26f8", "4cedb25c5dce0c49eebb693125235fc4ad1e26f8" ]
[ "models-ae/export_as_onnx.py", "benchmark/tvm/conv-autotune.py", "benchmark/tvm/tvm-onnx.py" ]
[ "import torch\nimport torchvision.models as models\nfrom berts import Bert\nfrom dilated_onnx import csrnet\n\n# 330 330 inception\n# 224 224 other\n# 16 1\n# resnet inception\nimport argparse\n\n# model_list = [\"resnet18\", \"inception\", \"bert-opt\", \"bert-onnx\", \"csrnet\"]\nmodel_list = [\"resnet18\", \"inc...
[ [ "torch.randn" ], [ "numpy.random.uniform", "numpy.zeros" ], [ "numpy.std", "numpy.random.randn", "numpy.mean" ] ]
otto-AMA/datacube-core
[ "b5ef5bb8d303a73bebdeca5b80486265067bbcb3" ]
[ "datacube/utils/geometry/_base.py" ]
[ "import functools\nimport math\nfrom collections import namedtuple, OrderedDict\nfrom typing import Tuple, Callable\n\nimport cachetools\nimport numpy\nfrom affine import Affine\nfrom osgeo import ogr, osr\n\nfrom .tools import roi_normalise, roi_shape\n\nCoordinate = namedtuple('Coordinate', ('values', 'units'))\n...
[ [ "numpy.isnan", "numpy.arange" ] ]
ondrejdyck/sidpy
[ "779034440b8233e1dae609a58a64ce2d25ca41c0" ]
[ "examples/viz_dataset/plot_visualizers.py" ]
[ "\"\"\"\n================================================================================\nPlotting Datasets\n================================================================================\n\n**Gerd Duscher**\n\n08/25/2020\n\n**Please download this example and run it as a notebook by scrolling to the\nbottom of t...
[ [ "numpy.random.normal", "numpy.arange", "matplotlib.pyplot.show" ] ]
JanAlexanderPersonal/covid19_weak_supervision
[ "5599e48c9945f1e08a2731740bc8f6e44a031703", "5599e48c9945f1e08a2731740bc8f6e44a031703" ]
[ "src/datasets/covid19_v1.py", "src/models/wisenet_base/packages/DEXTR/train_single_point.py" ]
[ "\nimport glob, torch\nfrom haven import haven_utils as hu\nimport numpy as np\nimport os\nfrom PIL import Image\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nimport kornia.augmentation as K\nimport PIL\n\nclass COVIDDataset(data.Dataset):\n def __init__(self, split, datadir, exp...
[ [ "numpy.array", "torch.LongTensor", "numpy.zeros", "numpy.unique" ], [ "torch.optim.SGD", "torch.utils.data.DataLoader", "torch.nn.functional.upsample" ] ]
OverLordGoldDragon/ssqueezepy
[ "b08fcb84dbc526245c66eb3bf5e441e04b87da23" ]
[ "ssqueezepy/_ssq_stft.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nfrom ._stft import stft, get_window, _check_NOLA\nfrom ._ssq_cwt import _invert_components, _process_component_inversion_args\nfrom .utils.cwt_utils import _process_fs_and_t, infer_scaletype\nfrom .utils.common import WARN, EPS32, EPS64\nfrom .utils import backend as S\...
[ [ "numpy.linspace", "numpy.argmax" ] ]
alkoumpa/coremltools
[ "0f0b24254fd9804402c2eaab77f74e8850e3ec05" ]
[ "coremltools/converters/mil/mil/ops/defs/elementwise_unary.py" ]
[ "# Copyright (c) 2020, Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can be\n# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\nimport scipy\nfrom ._op_reqs import *\n\n\"\"\"\nElementwise Unary Op Superclass\n\"\"\"\n\...
[ [ "scipy.special.erf" ] ]
apple2373/chainercv
[ "1442eac6a316c31eab029c156b6d6e151553be2a" ]
[ "chainercv/links/model/ssd/ssd_vgg16.py" ]
[ "from __future__ import division\n\nimport numpy as np\n\nimport chainer\nimport chainer.functions as F\nfrom chainer import initializers\nimport chainer.links as L\n\nfrom chainercv.links.model.ssd import Multibox\nfrom chainercv.links.model.ssd import Normalize\nfrom chainercv.links.model.ssd import SSD\nfrom cha...
[ [ "numpy.array" ] ]
xstgavin/Video-to-audio-converter
[ "9410f1a4cbb143756ed3dbd886d3fd52b51d9e00" ]
[ "video_to_audio2.py" ]
[ "#!/usr/bin/env python3\nimport os \nimport matplotlib\n\nimport urllib.request\nimport urllib.error\nimport re\nimport sys\nimport time\nimport pipes\nimport pylab\nmatplotlib.use('Agg')\nfrom matplotlib import pyplot as plt\nimport librosa\nimport librosa.display\nimport numpy as np\nimport glob\nimport subproces...
[ [ "matplotlib.use", "numpy.round" ] ]
wincooler/detectron2
[ "7f15a71c4d44bfe0b61bf410684b38eeaf4689a1" ]
[ "projects/DensePose/densepose/structures/chart_result.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\nfrom dataclasses import dataclass\nfrom typing import Any, Tuple\nimport torch\n\n\n@dataclass\nclass DensePoseChartResult:\n \"\"\"\n DensePose results for chart-based methods represented by labels and inner\n coordinates (U, V) of individual charts. ...
[ [ "torch.zeros", "numpy.moveaxis", "numpy.array" ] ]
Hazeliii/E-GMA-master
[ "8ed41079bfaf2834a0df991739699ec80704f1b6" ]
[ "preprocess_MVSEC_flow_1.py" ]
[ "import numpy as np\nimport os\nfrom decimal import *\nimport h5py\nimport pandas as pd\n\n\ndef read_events(events_pth):\n print('read_events Begin')\n events_h5 = h5py.File(events_pth)\n # image_ts = np.loadtxt(image_time_pth)\n # show(events_h5)\n events_left = events_h5['davis']['left']['events']...
[ [ "numpy.searchsorted", "numpy.array", "numpy.loadtxt", "pandas.DataFrame" ] ]
TxT1212/colmap
[ "ee87e7c8b9ee7541be62f45121febd431be134a9" ]
[ "scripts/sfm_toolkits/ezxr_sfm/trajectory_tools/generate_gt2d_by_ranges.py" ]
[ "# coding: utf-8\nimport os\nimport sys\nimport argparse\nimport numpy as np\nimport random\n\ndef random_positions():\n total_count = 20\n sample_range = [-5.0, 5.0]\n positions_2d = np.zeros((total_count, 2))\n for i in range(total_count):\n x = random.uniform(sample_range[0], sample_range[1])\...
[ [ "numpy.array", "numpy.sin", "numpy.arccos", "numpy.matmul", "numpy.zeros", "numpy.linalg.norm", "numpy.mean", "numpy.eye", "numpy.arctan2", "numpy.abs", "numpy.cos" ] ]
kluge-ai/docanchors
[ "15108f8fb1bab9f356ef7ca8f5a21a1ff6bd08ba" ]
[ "test/sampling/test_masking.py" ]
[ "import numpy as np\n\nfrom docanchors.sampling.masking import RandomUniformMask, RandomChunkMask, RandomNonUniformMask\n\n\ndef test_zero_perturbation_rate(subtests):\n\n for rmask in [RandomUniformMask, RandomChunkMask]:\n with subtests.test(rmask=rmask):\n m = rmask()\n m.perturba...
[ [ "numpy.all", "numpy.mean" ] ]
rstrudel/mdetr
[ "177724cc60c7d63628dd14a5f26b21ea2cea45e3", "177724cc60c7d63628dd14a5f26b21ea2cea45e3", "177724cc60c7d63628dd14a5f26b21ea2cea45e3" ]
[ "mdetr/datasets/clevrref.py", "mdetr/models/postprocessors.py", "mdetr/datasets/lvis_eval.py" ]
[ "# Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved\n\"\"\"Dataset and evaluator for CLEVR-Ref+\"\"\"\nimport copy\nfrom collections import defaultdict\nfrom pathlib import Path\n\nimport torch\nimport torch.utils.data\nfrom transformers import AutoTokenize...
[ [ "torch.as_tensor" ], [ "torch.stack", "torch.nn.functional.softmax", "torch.no_grad", "torch.nn.functional.interpolate", "torch.ones_like", "numpy.cumsum", "torch.sort" ], [ "numpy.concatenate", "numpy.logical_not", "numpy.array", "numpy.count_nonzero", ...
avidale/compress-fasttext
[ "838ab153191c2a4959ba0c1d003ea09166b34b1e" ]
[ "compress_fasttext/decomposition.py" ]
[ "import numpy as np\n\ntry:\n from sklearn.decomposition import TruncatedSVD\nexcept ImportError:\n # SVD is not the core feature of this library, so we keep this dependency optional\n TruncatedSVD = None\n\n\nclass DecomposedMatrix:\n def __init__(self, compressed, components):\n self.compressed...
[ [ "sklearn.decomposition.TruncatedSVD", "numpy.dot" ] ]
todorokit/tensorflow_cnn_image_sample
[ "5f8dee00eebcbada9e03de7742026b2a37963860" ]
[ "dataset/MultilabelLargeDataset.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nfrom dataset.AbstractDataset import AbstractDataset\nimport config.baseConfig as baseConfig\n\nclass MultilabelLargeDataset(AbstractDataset):\n def __init__(self, csvpath, config, batch_size, cache):\n def makeImage(img):\n shape = tf.shape(img)\n...
[ [ "tensorflow.shape", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.image.random_flip_left_right", "tensorflow.cond", "tensorflow.read_file", "tensorflow.data.Dataset.zip", "tensorflow.image.random_brightness", "tensorflow.image.random_contrast", "tensorflow.transpose...
fyviezhao/sparse-ncnet
[ "8e945afca830b78bd3c72c7aaf8171571db3d676" ]
[ "eval/eval_inloc_extract.py" ]
[ "import faiss\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\nimport os\nfrom os.path import exists, join, basename\nfrom collections import OrderedDict\n\nimport sys\nsys.path.append('..')\n\nfrom lib.model import ImMatchNet, MutualMatching\nfrom lib.normalization import imreadth, resi...
[ [ "torch.cuda.synchronize", "torch.cuda.Event", "torch.no_grad", "scipy.io.loadmat", "torch.cuda.reset_max_memory_allocated", "torch.cuda.max_memory_allocated", "torch.cuda.empty_cache", "torch.cuda.is_available", "numpy.arange", "torch.tensor", "torch.load", "numpy.a...
deno750/RO2
[ "3ef6fa7ab261548f96db3d5a82438f1741fa06a7" ]
[ "other_codes/tsp.py" ]
[ "\"\"\"\nExecute: python tsp.py -f filename.tsp -m METHOD\nWhere METHOD:\n - GREEDY\n - GREEDY_2OPT\n - GENETIC\nOther options:\n -s seed\n -t time limit\n -v verbose\n\"\"\"\n\n\nimport argparse\nimport matplotlib.pyplot as plt\nimport math\nimport time\nimport random\nfrom heapq import *\n\n#TSP instance\nc...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.scatter", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ] ]
EfMichalis/-home-efthmis-Application-of-Convolutional-Neural-Networks-Car-Plate-Recognition
[ "bf351f98fe66ea63bc9ed1251514f25f0b8ef022" ]
[ "cpr_default/scripts/methods.py" ]
[ "# Disclaimer:\n# This file is part of the undergraduate thesis of Mr. Efthymis Michalis.\n# The thesis was developed under the supervision of Assistant Prof. Aggelos\n# Pikrakis, in the Department of Informatics, School of ICT, University of\n# Piraeus, Greece.\n\n# methods.py\nimport numpy as np\nimport matplotli...
[ [ "numpy.concatenate", "numpy.where", "matplotlib.pyplot.plot", "matplotlib.pyplot.imshow" ] ]
udaylunawat/models
[ "5ceb3acfc48843f260bac9a8afae5f90c5409eed", "d739ec6c13a920f3e9d325bb3c8faeb8dfe8583f", "d739ec6c13a920f3e9d325bb3c8faeb8dfe8583f" ]
[ "official/benchmark/keras_imagenet_benchmark.py", "official/recommendation/ncf_keras_benchmark.py", "official/transformer/v2/transformer_layers_test.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.test.main" ], [ "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.test.main" ], [ "tensorflow.zeros", "tensorflow.compat.v1.enable_v2_behavior", "tensorflow.keras.layers.Input", "tensorflow.ones", "tensorflow.test.main" ] ]
cjwfuller/quantum-circuits
[ "39629d3d6a1c8ba0e64083aa85091ba88a1ada5e" ]
[ "quantum-circuits/gates/paulix.py" ]
[ "import numpy as np\nimport quantum_gate\n\nclass PauliXQuantumGate(quantum_gate.QuantumGate):\n def __init__(self):\n super(PauliXQuantumGate, self)\n self.symbol = 'X'\n self.num_qubits = 1\n self.matrix = np.matrix('0 1; 1 0', np.complex_)\n" ]
[ [ "numpy.matrix" ] ]
matthewstidham/AI_Reader
[ "c2cd820e74e8821ab72cfb669500736a25aee0f8" ]
[ "transformer/spatial_transformer.py" ]
[ "# Copyright 2016 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.batch_matmul", "tensorflow.floor", "tensorflow.zeros", "tensorflow.shape", "tensorflow.concat", "tensorflow.range", "tensorflow.expand_dims", "tensorflow.linspace", "tensorflow.ones_like", "tensorflow.reshape", "tensorflow.add_n", "tensorflow.pack", ...
mheanng/PythonNote
[ "e3e5ede07968fab0a45f6ac4db96e62092c17026", "e3e5ede07968fab0a45f6ac4db96e62092c17026" ]
[ "docs/02.AI_ML/code-1805/Day01all/lab.py", "docs/02.AI_ML/code-1905/day06/demo03_silhouette.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport numpy as np\nimport sklearn.preprocessing as sp\nraw_samples = np.array([\n 'audi', 'ford', 'audi', 'toyota', 'ford',\n 'bmw', 'toyota', 'ford', 'audi'])\nprint(raw_samples)\nlbe = sp.LabelEncoder()\nlbe_samples = lbe.fit(raw_samples).t...
[ [ "sklearn.preprocessing.LabelEncoder", "numpy.array" ], [ "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.xlabel", "sklearn.cluster.KMeans", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "numpy.loadtxt", "matplotlib.pyplot.sho...
ClLov/Xana
[ "83d880432a457cff0f1fab2801e2530ddecb4019" ]
[ "Xana/SaxsAna/find_center.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom lmfit.models import GaussianModel as gauss_mod\nfrom lmfit.models import VoigtModel as voigt_mod\nfrom lmfit.models import LinearModel as lin_mod\n\ndef find_center(img, mask=None, doplot=False, fit_report=False):\n \n mod = voigt_mod() + lin_mod...
[ [ "numpy.mean", "numpy.ones_like", "matplotlib.pyplot.subplots", "numpy.zeros" ] ]
RGring/cvat
[ "000e9c4dad8f3ddf8c822807b12ec9a93c37337d" ]
[ "datumaro/datumaro/components/operations.py" ]
[ "\n# Copyright (C) 2020 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport logging as log\nfrom copy import deepcopy\n\nimport cv2\nimport numpy as np\n\nfrom datumaro.components.extractor import AnnotationType\n\n\ndef mean_std(dataset):\n \"\"\"\n Computes unbiased mean and std. dev. for dataset...
[ [ "numpy.square", "numpy.histogram", "numpy.prod", "numpy.sqrt" ] ]
gugarosa/dualing
[ "a625476946bded8e6c9211d83fe79dc16b3d8f16" ]
[ "tests/dualing/core/test_model.py" ]
[ "import pytest\nimport tensorflow as tf\n\nfrom dualing.core import model\n\n\ndef test_base():\n new_base = model.Base(name='new_base')\n\n assert new_base.name == 'new_base'\n\n\ndef test_base_call():\n new_base = model.Base()\n\n with pytest.raises(NotImplementedError):\n new_base(None)\n\n\nd...
[ [ "tensorflow.zeros" ] ]
uzborg950/SARAS-ESAD-Baseline
[ "5282a416840af100d0dfe31845031ea60cdcdfdc" ]
[ "modules/frame_utils.py" ]
[ "import torch\nimport numpy as np\nimport os\nimport cv2\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\n\ndef save_image(image_tensor,ax,filename):\n image = image_tensor.detach().cpu().numpy()\n if ax is None:\n figure, ax = plt.subplots(1)\n ax.imshow(image)\n plt.savef...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.patches.Rectangle" ] ]
o19s/solr-grid-tuning
[ "cf14a6b5e0b9cdf4fb83ffc9689b4296ff9cac01" ]
[ "src/solr_grid_tuning/grid_search.py" ]
[ "from itertools import chain, combinations, product\nfrom sklearn.model_selection import ParameterGrid\nfrom collections.abc import Iterable\nfrom solr_grid_tuning.solr_query import SolrQuery\n\nparam_grid = {\n 'qf': ['title', 'content', 'brandModelTokenized'],\n 'pf': ['title', 'content', 'brandModelTokeniz...
[ [ "sklearn.model_selection.ParameterGrid" ] ]
paroda/incubator-mxnet
[ "9f14a68045a07d95cb8c86c3c614c84261507755" ]
[ "tests/python/unittest/test_gluon.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.ones", "numpy.random.rand", "numpy.dtype", "numpy.asarray" ] ]
want-fly/bootcamp
[ "e8b2d50413a1e530375372b402044175b69d8ec5" ]
[ "solutions/question_answering_system/quick_deploy/server/src/operations/load.py" ]
[ "import sys\nimport os\nimport pandas as pd\nfrom sklearn.preprocessing import normalize\n\nsys.path.append(\"..\")\nfrom config import DEFAULT_TABLE\nfrom logs import LOGGER\n\n\n# Get the vector of question\ndef extract_features(file_dir, model):\n try:\n data = pd.read_csv(file_dir)\n question_d...
[ [ "pandas.read_csv" ] ]
rioyokotalab/asdfghjkl
[ "f435c1e2527162fb07512b4ce5058460aab238b9" ]
[ "asdfghjkl/operations/conv.py" ]
[ "import torch\nfrom torch import nn\n\nfrom .operation import Operation\n\n\nclass Conv2d(Operation):\n \"\"\"\n module.weight: c_out x c_in x k_h x k_w\n module.bias: c_out x 1\n\n Argument shapes\n in_data: n x (c_in)(kernel_size) x out_size\n out_grads: n x c_out x out_size\n\n kernel_size =...
[ [ "torch.matmul" ] ]
LooperXX/NCRFpp
[ "49d799064eec36921d2d5854053af9766e6e9922" ]
[ "model/wordsequence.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: Jie Yang\n# @Date: 2017-10-17 16:47:32\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2019-02-01 15:59:26\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nimport torch\nimport torch.nn as nn\nimport torch...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.LSTM", "torch.nn.GRU", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.BatchNorm1d" ] ]
PierrickRauby/Anti-Barkinator
[ "bd1cae5ca929ae1313d083166f9f8891214da543" ]
[ "predict_barking.py" ]
[ "# Imports for the script\nimport numpy as np\nimport os \nimport errno\nimport librosa\n#from keras.models import model_from_json\nimport tensorflow as tf\nimport pyaudio\n# from gpiozero import LED\nimport wave\n# from time import sleep\n\n# fifo to triger python execution form javascript\nFIFO='PIPE'\n\n# Audio ...
[ [ "numpy.array", "tensorflow.lite.Interpreter", "numpy.argmax" ] ]
funkelab/synful
[ "cde0287470d33bdb0951b9e47b8c4fa076eec511" ]
[ "synful/evaluate_annotations.py" ]
[ "import csv\nimport json\nimport logging\nimport multiprocessing as mp\nimport os\nimport sys\nimport scipy\nimport pandas as pd\n\nimport daisy\nimport numpy as np\nfrom lsd import local_segmentation\nfrom pymongo import MongoClient\nfrom scipy.spatial import KDTree\nimport pymaid\n\nfrom . import database, synaps...
[ [ "scipy.spatial.KDTree", "pandas.DataFrame", "numpy.array", "numpy.mean" ] ]
rluiseugenio/dpa_rita
[ "4da52a103b455c97d7f3bc6253f1c455c340dfc4" ]
[ "src/utils/ec2_utils.py" ]
[ "#=====================================\n# Resources:\n#https://blog.ipswitch.com/how-to-create-and-configure-an-aws-vpc-with-python\n#https://blog.ipswitch.com/how-to-create-an-ec2-instance-with-python\n#https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#vpc\n#=====================...
[ [ "pandas.DataFrame" ] ]
pbazard/Voice-Assistant
[ "c9ccdd311fa689cfd8bb43d5e4e3cb94cb690a29" ]
[ "VoiceAssistant/wakeword/scripts/split_commonvoice.py" ]
[ "import os\nimport pandas as pd\nimport argparse\nfrom pydub import AudioSegment\nfrom pydub.utils import make_chunks\n\n\n# from pandarallel import pandarallel\n# pandarallel.initialize(progress_bar=True)\n\ndef main(args):\n df = pd.read_csv(args.file_name, sep='\\t')\n print(df.head())\n print('total da...
[ [ "pandas.read_csv" ] ]
risharma-csus/dnnCompiler
[ "528950ee72d3dce7707aa58e86cb68cbb08637c9" ]
[ "test/swig/Exp.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\") yo...
[ [ "numpy.reshape", "numpy.random.randn", "numpy.exp" ] ]
will-r-wang/NTP-Remote-Sensing
[ "4178d3c138480f7af200ce3ec0ad0c4684652230" ]
[ "mask_generator.py" ]
[ "\"\"\"\nPurpose\n-------\nTakes in an input VGG json annotated file and generates the corresponding masks and final masked output image\n\nInputs\n-------\n- Input json file name to which objects are read from\n- Output folder path to which masks are written to\n- Image dimensions\n\"\"\"\n\n\nimport json\nimport ...
[ [ "numpy.array", "numpy.zeros" ] ]
luigifvr/normalized-autoencoders
[ "77423a1d2bacadce76571af85a60b75f882c42c0" ]
[ "models/modules_sngan.py" ]
[ "\"\"\"\nResNet architectures from SNGAN(Miyato et al., 2018)\nBrought this code from:\n https://github.com/christiancosgrove/pytorch-spectral-normalization-gan\n\"\"\"\n# ResNet generator and discriminator\nfrom torch import nn\nfrom torch import Tensor\nfrom torch.nn import Parameter\nimport torch.nn.functiona...
[ [ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.init.xavier_uniform_", "torch.nn.GroupNorm", "torch.nn.Tanh", "torch.nn.Parameter", "torch.nn.ReLU", "torch.nn.Upsample"...
jhollowe-forks/python-mapswipe-workers
[ "22d77d0af613c59d3527fd3ff5c3a05d98d6e34a" ]
[ "mapswipe_workers/mapswipe_workers/generate_stats/project_stats_by_date.py" ]
[ "import datetime\n\nimport pandas as pd\n\nfrom mapswipe_workers.definitions import logger\n\n\ndef calc_results_progress(\n number_of_users: int,\n number_of_users_required: int,\n cum_number_of_users: int,\n number_of_tasks: int,\n number_of_results: int,\n) -> int:\n \"\"\"\n for each projec...
[ [ "pandas.NamedAgg" ] ]
pollyrolly/amazon-sagemaker-examples
[ "b1a56b4dc96201b769f7bbc1e207649423874586", "b1a56b4dc96201b769f7bbc1e207649423874586" ]
[ "sagemaker-pipeline-compare-model-versions/evaluate.py", "sagemaker_processing/fairness_and_explainability/text_explainability/code/inference.py" ]
[ "\"\"\"Evaluation script for measuring model accuracy.\"\"\"\nimport json\nimport logging\nimport pathlib\nimport pickle\nimport tarfile\nimport numpy as np\nimport pandas as pd\nimport xgboost\n\nfrom sklearn.metrics import (\n accuracy_score,\n precision_score,\n recall_score,\n confusion_matrix,\n ...
[ [ "sklearn.metrics.roc_curve", "sklearn.metrics.confusion_matrix", "numpy.round", "sklearn.metrics.precision_score", "sklearn.metrics.accuracy_score", "pandas.read_csv", "sklearn.metrics.recall_score" ], [ "torch.no_grad", "torch.cuda.is_available", "torch.nn.Softmax" ]...
zhongkeli/query2vec
[ "af5ae79c0444a040809f5404ce08341662fecd16" ]
[ "embedding/embedding.py" ]
[ "import tensorflow as tf\nfrom model.query2vec import Query2vec\nfrom helper import model_helper\nfrom config.config import FLAGS\nfrom utils import data_utils\nimport os.path\n\n\nclass Embedding:\n def __init__(self):\n pass\n\n @staticmethod\n def query_embedding():\n q2v = Query2vec()\n # Create mod...
[ [ "tensorflow.ConfigProto", "tensorflow.GPUOptions", "tensorflow.device" ] ]