repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
fatfatbear/tinynn
[ "8ef3e834e6af330c6809b1e09757bd95f91b0e3c" ]
[ "examples/mnist/pytorch-run.py" ]
[ "import argparse\nimport os\nimport time\n\nimport tinynn as tn\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\n\nclass Dense(nn.Module):\n\n def __init__(self):\n super(Dense, self).__init__()\n self.fc1 = nn.Linear(784, 200)\n self.fc...
[ [ "torch.nn.functional.log_softmax", "torch.nn.init.xavier_uniform_", "torch.nn.Linear", "torch.nn.LSTM", "torch.nn.functional.max_pool2d", "torch.flatten", "torch.manual_seed", "torch.no_grad", "torch.nn.functional.nll_loss", "torch.nn.functional.relu", "torch.from_numpy...
shaoshitong/hdvw
[ "fbb39da9ad8a765f74225eec7e9614978c740dde" ]
[ "hdvw/models/seresnet_mcdo_block.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport hdvw.models.layers as layers\nimport hdvw.models.gates as gates\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_channels, channels,\n stride=1, groups=1, width_per_group=64, rate=0.3, sd...
[ [ "torch.nn.Identity", "torch.nn.functional.dropout", "torch.nn.Sequential" ] ]
arxxv/ivy
[ "740881dfefbdf658f6e395f1b3bc17ed4a77f650" ]
[ "ivy/functional/backends/torch/array_api/manipulation_functions.py" ]
[ "# global\nimport torch\nfrom typing import Union, Optional, Tuple, List\n\n\ndef roll(x: torch.Tensor, shift: Union[int, Tuple[int]], axis: Union[int, Tuple[int]]=None)\\\n -> torch.Tensor:\n return torch.roll(x, shift, axis) \n\n\n# noinspection PyShadowingBuiltins\ndef flip(x: torch.Tensor,\n axis...
[ [ "torch.roll", "torch.flip" ] ]
xiadehu27/OIDDN
[ "29793c855831febcb09b60f8c4882b1e31faa28c" ]
[ "OIDN_def.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.nn.functional as F\nimport scipy.io as sio\nimport numpy as np\nimport os\n\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\n# Define Basic reconstruct blo...
[ [ "torch.nn.PixelShuffle", "torch.nn.functional.conv2d", "torch.sqrt", "torch.nn.functional.relu", "torch.sign", "torch.cuda.is_available", "torch.nn.ModuleList", "torch.abs", "torch.cat", "torch.Tensor" ] ]
hellpanderrr/chicksexer
[ "7cf2bd1f3bea7501c7a64eda06e9d0506a061928" ]
[ "preprocessor/main.py" ]
[ "# -*- coding: UTF-8 -*-\n\"\"\"\nMain module of preprocessor package. Can be executed by `python -m preprocessor`.\n\"\"\"\nimport os\nimport pickle\nfrom random import shuffle\n\nimport numpy as np\n\nfrom chicksexer.constant import POSITIVE_CLASS, NEGATIVE_CLASS, NEUTRAL_CLASS, CLASS2DEFAULT_CUTOFF\nfrom chickse...
[ [ "numpy.random.choice" ] ]
Rexiome/Knowledge-Distillation-Toolkit
[ "5e11420cb0d7e23adda17e2212b515516a53c883" ]
[ "examples/wav2vec2_compression_demo/wav2vec2_compression_demo.py" ]
[ "from collections import ChainMap\n\nimport yaml\nimport torch\nimport fairseq_mod\n\nimport sys\nsys.path.append(\"../..\")\n\nfrom wav2vec2_inference_pipeline import inference_pipeline\nfrom data_loader import LibriSpeechDataLoader\nfrom knowledge_distillation.kd_training import KnowledgeDistillationTraining\nfro...
[ [ "torch.load" ] ]
yoon-gu/chaospy
[ "f22aa31e2a338a32a6d09b810c5b629c10a87236" ]
[ "src/chaospy/distributions/copulas/baseclass.py" ]
[ "r\"\"\"\nA cumulative distribution function of an independent multivariate random\nvariable can be made dependent through a copula as follows:\n\n.. math::\n F_{Q_0,\\dots,Q_{D-1}} (q_0,\\dots,q_{D-1}) =\n C(F_{Q_0}(q_0), \\dots, F_{Q_{D-1}}(q_{D-1}))\n\nwhere :math:`C` is the copula function, and :math:`F_{...
[ [ "numpy.ones", "numpy.zeros", "numpy.abs", "numpy.array", "numpy.where" ] ]
Swapnil99007/sunpy
[ "249619d679ee8caf19f56a2cddadbfee6d026c52" ]
[ "sunpy/coordinates/tests/test_transformations.py" ]
[ "import numpy as np\nimport pytest\n\nimport astropy\nimport astropy.units as u\nfrom astropy.tests.helper import quantity_allclose, assert_quantity_allclose\nfrom astropy.coordinates import (SkyCoord, get_body_barycentric, Angle,\n ConvertError, Longitude, CartesianRepresentation,\n...
[ [ "numpy.arctan2", "numpy.all", "numpy.tan" ] ]
moeyensj/adam_home
[ "7dbe661ed9a04e9621ec4f5c9a0a9682cc37c227" ]
[ "adam/astro_utils.py" ]
[ "import numpy as np\n\nJPL_OBLIQUITY = np.deg2rad(84381.448 / 3600.0)\n\n\ndef icrf_to_jpl_ecliptic(x, y, z, vx, vy, vz):\n return _apply_x_rotation(JPL_OBLIQUITY, x, y, z, vx, vy, vz)\n\n\ndef jpl_ecliptic_to_icrf(x, y, z, vx, vy, vz):\n return _apply_x_rotation(-JPL_OBLIQUITY, x, y, z, vx, vy, vz)\n\n\ndef ...
[ [ "numpy.sin", "numpy.cos", "numpy.deg2rad" ] ]
amousist/cartpole
[ "7534d9504b4678a3b09a4e17466f54eaeaf23ccc" ]
[ "venv/lib/python3.6/site-packages/gym/envs/mujoco/humanoid_v3.py" ]
[ "import numpy as np\nfrom gym.envs.mujoco import mujoco_env\nfrom gym import utils\n\n\nDEFAULT_CAMERA_CONFIG = {\n 'trackbodyid': 1,\n 'distance': 4.0,\n 'lookat': np.array((0.0, 0.0, 2.0)),\n 'elevation': -20.0,\n}\n\n\ndef mass_center(model, sim):\n mass = np.expand_dims(model.body_mass, axis=1)\n...
[ [ "numpy.sum", "numpy.expand_dims", "numpy.clip", "numpy.array", "numpy.concatenate", "numpy.square", "numpy.linalg.norm" ] ]
kun-woo-park/MNIST-Alphabet-Superposition-CNN-DACON
[ "e5c50f6f28ae9cded2a65425f977e8f703b6fd89" ]
[ "deep_learning_modules.py" ]
[ "import os\nimport time\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import Dataset\n\n\nclass CustomDataset(Dataset): # custom dataset\n def __init__(self, x_dat, y_dat):\n x = x_dat\n y = y_dat\n self.len = x.shape[0]\n y = y.asty...
[ [ "torch.nn.BatchNorm2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.BatchNorm1d", "torch.save", "torch.tensor", "torch.no_grad", "torch.nn.CrossEntropyLoss", "torch.nn.KLDivLoss", "torch.cuda.is_available", "torch.nn.Conv2d", "torch.max", "torch.nn.ReLU" ...
AnastasiiaNovikova/sentiment-discovery
[ "eaae55921038d674e2f16fbd0bfd2e63194a9545" ]
[ "fp16/fp16.py" ]
[ "import torch\r\nfrom torch import nn\r\nfrom torch.autograd import Variable\r\nfrom torch.nn.parameter import Parameter\r\nfrom torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors\r\n\r\nfrom .loss_scaler import DynamicLossScaler, LossScaler\r\n\r\nFLOAT_TYPES = (torch.FloatTensor, torch.cuda.Floa...
[ [ "torch._utils._unflatten_dense_tensors", "torch._utils._flatten_dense_tensors", "torch.autograd.Variable", "torch.nn.utils.clip_grad_norm" ] ]
ZhuofanXie/Copulas
[ "3210fc141c741185b781686cb69e00a96972d960" ]
[ "tests/unit/univariate/test_base.py" ]
[ "from unittest import TestCase\n\nimport numpy as np\n\nfrom copulas.univariate.base import BoundedType, ParametricType, Univariate\nfrom copulas.univariate.beta import BetaUnivariate\nfrom copulas.univariate.gamma import GammaUnivariate\nfrom copulas.univariate.gaussian import GaussianUnivariate\nfrom copulas.univ...
[ [ "numpy.array" ] ]
Sand3r-/Paddle
[ "1217a521554d63caa1381b8716910d0268dfc22d" ]
[ "python/paddle/fluid/tests/unittests/test_imperative_deepcf.py" ]
[ "# Copyright (c) 2018 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.random.shuffle", "numpy.expand_dims", "numpy.zeros" ] ]
christian-oreilly/mne-python
[ "33146156f2660f122ecc04fa0d5b3fd3c34b549e" ]
[ "mne/io/brainvision/brainvision.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Conversion tool from Brain Vision EEG to FIF.\"\"\"\n\n# Authors: Teon Brooks <teon.brooks@gmail.com>\n# Christian Brodbeck <christianbrodbeck@nyu.edu>\n# Eric Larson <larson.eric.d@gmail.com>\n# Jona Sassenhagen <jona.sassenhagen@gmail.com>\n# Phi...
[ [ "numpy.fromfile", "numpy.empty", "numpy.zeros", "numpy.isinf", "numpy.arange", "numpy.isnan", "numpy.array", "numpy.deg2rad" ] ]
Myunghee13/DSCI560_HW5
[ "1a6104569b95ccca392ba67794e03054dd696c59" ]
[ "app.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom bokeh.plotting import figure, show, output_notebook,ColumnDataSource,curdoc\nfrom bokeh.models import HoverTool, Select, Div\nfrom bokeh.layouts import row, column\nfrom bokeh.transform import dodge\n\ndata1 = pd.read_csv('latimes-state-totals.csv')\n\ndata1['date_time...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
Tridentflayer/structure_tester_project
[ "0c67e450f3c1cd29dd9385ce407cc1407d9b9251" ]
[ "mcculw-master/structure-tester/tests_and_examples/embeded_gui_example.py" ]
[ "###################################################################\n# #\n# PLOT A LIVE GRAPH (PyQt5) #\n# ----------------------------- #\n# EMBED A MATPLOTLIB ANIMATI...
[ [ "matplotlib.lines.Line2D", "numpy.roll", "numpy.append", "matplotlib.animation.TimedAnimation._stop", "matplotlib.figure.Figure", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__", "matplotlib.animation.TimedAnimation._step", "matplotlib.use", "numpy.sin", "nu...
alvarofpp/ufrn-imd1130-nosql
[ "6abf0553befa8fd914e1fd19446f6ccf5c35ba05" ]
[ "trabalho_final/postgres/geo_postgres.py" ]
[ "import psycopg2;\nimport time;\nimport numpy as np\n\ncon = psycopg2.connect(\n host = \"localhost\",\n database = \"mydb\",\n user = \"brunnom\",\n password = \"postgres\"\n)\n\ncur = con.cursor();\n\ntime1km = []\nqtd1km = 0;\ntime15km = []\nqtd15km = 0;\ntime2km = []\nqtd2km = 0;\ntime25km = []\nqtd...
[ [ "numpy.average" ] ]
PolymerGuy/recon
[ "05b14f0834fa675579eabdf43fac046259df19bb" ]
[ "recolo/data_structures/read_abaqus_rpts.py" ]
[ "import os\nimport numpy as np\nfrom collections import namedtuple\nimport logging\nfrom natsort import natsorted\n\n\ndef list_files_in_folder(path, file_type=\".rpt\",abs_path=False):\n \"\"\" List all files with a given extension for a given path. The output is sorted\n Parameters\n ----------\n...
[ [ "numpy.array", "numpy.genfromtxt", "numpy.shape" ] ]
Jaskaran197/Red-blood-cell-detection-SSD
[ "a33b330ad17454a7425aa7f57818c0a41b4e0ff9" ]
[ "utils/training_utils/ssd_vgg16.py" ]
[ "import os\nfrom losses import SSD_LOSS\nfrom utils import data_utils\nfrom networks import SSD_VGG16\nimport tensorflow as tf\nfrom tensorflow.keras.optimizers import SGD, Adam\nfrom data_generators import SSD_DATA_GENERATOR\nfrom tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, TerminateOnNaN, Learni...
[ [ "tensorflow.keras.optimizers.Adam", "tensorflow.keras.optimizers.SGD" ] ]
qipeng/cudamat
[ "a346369447e9b2dbb730e4218a4c0eaa153840ef" ]
[ "test_learn.py" ]
[ "import pdb\nimport numpy as np\nimport nose\nimport cudamat as cm\nimport learn as cl\n\ndef setup():\n cm.cublas_init()\n\ndef teardown():\n cm.cublas_shutdown()\n\ndef test_mult_by_sigmoid_deriv():\n m = 256\n n = 128\n c_targets = np.array(np.random.randn(m, n)*10, dtype=np.float32, order='F')\n ...
[ [ "numpy.random.randn", "numpy.random.rand" ] ]
GeniusDog/Intelligent-Projects-Using-Python
[ "ca4650abb0c477b28a5698032835ea993cb08bd4" ]
[ "Chapter04/cycledGAN_edges_to_bags.py" ]
[ "from __future__ import print_function, division\n#import scipy\nimport tensorflow as tf\nimport datetime\nimport matplotlib.pyplot as plt\n#import sys\n#from data_loader import DataLoader\nimport numpy as np\nimport os\nimport time \nimport glob\nfrom scipy.misc import imread,imresize,imsave\nimport copy\nimport f...
[ [ "tensorflow.summary.scalar", "tensorflow.contrib.layers.batch_norm", "tensorflow.variable_scope", "tensorflow.abs", "tensorflow.get_variable_scope", "tensorflow.summary.merge", "tensorflow.summary.FileWriter", "tensorflow.global_variables_initializer", "tensorflow.truncated_nor...
mguo123/pan_omics
[ "e1cacd543635b398fb08c0b31d08fa6b7c389658" ]
[ "src/rgt/motifanalysis/Motif.py" ]
[ "###################################################################################################\n# Libraries\n###################################################################################################\n\nfrom __future__ import division\n# Python 3 compatibility\nfrom __future__ import print_function\n...
[ [ "numpy.argmax" ] ]
james94/driverlessai-recipes
[ "87c35460db59ffda8dc18ad82cb3a9b8291410e4" ]
[ "transformers/executables/pe_imports_features.py" ]
[ "\"\"\"Extract LIEF features from PE files\"\"\"\nfrom h2oaicore.transformer_utils import CustomTransformer\nimport datatable as dt\nimport numpy as np\n\n\nclass PEImportsFeatures(CustomTransformer):\n _modules_needed_by_name = ['lief==0.9.0']\n _regression = True\n _binary = True\n _multiclass = True\...
[ [ "sklearn.feature_extraction.FeatureHasher" ] ]
HanMeh/ABMT
[ "e2767bd29ad9e2da767948b5047cf7f287094c6b" ]
[ "demo.py" ]
[ "\"\"\"Main function of ABMT for the paper: Adversarial Brain Multiplex Prediction From a Single Brain Network with Application to Gender Fingerprinting\r\nView Network Normalization\r\n Details can be found in:\r\n (1) the original paper\r\n Ahmed Nebli, and Islem Rekik.\r\n -----------------------...
[ [ "tensorflow.reset_default_graph", "tensorflow.Session" ] ]
lkhphuc/pytorch-lightning
[ "6ebe0d7266fe29104f4c68dd9143326132885a30" ]
[ "pytorch_lightning/trainer/distrib_parts.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.ones", "torch.cuda.device_count", "torch.cuda.is_available", "torch.device", "torch.cuda.set_device" ] ]
xpertdev/insightface
[ "78654944d332573715c04ab5956761f5215d0f51" ]
[ "reconstruction/PBIDR/code/utils/general.py" ]
[ "import os\nfrom glob import glob\nimport torch\n\ndef mkdir_ifnotexists(directory):\n if not os.path.exists(directory):\n os.mkdir(directory)\n\ndef get_class(kls):\n parts = kls.split('.')\n module = \".\".join(parts[:-1])\n m = __import__(module)\n for comp in parts[1:]:\n m = getatt...
[ [ "torch.arange", "torch.index_select" ] ]
isplab-unil/kin-genomic-privacy
[ "a563a1cc02269d240efd687b64d20f25b12a9650" ]
[ "backend/kin_genomic_privacy/sequenced_family_tree.py" ]
[ "# -*- coding: utf-8 -*-\n\n__author__ = \"Didier Dupertuis, Benjamin Trubert, Kévin Huguenin\"\n__copyright__ = \"Copyright 2019, The Information Security and Privacy Lab at the University of Lausanne (https://www.unil.ch/isplab/)\"\n__credits__ = [\"Didier Dupertuis\", \"Benjamin Trubert\", \"Kévin Huguenin\", \"...
[ [ "numpy.array", "numpy.interp", "numpy.sum", "numpy.mean" ] ]
eribean/RyStats
[ "1cdd0ea55a074cc81e61d2845216f395ba095f10" ]
[ "inferential/test/test_ttests.py" ]
[ "import unittest\n\nimport numpy as np\n\nfrom RyStats.inferential import (unequal_variance_ttest, equal_variance_ttest, \n one_sample_ttest, repeated_ttest)\n\nfrom RyStats.inferential.ttests import _p_value_and_confidence_intervals \n\n\nclass TestEq...
[ [ "numpy.ones", "numpy.isinf", "numpy.random.default_rng", "numpy.testing.assert_allclose" ] ]
cheind/pytorch-blender-dr
[ "fd2e449dd81723bb1978f005736104f27cc1770b" ]
[ "py_torch/IoU_loss_test.py" ]
[ "import torch\r\nimport numpy as np\r\nimport math\r\n\r\ndef bbox_iou(box1, box2, x1y1x2y2=True, GIoU=False, DIoU=False, CIoU=False, eps=1e-9):\r\n # Returns the IoU of box1 to box2. box1 is 4, box2 is nx4\r\n box2 = box2.T # 4xn\r\n\r\n # Get the coordinates of bounding boxes\r\n if x1y1x2y2: # x1, ...
[ [ "torch.atan", "torch.min", "torch.no_grad", "torch.tensor", "torch.max" ] ]
IncyLiu/autokeras
[ "e9dbf66b005e2ffaabe29bc366bb4e72fa79add8" ]
[ "tests/nn/test_layers.py" ]
[ "from autokeras.nn.layers import *\nimport numpy as np\n\n\ndef test_global_layer():\n layer = GlobalAvgPool2d()\n inputs = torch.Tensor(np.ones((100, 50, 30, 40)))\n assert layer(inputs).size() == (100, 50)\n" ]
[ [ "numpy.ones" ] ]
RupertDodkins/medis
[ "bdb1f00fb93506da2a1f251bc6780e70e97a16c5" ]
[ "examples/MKID_pic.py" ]
[ "import os\nimport numpy as np\nimport matplotlib as mpl\nmpl.use('Qt5Agg')\nfrom medis.params import tp, mp, cp, sp, ap, iop\nimport medis.Detector.get_photon_data as gpd\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import LogNorm\nfrom medis.Utils.plot_tools import loop_frames, quicklook_im, view_data...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.show", "numpy.angle", "matplotlib.use", "numpy.array", "numpy.mean" ] ]
BubuLK/sfepy
[ "127ab753a2f4f24ed359d0152088d11227c3dd49", "f02f88c5df9814ad710c658429e23c90744b0d9d" ]
[ "sfepy/terms/terms_basic.py", "tests/test_homogenization_engine.py" ]
[ "import numpy as nm\n\nfrom sfepy.base.base import assert_\nfrom sfepy.linalg import dot_sequences\nfrom sfepy.terms.terms import Term, terms\n\nclass ZeroTerm(Term):\n r\"\"\"\n A do-nothing term useful for introducing additional variables into the\n equations.\n\n :Definition:\n\n .. math::\n ...
[ [ "numpy.sum", "numpy.ascontiguousarray", "numpy.asarray" ], [ "numpy.sum" ] ]
SebastianJia/e2e-coref
[ "9a68d6816cfb4ac00bca9c83f587891239215dce" ]
[ "coref_model.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport operator\nimport random\nimport math\nimport json\nimport threading\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow_hub as hub\nimport h5py\n\nimport util\nimport core...
[ [ "tensorflow.reduce_logsumexp", "tensorflow.PaddingFIFOQueue", "tensorflow.reshape", "tensorflow.nn.top_k", "tensorflow.logical_and", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.squeeze", "tensorflow.sequence_mask", "tensorflow.concat", "tensorflow.Vari...
cambiegroup/aizynthfinder
[ "f5bafb2ac4749284571c05ae6df45b6f45cccd30" ]
[ "tests/test_score.py" ]
[ "import pytest\nimport numpy as np\n\nfrom aizynthfinder.context.scoring import (\n StateScorer,\n NumberOfReactionsScorer,\n AverageTemplateOccurenceScorer,\n NumberOfPrecursorsScorer,\n NumberOfPrecursorsInStockScorer,\n PriceSumScorer,\n RouteCostScorer,\n ScorerCollection,\n ScorerExc...
[ [ "numpy.round" ] ]
stuart-fb/pyrobot
[ "2f06f337f84e2c0b172dcf5ee0cd8c7de73a50e1" ]
[ "src/pyrobot/utils/util.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\nimport sys\nimport numpy as np\nimport rospy\nimport tf\nimport geometry_msgs.msg\nfrom geometry_msgs.msg import PoseStamped, Pose\nf...
[ [ "numpy.eye" ] ]
autonomousvision/stylegan_xl
[ "8c76531bcbf0931c295ecd1d32f75af998d1411f" ]
[ "pg_modules/discriminator.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.transforms import Normalize\nimport pickle\n\nfrom training.diffaug import DiffAugment\nfrom training.networks_stylegan2 import FullyConnectedLayer\nfrom pg_modules.blocks import conv2d, DownBlock, DownBlockP...
[ [ "torch.nn.Sequential", "numpy.sqrt", "torch.nn.ModuleDict", "torch.cat", "torch.nn.functional.interpolate", "torch.nn.LeakyReLU" ] ]
Chrasmus/SDCN_July18_T3_P3_CapStone_System_Integration
[ "b64e01a0202adb4a6d82c2a598756a07e585fcbb" ]
[ "ros/src/tl_detector/light_classification/tl_classifier.py" ]
[ "from styx_msgs.msg import TrafficLight\nimport tensorflow as tf\nimport numpy as np\n\nclass TLClassifier(object):\n def __init__(self, is_site):\n #TODO load classifier\n # main code source : object_detection_tutorial.ipynb from Google's model-zoo on GitHub\n if is_site:\n PATH_...
[ [ "numpy.squeeze", "tensorflow.gfile.GFile", "tensorflow.Graph", "numpy.expand_dims", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.GraphDef" ] ]
zihanzawad/Blockchain-Project
[ "94d4542fce7653dcb95d13fe6a3951160e3defd2" ]
[ "app/backend/Scripts/Transformer.py" ]
[ "from pdf2image import convert_from_path, convert_from_bytes\nfrom os import path, makedirs\nfrom hashlib import sha256\nimport numpy as np\nimport base64\n\n\nclass Transformer():\n\n #read pdf from file path and convert to jpegs\n def save_pdf_as_image(inputPath:str, outputPath:str):\n if not path.ex...
[ [ "numpy.array", "numpy.array_split", "numpy.shape", "numpy.asarray" ] ]
rmxrmx/NLP-E21
[ "fd5c3af70a2434cc30a3ffb52e4e0872cbffdd23" ]
[ "syllabus/classes/class7/main.py" ]
[ "import numpy as np\nimport torch\n\nfrom datasets import load_dataset\nimport gensim.downloader as api\n\nfrom util import batch\nfrom LSTM import RNN\nfrom embedding import gensim_to_torch_embedding\n\n# DATASET\ndataset = load_dataset(\"conllpp\")\ntrain = dataset[\"train\"]\n\n# inspect the dataset\ntrain[\"tok...
[ [ "numpy.ones", "torch.LongTensor" ] ]
dsbrown1331/vav-icml
[ "90f40c2b5b52f3cc142ffd4e02bb82d88e1e221d" ]
[ "gridworld_vav/experiments/basic_value_alignment/gaussian_reward_value_alignment_experiment_runner_diffmethods_arp.py" ]
[ "#I want to rerun things with the ARP rather than the AEC...\n\nimport sys\nimport os\nexp_path = os.path.dirname(os.path.abspath(__file__))\nprint(exp_path)\nproject_path = os.path.abspath(os.path.join(exp_path, \"..\", \"..\"))\nsys.path.insert(0, project_path)\nprint(sys.path)\n\nimport src.experiment_utils as e...
[ [ "numpy.random.seed", "numpy.linalg.norm", "numpy.random.randn" ] ]
qasimtariq1171/estimator
[ "e7fcffa942006fc2ecf4905523df2d8d6fcf51bd" ]
[ "tensorflow_estimator/python/estimator/tpu/tpu_estimator.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.tpu.ops.tpu_ops.outfeed_dequeue_tuple", "tensorflow.math.equal", "tensorflow.python.data.util.nest.flatten_up_to", "tensorflow.python.training.evaluation._StopAfterNEvalsHook", "tensorflow.identity", "tensorflow.compat.v1.logging.info", "tensorflow.python.tpu.trainin...
eliemichel/ReACORN
[ "74501551ecb387352271674efb2ed6240d234df6" ]
[ "pluto_gen_stats.py" ]
[ "# This file is part of ReACORN, a reimplementation by Élie Michel of the ACORN\n# paper by Martel et al. published at SIGGRAPH 2021.\n#\n# Copyright (c) 2021 -- Télécom Paris (Élie Michel <elie.michel@telecom-paris.fr>)\n# \n# The MIT license:\n# Permission is hereby granted, free of charge, to any person obtainin...
[ [ "matplotlib.image.imsave", "numpy.ones_like", "matplotlib.pyplot.subplots", "numpy.abs", "numpy.power", "matplotlib.pyplot.close", "numpy.sqrt", "matplotlib.image.imread" ] ]
hassenmorad/CA-Migration
[ "762434b3a013f2488c382dbdc3d2dc7b7f91c572" ]
[ "Scripts/Census/Census_5yr_CA_top50_mig_counties_0917.py" ]
[ "# Top 50 in/out migration counties for 5-yr estimates, each year b/w 05-09 to 13-17\nimport pandas as pd\nimport numpy as np\n\ncensus5yr = pd.read_csv('ca_counties_mig_5yr_0917.csv')\nca0917 = census5yr[((census5yr.County1FIPS > 6000) & (census5yr.County1FIPS < 7000)) & (census5yr.County2FIPS < 60000) & (census5y...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.concat", "numpy.full" ] ]
Xero64/pyvlm
[ "f373ac826cc65281245a69979eb28786fbf67bd0" ]
[ "pyvlm/classes/latticesurface.py" ]
[ "from math import sqrt\nfrom pygeom.matrix3d import zero_matrix_vector\nfrom matplotlib.pyplot import figure\nfrom .latticesheet import LatticeSheet\nfrom .latticepanel import LatticePanel\n\nclass LatticeSurface(object):\n name = None\n scts = None\n shts = None\n cspc = None\n xspace = None\n st...
[ [ "matplotlib.pyplot.figure", "numpy.matlib.empty", "numpy.matlib.zeros" ] ]
pysat/pysat
[ "4d12a09ea585b88d54560413e03cae9289113718" ]
[ "pysat/_files.py" ]
[ "#!/usr/bin/env python\n# Full license can be found in License.md\n# Full author list can be found in .zenodo.json file\n# DOI:10.5281/zenodo.1199703\n# ----------------------------------------------------------------------------\n\nimport copy\nimport datetime as dt\nfrom functools import partial\nimport numpy as ...
[ [ "pandas.Series", "pandas.read_csv", "numpy.dtype", "numpy.all", "numpy.array", "numpy.where", "numpy.unique" ] ]
betterenvi/QA-rank
[ "9e709e5fd85212145c98a3bf3cd5007eb76e1ffc" ]
[ "tmp.py" ]
[ "import sys, os, collections, copy\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom pandas import DataFrame, Series\r\n\r\ndata_fn = 'data/WikiQA-train.tsv'\r\nX = pd.read_csv(data_fn, sep='\\t', header=0, dtype=str, skiprows=None, na_values='?', keep_default_na=False)\r\n" ]
[ [ "pandas.read_csv" ] ]
ys2899/DCAR
[ "154cf46fd45dec8639efb6aeb348b25db32c497b" ]
[ "data/model/dcrnn_model.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\nimport pdb\n\nfrom tensorflow.contrib import legacy_seq2seq\nfrom lib.metrics import masked_mae_loss\nfrom model.dcrnn_cell import DCGRUCell\n\n\nclass DCRNNARModel(object):\...
[ [ "tensorflow.placeholder", "tensorflow.zeros", "tensorflow.stack", "tensorflow.reshape", "tensorflow.summary.merge_all", "tensorflow.unstack", "tensorflow.contrib.rnn.MultiRNNCell", "tensorflow.variable_scope", "tensorflow.random_uniform", "tensorflow.exp", "tensorflow.g...
wang-chen/graph-action-recognition
[ "319a5287c3fb58f233a8b56ed70f5be94703aa61" ]
[ "models/mlp.py" ]
[ "#!/usr/bin/env python3\n\nimport torch\nimport torch.nn as nn\n\n\nclass MLP(nn.Module):\n def __init__(self):\n super().__init__()\n self.feat1 = nn.Sequential(nn.Flatten(), nn.Linear(50*5*5, 32*5*5), nn.ReLU())\n self.feat2 = nn.Sequential(nn.Linear(32*5*5, 32*12), nn.ReLU())\n sel...
[ [ "torch.nn.ReLU", "torch.nn.Linear", "torch.nn.Flatten" ] ]
jkhenning/ignite
[ "2485fd42c6ef4d3e97fd606a52f8c6e5d940357e" ]
[ "tests/ignite/distributed/utils/test_native.py" ]
[ "import os\n\nimport pytest\nimport torch\nimport torch.distributed as dist\n\nimport ignite.distributed as idist\nfrom ignite.distributed.utils import has_native_dist_support\nfrom tests.ignite.distributed.utils import (\n _test_distrib_all_gather,\n _test_distrib_all_reduce,\n _test_distrib_barrier,\n ...
[ [ "torch.distributed.get_rank", "torch.cuda.is_available", "torch.distributed.get_world_size", "torch.cuda.device_count" ] ]
ediphy-dwild/gpytorch
[ "559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a" ]
[ "gpytorch/utils/linear_cg.py" ]
[ "import torch\nfrom .. import settings\n\n\ndef _default_preconditioner(x):\n return x.clone()\n\n\ndef linear_cg(matmul_closure, rhs, n_tridiag=0, tolerance=1e-6, eps=1e-20, max_iter=None,\n initial_guess=None, preconditioner=None):\n \"\"\"\n Implements the linear conjugate gradients method ...
[ [ "torch.sum", "torch.addcmul", "torch.reciprocal", "torch.div", "torch.mul", "torch.norm", "torch.is_tensor" ] ]
Madlhawa/Real-time-Edge-analytics
[ "9e3e7be1c32f6d33f81ffe27c7eed63f8bbb6f39" ]
[ "Past data/GetPastData.py" ]
[ "# Import packages\nimport pandas as pd\nfrom datetime import datetime\nimport numpy as np\n\n#Reading predicted data and changing date column data type\npdata = pd.read_csv('/home/pi/LABS/Asingment/Real-time-Edge-analytics/PredictionDataset.csv', skiprows=0)\npdata['Date'] = pd.to_datetime(pdata['Date'])\n\n#Selec...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
bvanaken/FARM
[ "09767092457e73860c3a604b5060562c2004f03d" ]
[ "farm/modeling/language_model.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors, The HuggingFace Inc. Team and deepset Team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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 Lice...
[ [ "torch.stack", "numpy.zeros", "torch.nn.BatchNorm1d", "sklearn.decomposition.PCA", "numpy.ma.array", "torch.from_numpy", "torch.mean" ] ]
matfija/Projektivna-geometrija
[ "1d0df7e6009dffd45ff0b892cb1d3e5a8053f5c6" ]
[ "Izometrije-prostora/izvor/izometrije.py" ]
[ "#!/usr/bin/env python3\r\n\r\n# Ukljucivanje modula za matematiku\r\nimport numpy as np\r\nimport numpy.linalg as LA\r\n\r\n# Ukljucivanje modula za upozorenja\r\nimport warnings\r\n\r\n# NAPOMENA: svi razmatrani uglovi zadati su u radijanima,\r\n# sto je u skladu sa uobicajenom informatickom praksom\r\n\r\n# Matr...
[ [ "numpy.arctan2", "numpy.eye", "numpy.arcsin", "numpy.sign", "numpy.linalg.det", "numpy.isclose", "numpy.arccos", "numpy.cos", "numpy.abs", "numpy.array", "numpy.sin", "numpy.inner", "numpy.linalg.norm", "numpy.linalg.eig" ] ]
ludkinm/pyro
[ "d24c808a9d86d79c43a99990fe9e418ce5976613" ]
[ "pyro/infer/autoguide/initialization.py" ]
[ "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nr\"\"\"\nThe pyro.infer.autoguide.initialization module contains initialization functions for\nautomatic guides.\n\nThe standard interface for initialization is a function that inputs a Pyro\ntrace ``site`` dict and returns...
[ [ "torch.no_grad", "torch.distributions.transform_to" ] ]
sebas095/imageFilter
[ "7059b7abfaceffa8f03f27947e5059e3173954d1" ]
[ "filters/gaussian.py" ]
[ "import scipy\nfrom scipy import ndimage\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nl = scipy.misc.ascent()\nl = l[230:290, 220:320]\n\nnoisy = l + 0.4 * l.std() * np.random.random(l.shape)\ngauss_denoised = ndimage.gaussian_filter(noisy, 2)\n\nplt.subplot(121)\nplt.imshow(noisy, cmap=plt.cm.gray, vmin...
[ [ "matplotlib.pyplot.xticks", "matplotlib.pyplot.title", "numpy.random.random", "matplotlib.pyplot.subplot", "scipy.ndimage.gaussian_filter", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "scipy.misc.ascent", "matplotlib.pyplot.yticks" ] ]
vutuanhai237/Braces2TeethUtilities
[ "6dd480edb09d05ac9d6f48a013649f92796549aa" ]
[ "createPix2Pix (facial)/createTeeth2Dataset.py" ]
[ "from imutils import face_utils\nimport numpy as np\nimport argparse\nimport imutils\nimport dlib\nimport cv2\nimport copy\nimport colorsys\nimport math\nimport os\nimport shutil\nimport collections \nfrom convexHull import convexHull, convexRectangle \nfrom processBar import progressbar\nfrom genTeethColor import ...
[ [ "numpy.array", "numpy.concatenate" ] ]
lukemerrick/pytorch-forecasting
[ "000ea41bea4ab7a47a0e610841d4fd88fdfead1e" ]
[ "examples/ar.py" ]
[ "from pathlib import Path\nimport pickle\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.core.common import SettingWithCopyWarning\nimport pytorch_lightning as pl\nfrom pytorch_lightning.callbacks import EarlyStopping, LearningRateMonitor\nfrom pytorch_lightning.loggers import TensorBoardLo...
[ [ "torch.set_num_threads", "pandas.to_timedelta", "pandas.Timestamp" ] ]
yanxp/ASM-Pytorch
[ "4eec5caea13320d2502007015e032d76d59eefc4" ]
[ "lib/utils/help.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport _init_paths\nfrom model.config import cfg\nfrom model.test import im_detect\nfrom model.nms_wrapper import nms\n\nfrom utils.timer import Timer\nimport matplotlib.pyplot as plt\nimport numpy as ...
[ [ "numpy.sum", "matplotlib.pyplot.draw", "numpy.zeros", "matplotlib.pyplot.switch_backend", "matplotlib.pyplot.axis", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.gcf", "numpy.exp", "matplotlib.pyplot.subplots", "numpy.amax", "numpy.hstack", "numpy.log", "...
luispedro/Coelho2021_GMGCv1_analysis
[ "5f1a62844631121cc11f8ac5a776d25baca56ff7" ]
[ "taxonomic-annotation/reconcile.py" ]
[ "import pandas as pd\nfrom taxonomic import ncbi\nn = ncbi.NCBI()\ntaxonomic = pd.read_table('/g/bork1/coelho/DD_DeCaF/genecats.cold/GMGC10.taxonomic.map', index_col=0, engine='c')\nspecies = pd.read_table('/g/bork1/coelho/DD_DeCaF/genecats.cold/GMGC10.species.match.map', header=None, usecols=[1,2], index_col=0, s...
[ [ "pandas.read_table", "pandas.Series", "pandas.DataFrame" ] ]
Embodimentgeniuslm3/NeMo
[ "5f5a9a0a1d0bcf28675841af3df9b08b56ae3203" ]
[ "nemo/collections/nlp/models/machine_translation/mt_enc_dec_bottleneck_model.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. 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...
[ [ "torch.ones_like", "torch.randn_like", "torch.nn.Linear", "torch.zeros_like", "torch.no_grad", "numpy.not_equal", "torch.exp", "torch.is_tensor", "torch.nn.Identity", "numpy.mean" ] ]
szabolcsdombi/zengl
[ "2c9c26784285f2f049fb5d6fc9da0ad65d32d52f" ]
[ "examples/heightmap_terrain.py" ]
[ "import imageio\nimport numpy as np\nimport zengl\nfrom skimage.filters import gaussian\n\nimport assets\nfrom window import Window\n\nimageio.plugins.freeimage.download()\nimg = imageio.imread(assets.get('Terrain002.exr')) # https://ambientcg.com/view?id=Terrain002\n\nnormals = np.zeros((512, 512, 3))\nnormals[:,...
[ [ "numpy.tile", "numpy.zeros", "numpy.cos", "numpy.arange", "numpy.clip", "numpy.full", "numpy.sqrt", "numpy.sin", "numpy.random.randint" ] ]
RalfGuder/LaTeX-examples
[ "cd0d97f85fadb59b7c6e9062b37a8bf7d725ba0c" ]
[ "documents/math-minimal-distance-to-cubic-function/calcMinDist.py" ]
[ "#!/usr/bin/env python\n\nimport numpy\n\n\nclass Point:\n \"\"\"Represents a point in 2D.\"\"\"\n def __init__(self, x, y):\n self.x = x\n self.y = y\n\n\ndef euclidean_dist(p1, p2):\n \"\"\"Euclidean distance of two 2D points.\"\"\"\n from math import sqrt\n return sqrt((p1.x-p2.x)**2...
[ [ "numpy.arange" ] ]
lisong996/akshare
[ "1ee414cdecc2a492f2bb2f40d326a627c46dae2b", "1ee414cdecc2a492f2bb2f40d326a627c46dae2b" ]
[ "akshare/qhkc_web/qhkc_index.py", "akshare/stock_fundamental/stock_register.py" ]
[ "# -*- coding:utf-8 -*-\n#!/usr/bin/env python\n\"\"\"\nDate: 2019/9/30 13:58\nDesc: 奇货可查网站目前已经商业化运营, 特提供奇货可查-指数数据接口, 方便您程序化调用\n注:期货价格为收盘价; 现货价格来自网络; 基差=现货价格-期货价格; 基差率=(现货价格-期货价格)/现货价格 * 100 %.\n\"\"\"\nfrom typing import AnyStr\n\nimport pandas as pd\nimport requests\n\nfrom akshare.futures.cons import (\n QHKC...
[ [ "pandas.DataFrame" ], [ "pandas.DataFrame" ] ]
AK391/anycost-gan
[ "a827390a77d6360ed6902511de447a503584c63f" ]
[ "cuda_op/fused_act.py" ]
[ "import os\n\nimport torch\nfrom torch import nn\nfrom torch.autograd import Function\nfrom torch.utils.cpp_extension import load\n\n\nmodule_path = os.path.dirname(__file__)\nfused = load(\n 'fused',\n sources=[\n os.path.join(module_path, 'fused_bias_act.cpp'),\n os.path.join(module_path, 'fus...
[ [ "torch.zeros" ] ]
guolinke/pytorch
[ "ad4b2571b605d2c2a7e288585469a06e79738eb9" ]
[ "torch/testing/_internal/common_methods_invocations.py" ]
[ "from functools import reduce, wraps, partial\nfrom itertools import product\nfrom operator import mul\nimport collections\nimport operator\nimport random\n\nimport torch\nimport numpy as np\nfrom torch._six import inf\nfrom torch.autograd import Variable\nimport collections.abc\n\nfrom typing import List, Sequence...
[ [ "torch.empty", "torch.get_default_dtype", "torch.testing._internal.common_utils.random_symmetric_matrix", "torch.rand", "torch.no_grad", "torch.tril_indices", "torch.testing._internal.common_utils.make_tensor", "torch.cuda.empty_cache", "torch.testing._internal.common_utils.ran...
WJ-Lai/CenterNet-CentralNet
[ "d28a8c2438244782ccdd6805e555558b2c01ff46" ]
[ "src/lib/datasets/dataset/fir.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pycocotools.coco as coco\nfrom pycocotools.cocoeval import COCOeval\nimport numpy as np\nimport json\nimport os\n\nimport torch.utils.data as data\nimport src.config as cf\n\nsensor = 'fir'\n\nc...
[ [ "numpy.random.RandomState", "numpy.array" ] ]
Linohong/OpenNMT_dialog
[ "4a9e598afca780723d354d599815c320706af937" ]
[ "onmt/tests/test_random_sampling.py" ]
[ "import unittest\r\nfrom onmt.translate.random_sampling import RandomSampling\r\n\r\nimport torch\r\n\r\n\r\nclass TestRandomSampling(unittest.TestCase):\r\n BATCH_SZ = 3\r\n INP_SEQ_LEN = 53\r\n DEAD_SCORE = -1e20\r\n\r\n BLOCKED_SCORE = -10e20\r\n\r\n def test_advance_with_repeats_gets_blocked(self...
[ [ "torch.randint", "torch.randn", "torch.tensor", "torch.zeros", "torch.device" ] ]
ltriess/pointnet2_keras
[ "29be56161c8c772442b85b8fda300d10ff7fe7b3" ]
[ "pointnet2/modules/feature_propagation.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n__author__ = \"Larissa Triess\"\n__email__ = \"mail@triess.eu\"\n\n\nfrom typing import List\n\nimport tensorflow as tf\nfrom my_tf_ops.knn_op import k_nearest_neighbor_op as get_knn\n\nfrom ..layers.sample_and_group import group\n\n\nclass FeaturePropagationModul...
[ [ "tensorflow.keras.layers.LayerNormalization", "tensorflow.norm", "tensorflow.keras.models.Sequential", "tensorflow.divide", "tensorflow.shape", "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.layers.BatchNormalization", "tensorflow.conca...
ajyl/MIME
[ "7c34f3ae6dc8f8b9e6fb89b5bfa016fbaa445018" ]
[ "model/complex_res_gate.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass ComplexResGate(nn.Module):\n def __init__(self, embedding_size):\n super(ComplexResGate, self).__init__()\n self.fc1 = nn.Linear(2*embedding_size, 2*embedding_size)\n self.fc2 = nn.Linear(2*embedding_size, embedding_size)\n self.sigmoid ...
[ [ "torch.nn.Sigmoid", "torch.nn.Linear", "torch.cat" ] ]
rohitsanjay/radial_rl
[ "5daa30ec57319db8d0dd6bee10cf0f41832ef0f3" ]
[ "DQN/ibp.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ndef initial_bounds(x0, epsilon):\n '''\n x0 = input, b x c x h x w\n '''\n upper = x0+epsilon\n lower = x0-epsilon\n return upper, lower\n\ndef weighted_bound(layer, prev_upper, prev_lower):\n prev_mu = (prev_upper + prev_...
[ [ "torch.abs" ] ]
dn070017/GenEpi
[ "e6ee35e0b024408b80b75c25dd0b63c77a6e0339" ]
[ "genepi/tools/randomized_l1.py" ]
[ "\"\"\"\nNote:\nThis script is imported from scikit-learn 0.20.X,\nbecause scikit-learn 0.21.0 is no longer supported these functions\n\"\"\"\n\n\"\"\"\nRandomized Lasso/Logistic: feature selection based on Lasso and\nsparse Logistic Regression\n\"\"\"\n\n# Author: Gael Varoquaux, Alexandre Gramfort\n#\n# License: ...
[ [ "sklearn.utils.validation.check_is_fitted", "numpy.ones", "sklearn.utils.as_float_array", "scipy.interpolate.interp1d", "numpy.asarray", "sklearn.utils.deprecated", "scipy.sparse.dia_matrix", "sklearn.utils.safe_mask", "sklearn.linear_model.logistic.LogisticRegression", "nu...
tdye24/LightningFL
[ "48bb4a452082411e051cdb3a2e98ede6bbc91bbf" ]
[ "models/fedsp/mnist/MNIST.py" ]
[ "import torch\r\nimport torch.nn as nn\r\n\r\n\r\nclass MNIST(nn.Module):\r\n def __init__(self):\r\n super(MNIST, self).__init__()\r\n self.shared_encoder = torch.nn.Sequential(\r\n nn.Conv2d(in_channels=1, out_channels=32, kernel_size=5, padding=2),\r\n nn.ReLU(inplace=True)...
[ [ "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.Flatten", "torch.rand", "torch.nn.Conv2d", "torch.nn.ReLU", "torch.cat" ] ]
fchapoton/cars
[ "c145e12c8b984d5c496c29cff474628044f6216e" ]
[ "cars/steps/rasterization.py" ]
[ "#!/usr/bin/env python\n# coding: utf8\n#\n# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).\n#\n# This file is part of CARS\n# (see https://github.com/CNES/cars).\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...
[ [ "numpy.sum", "numpy.asarray", "numpy.size", "numpy.stack", "numpy.nan_to_num", "numpy.meshgrid", "numpy.rollaxis", "numpy.concatenate", "numpy.abs", "scipy.spatial.cKDTree", "numpy.linspace", "numpy.mean", "numpy.ceil", "numpy.zeros", "numpy.argmax", ...
theofpa/failing-loudly
[ "da5498babf39bdd9ba534265d67bed77b290e5b4" ]
[ "pipeline.py" ]
[ "# -------------------------------------------------\n# IMPORTS\n# -------------------------------------------------\n\nimport numpy as np\nfrom tensorflow import set_random_seed\nseed = 1\nnp.random.seed(seed)\nset_random_seed(seed)\n\nimport keras\nimport tempfile\nimport keras.models\n\nfrom keras import backend...
[ [ "numpy.save", "numpy.savetxt", "numpy.random.seed", "numpy.copy", "matplotlib.pyplot.ylabel", "numpy.isscalar", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gca", "matplotlib.rc", "numpy.delete", "numpy.where", "numpy.mean", "matplotlib.pyplot.axhline", "...
lc0/autokeras
[ "413508a5f6aaa38ee7aba719aadb057c0b029591" ]
[ "examples/celeb_age.py" ]
[ "\"\"\"\nRegression tasks estimate a numeric variable, such as the price of a house or voter\nturnout.\n\nThis example is adapted from a\n[notebook](https://gist.github.com/mapmeld/98d1e9839f2d1f9c4ee197953661ed07) which\nestimates a person's age from their image, trained on the\n[IMDB-WIKI](https://data.vision.ee....
[ [ "scipy.io.loadmat", "tensorflow.data.Dataset.from_tensor_slices", "numpy.array", "numpy.asarray" ] ]
Sillte/figpptx
[ "bf5539b09eeef4e6a17bb4483f62f29d286138b2" ]
[ "gallery/line2d.py" ]
[ "\"\"\"Check behaviors of ``Line2D``.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom figpptx.comparer import Comparer\n\n\nclass Line2DCheck:\n \"\"\"Line2DCheck.\n\n \"\"\"\n @classmethod\n def run(cls, ax):\n cls.various_line2d(ax)\n Comparer().compare(ax.figure)\n\n ...
[ [ "matplotlib.pyplot.subplots" ] ]
manluow/d3p
[ "23a33195d6fc4c0db60b24f3f871094a1f2cf8ab" ]
[ "seq2avg_data_generation.py" ]
[ "# -*- coding: utf-8 -*-\n\n\nimport os\nimport json\nimport pickle\nfrom datetime import datetime, timedelta\n\nimport numpy as np\nimport pandas as pd\n\nfrom utils import day_of_month\n\ndef is_first_day(shop_timeline, seq, dt):\n '''Jude whether a day is the first day of the sequence\n '''\n timeline =...
[ [ "numpy.ones", "numpy.load", "numpy.save", "numpy.sum", "numpy.zeros", "pandas.read_csv", "numpy.where", "numpy.expand_dims", "numpy.array", "numpy.genfromtxt", "numpy.full" ] ]
sushma-4/NEAT
[ "cb7394597acf1cd5824fcdc3b83308eaffbbe916" ]
[ "source/vcf_func.py" ]
[ "import io\nimport sys\nimport time\nimport gzip\nimport random\nimport pandas as pd\n\n\ndef parse_vcf(vcf_path: str, tumor_normal: bool = False, ploidy: int = 2,\n include_homs: bool = False, include_fail: bool = False, debug: bool = False,\n choose_random_ploid_if_no_gt_found: bool = Tr...
[ [ "pandas.DataFrame" ] ]
nstarman/jas1101_project
[ "f54620b715eb2f7dbe7bd39d4a1e21e50bc06541" ]
[ "jas1101finalproject/utils.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"**DOCSTRING**.\n\ndescription\n\nRouting Listings\n----------------\n\n\"\"\"\n\n\n###############################################################################\n# IMPORTS\n\n# GENERAL\nimport numpy as np\nimport astropy.units as u\n\nimport matplotlib.pyplot as plt\nfrom matplot...
[ [ "numpy.logical_and.reduce", "numpy.quantile", "matplotlib.pyplot.subplots", "numpy.tan", "matplotlib.rcParams.update", "numpy.mean" ] ]
vincentkslim/IPC
[ "eb702ead6f23a1dc0be39c9f5a0fd62c80abeb98" ]
[ "tools/process_IP_results.py" ]
[ "\"\"\"Process simulation results.\"\"\"\n\nimport sys\nimport os\nimport pathlib\nimport mmap\n\nimport numpy\nimport pandas\n\ntimesteps = (1e-2, 1e-3, 1e-4, 1e-5)\n\n\ndef save_results_csv(results):\n \"\"\"Save results to seperate CSV files.\"\"\"\n with open(\"results-IP.csv\", \"w\", newline=\"\") as f:...
[ [ "pandas.DataFrame" ] ]
geisten/bot
[ "76d4aef279cd168f6cbf7994055c1d289329e49c" ]
[ "backtest/simulator.py" ]
[ "\"\"\"Create and save random price data\"\"\"\nfrom random import random\nimport os\nfrom datetime import datetime, timedelta\nimport pandas as pd # type: ignore\n\n\ndef random_walker(data_length: int):\n \"\"\"Create a random walk data list\"\"\"\n # seed(1)\n random_walk = list()\n random_walk.appe...
[ [ "pandas.read_csv", "pandas.read_pickle", "pandas.DataFrame" ] ]
aseaday/ray
[ "673ecd1241934c644bca7cf92cb5c55a993b5e51" ]
[ "rllib/agents/ars/ars.py" ]
[ "# Code in this file is copied and adapted from\n# https://github.com/openai/evolution-strategies-starter and from\n# https://github.com/modestyachts/ARS\n\nfrom collections import namedtuple\nimport logging\nimport numpy as np\nimport random\nimport time\n\nimport ray\nfrom ray.rllib.agents import Trainer, with_co...
[ [ "numpy.random.uniform", "numpy.sign", "numpy.random.seed", "numpy.arange", "numpy.random.RandomState", "numpy.max", "numpy.array", "numpy.std", "numpy.square", "numpy.percentile", "numpy.mean" ] ]
Little-gg/tensorflow_learn
[ "3cb017e5745a20482d5e192a6840aac750e4c567" ]
[ "2_mnist_AGN/main.py" ]
[ "#/usr/bin/env python\n# encoding: utf-8\n\nimport numpy as np\nimport sklearn.preprocessing as prep\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n\ndef xavier_init(fan_in, fan_out, constant = 1):\n low = -constant * np.sqrt(6.0 / (fan_in + fan_out))\n high = constant...
[ [ "tensorflow.placeholder", "tensorflow.zeros", "tensorflow.global_variables_initializer", "tensorflow.subtract", "tensorflow.train.AdamOptimizer", "numpy.random.normal", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.random_uniform", "tensorflow.mat...
Mikehem/tfx
[ "b1acab7bf89ec1364c96b9b4e2cc41594407b86c" ]
[ "tfx/extensions/google_cloud_ai_platform/pusher/executor_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\...
[ [ "tensorflow.test.main" ] ]
KSaiRahul21/matrixprofile
[ "d8250e30d90ed0453bb7c35bb34ab0c04ae7b334" ]
[ "tests/test_skimp.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nrange = getattr(__builtins__, 'xrange', range)\n# end of py2 compatability boilerplate\n\nimport os\n\nimport py...
[ [ "numpy.testing.assert_equal", "numpy.random.uniform", "numpy.random.seed", "numpy.isnan" ] ]
UtrechtUniversity/nudging
[ "9eb1b77749f36059d0c03e60338308ed2e1ebe3d" ]
[ "nudging/dataset/matrix.py" ]
[ "\"\"\"DataSet class for simlated matrix data\"\"\"\nfrom pandas import DataFrame\n\nfrom nudging.dataset.base import BaseDataSet\n\n\nclass MatrixData(BaseDataSet):\n \"\"\"Class MatrixData\"\"\"\n @classmethod\n def from_data(cls, data, truth=None, names=None, **kwargs):\n \"\"\"Initialize dataset...
[ [ "pandas.DataFrame" ] ]
Bhaskers-Blu-Org2/arcticseals
[ "adfdd911e7f74ffaf288d1fbc4d8863844328d45" ]
[ "src/archive/ir-hotspot-rfc/hotspot_classifier.py" ]
[ "\"\"\"Functions and Command line Script for classifying hotspots\"\"\"\n# Standard Inputs\nimport argparse\nimport os\nimport sys\nimport pickle\n# Pip Inputs\nimport pandas as pd\nimport numpy as np\nfrom PIL import Image\n\ndef square_crop(image, x_pos, y_pos, size=35):\n \"\"\"Returns a square crop of size c...
[ [ "pandas.read_csv", "numpy.floor" ] ]
boczekbartek/flexconv
[ "610b5be3a846bcc1436275daaad89482b6b8e7cc" ]
[ "ckconv/utils/grids.py" ]
[ "import torch\n\n\ndef rel_positions_grid(grid_sizes):\n \"\"\"Generates a flattened grid of (x,y,...) coordinates in a range of -1 to 1.\n sidelen: int\n dim: int\n \"\"\"\n tensors = []\n for size in grid_sizes:\n tensors.append(torch.linspace(-1, 1, steps=size))\n # tensors = tuple(di...
[ [ "torch.linspace", "torch.meshgrid" ] ]
makoeppel/acl2019-GPPL-humour-metaphor
[ "f659144465085f80e699445c0bc0202d0bdb9817" ]
[ "python/models/gp_classifier_svi.py" ]
[ "'''\n\nUses stochastic variational inference (SVI) to scale to larger datasets with limited memory. At each iteration\nof the VB algorithm, only a fixed number of random data points are used to update the distribution.\n\n'''\n\nimport numpy as np\nimport logging\n\nimport scipy\n\nfrom gp_classifier_vb import GPC...
[ [ "numpy.sum", "numpy.ones", "numpy.argwhere", "numpy.diag", "numpy.any", "scipy.special.psi", "numpy.trace", "numpy.log", "numpy.random.choice", "numpy.linalg.slogdet", "sklearn.cluster.MiniBatchKMeans", "numpy.eye", "numpy.zeros", "scipy.linalg.solve", "...
habichta/ETHZDeepReinforcementLearning
[ "e1ae22159753724290f20068214bb3d94fcb7be4" ]
[ "abb_rl_algorithms/DDDQN_PER/rl_logging.py" ]
[ "\n\nimport numpy as np\nimport datetime as dt\nimport tensorflow as tf\nimport os,csv\nslim = tf.contrib.slim\n\n\n\ndef save_statistics(train_writer, episodes_reward_list, episodes_mean_max_q_value_list, episodes_mean_chosen_q_value_list=None, episodes_mean_batch_reward_list=None, episode_mean_action_q_value_list...
[ [ "tensorflow.summary.histogram", "tensorflow.stack", "tensorflow.reshape", "tensorflow.summary.image", "numpy.median", "tensorflow.Summary", "numpy.max", "tensorflow.split", "numpy.array", "tensorflow.constant", "tensorflow.transpose", "numpy.linalg.norm", "numpy...
GGCarrotsBerlin/test
[ "47d7414e8c4f2aa419710645c68bf32b584b29fa" ]
[ "backend_app/util.py" ]
[ "import numpy as np\n\nNW = (52.58363, 13.2035)\nSE = (52.42755, 13.62648)\nNE = (NW[0], SE[1])\nSW = (SE[0], NW[1])\n\n\ndef flatten_list(irregularly_nested_list):\n \"\"\"Generator which recursively flattens list of lists\n :param irregularly_nested_list: iterable object containing iterable and non-iterable...
[ [ "numpy.linspace" ] ]
bh107/benchpress
[ "e1dcda446a986d4d828b14d807e37e10cf4a046b" ]
[ "benchpress/benchmarks/lu/python_numpy/lu.py" ]
[ "from __future__ import print_function\nfrom benchpress.benchmarks import util\nimport numpy as np\n\nbench = util.Benchmark(\"LU decomposition on the matrix so that A = L*U\", \"<size>\")\n\n\ndef lu(a):\n \"\"\"\n Perform LU decomposition on the matrix `a` so that A = L*U\n \"\"\"\n u = a.copy()\n ...
[ [ "numpy.identity" ] ]
mattpoggi/SistemiDigitaliM20-21
[ "202e520a571a2bb961851763f37e9293c3af400d" ]
[ "Mengascini-Spina/Sistemi-Digitali-M/Datasets/Utilities/Maps/Noiseprint/noiseprint.py" ]
[ "from pathlib import Path\nimport os\nfrom PIL import Image\nfrom tensorflow.python.keras.layers import Conv2D, BatchNormalization, Activation\n\nimport logging\nlogging.getLogger(\"tensorflow\").setLevel(logging.ERROR)\nimport tensorflow as tf\ntf.get_logger().setLevel('ERROR')\nimport numpy as np\nfrom tensorflow...
[ [ "tensorflow.get_logger", "tensorflow.compat.v1.ConfigProto", "numpy.zeros", "numpy.squeeze", "tensorflow.python.keras.layers.Activation", "tensorflow.python.keras.models.Model", "numpy.max", "tensorflow.python.keras.layers.BatchNormalization", "numpy.min", "tensorflow.Tenso...
hex-plex/Pong-ReinforcementLearning
[ "62d257ae03afb7561403d0f48650344254dcc06e" ]
[ "ball.py" ]
[ "import pygame\nfrom random import randint\nBLACK = (0,0,0)\nimport numpy as np\n\nclass Ball(pygame.sprite.Sprite):\n\n def __init__(self, color , width ,height, twidth, theight):\n\n super().__init__()\n\n self.image = pygame.Surface([width,height])\n self.image.fill(BLACK)\n self.i...
[ [ "numpy.random.choice" ] ]
mnfienen/modflow-export
[ "e56e49285a7ef71797ce047151f6dbabbd8fe245" ]
[ "mfexport/tests/test_results_export.py" ]
[ "import os\nfrom pathlib import Path\nimport pytest\nfrom flopy.utils import binaryfile as bf\nimport numpy as np\nimport fiona\nimport rasterio\nfrom shapely.geometry import box\nimport pytest\nfrom ..grid import load_modelgrid\nfrom ..results import export_cell_budget, export_heads, export_drawdown, export_sfr_re...
[ [ "numpy.allclose", "numpy.isscalar" ] ]
neurophysik/jitcode
[ "cbc815da01974597057c8d78f74d16169bdad580" ]
[ "examples/double_fhn_restricted_lyap.py" ]
[ "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nfrom jitcode import jitcode_restricted_lyap, y\nimport numpy as np\nfrom scipy.stats import sem\n\na = -0.025794\nb1 = 0.01\nb2 = 0.01\nc = 0.02\nk = 0.128\n\nf = [\n\ty(0) * ( a-y(0) ) * ( y(0)-1.0 ) - y(1) + k * (y(2) - y(0)),\n\tb1*y(0) - c*y(1),\n\ty(2) * (...
[ [ "numpy.random.random", "numpy.array", "scipy.stats.sem", "numpy.average" ] ]
okinter11/VTuber-Python-Unity
[ "ebfdf729ffb07a1698acd07aa0e2baec0d6bbb02" ]
[ "facial_features.py" ]
[ "\"\"\"\r\nMiscellaneous facial features detection implementation\r\n\"\"\"\r\n\r\nimport cv2\r\nimport numpy as np\r\nfrom enum import Enum\r\n\r\nclass Eyes(Enum):\r\n LEFT = 1\r\n RIGHT = 2\r\n\r\nclass FacialFeatures:\r\n\r\n eye_key_indicies=[\r\n [\r\n # Left eye\r\n # eye lower ...
[ [ "numpy.sum", "numpy.dot", "numpy.linalg.norm" ] ]
aliny2003/pycwr
[ "7459371588e6d0d6d0737e249afa3921fe073151" ]
[ "pycwr/draw/colormap/cm.py" ]
[ "\"\"\"\nthis code is modified from pyart.graph.cm file, developed by Helmus, J.J. & Collis, S.M.\nhttps://github.com/ARM-DOE/pyart\n==============\n\nRadar related colormaps.\n\n.. autosummary::\n :toctree: generated/\n\n revcmap\n _reverser\n _reverse_cmap_spec\n _generate_cmap\n\n\nAvailable color...
[ [ "matplotlib.colors.LinearSegmentedColormap", "matplotlib.colors.LinearSegmentedColormap.from_list" ] ]
keshavpdl/sign-language-recognition-using-cnn-and-tensorflow
[ "11e7255fd5d7bdc791626670db6274d41fbd9c58" ]
[ "dataset.py" ]
[ "import cv2 # working with, mainly resizing, images\r\nimport numpy as np # dealing with arrays\r\nimport os # dealing with directories\r\nfrom random import shuffle # mixing up or currently ordered data that might lead our network astray in training.\r\n\r\npath='data'\r\n\...
[ [ "numpy.array", "numpy.save" ] ]