repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Thomaw/Rubik-s-cube-solver | [
"8258065a01707a14e8b61463d132d479e0e9f159"
] | [
"Code python/Pycharm/methode_video.py"
] | [
"import cv2\r\nimport numpy as np\r\nimport colorsys\r\nimport math\r\n\r\n\r\ndef visio():\r\n '''Initialisation de l'utilisation de la caméra'''\r\n cameratesting = True # Autorisation d'utiliser la webcam\r\n colors_modification = True # Autorisation de paramétrer les couleurs re... | [
[
"numpy.array"
]
] |
Krozark/lab | [
"2d7a371170d054bfceb5c92c5fffebcaadbd78b8"
] | [
"ideas/python/create_words.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy\nimport os\n\nfrom matplotlib import pyplot\n\nnumber = 100 # number of words to export\nstore_matrix = True # export watrix as image\nstarting_letter = None # starting letter\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\nfile_path = os.path.join(BASE_DIR, \"..\"... | [
[
"numpy.isnan",
"numpy.zeros",
"numpy.random.seed",
"matplotlib.pyplot.savefig",
"numpy.tile",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
Esther2013/SciSharp-Stack-Examples | [
"43c06d57a4fb5926c853dd9f18e6463b4c1104a7"
] | [
"src/tensorflow2.x-python-tutorial/keras_basic.py"
] | [
"\n# https://github.com/aymericdamien/TensorFlow-Examples/blob/master/tensorflow_v2/notebooks/1_Introduction/helloworld.ipynb\n\nimport tensorflow as tf\nimport numpy as np\n\nmodel = tf.keras.Sequential([\n tf.keras.layers.Dense(5, input_shape=(3,)),\n tf.keras.layers.Softmax()])\nmodel.save('/tmp/model')\nl... | [
[
"numpy.array",
"tensorflow.multiply",
"tensorflow.zeros",
"tensorflow.Variable",
"tensorflow.random.uniform",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.load_model",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.keras.layers.Softmax",
"tens... |
GereonV/MNIST | [
"1dc196419acc7266c68fb58282a88015b42b7027"
] | [
"gui.py"
] | [
"import tkinter as tk\nimport numpy as np\nfrom neural_network import Network\n\n\nclass ResultGUI:\n def __init__(self, test_data: list[tuple[np.ndarray, np.ndarray]], network: Network, size: int = 560):\n self.set = test_data\n self.i = 0\n self.network = network\n self.size = size\... | [
[
"numpy.zeros"
]
] |
xhan97/iNNE | [
"a2948770feeaed2c30997684feea980ba1426c81"
] | [
"inne/tests/test_inne.py"
] | [
"\n\"\"\"Tests for `inne` package.\"\"\"\n\nimport time\nfrom unittest.mock import Mock, patch\n\nimport numpy as np\nimport pytest\nfrom inne import IsolationNNE\nfrom scipy.sparse import csc_matrix, csr_matrix\nfrom sklearn.datasets import (load_diabetes, load_digits, load_iris,\n mak... | [
[
"numpy.max",
"numpy.array",
"sklearn.datasets.load_diabetes",
"sklearn.utils._testing.assert_array_equal",
"numpy.min",
"sklearn.model_selection.ParameterGrid",
"sklearn.utils.check_random_state",
"sklearn.ensemble.IsolationForest",
"sklearn.utils._testing.ignore_warnings",
... |
dreamerlin/MVFNet | [
"5bc41ae0451a2c3572302c441aaf35b444d04d56",
"5bc41ae0451a2c3572302c441aaf35b444d04d56"
] | [
"codes/models/backbones/resnet_r3d.py",
"codes/models/heads/i3d_clshead.py"
] | [
"\"\"\"R(2+1)D\nCode adopted from mmaction\nTODO: Debug\n\"\"\"\nimport numpy as np\nimport torch.nn as nn\nfrom mmcv.cnn import constant_init, kaiming_init\n\nfrom ...utils import get_root_logger, load_checkpoint\nfrom ..builder import BACKBONES\nfrom .resnet_r3d_utils import (add_bn, add_conv3d, conv3d_wbias, con... | [
[
"torch.nn.ReLU",
"torch.nn.MaxPool3d",
"torch.nn.BatchNorm3d",
"numpy.multiply"
],
[
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.MaxPool3d",
"torch.nn.init.normal_",
"torch.nn.Conv3d",
"torch.nn.AdaptiveMaxPool3d",
"torch.nn.AvgPool3d",
"torch.nn.Ada... |
theovincent/ReinforcementLearningWithDemonstration | [
"fc04afec0643c45860e12d3af4a45d32265a0c61"
] | [
"algorithms/API/replay_buffer.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass ReplayBuffer:\n def __init__(self, env, epsilon_decay, n_expert_samples=0, expert_policy=None):\n self.env = env\n self.epsilon_decay = epsilon_decay\n\n self.buffer_expert = []\n self.buffer_rl = []\n\n if n_exper... | [
[
"numpy.random.choice",
"numpy.zeros",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.random.random",
"matplotlib.pyplot.imshow"
]
] |
sylvieong/nmt-ported | [
"70fa4c473dfc6a3d9f576334145bd07c5e151431"
] | [
"nmt/utils/iterator_utils.py"
] | [
"# Copyright 2017 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.size",
"tensorflow.minimum",
"tensorflow.concat",
"tensorflow.contrib.data.group_by_window",
"tensorflow.TensorShape",
"tensorflow.reverse",
"tensorflow.constant",
"tensorflow.maximum",
"tensorflow.string_split",
"tensorflow.data.Dataset.zip"
]
] |
vamas/Capstone_ML | [
"d7fb044e42731b4a19abb15d4b94e354c598c9d3"
] | [
"helpers.py"
] | [
"import pandas as pd\nfrom sklearn.grid_search import GridSearchCV\nimport numpy as np\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import Imputer, StandardScaler, MinMaxScaler, RobustScaler\n\n\n\ndef select_random_date(date_range, training_period, testing_period):\n cond = True\n while... | [
[
"numpy.random.choice",
"numpy.sqrt"
]
] |
typhoonzero/models-1 | [
"a3559618a013820385f43307261ad34351da2fbf"
] | [
"sqlflow_models/lstmclassifier.py"
] | [
"import tensorflow as tf\n\nclass StackedBiLSTMClassifier(tf.keras.Model):\n def __init__(self, feature_columns, stack_units=[32], hidden_size=64, n_classes=2):\n \"\"\"StackedBiLSTMClassifier\n :param feature_columns: All columns must be embedding of sequence column with same sequence_length.\n ... | [
[
"tensorflow.keras.experimental.SequenceFeatures",
"tensorflow.keras.layers.LSTM",
"tensorflow.sequence_mask",
"tensorflow.keras.layers.Dense"
]
] |
liu-yushan/TLogic | [
"51c1feb1f196205437b25e82d9d721f55e84937c"
] | [
"mycode/score_functions.py"
] | [
"import numpy as np\n\n\ndef score1(rule, c=0):\n \"\"\"\n Calculate candidate score depending on the rule's confidence.\n\n Parameters:\n rule (dict): rule from rules_dict\n c (int): constant for smoothing\n\n Returns:\n score (float): candidate score\n \"\"\"\n\n score = rul... | [
[
"numpy.exp"
]
] |
GeorgOstrovski/jax | [
"578e5cf6d7272a9d29a6b9d50899efbcf17780f1"
] | [
"jax/test_util.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.shape",
"numpy.where",
"numpy.isscalar",
"numpy.conj",
"numpy.dtype"
]
] |
SallyDa/typhon | [
"8bd265e263a155e8c64e6d4aa9cb6c0f1e3bcc7d"
] | [
"typhon/plots/colors.py"
] | [
"\"\"\"Utility functions related to plotting.\"\"\"\nimport csv\nimport os\nimport re\nfrom functools import lru_cache\nfrom warnings import warn\n\nimport matplotlib.pyplot as plt\nfrom matplotlib import colors\nfrom matplotlib.colors import LinearSegmentedColormap\nimport numpy as np\n\nfrom typhon.utils import d... | [
[
"numpy.max",
"numpy.uint8",
"numpy.savetxt",
"numpy.zeros",
"matplotlib.pyplot.get_cmap",
"numpy.genfromtxt",
"matplotlib.pyplot.register_cmap",
"numpy.min",
"numpy.shape",
"numpy.flipud",
"numpy.fromfile",
"numpy.linspace",
"matplotlib.colors.LinearSegmentedCol... |
lgcharpe/Masters | [
"a8e01672c1e64633a03ec334fc0ecb328f1da691",
"a8e01672c1e64633a03ec334fc0ecb328f1da691"
] | [
"Tensorflow_tutorials/Simple Tutorials/Load and preprocess data/images.py",
"Tensorflow_tutorials/Simple Tutorials/save_and_load.py"
] | [
"import tensorflow as tf\nimport IPython.display as display\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport pathlib\nimport time\n\nAUTOTUNE = tf.data.experimental.AUTOTUNE\n\nprint(tf.__version__)\n\n# Setup\n\ndata_dir = tf.keras.utils.get_file(\n origin='https://... | [
[
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"numpy.ceil",
"tensorflow.keras.utils.get_file",
"tensorflow.image.convert_image_dtype",
"tensorflow.io.read_file",
"tensorflow.strings.split",
"matplotlib.pyplot.figure",
"tensorflow.image.resize",
"matplotlib.pyplot.i... |
syoukera/void_py | [
"4a2d695cf16e38f731725ff781790834924d5e0c"
] | [
"boid_py/core.py"
] | [
"\nimport numpy as np\n\nclass boid:\n\t\"\"\"\n\tClass for calculating the positions of boids\n\t\"\"\"\n\tdef __init__(self, num_boid=100):\n\n\t\t# attributes:\n\t\tself.N = num_boid\n\t\t# strength of force\n\t\tself.cohesion_force = 0.0008\n\t\tself.separation_force = 1.15\n\t\tself.alignment_force = 1.0\n\n\t... | [
[
"numpy.divide",
"numpy.count_nonzero",
"numpy.linalg.norm",
"numpy.empty",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum",
"numpy.multiply"
]
] |
ErinZhang1998/howto100m-erin | [
"1152ea0fe328d20fcf2218a1d548644881632656",
"1152ea0fe328d20fcf2218a1d548644881632656"
] | [
"loss.py",
"youcook_dataloader.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\nimport torch.nn.functional as F\nimport torch as th\nimport numpy as np\n\nclass MaxMarginRankingLoss(th.nn.Module):\n def __init__(self,\n m... | [
[
"torch.zeros",
"torch.arange",
"numpy.ones",
"torch.nn.functional.relu",
"numpy.eye",
"torch.logical_not",
"torch.tensor",
"torch.diag",
"torch.sum"
],
[
"numpy.concatenate",
"torch.zeros",
"torch.cat",
"numpy.array",
"torch.FloatTensor",
"torch.from... |
bbennett80/ClinicalTrials | [
"651d53aadf1680002cd0a4f2f85336abee4dbf77"
] | [
"nlp/criteria_download.py"
] | [
"import json\nimport requests\nimport csv\nfrom glob import glob\nimport pandas as pd\nfrom pathlib import Path\nfrom tqdm import trange\n\ndef main():\n folder_setup()\n download_trials()\n write_txt()\n\n\ndef folder_setup():\n \"\"\"Makes directory 'Full_Studies' to which trial files are downloaded.\... | [
[
"pandas.read_csv"
]
] |
ajain-23/open_spiel | [
"38941dee3beb52ffdb134b66f420a758634d9a20"
] | [
"open_spiel/python/algorithms/mccfr.py"
] | [
"# Copyright 2019 DeepMind Technologies Ltd. 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 r... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
callzhang/mmtracking | [
"52a2ed94297685d4fe47ee7ece18917961cc39f0"
] | [
"mmtrack/models/reid/linear_reid_head.py"
] | [
"import warnings\n\nimport torch.nn as nn\nfrom mmcls.models.builder import HEADS\nfrom mmcls.models.heads.base_head import BaseHead\nfrom mmcls.models.losses import Accuracy\nfrom mmcv.cnn import constant_init, normal_init\nfrom mmdet.models.builder import build_loss\n\nfrom .fc_module import FcModule\n\n\n@HEADS.... | [
[
"torch.nn.Linear",
"torch.nn.BatchNorm1d",
"torch.nn.ModuleList"
]
] |
eayvali/DeepRL | [
"4722af0f75487dd3167faafd4eabe8f01aea4305"
] | [
"Monte Carlo Prediction Control/MC_Control_Blackjack.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Dec 6 15:26:00 2019\n\nBlackjack:\nEach state is a 3-tuple of:\n the player's current sum ∈{0,1,…,31} ,\n the dealer's face up card ∈{1,…,10} , and\n whether or not the player has a usable ace (no=0 , yes=1 ).\nThe agent has two potential actions:\n ST... | [
[
"numpy.max",
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.arange",
"numpy.argmax"
]
] |
PFTL/py4lab | [
"e1ba563c3ffa14e85710c42c65a2975924060369"
] | [
"ch_07/PythonForTheLab/Model/experiment.py"
] | [
"import threading\nfrom datetime import datetime\nimport numpy as np\nimport os\nfrom time import sleep\nimport yaml\nfrom PythonForTheLab import ur\n\nclass Experiment:\n def __init__(self, config_file):\n self.config_file = config_file\n self.is_running = False # Variable to check if the scan is... | [
[
"numpy.linspace",
"numpy.vstack",
"numpy.zeros"
]
] |
bibinwils/metrics | [
"e1c3fda24f90367803c2b04315ad7c8bced719db"
] | [
"torchmetrics/regression/mean_squared_error.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.tensor"
]
] |
Jiahao000/ORL | [
"2ad64f7389d20cb1d955792aabbe806a7097e6fb"
] | [
"tools/selective_search.py"
] | [
"import argparse\nimport importlib\nimport os\nimport os.path as osp\nimport time\nimport json\n\nimport mmcv\nimport torch\nfrom mmcv.runner import get_dist_info, init_dist\n\nfrom openselfsup.datasets import build_dataloader, build_dataset\nfrom openselfsup.models import build_model\nfrom openselfsup.utils import... | [
[
"torch.no_grad"
]
] |
stefangachter/manif | [
"a4ba3df4f793fdce37c98b2cf9778321f9cea7c9"
] | [
"examples/se_2_3_localization.py"
] | [
"r\"\"\"\n\n\\file se_2_3_localization.py.\n\nCreated on: Jan 11, 2021\n\\author: Jeremie Deray\n\n---------------------------------------------------------\nThis file is:\n(c) 2021 Jeremie Deray\n\nThis file is part of `manif`, a C++ template-only library\nfor Lie theory targeted at estimation for robotics.\nManif... | [
[
"numpy.square",
"numpy.diagflat",
"numpy.zeros",
"numpy.set_printoptions",
"numpy.copy",
"numpy.identity",
"numpy.random.uniform",
"numpy.linalg.inv"
]
] |
brandonjbryant/classification-project-final | [
"c15c096d84bc14cfce9e1c8548e3c69154311bc7"
] | [
"acquire.py"
] | [
"import pandas as pd\nimport numpy as np\nimport os\n\n# acquire\nfrom env import host, user, password\nfrom pydataset import data\n\n\n\ndef get_connection(db, user=user, host=host, password=password):\n '''\n This function uses my info from my env file to\n create a connection url to access the Codeup db... | [
[
"pandas.read_csv"
]
] |
aliPMPAINT/fakecam | [
"7e5053b06083531dba96ffce44657402e2d52223"
] | [
"fakecam/fakecam/capture.py"
] | [
"import os\nimport signal\n\nimport cv2\nimport numpy as np\nfrom multiprocessing import Queue\n\nfrom .pyfakewebcam import FakeWebcam\nfrom .types import QueueDict\nfrom .bodypix_functions import scale_and_crop_to_input_tensor_shape, to_mask_tensor\n\nFHD = (1080, 1920)\nHD = (720, 1280)\nNTSC = (480, 720)\n\n\n# ... | [
[
"numpy.ones",
"numpy.roll",
"numpy.zeros",
"numpy.random.uniform"
]
] |
neelguha/tensorflow_constrained_optimization | [
"46b34d1c2d6ec05ea1e46db3bcc481a81e041637",
"46b34d1c2d6ec05ea1e46db3bcc481a81e041637"
] | [
"tensorflow_constrained_optimization/python/rates/binary_rates_test.py",
"experiments/training_utils.py"
] | [
"# Copyright 2018 The TensorFlow Constrained Optimization Authors. All Rights\n# Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n#\n# http://www.apache.org/licenses/L... | [
[
"numpy.array",
"tensorflow.assign",
"numpy.zeros",
"tensorflow.get_default_graph",
"numpy.sum",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.constant",
"numpy.sign",
"tensorflow.test.main",
"tensorflow.stack",
"tensorflow.local_variables_initializer",
... |
Yu-Yy/PR_project | [
"0999d0a7b2c37e5b1cd81acd43de95a024cf951f"
] | [
"image_text_fusion.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nfrom tensorboardX import SummaryWriter\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nimport torch.utils.data.distributed\nimport os\nimport argparse\nfrom lib.config.hrnet_config import update_config\nfrom lib.c... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.norm",
"torch.no_grad",
"torch.nn.LeakyReLU",
"torch.cuda.memory_allocated",
"torch.nn.BatchNorm1d",
"torch.load",
"torch.nn.DataParallel"
]
] |
lazydinoz/HackFest21 | [
"84bfbfbb2c75a6511226a87d2e947984db878ba1",
"84bfbfbb2c75a6511226a87d2e947984db878ba1"
] | [
"Data Analysis Projects/Wine Qulaity Prediction/refactor_wine_quality_.py",
"Tkinter Apps/Connect4.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"refactor-wine-quality .ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1HbL79czQHkBYg3_-oEF1aVNp7kYY7NAi\n\n# Refactor: Wine Quality Analysis\nIn this exercise, you'll refactor code that analyzes a wine qua... | [
[
"pandas.read_csv"
],
[
"numpy.flip",
"numpy.zeros"
]
] |
S1mHub/Molecular-Learning | [
"5254a88006b9981e776ba6bb76f5377c6260ca04"
] | [
"TD_Cluster_Code/ChemAAE_Prep.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 22 15:28:22 2019\n\n@author: sameermac\n\"\"\"\n\n#High Dimensional Unsupervised Learning on Organic Chemicals\n\n#from __future__ import print_function\n#import csv\n#import math\n#import random\n\n\n#from tqdm import tqdm.tqdm\n#for i in... | [
[
"numpy.array",
"numpy.reshape",
"numpy.argmin",
"numpy.ones",
"numpy.where",
"numpy.column_stack"
]
] |
zhangyujing/tensorflow | [
"c7a04561fb8972fb64907acc5f10f3c6d4cef9f2",
"8e86dcd1c59bb3f1dc978fcb5398dd3f2f51d9ad",
"c7a04561fb8972fb64907acc5f10f3c6d4cef9f2"
] | [
"tensorflow/python/keras/_impl/keras/layers/recurrent.py",
"tensorflow/contrib/nccl/python/ops/nccl_ops.py",
"tensorflow/contrib/autograph/converters/builtin_functions.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras._impl.keras.backend.zeros_like",
"tensorflow.python.keras._impl.keras.backend.batch_get_value",
"tensorflow.python.keras._impl.keras.backend.update",
"tensorflow.python.keras._impl.keras.constraints.get",
"tensorflow.python.keras._impl.keras.backend.is_keras_tensor",
... |
oi-analytics/oia-transport-archive | [
"f89cb686704fe76c1665697b35d14caccf37f3a1"
] | [
"src/vtra/plot/rail_network_failures_multi_modal.py"
] | [
"\"\"\"Rail network flows map\n\"\"\"\nimport os\nimport sys\n\nfrom collections import OrderedDict\n\nimport cartopy.crs as ccrs\nimport cartopy.io.shapereader as shpreader\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom shapely.geometry import LineString\n\n\nfrom vtra.utils import *\n\ndef main():\n\t... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.close"
]
] |
dhaulagiri0/AniGen | [
"bd845a29e771544ade1f64b94f967d8e178952f8"
] | [
"traversal.py"
] | [
"import numpy as np\nfrom data_process import create_dir, generate_latent_points, prediction_post_process\nfrom PIL import Image\nimport numpy as np\nimport os\nimport imageio\n\nimport re\ndef sorted_alphanumeric(data):\n convert = lambda text: int(text) if text.isdigit() else text.lower()\n alphanum_key = l... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.loadtxt"
]
] |
RjDuan/Advlight | [
"44e5fdea84b223e0f26935b23611880f8ed07a59"
] | [
"test.py"
] | [
"import numpy as np\nimport math\nimport os\nimport torch\nfrom light_simulation import tube_light_generation_by_func, simple_add\nfrom torchvision.datasets import ImageFolder\nfrom torchvision.models import resnet50\nimport torchvision.transforms as transforms\nimport argparse\nimport random\nimport shutil\nimport... | [
[
"numpy.asarray",
"torch.no_grad",
"numpy.random.randint",
"torch.load",
"numpy.clip"
]
] |
JoyMonteiro/sympl | [
"c8bee914651824360a46bf71119dd87a93a07219"
] | [
"sympl/_core/restore_dataarray.py"
] | [
"import numpy as np\nfrom .exceptions import InvalidPropertyDictError\nfrom .dataarray import DataArray\nfrom .wildcard import (\n get_wildcard_matches_and_dim_lengths, fill_dims_wildcard,\n expand_array_wildcard_dims\n)\n\n\ndef ensure_values_are_arrays(array_dict):\n for name, value in array_dict.items()... | [
[
"numpy.asarray"
]
] |
sehandev/JT-VAE | [
"8e60eb560034bbc23d9989938d36b08a739edbb6"
] | [
"data_module.py"
] | [
"# Standard\n\n# PIP\nfrom torch.utils.data import DataLoader\nfrom pytorch_lightning import LightningDataModule\nfrom pl_bolts.datasets import DummyDataset\n\n# Custom\nfrom custom.dataset import CustomDataset\n\n\nclass CustomDataModule(LightningDataModule):\n def __init__(\n self,\n seq_len,\n ... | [
[
"torch.utils.data.DataLoader"
]
] |
flowmatters/dsed-py | [
"b967db2797320e63bc504e40023b7c7623a0b002"
] | [
"dsed/ow.py"
] | [
"'''\nRunning Dynamic Sednet simulations using OpenWater\n'''\nimport os\nimport json\nimport pandas as pd\nimport geopandas as gpd\nimport shutil\nimport numpy as np\nfrom openwater import OWTemplate, OWLink\nfrom openwater.template import TAG_MODEL\nimport openwater.nodes as n\nfrom collections import defaultdict... | [
[
"pandas.DataFrame",
"pandas.date_range",
"pandas.concat"
]
] |
johannes-graeter/UnFlow | [
"3c6bf459952ef918d0226187539472f84fa9f00c"
] | [
"src/e2eflow/core/unsupervised.py"
] | [
"import tensorflow as tf\n\nfrom .augment import random_affine, random_photometric\nfrom .flownet import flownet, FLOW_SCALE\nfrom .losses import compute_losses, create_border_mask\nfrom .util import downsample\nfrom .visualization import get_flow_visualization\n\n# REGISTER ALL POSSIBLE LOSS TERMS\nLOSSES = ['occ'... | [
[
"tensorflow.image.resize_bilinear",
"tensorflow.shape",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.add_to_collection",
"tensorflow.identity",
"tensorflow.losses.get_regularization_loss"
]
] |
Gertrud-Violett/RocketSystem | [
"f567d166e6869598ae86395a7a8ba4b5b045f612"
] | [
"Performance_Calculator/PandasHandler.py"
] | [
"import pandas as pd\n\nclass PandasHandler:\n\n def __init__(self):\n print(\"This is Constructor\")\n \n def __del__(self):\n print(\"This is Destructor\")\n\n @staticmethod\n def getSheetNumber_Excel(filePathExcel=None):\n bk = pd.ExcelFile(filePathExcel)\n return l... | [
[
"pandas.ExcelFile",
"pandas.read_excel"
]
] |
AmitMY/joeynmt | [
"b30d1d53823ced56113def8fb5d5f7905d3c059f"
] | [
"joeynmt/plotting.py"
] | [
"#!/usr/bin/env python\n\nfrom typing import List, Optional\nimport numpy as np\n\n# pylint: disable=wrong-import-position\nimport matplotlib\nmatplotlib.use('Agg')\n\nfrom matplotlib import rcParams\nfrom matplotlib.figure import Figure\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import ... | [
[
"matplotlib.use",
"numpy.sum",
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.imshow"
]
] |
felixwzh/TSGB | [
"80dfb42c153c19a58ae170565d50ff8831a3029a"
] | [
"python-package/xgboost/sklearn.py"
] | [
"# coding: utf-8\n# pylint: disable=too-many-arguments, too-many-locals, invalid-name, fixme, E0012, R0912\n\"\"\"Scikit-Learn Wrapper interface for XGBoost.\"\"\"\nfrom __future__ import absolute_import\n\nimport numpy as np\nimport warnings\nfrom .core import Booster, DMatrix, XGBoostError\nfrom .training import ... | [
[
"numpy.array",
"numpy.argmax",
"numpy.vstack",
"numpy.repeat",
"numpy.unique"
]
] |
AbhishekRS4/deep_lab_v3_plus | [
"aec2e1d350ebc1218c5a2cce981a875a588fd225"
] | [
"src/deep_lab_v3_plus_model_frozen.py"
] | [
"# @author : Abhishek R S\n\nimport os\nimport h5py\nimport numpy as np\nimport tensorflow as tf\n\n\"\"\"\nDeepLabv3+\n\n# Reference\n- [Deep Residual Learning for Image Recognition]\n (https://arxiv.org/abs/1512.03385)\n- [DeepLabv3+](https://arxiv.org/pdf/1802.02611.pdf)\n\n# Pretrained model weights\n- [Downlo... | [
[
"tensorflow.image.resize_bilinear",
"tensorflow.layers.dropout",
"tensorflow.nn.batch_normalization",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.nn.relu",
"tensorflow.nn.conv2d",
"numpy.reshape",
"tensorflow.layers.batch_normalization",
"tensorflow.transpose",
... |
sallypannn/autogluon | [
"fe5eccc3c14eb18478495f0406c812b60a65cbc1"
] | [
"tabular/src/autogluon/tabular/models/fastainn/tabular_nn_fastai.py"
] | [
"import copy\nimport logging\nimport time\nfrom builtins import classmethod\nfrom pathlib import Path\n\nimport sklearn\nimport numpy as np\nimport pandas as pd\n\nfrom autogluon.core.constants import REGRESSION, BINARY, QUANTILE\nfrom autogluon.core.features.types import R_OBJECT, R_INT, R_FLOAT, R_DATETIME, R_CAT... | [
[
"torch.device",
"numpy.array",
"sklearn.preprocessing.MinMaxScaler",
"pandas.concat"
]
] |
Thuva97/TransSeg | [
"469722dd62755b75a865721b10c2016d9f2daa4a"
] | [
"dataloader.py"
] | [
"import librosa\r\nimport numpy as np\r\nimport soundfile as sf\r\nimport torch\r\nfrom boltons.fileutils import iter_find_files\r\nfrom torch.utils.data import Dataset\r\n\r\n\r\ndef collate_fn_padd(batch):\r\n \"\"\"collate_fn_padd\r\n Padds batch of variable length\r\n\r\n :param batch:\r\n \"\"\"\r\... | [
[
"numpy.concatenate",
"torch.zeros",
"numpy.zeros",
"torch.nn.utils.rnn.pad_sequence",
"torch.FloatTensor",
"numpy.stack",
"torch.LongTensor"
]
] |
rgayon/timesketch | [
"5b055a580652b85c594b7383ef3c7747ba956b4f"
] | [
"api_client/python/timesketch_api_client/search.py"
] | [
"# Copyright 2020 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... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
Siokhan/Self-Driving-Car | [
"a4419184f0378f31c4aa8efafd44beba5a5c8fc5"
] | [
"Scripts/generate_predictions.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Apr 21 14:00:01 2020\r\n\r\n@author: Siokhan Kouassi\r\n\"\"\"\r\n\r\nimport tensorflow as tf\r\nfrom tensorflow import keras\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nimport os\r\nimport csv\r\nimport pandas as pd\r\n\r\nn=3 #1 fo... | [
[
"pandas.concat",
"tensorflow.keras.models.load_model",
"numpy.asarray",
"pandas.DataFrame"
]
] |
caudexy/dashmap.io | [
"1f18ea201dcf017a3463a86565f42bbba4d116bc"
] | [
"website/dashmap/map_graphs.py"
] | [
"import os\nimport json\nimport pandas as pd\nimport geopandas as gpd\n\n# Dash & Plotly\nfrom dash import html\nfrom dash import dcc\nimport plotly.graph_objects as go\n\n# Environment Variables\nfrom dotenv import load_dotenv\nload_dotenv()\nMAPBOX_TOKEN = os.getenv('MAPBOX_TOKEN')\n\n# Colors used by graphs\ncol... | [
[
"pandas.read_csv"
]
] |
RMORIOKA/tensorflow | [
"6886eb9c73940fd3b4dfadc3d6964ae9aa71eef6",
"6886eb9c73940fd3b4dfadc3d6964ae9aa71eef6",
"6886eb9c73940fd3b4dfadc3d6964ae9aa71eef6"
] | [
"tensorflow/contrib/distributions/python/kernel_tests/mvn_test.py",
"tensorflow/contrib/distributions/python/ops/bernoulli.py",
"tensorflow/contrib/training/python/training/resample.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.matrix_band_part",
"tensorflow.batch_matmul",
"tensorflow.matrix_diag",
"numpy.cov",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.linalg.inv",
"numpy.ones",
"tensorflow.ones_like",
"numpy.linalg.det",
"numpy.identity",
"tensorflow.constant",
"sc... |
Udolf15/recommedMeMovies | [
"be5ae74acd98e3f93beaaa5bb55623974fb24247",
"952abcf471b819b6b6dfa23b6d5dd248155f9dbf",
"9444dce96954c546333d5aecc92a06c3bfd19aa5",
"9444dce96954c546333d5aecc92a06c3bfd19aa5"
] | [
"env/lib/python3.5/site-packages/pandas/core/arrays/numpy_.py",
"env/lib/python3.5/site-packages/sklearn/feature_extraction/tests/test_text.py",
"env/lib/python3.5/site-packages/sklearn/gaussian_process/kernels.py",
"env/lib/python3.5/site-packages/sklearn/utils/arpack.py"
] | [
"import numbers\n\nimport numpy as np\n\nfrom pandas._libs import lib\nfrom pandas.compat.numpy import function as nv\nfrom pandas.util._validators import validate_fillna_kwargs\n\nfrom pandas.core.dtypes.dtypes import ExtensionDtype\nfrom pandas.core.dtypes.generic import ABCIndexClass, ABCSeries\nfrom pandas.core... | [
[
"pandas.core.nanops.nanall",
"pandas.core.nanops.nansum",
"pandas.core.nanops.nansem",
"pandas._libs.lib.is_scalar",
"numpy.dtype",
"numpy.concatenate",
"pandas.core.algorithms.take",
"pandas.core.nanops.nanmin",
"pandas.core.nanops.nanmax",
"pandas.core.dtypes.inference.is... |
itohamy/self-conditioned-gan | [
"f01156ea4d8f0c7cb7a75eb1be5d19c11fbdda50"
] | [
"metrics.py"
] | [
"import argparse\nimport os\nimport json\nfrom tqdm import tqdm\n\nimport numpy as np\nimport torch\n\nfrom gan_training.config import load_config\nfrom seeded_sampler import SeededSampler\n\n#from utils.classifiers.pytorch_playground.utee import misc\n#print555 = misc.logger.info\n\nparser = argparse.ArgumentParse... | [
[
"torch.no_grad",
"numpy.savez",
"torch.stack"
]
] |
YBrady/pands-problem-set | [
"06f4bfb7ad520ac8e1e7c15aa8fa1692b71711d4"
] | [
"problem-10.py"
] | [
"# Problem No 10\n# --------------------------------------------------------------------------------\n# Write a program that displays a plot of the functions x, x2 and 2x \n# in the range [0, 4].\n# --------------------------------------------------------------------------------\n#\n# Author: Yvonne Brady\n# Studen... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Satertek/adventofcode | [
"9282d99bb9f74e02217b24b07421f48103a12b47"
] | [
"aoc2020/day5.py"
] | [
"import numpy as np\n\ndef get_day5(infile=\"./aoc2020/day5_input.txt\", part2=False):\n with open(infile, 'r') as f:\n data = f.read().split(\"\\n\")\n seats = []\n for each in data:\n seats.append(\n [int(each[0:7].replace(\"F\",\"0\").replace(\"B\",\"1\"), 2), \n... | [
[
"numpy.max"
]
] |
nmonath/Prob-CBR | [
"94daa1b79123ca326bba357db7a50c296e4afc6b"
] | [
"prob_cbr/data/stream_utils.py"
] | [
"from collections import Counter\nimport logging\nimport numpy as np\nimport os\n\nfrom prob_cbr.data.data_utils import get_inv_relation, is_inv_relation\nlogger = logging.getLogger('stream_utils')\nlogger.setLevel(logging.INFO)\nch = logging.StreamHandler()\nch.setLevel(logging.INFO)\nformatter = logging.Formatter... | [
[
"numpy.random.default_rng"
]
] |
ZachT1711/language | [
"de84080fc8a239a7271aad1d447fcb38a895790b"
] | [
"language/nql/nql/dataset.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"numpy.zeros",
"tensorflow.compat.v2.TensorShape",
"tensorflow.compat.v2.logging.warn",
"numpy.sum",
"tensorflow.compat.v2.compat.v1.placeholder",
"tensorflow.compat.v2.io.gfile.GFile"
]
] |
jarbus/neural-mmo | [
"a9a7c34a1fb24fbf252e2958bdb869c213e580a3"
] | [
"jsuarez/extra/embyr_deprecated/embyr/client.py"
] | [
"from pdb import set_trace as T\nimport pygame, time\nimport numpy as np\n\nfrom forge.embyr import embyr\nfrom forge.embyr.modules import *\n\nclass Client(embyr.Container):\n def __init__(self, view, size, realm, step, dims, nAnim, **kwargs):\n super().__init__(size, **kwargs)\n self.W, self.H, s... | [
[
"numpy.fliplr",
"numpy.clip"
]
] |
khoih-prog/transformers | [
"77321481247787c97568c3b9f64b19e22351bab8"
] | [
"src/transformers/models/roberta/modeling_roberta.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. 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 License.\n# You may... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.cat",
"torch.nn.MSELoss",
"torch.arange",
"torch.einsum",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.functional.softmax",
... |
Archymade/English-Letter-Classifier | [
"0aefc5114a4dc48205c18e8e667407c86217af19"
] | [
"scripts/viz_utils.py"
] | [
"import os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.metrics import plot_confusion_matrix\n \n \n# Univariate visualization\ndef univariate_plot(data, path, save = True):\n \n ''' Plot the data univariately. '''\n \n for col in data.columns:\n plt.figure(figsiz... | [
[
"sklearn.metrics.plot_confusion_matrix",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
msc-acse/acse-9-independent-research-project-dekape | [
"d3d2236e47e8604803850c7cacceb826c7649bcb"
] | [
"fullwaveqc/geom.py"
] | [
"#!/usr/bin/env python\n# Deborah Pelacani Cruz\n# https://github.com/dekape\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport datetime\nfrom collections import OrderedDict\nimport fullwaveqc.tools as tools\n\n\ndef boundarycalc(d, dx, fmin, vmax):\n \"\"\"\n Calculates the number of absorbing bo... | [
[
"numpy.array",
"numpy.ceil",
"numpy.zeros_like",
"matplotlib.pyplot.subplots",
"numpy.size",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
tobyglei/streamlit | [
"5ce9eeee09abb1ce34da8ffe2075881139ea7b7d"
] | [
"lib/streamlit/delta_generator.py"
] | [
"# Copyright 2018-2020 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ... | [
[
"pandas.RangeIndex"
]
] |
rgayler/VSA_altitude_hold | [
"648e64806942a050b00bc41d9f533ee84823df39"
] | [
"python/vsa/__init__.py"
] | [
"'''\nVSA functions\n\nCopyright (c) 2021 Ross W. Gayler and Simon D. Levy\n\nMIT License\n'''\n\nimport numpy as np\n\n# ---- mk_sample_spec --------------------------------------------------------\n\n# function to make a sampling specification for adding VSA vectors\n\n\ndef mk_sample_spec(\n dim, # integ... | [
[
"numpy.ceil",
"numpy.random.choice",
"numpy.random.seed",
"numpy.sum",
"numpy.ones",
"numpy.argsort",
"numpy.random.random",
"numpy.floor"
]
] |
aloui-mathias/ecoTeka-deepforest-demo | [
"54007af69a14d25bc8e48a02831260f4f2908ab6"
] | [
"script/functions.py"
] | [
"import json\nimport pyproj\nimport numpy\nimport pandas\nimport cv2\nfrom urllib.parse import unquote, urlencode\nfrom owslib.wmts import WebMapTileService\nfrom PIL import Image\nfrom matplotlib import pyplot\nfrom shapely import geometry\nfrom deepforest import main\nfrom qgis.core import (\n QgsApplication,\... | [
[
"matplotlib.pyplot.imsave",
"pandas.DataFrame",
"numpy.array"
]
] |
milebril/Temporal-SBMC-extension | [
"57c56b73786e49d233facffde4ba80f212a00fa8"
] | [
"sbmc/losses.py"
] | [
"# encoding: utf-8\n# Sample-based Monte Carlo Denoising using a Kernel-Splatting Network\n# Michaël Gharbi Tzu-Mao Li Miika Aittala Jaakko Lehtinen Frédo Durand\n# Siggraph 2019\n#\n# Copyright (c) 2019 Michaël Gharbi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this f... | [
[
"torch.abs",
"torch.mean",
"torch.clamp",
"torch.pow"
]
] |
chroneus/imgaug | [
"621a7e6a728250e818feccda9ccc6886242e196f"
] | [
"checks/check_heatmaps.py"
] | [
"from __future__ import print_function, division\n\nimport numpy as np\n\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\n\n\ndef main():\n quokka = ia.data.quokka(size=0.5)\n h, w = quokka.shape[0:2]\n heatmap = np.zeros((h, w), dtype=np.float32)\n heatmap[70:120, 90:150] = 0.1\n heatmap[... | [
[
"numpy.hstack",
"numpy.zeros"
]
] |
hturner08/openmc | [
"5e36cb2f5daf7ab9162734e927dd652c1118a5bd"
] | [
"openmc/deplete/results_list.py"
] | [
"import h5py\nimport numpy as np\n\nfrom .results import Results, _VERSION_RESULTS\nfrom openmc.checkvalue import check_filetype_version\n\n\nclass ResultsList(list):\n \"\"\"A list of openmc.deplete.Results objects\n\n Parameters\n ----------\n filename : str\n The filename to read from.\n\n ... | [
[
"numpy.empty_like"
]
] |
andrewli77/rllab-finetuning | [
"2dae9141d0fdc284d04f18931907131d66b43023"
] | [
"sandbox/finetuning/policies/categorical_mlp_policy.py"
] | [
"import lasagne.layers as L\nimport lasagne.nonlinearities as NL\nfrom contextlib import contextmanager\nimport numpy as np\n\nfrom rllab.core.lasagne_powered import LasagnePowered\nfrom rllab.core.network import MLP\nfrom rllab.core.serializable import Serializable\n\nfrom sandbox.finetuning.distributions.categori... | [
[
"numpy.argmax"
]
] |
YikSanChan/jina | [
"d7ad9fde97f02db79233ba93400e0bda74597580"
] | [
"jina/drivers/score.py"
] | [
"__copyright__ = \"Copyright (c) 2020 Jina AI Limited. All rights reserved.\"\n__license__ = \"Apache-2.0\"\n\n# lift the chunk-level topk to doc-level topk\nimport numpy as np\n\nfrom . import BaseExecutableDriver\nfrom .helper import pb_obj2dict\n\n\nclass BaseRankDriver(BaseExecutableDriver):\n \"\"\"Drivers ... | [
[
"numpy.array"
]
] |
avijit-chakroborty/ngraph-bridge | [
"ea6422491ec75504e78a63db029e7f74ec3479a5",
"ea6422491ec75504e78a63db029e7f74ec3479a5"
] | [
"test/python/test_updateconfig.py",
"test/python/test_slice.py"
] | [
"# ==============================================================================\n# Copyright 2019-2020 Intel Corporation\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# ... | [
[
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.disable_eager_execution"
],
[
"tensorflow.compat.v1.placeholder",
"numpy.random.rand",
"numpy.testing.assert_array_equal",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.constant",
"tensorflow.python.ops.arr... |
afeld/pandas | [
"9a1d87bc4633c24958254218aaf9762a845fd57d"
] | [
"pandas/conftest.py"
] | [
"\"\"\"\nThis file is very long and growing, but it was decided to not split it yet, as\nit's still manageable (2020-03-17, ~1.1k LoC). See gh-31989\n\nInstead of splitting it was decided to define sections here:\n- Configuration / Settings\n- Autouse fixtures\n- Common arguments\n- Missing values & co.\n- Classes\... | [
[
"pandas._testing.makeTimedeltaIndex",
"pandas._testing.getTimeSeriesData",
"pandas.Timestamp",
"pandas._testing.makeUnicodeIndex",
"pandas._testing.makeDateIndex",
"pandas.Timedelta",
"pandas.set_option",
"pandas.Interval",
"pandas.core.indexes.api.Index",
"pandas.DataFrame... |
kinoute/google-research | [
"562c7c6ef959cb3cb382b1b660ccc45e8f5289c4",
"562c7c6ef959cb3cb382b1b660ccc45e8f5289c4",
"562c7c6ef959cb3cb382b1b660ccc45e8f5289c4",
"4a59cab927579ea9722e43252c695de5da4eb5e2"
] | [
"mpi_extrapolation/render_sway.py",
"summae/beam_search.py",
"stacked_capsule_autoencoders/capsules/models/scae.py",
"eim/small_problems_density_plot.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.concatenate",
"numpy.array",
"matplotlib.pyplot.imsave",
"tensorflow.image.convert_image_dtype",
"tensorflow.Session",
"numpy.load",
"tensorflow.train.Saver",
"numpy.eye",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer"
... |
hamedomidvar/associativeconv | [
"9930915abd3625871354df676865fc44eb92abf3"
] | [
"Implementations/CIFAR10/models/densenet.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\n\n#############################\nCODE_SIZE = 72\nSLICE_SHAPE = [12,12,3,3]\n#############################\n\nclass Bottleneck(nn.Module):\n def __init__(self, in_planes, growth_rate, CSG, reg_mode=False):\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.avg_pool2d",
"numpy.ceil",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"numpy.prod",
"torch.randn"
]
] |
minus31/BlazeFace | [
"bddfb3261868b1a888408898c3de9bf6e12a372d"
] | [
"implementation/dataloader.py"
] | [
"import cv2\nimport pickle\nimport glob \nimport os \nimport numpy as np \n\n\nIM_EXTENSIONS = ['png', 'jpg', 'bmp']\n\n\ndef read_img(img_path, img_shape=(128,128)):\n \"\"\"\n load image file and divide by 255.\n \"\"\"\n img = cv2.imread(img_path)\n img = cv2.resize(img, img_shape)\n img /= 255... | [
[
"numpy.array",
"numpy.arange",
"numpy.random.choice"
]
] |
dawidvdh/programmers-introduction-to-mathematics | [
"2345a118f055bb7f98140ee58d5332c6691e1fc1"
] | [
"secret-sharing/plot_collisions.py"
] | [
"if __name__ == \"__main__\":\n import matplotlib as mpl\n mpl.use('TkAgg')\n\n import numpy as np\n import matplotlib.pyplot as plt\n from interpolate import *\n\n # Create a figure of size 8x6 points, 80 dots per inch\n plt.figure(figsize=(8, 8), dpi=80)\n\n # starting from these base poin... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"numpy.linspace"
]
] |
slimgroup/dfno | [
"3751ceddee14b949503300f6570ff56bac34c6e6"
] | [
"tests/gradient_test_torch.py"
] | [
"from gradient_test import gradient_test\n\nimport gc\nimport torch\nimport torch.nn as nn\n\ninput_shape = (16, 16)\nf = nn.Sequential(\n nn.Linear(16, 16, dtype=torch.float64),\n nn.Linear(16, 16, dtype=torch.float64)\n)\n\n# Initialize lazy parameters\nwith torch.no_grad():\n x = torch.rand(*inp... | [
[
"torch.nn.Linear",
"torch.device",
"torch.no_grad"
]
] |
apple35932003/IVS-Caffe | [
"54bb78daab04a8188d0df9ef5b8f4855082e0da5"
] | [
"lib/datasets/imdb.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nimport os\nimport os.path as osp\nimport PIL\nfrom utils.cy... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"numpy.sort",
"numpy.hstack",
"numpy.vstack"
]
] |
Aid91/Deep_Q_Learning_ATARI | [
"3e35f0bd21120774b48a918267055fb6f8a7d90e"
] | [
"dqn/pong_dqn_conv.py"
] | [
"\nimport time\nimport numpy as np\nimport tensorflow as tf\nimport numpy.random as rd\nimport gym\nimport cv2\n\nimport matplotlib.pyplot as plt\nfrom tf_tools import variable_summaries\nfrom replay_memory import *\n\n\nenv = gym.make(\"Pong-v0\")\n\nmini_batch_size = 32\nreplay_memory_size = 100000\nreplay_memory... | [
[
"numpy.random.choice",
"tensorflow.nn.conv2d",
"numpy.random.rand",
"tensorflow.matmul",
"tensorflow.merge_all_summaries",
"tensorflow.reshape",
"numpy.mean",
"tensorflow.mul",
"numpy.where",
"numpy.max",
"tensorflow.Variable",
"tensorflow.constant",
"numpy.rand... |
domschl/ml-indie-tools | [
"70a458a9e385acc883b979f3db8e6d391fdb863b"
] | [
"src/ml_indie_tools/keras_custom_layers.py"
] | [
"import tensorflow as tf\ntry:\n # the endless shuffle of keras modules\n import tensorflow.keras as keras\n from tensorflow.keras import layers\n print(\"Using TF-Keras version:\", keras.__version__)\nexcept ImportError:\n import keras\n import keras.layers as layers\n print(\"Using Keras vers... | [
[
"numpy.sin",
"tensorflow.matmul",
"numpy.float32",
"numpy.arange",
"numpy.cos",
"tensorflow.add",
"tensorflow.cast"
]
] |
jselvam11/funsor | [
"c54b2c5dbc0185bd4ed727d780596ab2da883d2b"
] | [
"test/test_memoize.py"
] | [
"# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\nimport numpy as np\nimport pytest\n\nimport funsor.ops as ops\nfrom funsor.cnf import BACKEND_TO_EINSUM_BACKEND, BACKEND_TO_LOGSUMEXP_BACKEND\nfrom funsor.einsum import einsum, naive_plated_einsum\nfrom funsor.interpreter impor... | [
[
"numpy.array"
]
] |
tmkkk/fcn | [
"e2d60fd5d54fd69f2b1d8280fe870f9af8cfda50"
] | [
"src/models.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras.applications.vgg16 import VGG16\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.layers import Input, Conv2D, Dropout, Conv2DTranspose, Add\nfrom tensorflow.keras.initializers import Zeros\n\n\ndef build_fcn32s(nb_classes, target_s... | [
[
"tensorflow.keras.initializers.Zeros",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Input",
"tensorflow.keras.applications.vgg16.VGG16",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Conv2DT... |
magnificent1208/mmdetection | [
"ce53f9afb4e6cd9343c02fb8218e54411f58c2b7"
] | [
".history/mmdet/models/dense_heads/center_triplets_head_20200812191524.py"
] | [
"from math import ceil, log\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom mmcv.cnn import normal_init, ConvModule, bias_init_with_prob\nfrom mmcv.ops import CornerPool\n\nimport numpy as np\nimport cv2\nimport math\n\nfrom mmdet.core import multi_apply, multiclass_nms, distance2bbo... | [
[
"torch.cat",
"torch.stack",
"torch.nn.ModuleList",
"torch.nn.ReLU",
"torch.abs",
"torch.ones_like",
"torch.zeros_like",
"torch.nn.functional.max_pool2d",
"torch.topk"
]
] |
yxyang/fast_and_efficient | [
"1d284337461ee826497bfc811b2461aa0ffcd27f"
] | [
"src/convex_mpc_controller/locomotion_controller.py"
] | [
"\"\"\"A model based controller framework.\"\"\"\nfrom absl import logging\n\nfrom datetime import datetime\nimport enum\nimport ml_collections\nimport numpy as np\nimport os\nimport pickle\nimport pybullet\nfrom pybullet_utils import bullet_client\nimport threading\nimport time\nfrom typing import Tuple\n\nfrom sr... | [
[
"numpy.ones"
]
] |
Mario-Kart-Felix/python-neo | [
"951c97cf9eb56f5489da88940de920329e0f4c1b"
] | [
"neo/test/iotest/test_nixio.py"
] | [
"# Copyright (c) 2016, German Neuroinformatics Node (G-Node)\n# Achilleas Koutsou <achilleas.k@gmail.com>\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted under the terms of the BSD License. See\n# LICENSE file in ... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.random.rand",
"numpy.testing.assert_almost_equal",
"numpy.shape",
"numpy.float64",
"numpy.random.uniform",
"numpy.transpose",
"numpy.random.randint",
"numpy.arange",
"numpy.cumsum",
"numpy.all",
"numpy.random.random",... |
mmuu1987/MyFluid | [
"406f8bcadc6607b3a87383e85864bf5a5556f231"
] | [
"python/RiemannSolver/Burgers1dGodunov.py"
] | [
"import numpy as np\n#Godunov Scheme for 1d Burgers equation\n#介绍:https://zhuanlan.zhihu.com/p/331771977\nnmax = 8\ntmax = 100\ndx = 1.0 / nmax\ndt = 1.0 / tmax\nU = np.zeros((tmax,nmax))\nF = np.zeros((tmax,nmax + 1))\nfor i in range(0,nmax):\n if(i < 2):\n U[0,i] = 2\n else:\n U[0,i] = 1\n\ncf... | [
[
"numpy.zeros"
]
] |
vdike/pyHalo | [
"c8d55cfbce2b0b9cb9c5520a2ec345a75ab502df"
] | [
"pyHalo/Halos/HaloModels/coreTNFW.py"
] | [
"from pyHalo.Halos.halo_base import Halo\nfrom pyHalo.Halos.HaloModels.TNFW import TNFWFieldHalo, TNFWSubhalo\nfrom lenstronomy.LensModel.Profiles.tnfw import TNFW\nimport numpy as np\n\n\nclass coreTNFWBase(Halo):\n \"\"\"\n The main class for a cored NFW field halo profile\n\n See the base class in Halos... | [
[
"numpy.round"
]
] |
manojkrishnan2490/gpt-2 | [
"f597167237a635e11fa95ea5d10d76a77db487de"
] | [
"encode.py"
] | [
"#!/usr/bin/env python3\n# Usage:\n# PYTHONPATH=src ./encode.py <file|directory|glob> /path/to/output.npy\n# PYTHONPATH=src ./train --dataset /path/to/output.npy\n\nimport argparse\nimport numpy as np\n\nimport encoder\nfrom load_dataset import load_dataset\n\nparser = argparse.ArgumentParser(\n description='P... | [
[
"numpy.save"
]
] |
luisvalesilva/chr_size_bias_in_ssDNA_chip-chip | [
"becc79c553d3da9a7781e6d84b067b0b408467a8"
] | [
"helpers.py"
] | [
"\"\"\" Helper functions \"\"\"\n\n# Standard library\nimport time\nimport os\nimport logging\n\n# Third party libraries\nimport pandas as pd\nfrom scipy.stats import ttest_ind\n\n\ndef array_file_names(path):\n \"\"\"\n Given a path to a folder (array library), returns dictionary\n containing each directo... | [
[
"pandas.DataFrame",
"scipy.stats.ttest_ind"
]
] |
baoguangsheng/g-transformer | [
"928f08f3391f589f8a89f1db9ff1fb6981a9443d"
] | [
"fairseq/models/fairseq_encoder.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 torch\nimport torch.nn as nn\nfrom typing import Dict, List, NamedTuple, Optional\nfrom torch import Tensor\n\nEncoderOut = N... | [
[
"torch.jit.is_scripting"
]
] |
burgerkingeater/io | [
"f2de208f474d6ba4926e2c7f9e901e102ca5c254"
] | [
"tensorflow_io/core/python/ops/hdf5_io_tensor_ops.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.TensorSpec",
"tensorflow.math.greater_equal",
"tensorflow.executing_eagerly",
"tensorflow.name_scope",
"tensorflow.unstack",
"tensorflow.math.equal"
]
] |
MarcCote/Theano | [
"f0d293161a624ccf10c60ee8405a92e7d321151a",
"f0d293161a624ccf10c60ee8405a92e7d321151a"
] | [
"theano/sandbox/cuda/fftconv.py",
"theano/d3viz/tests/test_d3viz.py"
] | [
"from __future__ import absolute_import, print_function, division\n\nimport numpy as np\nimport theano\nimport theano.tensor as T\n\nfrom theano.misc.pycuda_init import pycuda_available\nfrom theano.sandbox.cuda import cuda_available, GpuOp\nfrom theano.ifelse import ifelse\n\nif cuda_available:\n from theano.sa... | [
[
"numpy.complex64"
],
[
"numpy.random.RandomState"
]
] |
asharron/banditproblem | [
"25987b4c751ed871cb9512c3efa9e6efa5c35584"
] | [
"incremental.py"
] | [
"#This file uses the incremental approach to calculating\n# Q values instead of redoing the q equation for each entry in\n# the table\n\nimport numpy as np\nimport random\n\nrandomint = random.randint(1,51) #How many actions we will have between 1 - 50\nrewards = np.random.rand(1,randomint) #Rewards for each action... | [
[
"numpy.random.rand",
"numpy.zeros"
]
] |
LetteraUnica/unipi_lab_courses | [
"5bec20184cba3ca0e61831b193c407dba04651c1",
"5bec20184cba3ca0e61831b193c407dba04651c1"
] | [
"Lab 1/5) Piano Inclinato/theta 2 lineare.py",
"Lab 2/Relazione primo semestre/Diodo con led/analisis diodo con led.py"
] | [
"import math\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef regression_line (datix, datiy, n_dati) : #Calcola la linea di miglior fit\n ux = np.average(datix) #Formule prese da http://mathworld.wolfram.com/LeastSquaresFitting.html \n uy = np.average(datiy)\n sxx = -n_dati *... | [
[
"numpy.array",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"numpy.genfromtxt",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
"numpy.average",
"m... |
SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | [
"3fbc215de6b05904a5b54b2c7cde7e61074ae38d",
"3fbc215de6b05904a5b54b2c7cde7e61074ae38d",
"3fbc215de6b05904a5b54b2c7cde7e61074ae38d",
"3fbc215de6b05904a5b54b2c7cde7e61074ae38d",
"3fbc215de6b05904a5b54b2c7cde7e61074ae38d"
] | [
"xd_xd/aa/road_networks/skeletonize.py",
"xd_xd/aa/road_networks/wkt_to_graph.py",
"selim_sef/data_tools/generate_spacenet_dataset.py",
"selim_sef/models/unet.py",
"schapke/cresi/05_wkt_to_G.py"
] | [
"# -*- coding: utf-8 -*-\nfrom logging import getLogger\nfrom pathlib import Path\nimport os\nimport json\nimport time\nimport random\nimport argparse\nimport logging\nfrom itertools import tee\nfrom collections import OrderedDict #, defaultdict\nfrom multiprocessing import Pool, cpu_count\n\nfrom scipy.spatial.dis... | [
[
"numpy.dot",
"numpy.copy",
"matplotlib.pylab.plt.title",
"numpy.max",
"numpy.linalg.norm",
"pandas.DataFrame",
"numpy.cross",
"numpy.array",
"numpy.linalg.det",
"matplotlib.pylab.plt.imshow",
"numpy.argwhere",
"numpy.squeeze",
"scipy.spatial.distance.pdist",
... |
yuanxiangyuee/ins_seg_HRSIs | [
"d716a5d7726bb016a4f6c1032ef3e3ad108d00bb"
] | [
"carafe.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Function\nfrom torch.nn.modules.module import Module\n\n\ndef xavier_init(module, gain=1, bias=0, distribution='normal'):\n assert distribution in ['uniform', 'normal']\n if distribution == 'uniform':\n nn... | [
[
"torch.nn.init.constant_",
"torch.nn.functional.pixel_shuffle",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.normal_",
"torch.nn.Conv2d",
"torch.nn.functional.softmax",
"torch.zeros_like",
"torch.nn.init.xavier_normal_"
]
] |
kmes007/EducationProject | [
"14cd4a20341792d240e37f8f73bd795f74fa4fc3"
] | [
"app.py"
] | [
"\n# import sqlalchemy\n# from sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import create_engine, func\n# import plotly\n# import plotly.graph_objs as go\nfrom flask_sqlalchemy import SQLAlchemy\n\nfrom flask import Flask, jsonify, render_template, url_for, flash, ... | [
[
"pandas.read_sql",
"pandas.to_numeric"
]
] |
DanielTisza/spectralcamera | [
"4fef93b3b4cd8f83e016070f1c0d68aa0cff5102"
] | [
"python/capture_images/led_set_f.py"
] | [
"# ----------------------------------------------------------------------------\n#\tled_set_f.py\n#\n#\tCopyright 2021 Daniel Tisza\n#\tMIT License\n#\n#\tAcquiring LED set F wavelengths radiance and reflectance\n#\n# ----------------------------------------------------------------------------\n\nimport fpipy as fp... | [
[
"matplotlib.pyplot.gray"
]
] |
mbp28/determinantal-point-processes | [
"e3cebb9209ab47de41c35a0d9ef605d608ec9d98"
] | [
"sampling/sample_dpp.py"
] | [
"import numpy as np\nfrom scipy.linalg import orth\n\ndef sample_dpp(vals, vecs, k=0, one_hot=False):\n \"\"\"\n This function expects \n \n Arguments: \n vals: NumPy 1D Array of Eigenvalues of Kernel Matrix\n vecs: Numpy 2D Array of Eigenvectors of Kernel Matrix\n\n \"\"\"\n n = vecs.shape[... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.empty",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.arange",
"numpy.abs",
"numpy.outer"
]
] |
BlueBrain/vascpy | [
"65fbf17528ae76c1f08cac9db4a8979ddf99e834"
] | [
"tests/point_graph/test_features.py"
] | [
"import pandas as pd\nimport pytest\nfrom numpy import testing as npt\n\nfrom vascpy.point_graph import features as _feat\nfrom vascpy.point_vasculature import PointVasculature\n\n\n@pytest.fixture\ndef node_properties():\n return pd.DataFrame(\n {\n \"x\": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7... | [
[
"pandas.DataFrame",
"numpy.testing.assert_allclose"
]
] |
winxos/NAO | [
"02ef8609cfdcd6c36aba527757dfe0d2c0fb863e"
] | [
"python/py_udp_cv3_photo/py_udp_server_cv3_v2.py"
] | [
"# -*- coding: utf-8 -*-\n'''\npython udp server get remote image.\n\nwinxos 2015-07-19\n'''\nimport cv2\nimport numpy as np\nimport socket\nimport os\nimport stat # get file size\nimport struct # pack binary\nimport platform\n\nDEBUG = False\nMAX_PACK_SIZE = 1024\nport = 9100\nserver = socket.socket(socket.AF_IN... | [
[
"numpy.array"
]
] |
teubert/hybridq | [
"128292bddf6b7d51ea4a576ddda5cab77c014496"
] | [
"hybridq/extras/random.py"
] | [
"\"\"\"\nAuthor: Salvatore Mandra (salvatore.mandra@nasa.gov)\n\nCopyright © 2021, United States Government, as represented by the Administrator\nof the National Aeronautics and Space Administration. All rights reserved.\n\nThe HybridQ: A Hybrid Simulator for Quantum Circuits platform is licensed under\nthe Apache ... | [
[
"numpy.random.random",
"numpy.arange",
"numpy.random.choice",
"numpy.random.permutation"
]
] |
sharanramjee/adala-optimizer | [
"0d3417d41ac05622f8faf55bb2233296eb871e76"
] | [
"language_penntreebank/models/model.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom embed_regularize import embedded_dropout\nfrom locked_dropout import LockedDropout\nfrom weight_drop import WeightDrop\n\nclass RNNModel(nn.Module):\n \"\"\"Container module with an encoder, a recurrent module, and a decoder.\"\"\"\n\n def __init__(self, rnn_type, ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.GRU",
"torch.nn.ModuleList",
"torch.nn.Embedding"
]
] |
CAVED123/-navbot | [
"5c5711e034516017326bed98a1c66880b6165d9d"
] | [
"tools/draw_success_rate.py"
] | [
"#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\nimport matplotlib.pyplot as plt\n\nplt.rcParams['font.sans-serif'] = ['Times New Roman'] # 如果要显示中文字体,则在此处设为:SimHei\nplt.rcParams['axes.unicode_minus'] = False # 显示负号\nplt.figure(figsize=(10, 6))\nplt.grid(linestyle=\"--\") # 设置背景网格线为虚线\nax = plt.gca()\nax.spines['to... | [
[
"matplotlib.pyplot.setp",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.