repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
NunoEdgarGFlowHub/datasets
[ "c3351cdd59eedf8193d670334672ff75020f82b6" ]
[ "tensorflow_datasets/core/features/image_feature_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The TensorFlow Datasets 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 ...
[ [ "tensorflow.test.main" ] ]
brando90/Does-MAML-Only-Work-via-Feature-Re-use-A-Data-Set-Centric-Perspective
[ "45c4fabf35d6d8d19e49092e84e8ac9fa55aee8d" ]
[ "maml_vs_adapted_maml_src/models/resnet_rfs.py" ]
[ "import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nfrom torch.distributions import Bernoulli\n\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,\n padding=1...
[ [ "torch.cuda.is_available", "torch.nn.Conv2d", "torch.distributions.Bernoulli", "torch.nn.Sigmoid", "torch.nn.Dropout", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.functional.dropout", "torch.randn", "torch.nn.functional.pad", "torch.arange", "...
jwmueller/autogluon-benchmarking
[ "28f35188a65c5fb37d4950fa9657ea84c9163049" ]
[ "autogluon_utils/benchmarking/evaluation/tex_table.py" ]
[ "import pandas as pd\nimport numpy as np\n\n# Example usage: x = tex_table(df, textable_file=\"testlatextable.txt\", bold='min')\n\ndef tex_table(df, textable_file, bold = None, nan_char = \" x \", max_digits = 4):\n \"\"\" This function is only intended for fully numerical tables (dataset x frameworks comparis...
[ [ "numpy.abs" ] ]
peiyong86/FATE
[ "efae2b1add20d9f98ac05a669298e36369f91497" ]
[ "federatedml/linear_model/linear_model_weight.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n# Copyright 2019 The FATE 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://w...
[ [ "numpy.array" ] ]
NoldAndreas/FINDER
[ "a3d947c5d59a7cd6e54400b0e9aeb9e111689976" ]
[ "Code/Geometry_Base.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 20 14:51:07 2020\n\n@author: andreas\n\"\"\"\n\nimport numpy as np\nfrom abc import abstractmethod\n#import pickle\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport scipy.spatial.distance as dist\nimport glob\n\n#Geometry bas...
[ [ "scipy.spatial.distance.pdist", "matplotlib.pyplot.figure", "matplotlib.pyplot.axis", "matplotlib.pyplot.savefig", "numpy.asarray", "numpy.mean", "numpy.loadtxt" ] ]
fzfs/Multi-view-Chest-X-ray-Classification
[ "156149829629586d5a8d7946fc710b3b2dec1020" ]
[ "Resnet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass ResNet(nn.Module):\n\n def __init__(self, block, layers, view=4, num_classes=13, img_size = 224):\n\n self.inplanes = 64\n super(ResNet, self).__init__()\n c = 1\n if view == 4:\n c = 2\n ...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.nn.ReLU" ] ]
INF800/CLIP-rsicd
[ "80eb09a71b4ab8a4566eeaa72ec8890630c0d7ee" ]
[ "utils/data.py" ]
[ "import torch\nfrom torchvision.datasets import VisionDataset\nfrom torchvision.io import ImageReadMode, read_image\nfrom torchvision.transforms import (\n # added for image augmentation\n ToPILImage,\n RandomCrop,\n ColorJitter,\n RandomHorizontalFlip,\n RandomVerticalFlip,\n RandomResizedCrop...
[ [ "torch.no_grad" ] ]
google-research/DBAP-algorithm
[ "545a4e780f9d9d480c96b67e7a8ae590a983db6b" ]
[ "third_party/rlkit_library/rlkit/torch/skewfit/video_gen.py" ]
[ "# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.ones", "numpy.flip", "numpy.array", "numpy.concatenate", "numpy.uint8" ] ]
Ennosigaeon/scipy
[ "2d872f7cf2098031b9be863ec25e366a550b229c" ]
[ "scipy/sparse/bsr.py" ]
[ "\"\"\"Compressed Block Sparse Row matrix format\"\"\"\n\n__docformat__ = \"restructuredtext en\"\n\n__all__ = ['bsr_matrix', 'isspmatrix_bsr']\n\nfrom warnings import warn\n\nimport numpy as np\n\nfrom .data import _data_matrix, _minmax_mixin\nfrom .compressed import _cs_matrix\nfrom .base import isspmatrix, _form...
[ [ "numpy.empty", "numpy.zeros", "numpy.diff", "numpy.dtype", "numpy.any", "numpy.asarray", "numpy.ravel", "numpy.arange", "numpy.deprecate", "numpy.array" ] ]
dimitri-justeau/rasterio
[ "dda4b823473ba3cb27038e00ee7aa82f867f2a55" ]
[ "tests/test_blocks.py" ]
[ "from functools import partial\nimport logging\nimport os.path\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport unittest\n\nimport numpy as np\nimport pytest\n\nimport rasterio\nfrom rasterio import windows\n\n\nlogging.basicConfig(stream=sys.stderr, level=logging.DEBUG)\n\nclass WindowTest(un...
[ [ "numpy.ones" ] ]
Redhorde/biolabYoloTEST
[ "e74cdcffed9c2105f882bbd541b3746ce1b638be" ]
[ "YoloFunctionality.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport os\r\n\r\n\r\ndef yolo_cut(image):\r\n net = cv2.dnn.readNet(\"hand-obj_final.weights\", \"hand-obj.cfg\")\r\n classes = []\r\n with open(\"obj.names\", \"r\") as f:\r\n classes = [line.strip() for line in f.readlines()]\r\n\r\n layer_names = net.getLay...
[ [ "numpy.argmax" ] ]
putcn/moviepy
[ "48ae70c5f46dab61bafe8f462faa19d844ad60d3" ]
[ "moviepy/video/compositing/concatenate.py" ]
[ "import numpy as np\n\nfrom moviepy.audio.AudioClip import CompositeAudioClip\nfrom moviepy.tools import deprecated_version_of\nfrom moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip\nfrom moviepy.video.compositing.on_color import on_color\nfrom moviepy.video.VideoClip import ColorClip, VideoCl...
[ [ "numpy.cumsum" ] ]
raphaelavalos/multiagent-particle-envs
[ "d589429084031a58352d214b6147339a21f41cd5" ]
[ "multiagent/rendering.py" ]
[ "\"\"\"\n2D rendering framework\n\"\"\"\nfrom __future__ import division\nimport os\nimport six\nimport sys\n\nif \"Apple\" in sys.version:\n if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ:\n os.environ['DYLD_FALLBACK_LIBRARY_PATH'] += ':/usr/lib'\n # (JDS 2016/04/15): avoid bug on Anaconda 2.3.0 / ...
[ [ "numpy.fromstring" ] ]
bsm8734/formula-image-latex-recognition
[ "86d5070e8f907571a47967d64facaee246d92a35" ]
[ "checkpoint.py" ]
[ "import os\nimport torch\nfrom tensorboardX import SummaryWriter\n\nuse_cuda = torch.cuda.is_available()\n\ndefault_checkpoint = {\n \"epoch\": 0,\n \"train_losses\": [],\n \"train_symbol_accuracy\": [],\n \"train_sentence_accuracy\": [],\n \"train_wer\": [],\n \"train_score\": [],\n \"validati...
[ [ "torch.cuda.is_available", "torch.load" ] ]
webclinic017/fastbt
[ "715982cc454ee6fabcaa605188fd1aad7a32a376" ]
[ "tests/test_datasource.py" ]
[ "import unittest\nimport pandas as pd\nimport numpy as np\nimport context\n\nfrom fastbt.datasource import DataSource\nimport talib\n\nclass TestDataSource(unittest.TestCase):\n\n def setUp(self): \n df = pd.read_csv('tests/data/sample.csv', parse_dates=['timestamp'])\n self.ds = DataSource(...
[ [ "pandas.date_range", "pandas.read_csv", "numpy.random.seed", "numpy.random.randn", "numpy.arange", "pandas.isna" ] ]
OspreyData/lime
[ "ceec55cf074b6242ffdde3487afb08ab3250cd63" ]
[ "lime/lime_tabular.py" ]
[ "\"\"\"\nFunctions for explaining classifiers that use tabular data (matrices).\n\"\"\"\nimport collections\nimport copy\nfrom functools import partial\nimport json\nimport warnings\n\nimport numpy as np\nimport scipy as sp\nimport sklearn\nimport sklearn.preprocessing\nfrom sklearn.utils import check_random_state\...
[ [ "numpy.sqrt", "numpy.tile", "sklearn.utils.check_random_state", "numpy.transpose", "numpy.zeros", "scipy.sparse.issparse", "scipy.sparse.csr_matrix", "numpy.argsort", "numpy.exp", "scipy.sparse.isspmatrix_csr", "sklearn.preprocessing.StandardScaler", "numpy.array" ...
benwmcdowell/charge_density_methods_VASP
[ "c1d965b62e638e4509c8b2b94fc797568aa46919" ]
[ "charge_density_methods_VASP/2d_slice.py" ]
[ "from numpy import zeros, shape, dot\nfrom numpy.linalg import norm\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Patch\n\nfrom lib import parse_CHGCAR, parse_LOCPOT\n\ndef plot_2d_slice(ifile,pos,**args):\n if 'dim' in args:\n dim=args['dim']\n else:\n dim=2\n \n if...
[ [ "matplotlib.patches.Patch", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.shape", "matplotlib.pyplot.colorbar", "numpy.dot", "numpy.linalg.norm", "matplotlib.pyplot.xl...
rickyHong/TensorRT-inference-server-repl
[ "024e6760d4efd2f1bbeb242d7a306851ccb5ea62" ]
[ "qa/common/gen_qa_sequence_models.py" ]
[ "# Copyright (c) 2019, 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\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of c...
[ [ "tensorflow.strings.join", "tensorflow.placeholder", "tensorflow.equal", "tensorflow.shape", "tensorflow.initializers.global_variables", "numpy.dtype", "tensorflow.add", "tensorflow.assign", "tensorflow.Session", "tensorflow.saved_model.simple_save", "tensorflow.identit...
Rhcsky/cifar100-classification
[ "00a099b608d798f59f1781375687e10e7fd3a250" ]
[ "model/resnet.py" ]
[ "# Original code: https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py\n\nimport torch.nn as nn\nimport math\n\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,\n ...
[ [ "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.rand", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.ReLU" ] ]
KushDen/deepimportance_code_release
[ "5d16f1f95568dc402be6dfed4ad993ec0dbaa356" ]
[ "lrp_toolbox/modules/softmax.py" ]
[ "'''\n@author: Sebastian Lapuschkin\n@author: Gregoire Montavon\n@maintainer: Sebastian Lapuschkin\n@contact: sebastian.lapuschkin@hhi.fraunhofer.de, wojciech.samek@hhi.fraunhofer.de\n@date: 14.08.2015\n@version: 1.2+\n@copyright: Copyright (c) 2015-2017, Sebastian Lapuschkin, Alexander Binder, Gregoire Montavon, ...
[ [ "numpy.exp" ] ]
jhaux/triplet-reid
[ "ac475c38c1de083482634db75dde53f12ef69cb1" ]
[ "triplet_reid/edflow_implementations/deepfashion/eval_tsne.py" ]
[ "import sys\nsys.path.append(\".\")\nimport yaml, os, json\nfrom triplet_reid.edflow_implementations.deepfashion.data import (\n FromCSVWithEmbedding, FromCSVWithMultiEmbedding)\nfrom tqdm import trange, tqdm\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nfrom triplet_reid.excluders.diagonal impor...
[ [ "numpy.stack", "sklearn.manifold.TSNE", "matplotlib.pyplot.figure" ] ]
iam-abbas/numpy
[ "2fb5e969fded3cd468f2ca01d5b954c953545dd9" ]
[ "benchmarks/benchmarks/bench_lib.py" ]
[ "\"\"\"Benchmarks for `numpy.lib`.\"\"\"\n\n\nfrom .common import Benchmark\n\nimport numpy as np\n\n\nclass Pad(Benchmark):\n \"\"\"Benchmarks for `numpy.pad`.\n\n When benchmarking the pad function it is useful to cover scenarios where\n the ratio between the size of the input array and the output array ...
[ [ "numpy.nanmedian", "numpy.random.seed", "numpy.nancumsum", "numpy.nansum", "numpy.nanvar", "numpy.nanargmax", "numpy.nanquantile", "numpy.nanmean", "numpy.nancumprod", "numpy.unique", "numpy.random.uniform", "numpy.nanargmin", "numpy.pad", "numpy.nanmax", ...
hayatonakamura/feverDetector
[ "4d39a2551b45aa45954f633b4dd35e4f7444e7f8" ]
[ "board/new_hit_with_camera.py" ]
[ "# Hayato Nakamura\n# hn2357\n# Copyright 2020 Hayato Nakamura\nfrom __future__ import print_function #compatible with python 2.7\nimport sys, time\nimport numpy as np\nfrom picamera import PiCamera \nimport aws\nfrom collections import OrderedDict\nfrom decimal import *\nfrom datetime import datetime\n#import thre...
[ [ "numpy.mean", "numpy.zeros" ] ]
ichigo663/SimulatedAnnealing
[ "f319ee6bbdd8e0be16d39de0893a7a26d234a817" ]
[ "simulatedAnnealing.py" ]
[ "from pyglet.gl import *\nimport numpy as np\n\nclass SimulatedAnnealing:\n\n def __init__(self, function, tStart=15.0, tEnd=2.0,localMovement=False, dxMovement=1, scale=2.0):\n #xpos, ypos of current position\n self.scale = scale\n self.step = function.step\n self.xmin = function.min...
[ [ "numpy.random.ranf", "numpy.abs", "numpy.exp", "numpy.max", "numpy.min", "numpy.random.randint" ] ]
chipmuenk/A2SRC
[ "156c063c825669130bdaf1f41a1e972bbc1747e3" ]
[ "A2SRC/plot_vispy_test8_mesh.py" ]
[ "import numpy as np\nfrom vispy import app, gloo, visuals\nfrom vispy.geometry import create_sphere\nfrom vispy.visuals.transforms import (STTransform, AffineTransform,\n ChainTransform)\n\n\nclass Canvas(app.Canvas):\n def __init__(self):\n app.Canvas.__init__(self, k...
[ [ "numpy.random.normal", "numpy.ones", "numpy.linspace" ] ]
ttthomaschan/DeepcvLib
[ "18f7728559136a3c5c8ad54666788ea771e95b16", "18f7728559136a3c5c8ad54666788ea771e95b16" ]
[ "Detection/detect.py", "Detection/dataset/VOC_dataset.py" ]
[ "import cv2\r\nfrom model.fcos import FCOSDetector\r\nimport torch\r\nfrom torchvision import transforms\r\nimport numpy as np\r\nfrom dataset.VOC_dataset import VOCDataset\r\nimport time\r\nimport matplotlib.patches as patches\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.ticker import NullLocator\r\n\r\n\...
[ [ "torch.nn.BatchNorm2d", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.axis", "torch.no_grad", "matplotlib.pyplot.gca", "matplotlib.pyplot.subplots", "torch.device", "matplotlib.patches.Rectangle", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.close", ...
Ynakatsuka/nishika-22
[ "72994cab16486b3a26686642ad72a29b6761b46d" ]
[ "src/benchmark/app.py" ]
[ "import warnings\n\nimport numpy as np\nimport pandas as pd\nimport streamlit as st\nfrom benchmark import (\n EXPERIMENT_NAMES,\n get_result,\n load_augmentation,\n load_config,\n load_lightning_module,\n normalize,\n)\nfrom kvt.initialization import initialize as kvt_initialize\nfrom kvt.utils i...
[ [ "pandas.read_csv", "numpy.load", "numpy.array" ] ]
mmolnar0/sgillen_research
[ "752e09fdf7a996c832e71b0a8296322fe77e9ae3" ]
[ "torch_lstm_mod/lstm.py" ]
[ "import math\nimport torch as th\nimport torch.nn as nn\n\n\n\nclass LSTMCell(nn.Module):\n\n def __init__(self, input_size, hidden_size, bias=True):\n super(LSTMCell, self).__init__()\n self.input_size = input_size\n self.hidden_size = hidden_size\n self.bias = bias\n self.i2h...
[ [ "torch.unbind", "torch.stack", "torch.nn.Linear", "torch.randn", "torch.mul" ] ]
jxhuang0508/CVRN
[ "ecbd1bebd43dadfd29536a8f31a65b920346fda6" ]
[ "cvrn/dataset/datasets_crst.py" ]
[ "import os\nimport os.path as osp\nimport numpy as np\nimport random\nimport matplotlib.pyplot as plt\nimport collections\nimport torch\nimport torchvision.transforms as transforms\nimport torchvision\nimport cv2\nfrom torch.utils import data\nimport sys\nfrom PIL import Image\n\npalette = [128, 64, 128, 244, 35, 2...
[ [ "numpy.array", "numpy.asarray" ] ]
yasirabd/deployment-notebook-prescriptive
[ "f3e07ee8472be9f2d8c78cfea2990131bdcbe881" ]
[ "utils/transform.py" ]
[ "import pandas as pd\nimport numpy as np\nimport time\nfrom datetime import timedelta, date, datetime\n\nclass TransformData(object):\n def __init__(self):\n pass\n\n # get data and preprocessing\n def format_timestamp(self, utc_datetime):\n now_timestamp = time.time()\n offset = datet...
[ [ "numpy.around", "pandas.to_datetime" ] ]
CoAxLab/binding_manuscript
[ "fc6c3dabc81b505edb5a79a1835c6f29c494f941" ]
[ "imaging_code/fMRI_task.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\nfrom __future__ import division # so that 1/3=0.333 instead of 1/3=0\nfrom psychopy import visual, core, data, event, logging, gui\nfrom psychopy.constants import * # things like STARTED, FINISHED\nimport pandas as pd\nimport numpy as np # whole numpy lib is avai...
[ [ "numpy.tile", "numpy.random.shuffle", "numpy.zeros", "numpy.savetxt", "pandas.DataFrame", "numpy.asarray", "numpy.repeat", "numpy.where", "numpy.tril" ] ]
NunoEdgarGFlowHub/io
[ "242a3be6c375e4f7cf130766c0098cfe4b0fc8d2" ]
[ "tensorflow_io/kafka/__init__.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.python.util.all_util.remove_undocumented" ] ]
jbbrokaw/matplotlib
[ "86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427", "86ec1b6fc5628bfb2d09797c58d7eed0ca8c2427" ]
[ "lib/matplotlib/backends/backend_cairo.py", "examples/mplot3d/trisurf3d_demo.py" ]
[ "\"\"\"\nA Cairo backend for matplotlib\nAuthor: Steve Chaplin\n\nCairo is a vector graphics library with cross-device output support.\nFeatures of Cairo:\n * anti-aliasing\n * alpha channel\n * saves image files as PNG, PostScript, PDF\n\nhttp://cairographics.org\nRequires (in order, all available from Cairo websi...
[ [ "matplotlib.backend_bases.FigureManagerBase", "matplotlib.backend_bases.RendererBase.__init__", "matplotlib.cbook.is_string_like", "matplotlib.backend_bases.GraphicsContextBase.__init__", "matplotlib.backend_bases.GraphicsContextBase.set_foreground", "numpy.asarray", "matplotlib.backen...
ejnnr/steerable_pdo_experiments
[ "17902e56641cefe305b935c8733b45aa066bf068" ]
[ "stl_experiments/experiments/plot_exps.py" ]
[ "\nimport pandas as pd\nimport argparse\nimport os\nimport matplotlib\n\nimport utils\n\nif \"DISPLAY\" not in os.environ:\n matplotlib.use('Agg')\n\nimport matplotlib.pyplot as plt\n\nSHOW_PLOT = False\nSAVE_PLOT = True\n\nRESHUFFLE = False\nAUGMENT_TRAIN = False\n\ncolors = {\n \"train\": \"blue\",\n \"v...
[ [ "matplotlib.use", "matplotlib.pyplot.pause", "matplotlib.pyplot.draw", "matplotlib.pyplot.subplots" ] ]
Abdiel-EMT/segnet
[ "474a68079000a85d1e62ad9723d316074bb1eb8d" ]
[ "segnet/models/multiresunet.py" ]
[ "from tensorflow import keras as K\n\n\ndef conv2d(x, filters, shape, padding=\"same\", strides=(1, 1), activation=\"relu\"):\n \"\"\"\n 2D Convolutional layers with Batch Normalization\n \n Arguments:\n x: Keras layer, the input to the feature map\n filters: Int representing the number of...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Activation", "tensorflow.keras.models.Model", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Conv2D", "tensorfl...
iankhr/armagarch
[ "5d292b54cde992cca47024aaeb8d4120f0665a7d" ]
[ "armagarch/tStudent.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Jun 26 12:46:36 2020\r\nThis class defines t-Student distribution for ARMA-GARCH models\r\n\r\n@author: Ian Khrashchevskyi\r\n\"\"\"\r\n\r\nfrom .distModel import DistModel\r\nimport numpy as np\r\nimport scipy.stats as stats\r\nfrom scipy.special import gamma\r\...
[ [ "numpy.sqrt", "numpy.log", "scipy.stats.t.rvs", "scipy.special.gamma" ] ]
ishine/sudo_rm_rf
[ "ec3fae1e2c9d85710f933a600f3ab93f92468dee" ]
[ "sudo_rm_rf/dnn/experiments/run_fuss_separation.py" ]
[ "\"\"\"!\n@brief Running an experiment with the improved version of SuDoRmRf on\nuniversal source separation with multiple sources.\n\n@author Efthymios Tzinis {etzinis2@illinois.edu}\n@copyright University of Illinois at Urbana-Champaign\n\"\"\"\n\nimport os\nimport sys\ncurrent_dir = os.path.dirname(os.path.abspa...
[ [ "torch.sum", "torch.stack", "torch.std", "torch.rand", "torch.no_grad", "torch.randperm", "torch.nn.DataParallel", "torch.mean" ] ]
niekh-13/Textmining_NPA-reports
[ "0453f2f12e7d0745ac59076a1d255f4de79fc85c" ]
[ "util/outlier.py" ]
[ "##############################################################\n# #\n# Niek Huijsmansen #\n# Textmining medical notes for cognition #\n# Outlier Z score ...
[ [ "scipy.special.erf" ] ]
knit-pk/AI-Section-2017
[ "a744b130defe58050264a37d88732af66ecabf40" ]
[ "SARSA/SARSA.py" ]
[ "'''\nExample implementation of SARSA algorithm for learning the path through frozen lake.\nThe is_slippery flag lets us change the rules of the game, if True the probability of\nchanging the chosen direction is 4 out of 10.\n'''\n\nimport gym\nimport numpy as np\nimport time\nimport pygame\n\n\nclass Game:\n st...
[ [ "numpy.random.randn", "numpy.argmax", "numpy.zeros" ] ]
RCheese/gumpy
[ "c5d602122bef87827dae4abeace6c867c65eb1cb" ]
[ "gumpy/split.py" ]
[ "import sklearn.model_selection\nfrom sklearn.model_selection import (ShuffleSplit, StratifiedKFold,\n StratifiedShuffleSplit)\n\n\ndef normal(X, labels, test_size):\n \"\"\"Split a dataset into training and test parts.\n Args:\n X (numpy.ndarray): 2D features matri...
[ [ "sklearn.model_selection.StratifiedShuffleSplit", "sklearn.model_selection.StratifiedKFold", "sklearn.model_selection.ShuffleSplit" ] ]
XiSHEN0220/SSR
[ "50f473b690f6c28e8c828c8ec65de7680400b011" ]
[ "transductive_few_shot/src/dataset.py" ]
[ "## settings of different datasets\nimport numpy as np\nimport torchvision.transforms as transforms\n\ndef dataset_setting(dataset, nSupport, nQuery=15):\n\n if 'miniImageNet' in dataset :\n mean = [x/255.0 for x in [120.39586422, 115.59361427, 104.54012653]]\n std = [x/255.0 for x in [70.68188272...
[ [ "numpy.asarray" ] ]
jlee-ds/meshcnn
[ "6a3c9efa18f00786e2c71f56934d101a1895e9c2" ]
[ "data/autoencoder_data.py" ]
[ "import os\nimport torch\nfrom data.base_dataset import BaseDataset\nfrom util.util import is_mesh_file, pad, pad_vertices\nimport numpy as np\nfrom models.layers.mesh import Mesh\n\nclass AutoEncoderData(BaseDataset):\n\n def __init__(self, opt):\n BaseDataset.__init__(self, opt)\n self.opt = opt\...
[ [ "numpy.std", "torch.device", "numpy.mean" ] ]
hegland/cmepy
[ "fa8cdf2fad779badbcb629bf6ee33316724ec4a4" ]
[ "cmepy/lexarrayset.py" ]
[ "\"\"\"\nlexical array set operations\n\nthese operations are based upon the one dimensional array set operations\nfrom numpy.lib.arraysetops, but generalised to work for sets of m-tuples,\nwhere each element is stored as a row of a 2d m by n array, using numpy's\n'lexsort' lexical sorting function.\n\"\"\"\n\nimpo...
[ [ "numpy.logical_and.reduce", "numpy.zeros", "numpy.add.accumulate", "numpy.asarray", "numpy.size", "numpy.lexsort", "numpy.logical_not", "numpy.hstack", "numpy.shape", "numpy.logical_or.reduce", "numpy.concatenate", "numpy.array" ] ]
remorsecs/Kaggle-plant-seedlings-classification
[ "2fb837fb09ad07c3950684a8179052aa14a745e9" ]
[ "libs/model.py" ]
[ "import torch.nn as nn\n\n\nclass VGG11(nn.Module):\n def __init__(self):\n super().__init__()\n conv_layers = nn.Sequential(\n nn.Conv2d(3, 64, kernel_size=3, padding=1),\n nn.ReLU(True),\n nn.MaxPool2d((2, 2), 2),\n\n nn.Conv2d(64, 128, kernel_size=3, p...
[ [ "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.Flatten", "torch.nn.Conv2d", "torch.nn.ReLU", "torch.nn.Dropout" ] ]
VinAIResearch/PointSWD
[ "ea676926e21286185e836ab355fee7937540ce69" ]
[ "criteria_comparing_sets_pcs/all_metrics_calculator.py" ]
[ "import os.path as osp\nimport sys\n\nimport torch\nimport torch.nn as nn\n\n\nsys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))\nfrom criteria_comparing_sets_pcs.jsd_calculator import JsdCalculator\nfrom metrics_from_point_flow.evaluation_metrics import compute_all_metrics\n\n\nclass AllMetricsCalcu...
[ [ "torch.empty", "torch.is_tensor" ] ]
nden/photutils
[ "87879b2464ccfcd160f6a0c53ea4c0869a6e1cc2" ]
[ "photutils/detection/tests/test_findstars.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport os.path as op\nimport itertools\nimport warnings\n\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport pytest\n\nfrom astropy.table import Table\nfrom astropy.utils.exceptions import AstropyUserWarning\n\nfrom ..findstars ...
[ [ "numpy.ones", "numpy.zeros_like", "numpy.isfinite", "numpy.testing.assert_allclose" ] ]
kjdavidson/NoisePy
[ "a7445dd2f68f64cb562d6a87096e5f12a2c3b612" ]
[ "src/application_modules/measure_dvv.py" ]
[ "import sys\nimport time\nimport obspy\nimport pyasdf\nimport os, glob\nimport datetime\nimport numpy as np\nimport pandas as pd\nfrom mpi4py import MPI\nimport matplotlib.pyplot as plt\nfrom obspy.signal.filter import bandpass\n\nsys.path.insert(1,'../')\nimport noise_module\n\n# register datetime converter\nfrom ...
[ [ "numpy.empty", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.abs", "pandas.plotting.register_matplotlib_converters", "numpy.arange", "matplotlib.pyplot.subplot", "numpy.max", "numpy.float", "numpy.min", "matplotlib.pyplot.close", ...
kanesp/keras
[ "7f8c62b90274f9c5a261984c098312ff8fab3d66" ]
[ "keras/layers/preprocessing/index_lookup_test.py" ]
[ "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v2.__internal__.tf2.enabled", "tensorflow.compat.v2.data.Dataset.from_tensor_slices", "tensorflow.compat.v2.ragged.constant", "tensorflow.compat.v2.io.gfile.GFile", "tensorflow.compat.v2.test.main", "tensorflow.compat.v2.data.Dataset.from_tensors", "tensorflow.compat...
Qub3k/subjective-exp-consistency-check
[ "ad159e9ed161e7f04016cc053d90b8e20f6963ed" ]
[ "qnormal.py" ]
[ "# Authors: Krzysztof Rusek <krusek@agh.edu.pl>\n# Jakub Nawała <jnawala@agh.edu.pl>\n\nimport numpy as np\nimport probability_grid_estimation as pge\n\n\ndef prob(psi, sigma, cdf=False):\n \"\"\"\n\n :param psi: QNormal parameter, vector\n :param sigma: QNormal parameter, vector\n :param cdf...
[ [ "numpy.cumsum", "numpy.random.multinomial" ] ]
mukaiu/PaddleNLP
[ "0315365dbafa6e3b1c7147121ba85e05884125a5" ]
[ "paddlenlp/utils/tools.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.array", "numpy.split" ] ]
yanb514/I24-trajectory-generation
[ "3b1e25f94f42f1e761a13ab57c48d362b1eb7bc0" ]
[ "homography.py" ]
[ "# Attention interviewers!!! - this code is indicative of how I like to write. Not better, not worse.\n# Judge me based off of this\n# Thanks, Derek Gloudemans 2021\n\nimport torch\nimport numpy as np\nimport cv2\nimport sys, os\nimport csv\n\ndef line_to_point(line,point):\n \"\"\"\n Given a line defined by ...
[ [ "torch.ones", "torch.stack", "numpy.array", "numpy.zeros", "torch.pow", "numpy.stack", "torch.zeros", "numpy.abs", "numpy.arange", "torch.sign", "torch.matmul", "torch.from_numpy", "torch.abs", "numpy.sqrt", "numpy.linspace", "torch.mean", "torch...
pengfeidip/SSD_pytorch
[ "f17dcfa76e359c288420df1690e9ce4365353f0a" ]
[ "ssd.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom layers import *\nfrom data import voc, coco\nimport os\n\n\nclass SSD(nn.Module):\n \"\"\"Single Shot Multibox Architecture\n The network is composed of a base VGG network followed by the\n adde...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.load", "torch.nn.Softmax", "torch.nn.Conv2d", "torch.nn.ModuleList", "torch.nn.ReLU" ] ]
sum-coderepo/HadoopApp
[ "0e8d48c5d541b5935c9054fb1335d829d67d7b59" ]
[ "NeuralNetwork/ClassificationNeuralNetwok.py" ]
[ "import numpy as np\nfrom sklearn import datasets, linear_model\nimport matplotlib.pyplot as plt\n\n\nclass Config:\n nn_input_dim = 2 # input layer dimensionality\n nn_output_dim = 2 # output layer dimensionality\n # Gradient descent parameters (I picked these by hand)\n epsilon = 0.01 # learning ra...
[ [ "numpy.sum", "numpy.zeros", "numpy.dot", "sklearn.datasets.make_moons", "numpy.random.seed", "numpy.random.randn", "numpy.exp", "numpy.argmax", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.show", "numpy.power", "numpy.sqrt", "matplotlib.pypl...
sunshineInmoon/ssd.pytorch
[ "a1cb37ea3e5fe64cdcf1c3d0004006baf1d046a1" ]
[ "train.py" ]
[ "from data import *\nfrom utils.augmentations import SSDAugmentation\nfrom layers.modules import MultiBoxLoss\nfrom ssd import build_ssd\nimport os\nimport sys\nimport time\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\ni...
[ [ "torch.utils.data.DataLoader", "torch.ones", "torch.nn.init.xavier_uniform", "torch.load", "torch.autograd.Variable", "torch.set_default_tensor_type", "torch.cuda.is_available", "torch.zeros", "torch.nn.DataParallel", "torch.Tensor" ] ]
clairebub/interpretability
[ "8c71bbc976ce9382705a2395ad651da009ab4785" ]
[ "metrics/segmentation.py" ]
[ "# modified from https://github.com/learningtitans/isbi2017-part1/blob/master/metrics.py\n\n\nimport numpy as np\nfrom sklearn.metrics import jaccard_similarity_score\n\nsmooth_default = 1.\n\n\ndef dice_coef(y_true, y_pred, smooth=smooth_default):\n y_true_f = y_true.flatten()\n y_pred_f = y_pred.flatten()\n...
[ [ "numpy.sum", "numpy.logical_and" ] ]
mcvine/mcvine
[ "42232534b0c6af729628009bed165cd7d833789d" ]
[ "packages/mccomponents/tests/mccomponents/sample/geometry/intersection_TestCase.py" ]
[ "#!/usr/bin/env python\n#\n\nstandalone = True\n\nimport os\nos.environ['MCVINE_MPI_BINDING'] = 'NONE'\n\nimport mcni, shutil, numpy as np\nfrom mccomponents.sample import samplecomponent\n\n\nimport unittest\nclass TestCase(unittest.TestCase):\n\n\n def test1a(self):\n \"intersection: two blocks\"\n ...
[ [ "numpy.isclose" ] ]
hnt4499/fairseq
[ "4b519e9876737db32047167e77bf5f8781edef99" ]
[ "fairseq/tasks/sentence_ranking.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom loguru import logger\nimport os\n\nimport numpy as np\nfrom fairseq import utils, utils_loguru\nfrom fairseq.data import (\n ...
[ [ "numpy.maximum.reduce" ] ]
YiyiLiao/deep_marching_cubes
[ "6fce0b26d110a6c839b6d46ea2ab67b5bdb470b2" ]
[ "marching_cube/model/cffi/functions/occupancy_to_topology.py" ]
[ "# functions/add.py\nimport torch\nfrom torch.autograd import Function\nfrom _ext import forward_utils \nif torch.cuda.is_available():\n from _ext import forward_utils_cuda \n\n\nclass OccupancyToTopology(Function):\n \"\"\" Convert the occupancy probability to topology probability\n see ../src/occupan...
[ [ "torch.zeros", "torch.cuda.is_available" ] ]
adsar/tensorflow
[ "b4b2575ec4bf7e6da2686505f61b5f16cb9273ab" ]
[ "tensorflow/python/ops/nn_ops.py" ]
[ "# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.python.framework.tensor_shape.unknown_shape", "tensorflow.python.ops.gen_nn_ops._top_kv2", "tensorflow.python.ops.common_shapes.unchanged_shape_with_rank", "tensorflow.python.ops.common_shapes.max_pool_shape", "tensorflow.python.ops.gen_nn_ops._sparse_softmax_cross_entropy_with_log...
JayKimBravekjh/deepchem
[ "842dd48ee065bee1034754540569f946cbb579eb" ]
[ "deepchem/molnet/load_function/pdbbind_datasets.py" ]
[ "\"\"\"\nPDBBind dataset loader.\n\"\"\"\nimport logging\nimport multiprocessing\nimport os\nimport re\nimport time\n\nimport deepchem\nimport numpy as np\nimport pandas as pd\nimport tarfile\nfrom deepchem.feat import RdkitGridFeaturizer\nfrom deepchem.feat import ComplexNeighborListFragmentAtomicCoordinates\nfrom...
[ [ "numpy.array", "numpy.delete", "pandas.read_csv" ] ]
webclinic017/pyStock-1
[ "4ed6bf20130dcfc37d542bd5b3aec505a12f3106" ]
[ "indicators/bollinger.py" ]
[ "# Add import from parent directory possible\nimport matplotlib.pyplot as plt\nfrom helpers.DataOperations import FindIntersections, CreateSubsetByValues\nfrom core.indicator import indicator\n# Creates object\n\n\ndef CreateBollinger(prices, n=20, k=2):\n return Bollinger(prices, n, k)\n\n# Bollinger object wh...
[ [ "matplotlib.pyplot.fill_between", "matplotlib.pyplot.ylim" ] ]
RGiskard/Data-Structures-and-Algorithms
[ "045eab8e2167fa86aa48f194a7e2d621ce7f19ed" ]
[ "meetup pandas/Funciones/comandos_pandas_v2.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 1 07:45:15 2019\n\n@author: PAULA\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\n\n##########################\n# Funciones de selección #\n##########################\n\nprint('##########################')\nprint('# Funciones de selección #')\nprint('#####...
[ [ "numpy.array", "pandas.Timestamp" ] ]
timoblak/OpenAFQA
[ "dc3e4a02efac3342fc6341a2946398d19d6b7c84" ]
[ "afqa_toolbox/features/gabor.py" ]
[ "from afqa_toolbox.features import block_properties\nimport numpy as np\nimport cv2\n\n\ndef gabor_filter(theta, freq, sigma, shen=False):\n \"\"\"Produces a Gabor filter based on the provided parameters\n\n :param theta: The angle of the filter\n :param freq: The frequency of the filter\n :param sigma:...
[ [ "numpy.zeros", "numpy.abs", "numpy.cos", "numpy.exp", "numpy.arange", "numpy.sin", "numpy.meshgrid" ] ]
SunNy820828449/CINN
[ "6384f730867132508c2c60f5ff2aae12959143d7" ]
[ "python/tests/pool_utils.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) 2021 CINN 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...
[ [ "numpy.ix_", "numpy.sum", "numpy.zeros", "numpy.max", "numpy.maximum", "numpy.full", "numpy.mean" ] ]
PyDemic/pydemic
[ "7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5" ]
[ "tests/models/test_sir.py" ]
[ "import numpy as np\n\nfrom pydemic.diseases import covid19\nfrom pydemic.models import eSIR\n\n\nclass TestSIR:\n def test_basic_esir_api(self):\n m = eSIR(disease=covid19)\n m.run(30)\n res = m[\"I\"]\n ok = m.data.loc[m.times[0], \"infectious\"] * np.exp(m.K * m.times)\n\n a...
[ [ "numpy.abs", "numpy.exp" ] ]
dorothykiz1/pandas
[ "6033ed4b3383d874ee4a8a461724c0b8c2ca968d" ]
[ "pandas/io/excel/_xlsxwriter.py" ]
[ "from __future__ import annotations\n\nfrom typing import Any\n\nimport pandas._libs.json as json\nfrom pandas._typing import (\n FilePath,\n StorageOptions,\n WriteExcelBuffer,\n)\n\nfrom pandas.io.excel._base import ExcelWriter\nfrom pandas.io.excel._util import (\n combine_kwargs,\n validate_freez...
[ [ "pandas.io.excel._util.combine_kwargs", "pandas.io.excel._util.validate_freeze_panes", "pandas._libs.json.dumps" ] ]
kali20gakki/code
[ "369a2e64c2bfbd18899d1d49556d8d208d01bdff" ]
[ "ppdet/data/transform/operators.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.ones", "numpy.take", "numpy.ones_like", "numpy.asarray", "numpy.log", "numpy.full", "numpy.concatenate", "numpy.logical_and", "numpy.cos", "numpy.random.choice", "numpy.empty_like", "numpy.expand_dims", "numpy.random.rand", "numpy.delete", "numpy....
double-fire-0/SystemNoise
[ "ab042dd54371482a18117eb13f816a7472e51590" ]
[ "EOC/prototype/data/utils/imagenet_s_gen.py" ]
[ "import os.path as osp\nimport numpy as np\nfrom PIL import Image\nimport io\nimport cv2\nimport ffmpeg\nimport copy\nimport math\nimport random\nimport os\nfrom tqdm import tqdm\n# try:\n# import mc\n# except ImportError:\n# pass\nimport argparse\n\n\npil_resize_mode_dict = {\n \"pil-bilinear\": Image.B...
[ [ "numpy.save", "numpy.fromfile", "numpy.asarray", "numpy.array", "numpy.frombuffer" ] ]
zehuilu/How-to-Use-Qualisys-Motion-Capture-System-in-AIMS-Lab
[ "862860a9a5d28fc60ee01954e4929a908bf80533" ]
[ "python/streaming_6dof_data.py" ]
[ "#!/usr/bin/python3\n\n\"\"\"\n Streaming 6-DOF data from QTM forever\n (start QTM first, Capture->Continuous Capture)\n\"\"\"\n\nimport asyncio\nimport xml.etree.ElementTree as ET\nimport pkg_resources\nimport qtm\nimport json\nimport numpy as np\nimport socket\n\n\ndef create_body_index(xml_string):\n \"...
[ [ "numpy.array", "numpy.asarray" ] ]
markmac99/WesternMeteorPyLib
[ "c5104974c3f1e2259b0d0ea63a9bbaa15d236be2" ]
[ "wmpl/Trajectory/Orbit.py" ]
[ "from __future__ import print_function, division, absolute_import\n\nimport os\nimport sys\nimport datetime\nimport argparse\n\nimport numpy as np\n\nfrom jplephem.spk import SPK\n\n\nfrom wmpl.Config import config\n\nfrom wmpl.Utils.Earth import calcEarthRectangularCoordJPL\nfrom wmpl.Utils.ShowerAssociation impor...
[ [ "numpy.degrees", "numpy.arctan2", "numpy.arcsin", "numpy.zeros", "numpy.cross", "numpy.cos", "numpy.abs", "numpy.tan", "numpy.isnan", "numpy.sqrt", "numpy.sin", "numpy.dot", "numpy.array", "numpy.radians" ] ]
vervacity/ggr-project
[ "7a9155c5fb573f7b877c63390f8052fcda5b6f6e" ]
[ "ggr/analyses/filtering.py" ]
[ "\"\"\"Contains functions for filtering\n\"\"\"\n\nimport math\nimport pandas as pd\n\n\ndef remove_media_timepoints(in_mat_file, args, out_mat_file):\n \"\"\"Takes an input matrix and removes specific timepoints\n \"\"\"\n media_timepoints = args.misc[\"media_timepoints\"]\n data = pd.read_table(in_mat...
[ [ "pandas.read_table", "pandas.read_csv" ] ]
graphnj/mmdetection
[ "a53cc3766cf2bf54a28392212d07cff4486f6bb3" ]
[ "mmdet/core/export/pytorch2onnx.py" ]
[ "from functools import partial\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.runner import load_checkpoint\n\n\ndef generate_inputs_and_wrap_model(config_path, checkpoint_path, input_config):\n \"\"\"Prepare sample input and wrap model for ONNX export.\n\n The ONNX export API only accept args, a...
[ [ "numpy.array", "torch.from_numpy" ] ]
modi712/Computer-Vision
[ "a34d3d73f883beae812c50b879f4dc8ef679b3ac" ]
[ "src/projectSift.py" ]
[ "# Single projection original code\n\nimport argparse\nimport cv2\nimport numpy as np\nimport math\nimport os\nfrom objloader_simple import *\n\n# PARAMETERS\nTHRESHOLD = 10\t# min number of matches to be recognized\n# 105 for mark4, 65 - mark2\n# for sift: 10 for mark4\nSIZE = 3\t\t# size for the display obj\n# 3 ...
[ [ "numpy.eye", "numpy.linalg.inv", "numpy.stack", "numpy.cross", "numpy.float32", "numpy.int32", "numpy.array", "numpy.dot", "numpy.linalg.norm" ] ]
soar-telescope/sami
[ "8a9e2b28e3e7d753d05220abd0bac6912fa36ad1" ]
[ "soar_simager/data_reduction/reduce.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf8 -*-\n\"\"\"\n SAMI XJoin\n\n This script simply joins the four existing extensions inside a FITS file\n created during observations with SAMI (SAM Imager). During the reduce,\n it also fits a 2nd degree polynomium to the OVERSCAN region that is\n subtracted ...
[ [ "numpy.vstack", "numpy.ones", "numpy.empty", "numpy.zeros", "numpy.polyval", "numpy.argmin", "numpy.median", "numpy.cos", "numpy.repeat", "numpy.arange", "numpy.hstack", "numpy.polyfit", "numpy.array", "numpy.sin", "numpy.random.randint", "numpy.deg2...
haophancs/TREQS
[ "49e354ce2a08cf963ec139d99936020e0f80ced8" ]
[ "LeafNATS/eval_scripts/eval_class_v1.py" ]
[ "import numpy as np\nfrom sklearn.metrics import precision_recall_fscore_support\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import mean_squared_error\n\ndef evaluation(args):\n '''\n We use f-score, accuracy, MSE to evaluation the performance of different models.\n Here, the best mod...
[ [ "numpy.round", "sklearn.metrics.accuracy_score", "sklearn.metrics.precision_recall_fscore_support", "sklearn.metrics.mean_squared_error" ] ]
nsfzyzz/dispersion-score
[ "ac0c633fe3af091e83d2d198809d98545a0a311a" ]
[ "eval/output_ds_synthetic.py" ]
[ "\"\"\"This script is used to measure output dispersion score of synthetic datasets\n\"\"\"\nimport os\nimport sys\nimport numpy as np\nimport torch\nimport random\nimport tqdm\nimport time\nfrom pathlib import Path\nfrom os.path import join\nfrom model.model import EncoderDecoder\nsys.path.append(join(os.path.dirn...
[ [ "torch.utils.data.DataLoader", "torch.load", "torch.utils.data.Subset", "torch.set_grad_enabled", "numpy.array", "torch.device", "torch.cat" ] ]
elifesciences-publications/nelpy
[ "68c1ffff5eee5de60fc365c4f5df3c7200f5c319" ]
[ "nelpy/decoding.py" ]
[ "\"\"\"Bayesian encoding and decoding\"\"\"\n\n__all__ = ['decode1D',\n 'decode2D',\n 'k_fold_cross_validation',\n 'cumulative_dist_decoding_error_using_xval',\n 'cumulative_dist_decoding_error',\n 'get_mode_pth_from_array',\n 'get_mean_pth_from_array']\n\...
[ [ "numpy.vstack", "numpy.cumsum", "numpy.transpose", "numpy.zeros", "numpy.append", "numpy.histogram", "numpy.nanmean", "numpy.abs", "numpy.insert", "numpy.asanyarray", "numpy.exp", "numpy.arange", "numpy.argmax", "numpy.log", "numpy.max", "numpy.isnan...
griff4692/fairseq
[ "3a1b078e93d6b359282868d8369eb97ed9fdb2e5" ]
[ "fairseq/trainer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nTrain a network across multiple GPUs.\n\"\"\"\n\nimport contextlib\nimport logging\nimport sys\nimport time\nfrom argparse i...
[ [ "torch.cuda.empty_cache", "torch.cuda.memory_summary", "torch.zeros_like", "torch.no_grad", "torch.autograd.profiler.record_function", "torch.tensor", "torch.cuda.device_count", "torch.distributed.is_initialized", "torch.cuda.reset_peak_memory_stats", "torch.cuda.is_availab...
xixiobba/MVP-Net
[ "07bf00390080670b5d9a643b99f633419322a1ec" ]
[ "lib/modeling/rpn_heads.py" ]
[ "from torch import nn\nfrom torch.nn import init\nimport torch.nn.functional as F\n\nfrom core.config import cfg\nfrom modeling.generate_anchors import generate_anchors\nfrom modeling.generate_proposals import GenerateProposalsOp\nfrom modeling.generate_proposal_labels import GenerateProposalLabelsOp\nimport modeli...
[ [ "torch.nn.functional.sigmoid", "torch.nn.init.constant_", "torch.nn.init.normal_", "torch.nn.Conv2d", "torch.nn.functional.cross_entropy" ] ]
sebaslherrera/holbertonschool-machine_learning
[ "a4c09230688700aee199f4099de32261104918be" ]
[ "math/0x00-linear_algebra/9-let_the_butcher_slice_it.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nmatrix = np.array([[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12],\n [13, 14, 15, 16, 17, 18], [19, 20, 21, 22, 23, 24]])\nmat1 = matrix[1:3]\nmat2 = matrix[:, 2:4]\nmat3 = matrix[1:, 3:]\nprint(\"The middle two rows of the matrix are:\\n{}\".format(mat1))\n...
[ [ "numpy.array" ] ]
KuangHaofei/pytorch-deepFEPE
[ "012651c93f948cfd793cf8bba9670ab69abc0e04" ]
[ "deepFEPE/utils/plot_tools.py" ]
[ "import argparse\nimport time\nimport csv\nimport yaml\nimport os\nimport logging\nfrom pathlib import Path\n\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom tensorboardX import SummaryWriter\nimport cv2\nimport matplotlib.pyplot as plt\n\n\nclass plot_results(object):\n def __init__(self, frame_list=[100], m...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
XiangLiK/cv_course
[ "da7c2318fd4128bbdab96db26ddbb2524f37d0a0", "da7c2318fd4128bbdab96db26ddbb2524f37d0a0" ]
[ "chapter_03/example-3_1.py", "chapter_07e/face_detection/config_farm/acc_model.py" ]
[ "#-*-coding:utf-8-*-\r\n# date:2020-03-28\r\n# Author: xiang li\r\n\r\nimport torch # 加载torch库\r\nimport numpy as np # 加载Numpy库\r\nif __name__ == \"__main__\":\r\n print(torch.__version__)# 查看 torch 版本\r\n print('-----------------------')\r\n y = torch.rand(2,3)# 随机矩阵\r\n print(y)\r\n print(y.size())...
[ [ "torch.ones", "torch.rand_like", "torch.rand", "torch.zeros", "torch.eye" ], [ "torch.load", "torch.nn.MSELoss", "torch.randn", "torch.no_grad", "torch.sqrt", "torch.mm", "torch.cuda.is_available", "torch.nn.Conv2d", "torch.device", "numpy.mean", ...
samcom12/anuga_core
[ "f4378114dbf02d666fe6423de45798add5c42806" ]
[ "validation_tests/analytical_exact/transcritical_without_shock/analytical_without_shock.py" ]
[ "\"\"\"\r\nTranscritical flow over a bump without a shock.\r\nRef1: Houghton & Kasahara, Nonlinear shallow fluid flow over an isolated ridge.\r\nComm. Pure and Applied Math. DOI:10.1002/cpa.3160210103\r\n\r\nRef2: Delestre et al, 2012, SWASHES: a compilation of shallow water\r\nanalytic solutions..., Int J Numer Me...
[ [ "scipy.optimize.fsolve" ] ]
JaesikKim/HiG2Vec
[ "62803d421a29336d89d0a1336054b33672434fe3" ]
[ "evalGene/score_prediction_NN.py" ]
[ "import torch as th\nimport torch.nn as nn\nimport argparse\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom torch.utils.data import DataLoader, TensorDataset\nimport pandas as pd\nimport numpy as np\nimport copy\n\nclass Net(nn.Module):\n de...
[ [ "torch.utils.data.DataLoader", "torch.FloatTensor", "numpy.load", "torch.nn.MSELoss", "torch.load", "torch.nn.Dropout", "pandas.read_csv", "sklearn.metrics.mean_squared_error", "torch.no_grad", "pandas.DataFrame", "torch.cuda.is_available", "numpy.array", "sklea...
RoosterQMonee/GTAG-PyAI
[ "1bef3cfc85da034f9129a008bd6c5e9114ce3cfd" ]
[ "Chat/commands/exe_command.py" ]
[ "import speech_recognition as sr\nfrom pydub import AudioSegment\nimport os\nfrom datetime import date\nimport sounddevice as sd\nfrom scipy.io.wavfile import write\nfrom random import choice, randint\nimport pyttsx3\nimport time\nimport webbrowser\nfrom playsound import playsound\n\n# Commands\n\nhello = [\"hi\", ...
[ [ "scipy.io.wavfile.write" ] ]
snikhil17/mlzoomcamp
[ "dd04a23aa1ed506247adf9922c73069ad211044d" ]
[ "9_Serverless/lambda_function.py" ]
[ "import tflite_runtime.interpreter as tflite\r\nfrom PIL import Image\r\nfrom io import BytesIO\r\nfrom urllib import request\r\nimport numpy as np\r\n\r\n\r\n#import model\r\ninterpreter = tflite.Interpreter(model_path='cats-dogs-v2.tflite')\r\ninterpreter.allocate_tensors()\r\n\r\n\r\n# get input and output index...
[ [ "numpy.array" ] ]
cmccully/pysalt
[ "d67262a42114bd359efc6ec23fc2d05be66d2025" ]
[ "saltred/saltmosaic.py" ]
[ "#!/usr/bin/env python\n\n# LICENSE\n# Copyright (c) 2014, South African Astronomical Observatory (SAAO)\n# All rights reserved. See License file for more details\n\n\"\"\"\nSALTMOSAIC is a task to apply the CCD geometric corrections to MEF style SALT\ndata.\n\nAuthor Version Date\n-----------...
[ [ "numpy.interp", "numpy.zeros", "scipy.ndimage.maximum_filter", "scipy.ndimage.geometric_transform", "numpy.arange", "scipy.ndimage.minimum_filter" ] ]
tmpaul06/dgl
[ "8f458464b0e14c78978db4b91590e8ca718c5ec6" ]
[ "transformer/dataset/utils.py" ]
[ "import numpy as np\nimport torch as th\nimport os\nfrom dgl.data.utils import *\nimport spacy\nfrom tqdm import tqdm\n\nnlp = spacy.load('en')\n\n_urls = {\n 'wmt': 'https://s3.us-east-2.amazonaws.com/dgl.ai/dataset/wmt14bpe_de_en.zip',\n 'scripts': 'https://s3.us-east-2.amazonaws.com/dgl.ai/dataset/transfor...
[ [ "numpy.random.normal", "numpy.sort", "numpy.random.choice" ] ]
lhoestq/DeDLOC
[ "36f5a6d043c3d727f9d098a35fba94aa351a5cd4" ]
[ "swav/vissl/extra_scripts/create_ucf101_data_files.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport argparse\nimport os\nimport ssl\nfrom contextlib import contextmanager\nfrom typing import List, Optional, Tuple\n\nfrom PIL import Image\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets.utils import download_url, e...
[ [ "torch.utils.data.DataLoader" ] ]
tatatodd/tensorflow
[ "8ae7343f3d24569b4bb142ddc7b58037267a2d3c" ]
[ "tensorflow/contrib/optimizer_v2/optimizer_v2.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.variable_scope.variable", "tensorflow.python.framework.ops.convert_to_tensor_or_indexed_slices", "tensorflow.python.training.checkpointable.base.CheckpointableReference", "tensorflow.python.util.nest.flatten", "tensorflow.python.training.distribution_strategy_context.get...
DS3Lab/LambdaML
[ "0afca7819e08632ba116fec8e102084e4040a47a" ]
[ "archived/functions/higgs/SVM_ADMM_reduce.py" ]
[ "import time\r\nimport numpy as np\r\n\r\nimport torch\r\nfrom torch.autograd import Variable\r\nfrom torch.utils.data.sampler import SubsetRandomSampler\r\n\r\nfrom archived.s3.get_object import get_object\r\nfrom archived.s3 import clear_bucket\r\nfrom archived.sync import reduce_epoch, delete_expired_merged_epoc...
[ [ "torch.utils.data.DataLoader", "numpy.sum", "numpy.random.shuffle", "numpy.sign", "numpy.ones", "torch.autograd.Variable", "numpy.random.seed", "numpy.floor", "torch.norm", "torch.utils.data.sampler.SubsetRandomSampler", "torch.from_numpy", "numpy.random.rand", ...
MattUAV/pandas_market_calendars
[ "397efbf835085152c0eae2de97fe48bac58d8a82" ]
[ "pandas_market_calendars/exchange_calendar_hel.py" ]
[ "from datetime import time\r\n\r\nfrom pandas.tseries.holiday import Holiday, GoodFriday, EasterMonday, AbstractHolidayCalendar\r\nfrom pytz import timezone\r\n\r\nfrom .common_holidays import (\r\n new_years_day,\r\n epiphany,\r\n european_labour_day,\r\n ascension_day,\r\n midsummer_eve,\r\n chr...
[ [ "pandas.tseries.holiday.Holiday", "pandas.tseries.holiday.AbstractHolidayCalendar" ] ]
kensho-technologies/kwnlp-preprocessor
[ "97b13aa109018e38d528e1e9c11f69e0847aa069" ]
[ "kwnlp_preprocessor/task_21p1_gather_wikidata_chunks.py" ]
[ "# Copyright 2021-present Kensho Technologies, LLC.\nimport logging\nimport os\nimport re\n\nimport pandas as pd\n\nfrom kwnlp_preprocessor import argconfig\nfrom kwnlp_preprocessor import utils\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef main(wd_yyyymmdd: str, data_path: str = argconfig.DEFAULT_KWNLP_DATA_P...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.concat" ] ]
dc2016bte0006/Latex_OCR
[ "2e919617da8f2f7f3445ed8d1953a5664c1aaba7" ]
[ "eval.py" ]
[ "from dataset.dataset import Im2LatexDataset\r\nimport os\r\nimport sys\r\nimport argparse\r\nimport logging\r\nimport yaml\r\n\r\nimport numpy as np\r\nimport torch\r\nfrom torchtext.data import metrics\r\nfrom munch import Munch\r\nfrom tqdm.auto import tqdm\r\nimport wandb\r\nfrom Levenshtein import distance\r\n...
[ [ "torch.no_grad", "torch.load", "numpy.mean" ] ]
tilman/compositional_elements
[ "45271196ed01d0515357c7abdf35d6b87f2036d5" ]
[ "evaluation/compare_final2_compoelem.py" ]
[ "# call this script with `python -m evaluation.evaluate_poselines_globalaction`\nimport os\nimport numpy as np\nimport datetime\nfrom tqdm import tqdm\nfrom . import eval_utils\nimport pickle\nimport copyreg\nimport cv2\n\nfrom .compare_deepfeatures import negative_cosine_dist_flatten, eucl_dist_flatten\nfrom .comp...
[ [ "numpy.array", "numpy.lexsort", "numpy.argsort" ] ]
jae1001/FibreCOP
[ "328cf5feb1c8447a20d52b23035098558c3a6e8b" ]
[ "ODFnOPsimulator.py" ]
[ "'''This program calculates the Chebyshev/Herman orientation parameters\r\nfrom simulated intensity distribution data.\r\n\r\nCode developed by Dr. A. Kaniyoor,\r\nMacromolecular Materials Laboratory,University of Cambridge, Cambridge, UK\r\n2020-2021\r\n\r\nReference Publication: Quantifying Alignment in Carbon Na...
[ [ "matplotlib.pyplot.tight_layout", "numpy.asarray", "scipy.special.gamma", "numpy.log", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "numpy.vstack", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure", "numpy.abs", "numpy.cos", "numpy.empty_like", "ma...
bjlittle/poc-ngvat
[ "03cab7c4b184d1fa47d3a1dfee77f48ec609723a" ]
[ "poc-3/data/test/synthetic/utils.py" ]
[ "import matplotlib; matplotlib.use(\"Agg\")\r\nimport torch\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom PIL import Image\r\nimport glob\r\nimport os\r\nimport shutil\r\nimport time\r\nimport sys\r\nimport collections\r\npjoin = os.path.join\r\n\r\nclass LogPrint():\r\n def __init__(self, fil...
[ [ "matplotlib.use", "torch.load" ] ]
irom-lab/AMR-Policies
[ "43552ca0ddcd584a9faa12b5588874bac41bd205" ]
[ "gibson2/agents/tf_agents/agents/reinforce/reinforce_agent.py" ]
[ "# coding=utf-8\n# # Copyright 2018 The TF-Agents 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 required...
[ [ "tensorflow.compat.dimension_at_index", "tensorflow.name_scope", "tensorflow.reduce_sum", "tensorflow.debugging.check_numerics", "tensorflow.debugging.assert_greater", "tensorflow.nest.assert_same_structure", "tensorflow.GradientTape", "tensorflow.math.cumsum", "tensorflow.comp...
CQCL/qvtsim
[ "875a480e4daf9331cc5ab43c49018a6f6e327183" ]
[ "numerical_class.py" ]
[ "#!/usr/bin/env python\n\n#####################################################################################\n#\n# Copyright 2022 Quantinuum\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...
[ [ "numpy.array", "numpy.sum", "numpy.argsort", "numpy.abs" ] ]
skasiraj/Parameter-Estimation-BO
[ "90e701db7faec8e500a74a6d58bbbd121958f326" ]
[ "examples/rosenbrock/rosenbrock_estimate_params_scipy.py" ]
[ "\"\"\"\nEstimate the Rosenbrock function parameters a and b\nfor the function f(x,y) = (a - x)^2 + b(y - x^2)^2\nusing generated data similar to a typical parameter\nestimation problem\n\"\"\"\n\nimport time\nimport numpy as np\nimport pandas as pd\nfrom scipy.optimize import minimize\nfrom scipy.optimize import B...
[ [ "pandas.read_csv", "scipy.optimize.minimize", "scipy.optimize.Bounds", "numpy.meshgrid", "numpy.linspace" ] ]