repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
samplics-org/samplics
[ "4a0f6ea6168afb74c2ea2c958fb76c7d27dfba83" ]
[ "tests/sae/test_eb_unit_model.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom samplics.sae.eb_unit_model import EbUnitModel\n\n\nincomesample = pd.read_csv(\"./tests/sae/incomedata.csv\")\n\nareas = incomesample[\"prov\"]\nys = incomesample[\"income\"]\nXs = incomesample[\n [\"age2\", \"age3\", \"age4\", \"age5\", \"nat1\", \"educ1\", \"edu...
[ [ "pandas.read_csv", "numpy.random.seed", "numpy.mean", "numpy.array", "numpy.isclose" ] ]
thtang/DLCV2018SPRING
[ "5aa6bd2921e317590cd8261fc2d9e0e2534acf37" ]
[ "hw5/hw5_p3_inference.py" ]
[ "from reader import readShortVideo\nfrom reader import getVideoList\nfrom os import listdir\nimport os\nimport sys\nimport pandas as pd\nimport numpy as np\nimport pickle\n\nimport torchvision\nimport torch\nimport torchvision.transforms as transforms\nfrom torch.utils.data import Dataset\nfrom torch.utils.data imp...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.LSTM", "torch.load", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.utils.rnn.pad_packed_sequence", "torch.no_grad", "torch.stack", "torch.nn.ReLU" ] ]
RichardRed0x/checkonchain
[ "2a2c1b50fb9f31c9afc01e97095ca09d62b41860" ]
[ "dcronchain/charts/chart_dcr_mcap_powerlaws.py" ]
[ "#Calculate the Linear Regression between Market Caps\nimport pandas as pd\nimport numpy as np\nimport datetime as date\ntoday = date.datetime.now().strftime('%Y-%m-%d')\n\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\nimport plotly.io as pio\npio.renderers.default = \"browser\"\n\nf...
[ [ "pandas.merge_asof" ] ]
Longqi-S/keras_cpn
[ "53d241ecde4bff5073832dfb1ea9c1e08931520e" ]
[ "models/subnet.py" ]
[ "import keras.layers as KL\nimport keras.backend as K\nimport tensorflow as tf\nfrom lib.nets.resnet_backbone import identity_block as bottleneck\nfrom keras.utils import conv_utils\nfrom keras.engine import InputSpec\nimport numpy as np\n\nclass UpsampleBilinear(KL.Layer):\n def call(self, inputs, **kwargs):\n ...
[ [ "tensorflow.image.resize_bilinear", "tensorflow.shape" ] ]
dkaterenchuk/lstm_text_embedding
[ "25cf8c434fcf32e5d9af057acff823f191d31b0c" ]
[ "continue_train_lstm.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nTrains an LSTM embedding model on Wiki articles.\n\nThe data is freelly available here: https://www.wikidata.org/wiki/Wikidata:Database_download\n\nNOTE: the data is in WIKI xml format and in order to extract text I recommend to use wikiextractor\n(https://github.com/attardi/wikie...
[ [ "tensorflow.ConfigProto", "numpy.asarray", "tensorflow.Session" ] ]
utiasASRL/pysteam
[ "c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b" ]
[ "pysteam/solver/dogleg_gauss_newton_solver.py" ]
[ "import numpy as np\nimport numpy.linalg as npla\nimport scipy.linalg as spla\n\nfrom . import GaussNewtonSolver\nfrom ..problem import OptimizationProblem\n\n\nclass DoglegGaussNewtonSolver(GaussNewtonSolver):\n\n def __init__(self, problem: OptimizationProblem, **parameters) -> None:\n super().__init__(proble...
[ [ "numpy.sqrt", "numpy.linalg.norm" ] ]
zoeparman/benchmark
[ "96331b7fa0db84f5f422b52cae2211b41bbd15ce" ]
[ "src/attrbench/lib/masking/blurring_masker.py" ]
[ "from attrbench.lib.masking import ImageMasker\nfrom cv2 import blur\nimport numpy as np\nimport torch\n\n\nclass BlurringMasker(ImageMasker):\n def __init__(self, feature_level, kernel_size):\n super().__init__(feature_level)\n if not 0 < kernel_size < 1.0:\n raise ValueError(\"Kernel s...
[ [ "numpy.stack", "numpy.transpose" ] ]
dozou/pyio_plugins
[ "bb84a449d454d04de156a277709a169e904a9ca2" ]
[ "recoder_v1/Window.py" ]
[ "# -*- coding:utf-8 -*-\n\nimport time\nimport os.path\nimport sys\nimport time\nimport numpy as np\nimport pandas as pd\nfrom PyQt5.QtWidgets import *\nfrom yapsy.IPlugin import IPlugin\nfrom pyio.Main import main\nfrom pyio.Util import System\nfrom pyio.Window.LineEdit import *\nfrom pyio.DataSturucture import *\...
[ [ "numpy.array", "pandas.DataFrame" ] ]
ankahira/chainermnx
[ "ffee217a555a5d59a6ccd5d8b054e071d1d7d09a" ]
[ "chainermnx/links/filter_parallel_convolution_2d.py" ]
[ "import chainer\nimport chainermn\nimport numpy as np\nimport chainer.functions as F\n\n\nclass FilterParallelConvolution2D(chainer.links.Convolution2D):\n def __init__(self, comm, in_channels, out_channels, *args, **kwargs):\n self.comm = comm\n self.in_channels = in_channels\n self.filters...
[ [ "numpy.arange" ] ]
ouhenio/stylegan2-ada-pytorch-1
[ "aadac107a7b63569053a73793ea9580a3fdd671e" ]
[ "projector_clip.py" ]
[ "# Modified StyleGAN2 Projector with CLIP, addl. losses, kmeans, etc.\n# by Peter Baylies, 2021 -- @pbaylies on Twitter\n\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, re...
[ [ "torch.randn_like", "torch.jit.load", "torch.max", "numpy.concatenate", "numpy.mean", "numpy.random.randn", "torch.nn.functional.interpolate", "torch.no_grad", "torch.device", "torch.median", "torch.from_numpy", "torch.tensor", "numpy.std", "torch.nn.functio...
samyam/DeepSpeed
[ "22aca3694ad4f01d13813b9630caac8683bb22e9" ]
[ "deepspeed/runtime/pipe/module.py" ]
[ "import os\nimport glob\nimport enum\n\nimport re as regex\n\nfrom collections import defaultdict\nfrom functools import partial\n\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\n\nfrom deepspeed.utils import logger\nfrom .. import utils as ds_utils\nfrom ..activation_checkpointing import ch...
[ [ "torch.nn.ModuleDict", "torch.distributed.is_initialized", "torch.distributed.new_group", "torch.distributed.get_rank", "torch.distributed.get_world_size", "torch.distributed.all_reduce" ] ]
jonathantelliott/mobile-telecommunications
[ "32df68d05bf12088e6a1e635820452f6870f90db" ]
[ "code/counterfactuals/infrastructureequilibrium.py" ]
[ "# %%\nimport copy\n\nimport numpy as np\n\nfrom scipy.optimize import fsolve\n\nimport counterfactuals.infrastructurefunctions as infr\nimport counterfactuals.transmissionequilibrium as transeq\nimport counterfactuals.priceequilibrium as pe\nimport counterfactuals.welfare as welfare\n\nimport demand.blpextension a...
[ [ "numpy.unique", "numpy.reshape", "numpy.arange", "numpy.tile", "numpy.ones", "numpy.copy", "numpy.prod", "numpy.repeat", "numpy.zeros", "numpy.sum" ] ]
hiropppe/ncm
[ "8861da3a3575c891fc5c429ae52176a3a64d4478" ]
[ "my_seq2seq.py" ]
[ "\n\n\"\"\"Library for creating sequence-to-sequence models in TensorFlow.\nSequence-to-sequence recurrent neural networks can learn complex functions\nthat map input sequences to output sequences. These models yield very good\nresults on a number of tasks, such as speech recognition, parsing, machine\ntranslation,...
[ [ "tensorflow.convert_to_tensor", "tensorflow.device", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.zeros", "tensorflow.stack", "tensorflow.sparse_softmax_cross_entropy_with_logits", "tensorflow.cast", "tensorflow.contrib.rnn.EmbeddingWrapper", "tensorflow.add_...
ljansen2140/4L13NHUN73RS
[ "b1ece351d0f7a0282e8e0e18ef6d124cca211e00" ]
[ "vae_code.py" ]
[ "# Full example for my blog post at:\n# https://danijar.com/building-variational-auto-encoders-in-tensorflow/\n\n############################ Yvannia ################################\n\n# Importing the package --> \"numpy\" so that all the objects defined in the module can be used. Imported as \"np\" for easy refer...
[ [ "tensorflow.layers.flatten", "tensorflow.reduce_mean", "tensorflow.zeros", "tensorflow.train.MonitoredSession", "tensorflow.reshape", "matplotlib.pyplot.subplots", "tensorflow.placeholder", "matplotlib.pyplot.savefig", "tensorflow.layers.dense", "tensorflow.ones", "tens...
ZhenchaoTang/VectorCapsule
[ "3a5a3373cea11d7aa2186cf0c08d5b8239ce9eab" ]
[ "DGLRoutingLayer.py" ]
[ "import torch.nn as nn\r\nimport torch as th\r\nimport torch.nn.functional as F\r\nimport dgl\r\n\r\n\r\nclass DGLRoutingLayer(nn.Module):\r\n def __init__(self, in_nodes, out_nodes, f_size, batch_size=0, device='cpu'):\r\n super(DGLRoutingLayer, self).__init__()\r\n self.batch_size = batch_size\r\...
[ [ "torch.nn.functional.softmax", "numpy.linspace", "torch.cat", "torch.sqrt", "torch.randn", "torch.zeros", "torch.sum", "matplotlib.pyplot.subplots", "numpy.std", "matplotlib.pyplot.ylabel", "numpy.mean", "torch.log", "matplotlib.pyplot.xlabel", "matplotlib.p...
dwillmer/pyquil
[ "f9a8504d20729b79f07ec4730c93f4b84d6439eb" ]
[ "pyquil/api/_base_connection.py" ]
[ "##############################################################################\n# Copyright 2016-2018 Rigetti Computing\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#\...
[ [ "numpy.array" ] ]
KIM-HC/ai-imu-dr
[ "023a71734016e39d52f79fe8080eaf553c06991a" ]
[ "src/utils_torch_filter.py" ]
[ "import torch\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport time\nfrom termcolor import cprint\nfrom utils_numpy_filter import NUMPYIEKF\nfrom utils import prepare_data\n\nclass InitProcessCovNet(torch.nn.Module):\n\n def __init__(self):\n super(InitProcessCovNet, self)._...
[ [ "torch.svd", "torch.sin", "torch.load", "torch.zeros", "torch.nn.Dropout", "torch.norm", "torch.ones", "torch.sqrt", "torch.eye", "torch.from_numpy", "torch.cos", "torch.nn.ReplicationPad1d", "torch.nn.Linear", "torch.nn.Conv1d", "torch.diag", "torch...
leopold-franz/muMatch
[ "5e6a2e9a300e2aa2d2164fdd6f9346fc31055115" ]
[ "micro_match/correspondence/functional_maps/spectoral_filtering.py" ]
[ "import jax\nimport jax.numpy as jnp\nimport numpy as np\nfrom scipy.optimize import minimize\n\n\ndef l12_functors(X, Y):\n def l21_norm(X):\n return jnp.sum(jnp.linalg.norm(X, axis=0))\n\n def functor(C):\n return l21_norm(C @ X - Y)\n\n f = jax.jit(functor)\n df = jax.jit(jax.grad(funct...
[ [ "numpy.linalg.lstsq", "scipy.optimize.minimize" ] ]
lilao/serving
[ "79968817470bf5700eddbd3ad6dc7cdd4c759909" ]
[ "tensorflow_serving/example/inception_export.py" ]
[ "# Copyright 2016 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.FixedLenFeature", "tensorflow.initialize_all_tables", "tensorflow.train.ExponentialMovingAverage", "tensorflow.map_fn", "tensorflow.app.flags.DEFINE_string", "tensorflow.image.central_crop", "tensorflow.to_int64", "tensorflow.Graph", "tensorflow.contrib.session_bund...
SravanChittupalli/Lane-following-bot-in-Gazebo
[ "3f8a775cd9216f1471e1e729898d1a9de59a6a2d" ]
[ "ros_ws/lane_follow/scripts/utils.py" ]
[ "\nimport cv2\nimport numpy as np\nimport math\n\nkernel = np.ones((5 , 5) , np.float32)/25\nlower_red = np.array([160,100,100])\nupper_red = np.array([179,255,255])\n\n\ndef show_steering_corection(image , error):\n correction_image = np.zeros_like(image)\n error_radian = (error*math.pi)/180\n diff_in_x =...
[ [ "numpy.polyfit", "numpy.asarray", "numpy.ones", "numpy.zeros_like", "numpy.average", "numpy.array" ] ]
jcartus/Lanczos
[ "f0660676d6bd28ee101c9fd7299c4d5987514c24" ]
[ "tests.py" ]
[ "\"\"\"\nDescription:\n This module provides unit tests for the functionality provided in qm.py\n\nAuthor:\n Johannes Cartus, TU Graz\n\"\"\"\n\nimport unittest\n\nimport numpy as np\n\nfrom utilities import InfoStream\nfrom qm import BasisState, Sector, simulate_heisenberg_model\n\nclass TestBasisStates(unit...
[ [ "numpy.linalg.eigh", "numpy.random.rand", "numpy.var", "numpy.array", "numpy.testing.assert_array_almost_equal" ] ]
lucidrains/compare_gan
[ "2a685ab94129c398620da67d999487fa63b7f741" ]
[ "compare_gan/gans/clgan.py" ]
[ "# coding=utf-8\n# Copyright 2018 Google LLC & Hwalsuk Lee.\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 require...
[ [ "tensorflow.get_variable", "tensorflow.image.random_contrast", "tensorflow.concat", "tensorflow.image.random_saturation", "tensorflow.image.random_hue", "numpy.arange", "tensorflow.stop_gradient", "tensorflow.image.rgb_to_grayscale", "tensorflow.tile", "tensorflow.matmul", ...
MalihehIzadi/hybrid-linker
[ "5e9e134634e71c9c44d7fb74997d809355cabfd1" ]
[ "baselines/FRLink/FrLink.py" ]
[ "import logging\nimport json\nimport os\nfrom gensim.models import TfidfModel\nfrom gensim.corpora import Dictionary\nfrom gensim.matutils import cossim\nimport pandas as pd\n\n\nlogging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)\nTRAIN_ITERS = 300\n\ndef getCorpus(df, data_...
[ [ "pandas.read_parquet", "pandas.DataFrame" ] ]
kazum/nnvm
[ "6eb04ae85b7ce22f33563030da36586ee535ac03" ]
[ "python/nnvm/frontend/darknet.py" ]
[ "\"\"\"\nDarkNet symbol frontend.\n\"\"\"\n\nfrom __future__ import absolute_import as _abs\nfrom enum import IntEnum\nimport numpy as np\nimport tvm\nfrom .. import symbol as _sym\n\nclass LAYERTYPE(IntEnum):\n \"\"\"Darknet LAYERTYPE Class constant.\"\"\"\n CONVOLUTIONAL = 0\n DECONVOLUTIONAL = 1\n CO...
[ [ "numpy.zeros", "numpy.finfo" ] ]
rkalahasty/nipy
[ "d16d268938dcd5c15748ca051532c21f57cf8a22" ]
[ "nipy/labs/bindings/tests/test_linalg.py" ]
[ "from __future__ import absolute_import\n\n#\n# Test fff linear algebra routines \n#\n\nfrom numpy.testing import assert_equal\nimport numpy as np\nfrom .. import vector_get, vector_set \n\nn = 15\n\ndef test_vector_get():\n x = np.random.rand(n)\n i = np.random.randint(n)\n xi = vector_get(x, i)\n asse...
[ [ "numpy.testing.assert_equal", "numpy.random.rand", "numpy.random.randint" ] ]
ZeeD26/pysimplevtk
[ "188ef6e776850402e11f59eaa6bd6e511a3259e0" ]
[ "pysimplevtk/utilities/global_point_list.py" ]
[ "# -*- coding: utf-8 -*-\nfrom numpy import all, asanyarray, empty, isclose, vstack, where\n\n\n__all__ = ['GlobalPointList']\n\n\nclass GlobalPointList(object):\n\n def __init__(self, rtol=1e-05, atol=1e-08):\n self.points = empty([0, 3])\n self.rtol = rtol\n self.atol = atol\n\n def _ad...
[ [ "numpy.asanyarray", "numpy.empty", "numpy.isclose" ] ]
scrambleegg7/Mask_RCNN
[ "f3dd0563278160b1068f0215b5eba81eb3ce7cae" ]
[ "myTrain/dataImage.py" ]
[ "\nimport sys\nimport math\nimport cv2\n\nROOT_DIR = \"/Users/donchan/Documents/Miyuki/Mask_RCNN\"\n\n# Import Mask RCNN\nsys.path.append(ROOT_DIR) # To find local version of the library\n\nfrom mrcnn import utils\nimport numpy as np \nimport pandas as pd \n\nimport random\nimport matplotlib.pyplot as plt\n\ncla...
[ [ "numpy.logical_not", "matplotlib.pyplot.imshow", "numpy.arange", "numpy.ones", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show" ] ]
kwasniakk/CS-GO-Grenade-Classification
[ "7d00f93a9df96f8e892d92aad92b50f060e243ff" ]
[ "project/utils/data_utils.py" ]
[ "import pandas as pd\n\nCOLUMNS_TO_DROP = [\"demo_id\", \"demo_round_id\", \"weapon_fire_id\", \"round_start_tick\"]\nDUMMY_COLS = [\"LABEL\", \"team\", \"TYPE\", \"map_name\"]\n\n\ndef preprocess(df):\n data_dropped = df.drop(columns = COLUMNS_TO_DROP)\n data_cleaned = pd.get_dummies(data_dropped, columns =...
[ [ "pandas.get_dummies" ] ]
Top34051/stargan-zsvc
[ "ac9f91ec6ea6fa8c1950d28cca1a23931388d496" ]
[ "solver.py" ]
[ "import torch\nfrom torch import nn\nfrom tqdm import tqdm\n\nfrom model.discriminator import Discriminator\nfrom model.generator import Generator\n\n\nclass Solver():\n\n def __init__(self, train_loader, test_loader, config):\n\n self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\...
[ [ "torch.mean", "torch.load", "torch.nn.L1Loss", "torch.cuda.is_available", "torch.nn.MSELoss" ] ]
fenning-research-group/Instruments
[ "c4e5f854fed1cce20f25076a38842bfbb5396917" ]
[ "FRG Hardware/frghardware/wardmapper/frghardware/wardmapper/processing.py" ]
[ "import matplotlib.pyplot as plt\nimport h5py\nimport os\nimport numpy as np\nfrom matplotlib_scalebar.scalebar import ScaleBar\nfrom frgtools.ward import *\nimport cmocean\nimport imreg_dft as ird\nfrom skimage.filters import gaussian\nfrom scipy import ndimage as nd\nfrom matplotlib.widgets import Button\nfrom tq...
[ [ "numpy.linspace", "numpy.round", "numpy.max", "matplotlib.pyplot.axes", "numpy.mean", "numpy.where", "numpy.divide", "matplotlib.pyplot.tight_layout", "scipy.ndimage.distance_transform_edt", "matplotlib.pyplot.Circle", "matplotlib.pyplot.close", "matplotlib.pyplot.a...
lawwu/nni
[ "b869dd48dfe36392e7b78c70ea35eb6d4b4779dc" ]
[ "src/sdk/pynni/tests/test_compressor.py" ]
[ "from unittest import TestCase, main\nimport nni.compression.tensorflow as tf_compressor\nimport nni.compression.torch as torch_compressor\nimport torch\nimport torch.nn.functional as F\nimport tensorflow as tf \n\ndef weight_variable(shape):\n return tf.Variable(tf.truncated_normal(shape, stddev = 0.1))\n\ndef ...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.constant", "tensorflow.truncated_normal", "torch.nn.functional.log_softmax", "tensorflow.nn.max_pool", "tensorflow.reshape", "torch.nn.Conv2d", "tensorflow.placeholder", "tensorflow.cast", ...
gwaygenomics/pooled-cell-painting-profiling-recipe
[ "886a601761ab62f9ee07b4996c6add9689b41077" ]
[ "0.preprocess-sites/scripts/spot_utils.py" ]
[ "import pathlib\nimport pandas as pd\nimport plotnine as gg\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\ndef spot_counts_per_cell_histogram(df, col, file, bins=50):\n plt.figure(num=None, figsize=(4, 3), dpi=300, facecolor=\"w\", edgecolor=\"k\")\n df.loc[:, col].squeeze().value_counts().hist(...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
zsamadi/pml_tools
[ "0de0c8a6d5bc7ab2c20aab0649e407799b387bdb" ]
[ "software/algorithms/linear_regression_cls.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Jan 17 12:07:50 2021\r\n\r\n@author: zayn\r\n\"\"\"\r\n\r\n\"\"\"\r\nLinear regression implementation.\r\n\r\n\"\"\"\r\n\r\nimport numpy as np\r\n\r\n\r\nclass LReg:\r\n \"\"\" implementation of multi variable Linear Regression, \r\n with results derive...
[ [ "numpy.asarray", "numpy.linalg.pinv", "numpy.std", "numpy.mean", "numpy.zeros" ] ]
espoirMur/lm-prior-for-nmt
[ "e3d736f9da8a20fa5f4983e6ddae86325ebd44ed", "e3d736f9da8a20fa5f4983e6ddae86325ebd44ed" ]
[ "modules/data/samplers.py", "libs/joeynmt/search.py" ]
[ "import math\n\nimport numpy\nimport torch\nfrom torch.utils.data import Sampler\n\n\nclass BPTTSampler(Sampler):\n \"\"\"\n Samples elements per chunk. Suitable for Language Models.\n Arguments:\n data_source (Dataset): dataset to sample from\n \"\"\"\n\n def __init__(self, size, batch):\n ...
[ [ "numpy.arange", "numpy.array", "numpy.array_split" ], [ "torch.max", "torch.full", "torch.zeros", "torch.nn.functional.log_softmax", "numpy.stack", "torch.no_grad", "torch.arange", "torch.argmax" ] ]
danielsnider/ecosystem-project-website-template
[ "355666d910d80dc51f84192122ed26d9ca06f044" ]
[ "cli/skyline/tracking/memory/activations.py" ]
[ "import collections\nimport gc\n\nimport torch\n\nfrom skyline.tracking.backward_interceptor import BackwardInterceptor\nfrom skyline.tracking.base import TrackerBase\nfrom skyline.tracking.call_stack import CallStack\nfrom skyline.tracking.callable_tracker import CallableTracker\nfrom skyline.tracking.utils import...
[ [ "torch.cuda.memory_allocated" ] ]
rumschuettel/qhomer
[ "9526473c1d25e1e280d11583a03682750986bc89" ]
[ "VectorQraphics.py" ]
[ "import svgpathtools\nimport math\nfrom numpy import real, imag\nimport json\n\n# input: list of svgpathtools.path objects, each containing a list of segments\n# output: list of lists of points in 2D space\n\n\ndef get_points(file, density):\n #TODO: calculate density automatically for target point #\n paths ...
[ [ "numpy.real", "numpy.imag" ] ]
cmmakerclub/nl-covid
[ "2e12a8a02fdad3fc9424ce9111d49fbc8798ff4e" ]
[ "raw/polyregression.py" ]
[ "\"\"\"\nCreated on Mon Mar 30 12:10:59 2020\nauthor: yuen\n\npublisher : NL x KBTG\nedit : katopz\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Thailand COVID 19 Dataset\n\n# Predict data\nX = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,\n 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]\nY = [...
[ [ "numpy.polyfit", "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
rainerkelz/ISMIR19
[ "6dbbb166e8cea80b7233ac1a6fdb23b43df0aadf" ]
[ "plot_maps_spec2labels_xyz.py" ]
[ "import matplotlib.pyplot as plt\nimport torch\nimport argparse\nimport numpy as np\n\nfrom plot_input_output import plot_input_output\nfrom reversible import ReversibleModel\nfrom audio_midi_dataset import get_dataset_individually, Spec2MidiDataset, SqueezingDataset\nfrom torch.utils.data.dataloader import DataLoa...
[ [ "torch.zeros", "torch.load", "numpy.stack", "torch.utils.data.dataloader.DataLoader", "matplotlib.pyplot.close", "torch.cuda.is_available", "torch.utils.data.sampler.SequentialSampler", "numpy.vstack" ] ]
Hide927/UDTL
[ "45c256f69c7f0bf06d8b9505834edf991d4484d4" ]
[ "datasets/CWRUFFT.py" ]
[ "import os\nfrom scipy.io import loadmat\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom sklearn.model_selection import train_test_split\nfrom datasets.SequenceDatasets import dataset\nfrom datasets.sequence_aug import *\nfrom tqdm import tqdm\n\n#Digital data was collected at 12,000 samples per second...
[ [ "numpy.abs", "numpy.fft.fft", "scipy.io.loadmat", "sklearn.model_selection.train_test_split", "pandas.DataFrame" ] ]
Tommy-Moffat/pyquil
[ "bc6c0462b11117fe5758b899e10f19b8190b2d96" ]
[ "pyquil/device/tests/test_device.py" ]
[ "import networkx as nx\nimport numpy as np\nimport pytest\n\nfrom pyquil.device import (\n Device,\n ISA,\n Qubit,\n Edge,\n Specs,\n QubitSpecs,\n EdgeSpecs,\n THETA,\n gates_in_isa,\n isa_from_graph,\n isa_to_graph,\n NxDevice,\n)\nfrom pyquil.noise import NoiseModel, KrausMode...
[ [ "numpy.eye" ] ]
rober5566a/NTUT_109-2_MVA_Final-Project
[ "d18494760750efae1ff0810dcaa281a03d0827c0" ]
[ "src/application_process/Model/class4_DIP.py" ]
[ "import pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nimport numpy as np\r\nfrom Model.BoundaryDescriptor import get_contours_binary, calc_contour_feature, draw_bbox\r\n\r\n\r\ndef get_canny(img, isShow=True):\r\n gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\r\n blurred = cv2.GaussianBlur(g...
[ [ "numpy.hstack", "numpy.where", "numpy.mean" ] ]
trisct/AtlasNet
[ "b063fb635ed6ec0304b4a60e41598c214266f492" ]
[ "training/metro.py" ]
[ "import argparse\nimport numpy as np\nimport pymesh\nfrom os.path import exists\nimport os\nimport subprocess\nfrom shutil import copy\n\n\"\"\"\n Author : Thibault Groueix 01.11.2019\n\"\"\"\n\n\ndef metro(path1, path2, metro='./auxiliary/metro_sources/build/metro'):\n \"\"\"\n Run the metro compiled ...
[ [ "numpy.load" ] ]
romainloiseau/deep-linear-shapes
[ "faed8e14a8f66ab1c780972f616543552295cb1e" ]
[ "dlm/viz/gif.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom matplotlib import animation, rc\nfrom IPython.display import display\n\nimport torch\n\nfrom .tools import prepare_ax, prepare_cloud, get_colorscale\n\nfrom ..global_variables import CMAP, PLOT_3D_ALPHA\nfrom ..global_variables import DEFAULT_3D_VIEW, PLO...
[ [ "numpy.expand_dims", "numpy.random.random", "numpy.abs", "numpy.arange", "matplotlib.pyplot.get_cmap", "numpy.log10", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.close", "matplotlib.rc", "matplotlib.pyplot.figure" ] ]
NarrativeApp/tvm
[ "c7ddb4134cc52916a1931439505a20135ac156b8" ]
[ "tests/python/relay/test_vm.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.split", "numpy.reshape", "numpy.int32", "numpy.ones", "numpy.random.rand", "numpy.float32", "numpy.random.uniform", "numpy.array" ] ]
artidoro/gpt-2-output-dataset
[ "00651e362aa61d65efa7a0495b231bd6a0af395c" ]
[ "data_loading.py" ]
[ "import os\nimport json\n\nimport numpy as np\nfrom sklearn.utils import shuffle\nimport pandas as pd\n\n\ndef _load_split(data_dir, source, split, n=np.inf, start_at=0):\n path = os.path.join(data_dir, f'{source}.{split}.jsonl')\n if not os.path.exists(path):\n path = os.path.join(data_dir, f'{source}...
[ [ "pandas.DataFrame" ] ]
IRISMeister/iris-pygw-blueprint
[ "083372421d54a277b55bca7be766d303e4a7abb5" ]
[ "python/src/PersonDemo.py" ]
[ "from Company import Company\nfrom math import cos,sin,tan\nimport numpy as np\n\nclass Person:\n\n def __init__(self):\n self._name = \"Tom\"\n self._age = 5\n self.company = Company()\n\n @property\n def name(self):\n return self._name\n\n @name.setter\n def name(self, newName):\n self._name =...
[ [ "numpy.array" ] ]
dtabb73/Zorbit-Analyzer
[ "a8ea8e9a11fe93a2a2a9de62b9ca404ff2259c53" ]
[ "202102115-icechia.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nfrom io import StringIO\r\nimport re\r\nimport csv\r\nfrom csv import reader, writer\r\nimport sys\r\nimport os\r\nimport glob\r\nimport fnmatch\r\nfrom os import path\r\nimport matplotlib\r\nfrom matplotlib import pyplot as plt\r\n\r\nprint(\"You are using Zorbit Analy...
[ [ "pandas.merge", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.savefig", "numpy.concatenate", "matplotlib.pyplot.clf", "pandas.unique", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
francisr/TorchPQ
[ "cb851053ac01a64b9fa374c9985c354f6249a628" ]
[ "torchpq/kmeans/kernels/CustomKernel.py" ]
[ "import cupy as cp\nimport torch\n\n@cp.util.memoize(for_each_device=True)\ndef cunnex(func_name, func_body):\n return cp.cuda.compile_with_cache(func_body).get_function(func_name)\n # return cp.cuda.compile_with_cache(globals()[strFunction]).get_function(strFunction)\n\nclass Stream:\n def __init__(self, ptr):\...
[ [ "torch.cuda.current_stream", "torch.empty" ] ]
amueller/scikit-image
[ "a8bfc5c5814a3c7fe363cfcad0c68b935706cd3c" ]
[ "skimage/measure/tests/test_find_contours.py" ]
[ "import numpy as np\nfrom numpy.testing import *\n\nfrom skimage.measure import find_contours\n\na = np.ones((8, 8), dtype=np.float32)\na[1:-1, 1] = 0\na[1, 1:-1] = 0\n\n## array([[ 1., 1., 1., 1., 1., 1., 1., 1.],\n## [ 1., 0., 0., 0., 0., 0., 0., 1.],\n## [ 1., 0., 1., 1., 1., 1.,...
[ [ "numpy.testing.run_module_suite", "numpy.sqrt", "numpy.ones" ] ]
felixitous/snowflake-connector-python
[ "e4a1304246d7ed8ba42e3f6fbe34badf8e6990ad" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.\n#\nfrom codecs import open\nfrom os import path\nimport os\nimport sys\nfrom sys import platform\nfrom shutil import copy\nimport glob\n\nfrom setuptools import setup, Extension\n\nTHIS_DIR = ...
[ [ "numpy.get_include" ] ]
yuxiangsun/RTFNet
[ "7dc43e6af8b6bfb2ebd2248dd9606f548e017b66" ]
[ "run_demo.py" ]
[ "# By Yuxiang Sun, Dec. 14, 2020\n# Email: sun.yuxiang@outlook.com\n\nimport os, argparse, time, datetime, sys, shutil, stat, torch\nimport numpy as np \nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom util.MF_dataset import MF_dataset \nfrom util.util import compute_results, visu...
[ [ "torch.cuda.set_device", "torch.cuda.current_device", "torch.utils.data.DataLoader", "sklearn.metrics.confusion_matrix", "torch.cuda.get_device_name", "numpy.nan_to_num", "torch.no_grad", "scipy.io.savemat", "torch.cuda.device_count", "numpy.zeros", "torch.autograd.Vari...
tjunderhill/beam
[ "1eaa8694528f44c8254992ad30da98aa8fb999cf" ]
[ "sdks/python/apache_beam/dataframe/frames.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.concat", "pandas.core.series.is_iterator", "pandas.core.dtypes.common.is_numeric_dtype", "pandas.Series", "pandas.core.dtypes.common.is_bool_dtype", "pandas.core.common.is_bool_indexer", "pandas.DataFrame" ] ]
ziatdinovmax/im2spec
[ "60fa6f44db6c0d69e7c6f1d608553b574190e704" ]
[ "im2spec/utils.py" ]
[ "from typing import Tuple, Type, Union\n\nimport numpy as np\nimport torch\nfrom shapely.geometry import Polygon\nfrom sklearn.mixture import GaussianMixture\n\n\ndef predict(model, feature_arr: Union[np.ndarray, torch.Tensor]) -> np.ndarray:\n \"\"\"\n Makes a prediction with a trained NN\n \"\"\"\n de...
[ [ "numpy.abs", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available", "sklearn.mixture.GaussianMixture", "numpy.array" ] ]
ellery92/deep-text-recognition-benchmark
[ "43304dc94589ceb9fd832e0d3c24f53554763e9a" ]
[ "gencharset.py" ]
[ "import pandas as pd\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--train_list', required=True, help='path to train_list file')\nparser.add_argument('--test_list', required=True, help='path to test_list file')\nopt = parser.parse_args()\n\nchar_set = set()\ntrain_list = pd.read_csv(o...
[ [ "pandas.read_csv" ] ]
ymtz03/freqerica
[ "d79e76181a037da5c11b47f8a4e1bf4387a0468f" ]
[ "freqerica/op/orbital.py" ]
[ "import numpy as np\nfrom pyscf import gto, scf, mcscf, ao2mo, symm\nfrom collections import namedtuple\n\nMoleInput = namedtuple('MoleInput', ['mol', 'norb', 'nelec'])\nOrbitalProperty = namedtuple('OrbitalProperty', ['hcore', 'hint', 'gint', 'irreps', 'mo_energy', 'mo_occ', 'mo_coeff', 'ncore', 'ncas', 'nelecas']...
[ [ "numpy.zeros", "numpy.empty" ] ]
Sui-Siann-Dataset/HunLian
[ "fc3cebcb34bcc342005527a46ab9a2d048b58e7d" ]
[ "Tacotron2-Ray/hparams.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\n# Default hyperparameters\nhparams = tf.contrib.training.HParams(\n\t# Comma-separated list of cleaners to run on text prior to training and eval. For non-English\n\t# text, you may want to use \"basic_cleaners\" or \"transliteration_cleaners\".\n\tcleaners='english_c...
[ [ "numpy.log" ] ]
NEUNLP-RE/Erich_Relation_Classification
[ "31c3e9dc7461dcd1fcf72969f150a603b3edaf28" ]
[ "src/utils.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport os\nimport torch\nimport random\nimport numpy as np\n\n\ndef simple_accuracy(preds, labels):\n return (preds == labels).mean()\n\n\ndef semeval_score():\n output = os.popen('bash test.sh')\n text = [i for i in output.read().split(\...
[ [ "torch.manual_seed", "numpy.random.seed", "torch.cuda.manual_seed_all" ] ]
cthtuf/v-diffusion-pytorch
[ "3525561043113bb855a49f91b4bccd2afdb94f8d" ]
[ "clip_sample.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"CLIP guided sampling from a diffusion model.\"\"\"\n\nimport argparse\nfrom functools import partial\nfrom pathlib import Path\n\nfrom PIL import Image\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torchvision import transforms\nfrom torchvision.tra...
[ [ "torch.nn.functional.normalize", "torch.linspace", "torch.randint", "torch.cat", "torch.load", "torch.manual_seed", "torch.randn", "torch.tensor", "torch.nn.functional.adaptive_avg_pool2d", "torch.rand", "torch.cuda.is_available", "torch.device", "torch.autograd...
vladfi1/ray
[ "3b141b26cd4af491b3c1fb8ce4dbb00265246b1e" ]
[ "python/ray/rllib/agents/agent.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom datetime import datetime\nimport copy\nimport logging\nimport os\nimport pickle\nimport six\nimport tempfile\nimport tensorflow as tf\nfrom types import FunctionType\n\nimport ray\nfrom ray.except...
[ [ "tensorflow.ConfigProto", "tensorflow.Graph" ] ]
wx1356021541/flow-statistics
[ "7a2ba366c2448cea8afa5226897f02010d491f29" ]
[ "utils/backbone.py" ]
[ "import glob, os\nimport tensorflow as tf\nfrom utils import label_map_util\n\n\ndef set_model(model_name):\n\tmodel_found = 0\n\n\tfor file in glob.glob(\"*\"):\n\t\tif (file == model_name):\n\t\t\tmodel_found = 1\n\n\t# What model to download.\n\tmodel_name = model_name\n\tmodel_file = model_name + '.tar.gz'\n\td...
[ [ "tensorflow.gfile.GFile", "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.GraphDef" ] ]
Qbuer/SMP_2018
[ "6a7f167e6791edd8a518b030bda2d3adb84ee51d" ]
[ "Classfiy.py" ]
[ "\n# coding: utf-8\n\n\n\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\nfrom tensorflow.contrib.seq2seq import BahdanauAttention\nimport logging\nimport util\nimport time\nimport sys\nimport argparse\nimport numpy as np\nimport json\nimport pickle\nfrom datetime import datetime\nimport os \n\n\nos.en...
[ [ "tensorflow.convert_to_tensor", "tensorflow.nn.dynamic_rnn", "tensorflow.matmul", "tensorflow.Graph", "tensorflow.nn.rnn_cell.LSTMCell", "tensorflow.reduce_sum", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.constant_initializer", "tensorflow.global_variables_...
MiningMyBusiness/HMMExperiments
[ "555b9f5833b1422bd3c6b7fc64894266fb6ddcc8" ]
[ "CreateFakeData.py" ]
[ "import numpy as np\r\nimport scipy.sparse as sp\r\nimport matplotlib.pyplot as plt\r\n\r\n# set initial probability distribution of semi-Markov Process \r\ndef SetInitProb(num_states):\r\n init_prob = np.random.rand(num_states)\r\n init_prob = init_prob/np.sum(init_prob)\r\n return init_prob\r\n\r\ndef Se...
[ [ "numpy.sqrt", "scipy.sparse.rand", "numpy.save", "numpy.random.randn", "numpy.random.rand", "numpy.mean", "numpy.array", "numpy.sum" ] ]
psrc/populationsim
[ "8307c5a53a4d84994a224058a201b8c4f42543b8" ]
[ "populationsim/steps/setup_data_structures.py" ]
[ "\n# PopulationSim\n# See full license in LICENSE.txt.\n\nimport logging\nimport os\n\nimport pandas as pd\nimport numpy as np\n\nfrom activitysim.core import inject\nfrom activitysim.core import pipeline\n\nfrom ..assign import assign_variable\nfrom helper import control_table_name\nfrom helper import get_control_...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
LemonPepperSeasoning/Path-Finder-With-Social-Zone
[ "2fe3e977520feff5637ab6a5e54dc5a2777b5097" ]
[ "CoordinateConverter/main.py" ]
[ "\nimport math\nimport matplotlib.pyplot as plt\n\nimport numpy as np\n\ndef robot_to_camera(rx, ry):\n R = [rx, ry]\n A = math.sqrt(R[0]**2 + R[1]**2) / ratio\n alpha = math.atan(R[1] / R[0])\n\n add_x = math.cos(diff_degree + alpha) * A\n add_y = math.sin(diff_degree + alpha) * A\n\n c_x = p0[0]...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.scatter" ] ]
eduardofv/lang_model_eval
[ "d89dbe9fe291f0befb9701e8dc4cea4154cf9d45" ]
[ "analysis/analysis_utils.py" ]
[ "\"\"\"Utility functions to be used by analysis tasks.\"\"\"\nimport os\nimport re\nimport collections\nimport json\nimport numpy as np\nimport pandas as pd\nimport matplotlib as mpl\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\n\n\n#File Utils\ndef load_metadata(directory):\n \"\"\"Load the meta...
[ [ "matplotlib.patches.Patch", "pandas.DataFrame", "matplotlib.pyplot.draw", "matplotlib.pyplot.axes", "matplotlib.pyplot.plot", "numpy.argmin", "matplotlib.pyplot.text" ] ]
adswa/pymento
[ "17182124a9b917365b181bf7936f290f16a9105c" ]
[ "pymento_meg/viz/plots.py" ]
[ "import mne\nimport matplotlib\n\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nfrom pymento_meg.utils import _construct_path\nfrom pathlib import Path\nfrom matplotlib import interactive\n\ninteractive(True)\n\n\ndef plot_psd(raw, subject, figdir, filtering):\n ...
[ [ "matplotlib.interactive", "pandas.Index", "numpy.nanmin", "matplotlib.pyplot.subplots" ] ]
alegonz/hmmlearn
[ "ad6df92f85b88a7aecce70953a3873f6f3c95ccb" ]
[ "lib/hmmlearn/tests/test_gmm_hmm.py" ]
[ "from __future__ import absolute_import\n\nimport numpy as np\nimport pytest\nfrom sklearn.mixture import GaussianMixture\nfrom sklearn.utils import check_random_state\n\nfrom hmmlearn import hmm\n\nfrom . import log_likelihood_increasing, make_covar_matrix, normalized\n\npytestmark = pytest.mark.xfail()\n\ndef cre...
[ [ "numpy.allclose", "numpy.arange", "numpy.ones", "sklearn.mixture.GaussianMixture", "numpy.random.RandomState", "sklearn.utils.check_random_state" ] ]
browatbn2/MAD
[ "2b3f1a9b36ef096db648ede9854c733fd444a2a6" ]
[ "datasets/voxceleb.py" ]
[ "import os\nimport time\nimport cv2\nimport numpy as np\nfrom skimage import io\n\nimport torch.utils.data as td\nimport pandas as pd\n\nimport config as cfg\nfrom datasets import ds_utils\nimport utils.io\nfrom utils import log\n\nimport cv2 as cv\n\n# Ignore warnings\nimport warnings\nwarnings.filterwarnings(\"ig...
[ [ "pandas.merge", "pandas.read_pickle", "numpy.minimum", "numpy.sqrt", "numpy.abs", "numpy.eye", "numpy.int32", "torch.utils.data.DataLoader", "numpy.arctan2", "numpy.deg2rad", "pandas.DataFrame.from_dict", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
BILAB-NTU/Deep-learning-based-multi-transducer-photoacoustic-tomography-imaging-without-radius-calibration
[ "d02e7b05f9ddc6c740f691158844fd3c74704e91" ]
[ "Fully_Dense_UNet_convLSTM_bridge.py" ]
[ "from tensorflow.keras import Model\r\nfrom tensorflow.keras.layers import Conv2D, Add, Input, ConvLSTM2D,BatchNormalization, Concatenate, Conv2DTranspose,Reshape\r\n\r\n\r\n\r\n########################################################################################################################\r\n'''MODEL FUN...
[ [ "tensorflow.keras.layers.Concatenate", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Model", "tensorflow.keras.layers.Add", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.ConvLSTM2D", "tensorflow.keras.layers....
maffei2443/trabalhoBD
[ "df8d69ce01aa31f98137c3a2df291ab38aa5bada" ]
[ "user_interface.py" ]
[ "#!/usr/bin/python\n# -*- coding: UTF-8 -*-\nimport os\nimport base64\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nfrom crud import dao\n\ndef get_img(img):\n with open(img, \"rb\") as file:\n ret = base64.b64encode(file.read())\n return ret\n\ndef show_img(str_img):\n str...
[ [ "matplotlib.image.imread", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
Msameim181/RSNA-Bone-Age
[ "099d68c74aaf3311a6742d62c21146700e2c6c2c" ]
[ "models/VGGNet/vggnet_model.py" ]
[ "\"\"\"\nA from scratch implementation of the VGG architecture.\n\"\"\"\n\n# Imports\nimport torch\nimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, BatchNorm, Loss functions\n\nVGG_types = {\n \"VGG11\": [64, \"M\", 128, \"M\", 256, 256, \"M\", 512, 512, \"M\", 512, 512, \"M\"],\n \...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.cat", "torch.randn", "torch.nn.Conv2d", "torch.unsqueeze", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.cuda.is_available", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
abdullah-zaiter/Camera-Calibration
[ "ac113cc36cc3c0ae4794f2e5a85b1ee9b6d244dd" ]
[ "src/common.py" ]
[ "import os\nimport numpy as np\nimport cv2 as cv\nfrom collections import deque\nfrom calibrationUtils import NewtonRaphsonUndistort\n\nCEND = '\\33[0m'\nCBOLD = '\\33[1m'\nCRED = '\\33[31m'\nCGREEN = '\\33[32m'\nCBLUE = '\\33[34m'\npointr1 = []\npointr2 = []\npointd1 = []\npointd2 = []\n\nmode__ = str()\n\ndef ini...
[ [ "numpy.std" ] ]
secretBiology/SecretPlots
[ "eca1d0e0932e605df49d1f958f98a1f41200d589" ]
[ "SecretPlots/network/pathfinder.py" ]
[ "# SecretPlots\n# Copyright (c) 2019. SecretBiology\n#\n# Author: Rohit Suratekar\n# Organisation: SecretBiology\n# Website: https://github.com/secretBiology/SecretPlots\n# Licence: MIT License\n# Creation: 11/15/19, 11:09 AM\n#\n#\n# Path finder functions related to the our network\n\nfrom typing import Li...
[ [ "numpy.square", "numpy.array", "numpy.asanyarray" ] ]
alanmatzumiya/Paper
[ "d65ff68475eb72324594701d06754d0d005f6a86" ]
[ "examples/burgers_example/test_burgers.py" ]
[ "from numpy import sin, pi, linspace\nfrom pySpectralFPK import FPK_solver\nfrom timeit import timeit\n\n\ndef u0(x):\n \"\"\"\n Initial Condition\n Parameters\n ----------\n x : array or float;\n Real space\n Returns\n -------\n array or float : Initial condition evaluated in the rea...
[ [ "numpy.linspace", "numpy.sin" ] ]
orduek/nilearn
[ "1e244d8bddbf755611b854c37d28f121d68a59d7" ]
[ "nilearn/image/tests/test_resampling.py" ]
[ "\"\"\"\nTest the resampling code.\n\"\"\"\nimport os\nimport copy\nimport math\n\nfrom numpy.testing import (assert_almost_equal,\n assert_array_equal,\n assert_array_almost_equal)\nimport numpy as np\nimport pytest\n\nfrom nibabel import Nifti1Image\n\nfrom nile...
[ [ "numpy.diag", "numpy.dot", "numpy.concatenate", "numpy.all", "numpy.max", "numpy.random.randint", "numpy.eye", "numpy.testing.assert_almost_equal", "numpy.zeros", "numpy.testing.assert_array_almost_equal", "numpy.logical_not", "numpy.array", "numpy.random.Random...
ravic1995/FundamentalAnalysis
[ "0ca0d75a81e0bcf8df75843a451d174a40150915" ]
[ "FundamentalAnalysis/ratios.py" ]
[ "from urllib.request import urlopen\nfrom urllib.error import HTTPError\nimport json\nimport pandas as pd\n\n\ndef key_metrics(ticker, api_key, period=\"annual\", TTM=False, limit=0):\n \"\"\"\n Description\n ----\n Gives information about key metrics of a company overtime which includes\n i.a. PE ra...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
NISP-official/CARTL
[ "8fba278783c9088b876f09eb0e659a9f9356f129" ]
[ "src/utils/spectral_norm.py" ]
[ "\"\"\"\nSpectral Normalization from https://arxiv.org/abs/1802.05957\nCode from PyTorch 1.5.1\n\"\"\"\nimport torch\nfrom torch.nn.functional import normalize\n\n\nclass SpectralNorm(object):\n # Invariant before and after each forward call:\n # u = normalize(W @ v)\n # NB: At initialization, this invar...
[ [ "torch.mv", "torch.no_grad" ] ]
Naroloal/dlaCluster
[ "0a0990e332068670069ed5a2621cf25c9065c0c6" ]
[ "fractalDimensionality.py" ]
[ "\"\"\"\nThis function finds the fractal dimensionality of the cluster \n\"\"\"\n\nfrom DLAcluster import DLAcluster \nimport numpy\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import curve_fit\n\n\n\nradiusArray=numpy.arange(30,60,5)\nmass=[]\n\nfor i in radiusArray:\n massValue,matrix=DLAcluster(i,Fal...
[ [ "numpy.log", "numpy.poly1d", "numpy.polyfit", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.savefig", "numpy.round", "matplotlib.pyplot.subplot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.sh...
sjpfenninger/calliope
[ "a4e49c3b7d37f908bafc84543510eec0b4cf5d9f" ]
[ "calliope/time_masks.py" ]
[ "\"\"\"\nCopyright (C) 2013-2016 Stefan Pfenninger.\nLicensed under the Apache 2.0 License (see LICENSE file).\n\ntime_masks.py\n~~~~~~~~~~~~~\n\nFunctions to pick timesteps from data given certain criteria.\n\n\"\"\"\n\nimport pandas as pd\n\nfrom . import time_funcs\n\n\ndef _get_array(data, var, tech, locations)...
[ [ "pandas.TimeGrouper", "pandas.Timedelta", "pandas.date_range" ] ]
TheMemoryDealer/CV-leaf-segm
[ "291d46c0732b3be2f4cdbf4440e8d0f0584c1db4" ]
[ "main.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport csv, os, sys, glob, statistics, cv2, re\nfrom termcolor import colored\nimport pandas as pd\nfrom scipy import ndimage as ndi\nfrom skimage.measure import regionprops\nfrom skimage.segmentation import watershed\nfrom skimage.feature import peak_local_max\...
[ [ "matplotlib.pyplot.imshow", "pandas.read_csv", "numpy.logical_and", "numpy.asarray", "numpy.uint8", "numpy.around", "scipy.ndimage.distance_transform_edt", "pandas.DataFrame", "numpy.ones", "scipy.ndimage.label", "numpy.copy", "matplotlib.pyplot.subplot", "numpy...
LiFH/MySR
[ "f6075f8711853aba6f0aae9cef18c5da84abb78c" ]
[ "utils.py" ]
[ "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n'''\n@File : utils.py \n@Contact : fh.li@foxmail.com\n@Modify Time 2020/3/30 3:56 PM \n'''\nimport torch\nimport pytorch_ssim\nfrom math import log10\n\ndef get_network_params(net):\n return sum(param.numel() for param in net.parameters())\n\n\n\n\n...
[ [ "torch.zeros_like", "torch.rand", "torch.cuda.is_available", "torch.where", "torch.ones_like" ] ]
settinghead/pytorch-CycleGAN-and-pix2pix
[ "1d31100d608cc7835fdd24c2279cb54ab3c82e0b" ]
[ "options/base_options.py" ]
[ "import argparse\nimport os\nfrom util import util\nimport torch\nimport models\nimport data\n\n\nclass BaseOptions():\n def __init__(self):\n self.initialized = False\n\n def initialize(self, parser):\n parser.add_argument('--dataroot', required=True,\n help='path to ...
[ [ "torch.cuda.set_device" ] ]
Crazy-LittleBoy/MLTools
[ "813d3a29ac64b21e74d33f0470fb31fc372b27c4" ]
[ "stacking.py" ]
[ "# -*- coding:utf-8 -*-\r\nimport numpy as np\r\nimport json\r\nfrom sklearn.metrics import classification_report\r\nfrom sklearn.model_selection import train_test_split, StratifiedShuffleSplit, KFold\r\nimport pandas as pd\r\nfrom lightgbm import LGBMClassifier\r\nfrom xgboost import XGBClassifier\r\nfrom sklearn....
[ [ "pandas.read_csv", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.KFold", "numpy.concatenate", "sklearn.ensemble.AdaBoostClassifier", "numpy.mean", "sklearn.ensemble.GradientBoostingClassifier", "numpy.array" ] ]
farizrahman4u/dl4j-test-resources
[ "ec81bfb53c77bbdfffef146a4bc11074dc7f3191" ]
[ "src/main/resources/modelimport/keras/fullconfigs/cnn/predict.py" ]
[ "from keras.models import load_model\nimport numpy as np\n\nnp.random.seed(1337)\n\nmodel = load_model(\"cnn_batch_norm.h5\")\ninput = np.random.random((5, 10, 10, 3))\n\noutput = model.predict(input)\n\nassert abs(-0.0520611 - output[0][0]) < 0.000001\nassert abs(0.04986075 - output[1][0]) < 0.000001\nassert abs...
[ [ "numpy.save", "numpy.random.random", "numpy.random.seed" ] ]
dejac001/MCFlow
[ "19d1ee21318b49102842d75493a2fb830ec116f0", "19d1ee21318b49102842d75493a2fb830ec116f0" ]
[ "quick/calc_kH.py", "defineIntersection.py" ]
[ "def kH(dG, MW):\n mean, stderr = dG\n b = -1/(0.008314*323.)\n a = MW/(8314*323.)\n return [\n math.exp(b*mean)*a,\n b*stderr*math.exp(b*mean)*a,\n ]\n\nimport math\n\n#dG = [-12.7,0.7]\nif __name__ == '__main__':\n# print(kH(dG, 102.162))\n# print(kH([-39.7,0.2], 104.15))\n import sys\...
[ [ "numpy.std", "numpy.mean" ], [ "numpy.cos", "numpy.linspace", "numpy.sin" ] ]
codemzs/onnxruntime
[ "c69194ec4c8c9674368113aa6044d0db708cd813" ]
[ "onnxruntime/test/python/onnx_backend_test_series.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport argparse\nimport sys\nimport os\nimport platform\nimport unittest\nimport onnx\nimport onnx.backend.test\n\nimport numpy as np\nimport onnxruntime.backend as c2\n\npytest_plugins = 'onnx.backend.test.report',\n...
[ [ "numpy.testing.assert_array_equal", "numpy.testing.assert_equal", "numpy.testing.assert_allclose" ] ]
hammcin/CarND-Behavioral-Cloning-P3
[ "bbce8d03cdc5fdc9ff0b65dafb6adb926ce1c56a" ]
[ "model.py" ]
[ "import csv\nfrom sklearn.model_selection import train_test_split\nimport cv2\nimport random\nimport numpy as np\nimport sklearn\nfrom scipy import ndimage\nfrom keras.models import Sequential, Model\nfrom keras.layers import Flatten, Dense, Lambda, Convolution2D, MaxPooling2D\nfrom keras.layers import Cropping2D, ...
[ [ "matplotlib.pyplot.legend", "scipy.ndimage.imread", "matplotlib.pyplot.title", "sklearn.utils.shuffle", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.ylabel" ...
lim0606/pytorch-ardae-vae
[ "52f460a90fa5822692031ab7dcca39fa9168988e" ]
[ "models/vae/auxtoy.py" ]
[ "import math\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import autograd\n\nfrom models.layers import Identity, MLP\nfrom models.reparam import NormalDistributionLinear\nfrom utils import loss_kld_gaussian, loss_kld_gaussian_vs_gaussian, loss_recon_gaussia...
[ [ "torch.randn_like", "torch.mean", "torch.max", "torch.cat", "torch.exp" ] ]
LeeDoYup/DeblurGAN-tf
[ "c147055e968006702718c98cfd3ad2c3abf33d31" ]
[ "data/data_loader.py" ]
[ "from __future__ import print_function\n\nimport os\nimport numpy as np\nimport cv2\nimport glob\nimport logging\n\ndef read_data_path_custom(data_path, image_type='png'):\n image_names = '*.'+image_type\n names = glob.glob(os.path.join(data_path, image_names))\n return names\n\ndef read_data_path(data_pat...
[ [ "numpy.shape", "numpy.array", "numpy.expand_dims" ] ]
movingpictures83/Caffe
[ "bed251d065f1ba8f408b562f8c27b3239a45b477" ]
[ "CaffePlugin.py" ]
[ "import caffe\nimport sys\nimport pickle\nimport numpy as np\n#caffe_root = \"/home/User/caffe/\"\n#sys.path.insert(0, caffe_root + 'python')\ncaffe.set_mode_gpu()\n\n\nclass CaffePlugin():\n def input(self, file):\n with open(file) as config:\n self.model_def = config.readline().strip()\n self.model_...
[ [ "numpy.load", "numpy.loadtxt" ] ]
CheerfulUser/tessffi
[ "576c6baed6e2a5762da2a97e12f2e5a8e233b74c" ]
[ "tess_ffi_mask.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom astropy.coordinates import SkyCoord\nfrom astropy import units as u\nfrom astropy.io import fits\nfrom astropy.nddata import Cutout2D\nfrom astropy.wcs import WCS\nfrom scipy.signal import fftconvolve\n\nimport ...
[ [ "pandas.read_csv", "numpy.sqrt", "scipy.signal.fftconvolve", "numpy.isfinite", "numpy.ones", "numpy.loadtxt", "numpy.nansum", "numpy.zeros_like", "numpy.array", "numpy.where", "numpy.zeros" ] ]
Sen-R/rl
[ "76c5660dbd21d9cce767afd8a416b6e744181b60" ]
[ "tests/test_utils.py" ]
[ "import pytest\nfrom rl.utils import *\n\nimport torch\nfrom torch import nn\n\nl_init = -2.\nt_init = 2.\n\ndef local_nn():\n l = nn.Linear(3, 2)\n nn.init.constant_(l.weight, l_init)\n nn.init.constant_(l.bias, l_init)\n return l\n\ndef target_nn():\n t = nn.Linear(3, 2)\n nn.init.constant_(t.we...
[ [ "torch.nn.init.constant_", "torch.nn.Linear", "torch.allclose", "torch.ones_like" ] ]
DrArryYao/PVE-MCC_for_unsignalized_intersection
[ "78a4e0c8d368738a1f959791e6c020e97de8862d" ]
[ "main.py" ]
[ "# 模型训练的主代码\nimport numpy as np\nimport tensorflow as tf\nimport os\nimport scipy.io as scio\nimport argparse\nimport cv2\nfrom shutil import copyfile\nimport matplotlib.pyplot as plt\nfrom traffic_interaction_scene import TrafficInteraction\nfrom traffic_interaction_scene import Visible\nimport time\nfrom model_ag...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "numpy.random.randn", "numpy.mean", "tensorflow.get_default_graph", "tensorflow.summary.scalar", "tensorflow.Variable", "scipy.io.loadmat", "tensorflow.ConfigProto", "numpy.std", "tensorflow.Session", "matplotlib...
hjurong/predprey
[ "82e4cb07c45ce37ce502498a1af16a2b465ff9e6" ]
[ "pred_prey.py" ]
[ "import random\r\nimport time\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nfrom timeit import default_timer\r\n\r\nrandom.seed(100000)\r\n\r\nclass Island (object):\r\n \"\"\"Island\r\n a 3D grid where zero value indicates position not occupied.\r\n \"\"\"\r\n ## Init...
[ [ "matplotlib.pyplot.ioff", "matplotlib.pyplot.close", "matplotlib.pyplot.show", "matplotlib.pyplot.pause", "matplotlib.pyplot.ion", "matplotlib.pyplot.figure" ] ]
RedisDL/RedisDL
[ "eca43e13617989a0cdd5cbcaff88dd7e1474daaf" ]
[ "tests/flow/includes.py" ]
[ "import json\nimport os\nimport random\nimport sys\nimport time\nfrom multiprocessing import Process, Pipe\nimport threading\n\nimport redis\nfrom numpy.random import default_rng\nimport numpy as np\nfrom skimage.io import imread\nfrom skimage.transform import resize\n\n\nsys.path.insert(0, os.path.join(os.path.dir...
[ [ "numpy.random.default_rng" ] ]
oya163/nepali-ner
[ "9e8a853fd6eb912cdcd1195c6b3a5ee8a460b9e8" ]
[ "train.py" ]
[ "#!/usr/bin/env python3\n\n'''\n Trainer\n Author: Oyesh Mann Singh\n'''\n\nimport os\nfrom utils.eval import Evaluator\nfrom tqdm import tqdm, tqdm_notebook, tnrange\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom sklearn.metrics import accuracy_score\n\ntorch.manual_seed(163)\ntqdm.p...
[ [ "torch.nn.NLLLoss", "torch.max", "torch.load", "torch.manual_seed", "torch.save", "sklearn.metrics.accuracy_score" ] ]
Carlor87/naima
[ "1728b0ac18fab9e709816c868625e5ffbaab83b7" ]
[ "docs/_static/RXJ1713_IC.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nimport naima\nimport os\nimport sys\nimport astropy.units as u\nfrom astropy.io import ascii\n\n# Model definition\n\nfrom naima.models import InverseCompton, ExponentialCutoffPowerLaw\n\n\ndef ElectronIC(pars, data):\n\n # Match parameters to ECPL properties, and give...
[ [ "numpy.logspace", "numpy.log10" ] ]
dragan-avramovski/tensorflow-som
[ "043f5a04c5b3a3662a76b99cc4e941603793ec62" ]
[ "tf_som.py" ]
[ "# MIT License\r\n#\r\n# Copyright (c) 2018 Chris Gorman\r\n#\r\n# Permission is hereby granted, free of charge, to any person obtaining a copy\r\n# of this software and associated documentation files (the \"Software\"), to deal\r\n# in the Software without restriction, including without limitation the rights\r\n# ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.device", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.cast", "tensorflow.argsort", "tensorflow.linspace", "tensorflow.compat.v1.train.Saver", "tensorflow.linalg.eigh", "tensorflow.argmin", "sklearn.preprocessing.Mi...
ankushaggarwal/scipy
[ "eadc876441aa81bcc37d2e4b3d815502ae415004" ]
[ "scipy/optimize/__init__.py" ]
[ "\"\"\"\n=====================================================\nOptimization and root finding (:mod:`scipy.optimize`)\n=====================================================\n\n.. currentmodule:: scipy.optimize\n\nSciPy ``optimize`` provides functions for minimizing (or maximizing)\nobjective functions, possibly sub...
[ [ "scipy._lib._testutils.PytestTester" ] ]
rraminen/pytorch
[ "f7d5d02a1d873ef61b10186225704b2b283a989a" ]
[ "torch/utils/data/datapipes/dataframe/dataframe_wrapper.py" ]
[ "try:\n import pandas # type: ignore[import]\n\n # pandas used only for prototyping, will be shortly replaced with TorchArrow\n WITH_PANDAS = True\nexcept ImportError:\n WITH_PANDAS = False\n\n\nclass PandasWrapper:\n @classmethod\n def create_dataframe(cls, data, columns):\n if not WITH_P...
[ [ "pandas.concat", "pandas.DataFrame" ] ]