repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
thhuang/notes-fcnd | [
"c5b0ec7d99df3cb60a850308d16ccc6c096c7931"
] | [
"Course04/19-8_Attitude estimation/helpers.py"
] | [
"import numpy as np\nfrom matplotlib import pyplot as plt\n\nclass IMU:\n def __init__(self, accel_sigma=0.1, gyro_sigma=0.5):\n self.accel_sigma = accel_sigma\n self.gyro_sigma = gyro_sigma\n \n def measure(self, true_state):\n \"\"\"true_state is [theta, phi, q, p]\"\"\"\n ... | [
[
"numpy.array",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"numpy.random.normal",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
... |
sethdmay/dg-cv | [
"09eac355b11507b6d034eb209168cec820851e36"
] | [
"seth/background_extract.py"
] | [
"import cv2 as cv\nimport numpy as np\n\n\nwindow_name = \"FG Mask\"\npaused = False\n\n# Lucas kanade params\nlk_params = dict(\n winSize=(15, 15),\n maxLevel=4,\n criteria=(cv.TERM_CRITERIA_EPS | cv.TERM_CRITERIA_COUNT, 10, 0.03),\n)\n\n\nvideo = cv.VideoCapture(\"resources/putt.mov\")\nbg_extract = cv.c... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.interp"
]
] |
EuphoriaYan/Chinese-ancient-book-recognition-HSK | [
"865736d16389037f555f0eea7ec6c4ab7e4319c9"
] | [
"noise_util.py"
] | [
"from PIL import Image, ImageDraw\nimport numpy as np\nfrom tqdm import tqdm\nimport random\nimport math\nimport json\n\n\ndef cal_dis(pA, pB):\n return math.sqrt((pA[0] - pB[0]) ** 2 + (pA[1] - pB[1]) ** 2)\n\n\ndef add_noise(img, generate_ratio=0.003, generate_size=0.006):\n if not isinstance(img, np.ndarra... | [
[
"numpy.array"
]
] |
stephanedenis/donkeycar | [
"a0eb5df643f19c6ba51a864add5abdc4e13b9104"
] | [
"donkeycar/templates/complete.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nScripts to drive a donkey 2 car\n\nUsage:\n manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical)] [--camera=(single|stereo)] [--meta=<key:value> ...] [--myconfig=<filename>]\n manage.py (train) [--tubs=tubs] (--model=<model>) [--type=(linear|inferred|tensorr... | [
[
"tensorflow.python.keras.models.model_from_json"
]
] |
Taemin0707/uncertainty_for_robot | [
"381ee3e399a804a4b94d3c09b40ff45c996347f7"
] | [
"uncertainty_of_deeplearning/src/gui_number_recognizer_cnn.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nThis program creates a Number-Recognizer.\n\nAuthor: Taemin Choi\nEmail: choitm0707@kist.re.kr\nLast edited: November 2018\n\"\"\"\n\nimport os\nimport sys\nimport time\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import *\nimp... | [
[
"matplotlib.pyplot.Figure",
"tensorflow.nn.max_pool",
"numpy.max",
"numpy.mean",
"numpy.var",
"numpy.where",
"tensorflow.nn.conv2d",
"numpy.reshape",
"numpy.arange",
"tensorflow.reset_default_graph",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.Sessio... |
AUAMO/atomic_data_codes | [
"5f12b59152bef209f95c60596c23b4c40786de72"
] | [
"gcr/DP_data_analysis.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jul 15 10:06:27 2016\n\n@author: ALEXIS\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\n\nspect_dir = 'C:/Users/ivan/OneDrive/Research/ar_OES/DATA/BC1E'\nos.chdir(spect_dir)\n\n# %%\ndef retrieve_file_dir_data(spect_dir):\n from astropy.io... | [
[
"numpy.hstack",
"numpy.abs",
"numpy.cosh",
"matplotlib.pyplot.ylim",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"numpy.size",
"numpy.mean",
"scipy.stats.linregress",
"numpy.tanh",
"numpy.array",
"scipy.optimize.curve_fit",
"numpy.vst... |
namachan10777/nmf-learn | [
"c0e0d81508632554f3274816331aa72eeb648ade"
] | [
"ICA/mix.py"
] | [
"#!/usr/bin/python\n# 2019 Nakano Masaki\n\nimport sys\nimport soundfile as sf\nimport numpy as np\n\nif __name__ == '__main__':\n n = len(sys.args)\n mix = np.random.rand(n, n) * 2 - 1\n _, samplerate = sf.read(sys.args[1])\n wavs = []\n for f in sys.args:\n wav, rate = sf.read(f)\n as... | [
[
"numpy.dot",
"numpy.array",
"numpy.random.rand"
]
] |
facultyai/sherlockml-boltzmannclean | [
"6e2b49bce9a6020b2e70e399ef6bf6740af5e69b"
] | [
"boltzmannclean.py"
] | [
"from __future__ import division, print_function\n\nimport pandas as pd\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.impute import SimpleImputer as Imputer\nfrom sklearn.model_selection import GridSearchCV\n\nCOLNAME_SE... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.random.random_sample",
"pandas.DataFrame",
"numpy.nan_to_num",
"numpy.zeros_like",
"numpy.random.randn",
"numpy.exp",
"sklearn.preprocessing.MinMaxScaler",
"numpy.square",
"numpy.hstack",
"numpy.ones_like",
"numpy.reshape",
... |
lafleur1/rgnModified | [
"56ffbcefa48d314326f98a5d90e3050aa0d33157"
] | [
"viewEnergyDistributions.py"
] | [
"#view the distriution of fa scores, # h-bonds, and percent SS for true and false HLH structures\n\nimport pandas as pd\nimport sys,os,json\nimport tempfile\nimport numpy as np\nimport argparse\nfrom pyrosetta import *\nfrom pyrosetta.rosetta.protocols.minimization_packing import MinMover\nimport time\nfrom pyroset... | [
[
"matplotlib.pyplot.show",
"pandas.DataFrame"
]
] |
Demon-JieHao/Modeling-Structure-for-Transformer-Network | [
"329831964731ccb7361b847e0ff7c2d809ab7231"
] | [
"thumt/layers/attention.py"
] | [
"# coding=utf-8\n# Copyright 2018 The THUMT Authors\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport tensorflow as tf\n\nfrom thumt.layers.nn import linear\n\n\ndef add_timing_signal(x, min_timescale=1.0, max_timescale=1.0e4, na... | [
[
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.tanh",
"tensorflow.where",
"tensorflow.name_scope",
"tensorflow.to_float",
"tensorflow.nn.dropout",
"tensorflow.matmul",
"tensorflow.shape",
"tensorflow.split",
"tensorflow.nn.softmax",
... |
violapterin/channel-estimation-via-dantzig-selector-code | [
"4f533725e451269fc35379a756f67f29322a10f1"
] | [
"src/test.py"
] | [
"#! /usr/bin/env python3\n\nimport numpy as np\nimport scipy as sp\nimport cvxpy as cp\nimport random\n\nimport constants as cst\nimport classes as cls\nimport functions as fct\n\naa = np.array ([[3,1,5], [2,4,6], [7,7,-7]])\nbb = np.array ([[9,7,-8], [-1,0,3]])\nx = fct.vectorize (aa)\ny = fct.vectorize (bb)\nz = ... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.abs",
"numpy.linalg.norm",
"numpy.ones",
"numpy.concatenate",
"numpy.linalg.pinv",
"numpy.random.normal",
"numpy.exp",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
jdasam/scDCC | [
"8ebaed766db5ad56021983ebc13e9a60b6c7b453"
] | [
"scDCC_latent.py"
] | [
"from time import time\nimport math, os\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.nn import Parameter\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader, TensorDataset\n\nfrom scDCC import scDCC\nimport numpy as np\nim... | [
[
"torch.load",
"numpy.median",
"numpy.random.shuffle",
"sklearn.metrics.normalized_mutual_info_score",
"torch.tensor",
"numpy.delete",
"numpy.savetxt",
"sklearn.metrics.adjusted_rand_score",
"numpy.array",
"numpy.loadtxt"
]
] |
neloial/tac | [
"b4d92629c293a15016fed0ce80a7dfde4bf68b19"
] | [
"scripts TP4/script_tp4_neloial.py"
] | [
"\"\"\"Analyse frequency distribution of words\"\"\"\n\nimport nltk\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport sys\nfrom nltk.corpus import stopwords\nfrom collections import defaultdict\nfrom textblob import Blobber\nfrom textblob_fr import PatternTagger, PatternAnalyzer\n\nsw = stopwo... | [
[
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.figure"
]
] |
takua624/brainiak | [
"4774975bef95a445a1b62a5809627a6f023297d9"
] | [
"examples/utils/fmrisim_example.py"
] | [
"# Copyright 2016 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.diag",
"numpy.add",
"numpy.array",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
fritzt/gcgridobj | [
"727778b26cbf1a35ecf741665469f08084d4be44"
] | [
"gcgridobj/atmos_isa_mini.py"
] | [
"import numpy as np\nfrom . import physconstants\n\n# Persistent (module) variables\nz_int = None\np_int = None\n\ndef altitude_to_many(z_m):\n '''Lightweight version of atmosisa from the Aerospace Toolbox'''\n\n # Sort from lowest to highest altitude\n sort_idx = np.argsort(z_m)\n #z_sorted = z_m[sort_... | [
[
"numpy.abs",
"numpy.power",
"numpy.arange",
"numpy.concatenate",
"numpy.diff",
"numpy.interp",
"numpy.exp",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
timgates42/jax | [
"ac62a5a6bdd3395046470516e7873f20ab62bd55"
] | [
"tests/api_test.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.asarray",
"numpy.all",
"numpy.random.randn",
"numpy.tri",
"numpy.exp",
"numpy.arange",
"numpy.eye",
"numpy.float16",
"numpy.sin",
"numpy.float32",
"numpy.zeros",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.random.Ra... |
tomography/scanscripts | [
"f7486fe1285da4684f3709661f112ccc15c2e4b8"
] | [
"tests/test_scanlib.py"
] | [
"\"\"\"Unit test for the extra tooling in scanlib.\"\"\"\n\nimport logging\nlogging.basicConfig(level=logging.WARNING)\nimport warnings\nimport unittest\n\nimport numpy as np\n\nfrom scanlib.tools import energy_range, energy_range_from_points\nfrom scanlib.scan_variables import parse_list_variable\n\nlog = logging.... | [
[
"numpy.testing.assert_array_equal",
"numpy.array"
]
] |
openclimatefix/nowcasting_utils | [
"7a45e9d24ce29693d96fd9c75a34ca1d205b64bc"
] | [
"nowcasting_utils/models/losses/FocalLoss.py"
] | [
"\"\"\" Focal Loss - https://arxiv.org/abs/1708.02002 \"\"\"\nfrom typing import List, Optional, Union\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn as nn\nfrom torch.autograd import Variable\n\n\nclass FocalLoss(nn.Module):\n \"\"\"Focal Loss\"\"\"\n\n def __init__(\n self,\n ... | [
[
"torch.Tensor",
"torch.nn.functional.log_softmax",
"torch.autograd.Variable"
]
] |
cambel/ur3 | [
"e6866e951dbae1257e56b34f739abc1a839c3685"
] | [
"ur_control/src/ur_control/utils.py"
] | [
"# ROS utilities used by the CRI group\n#! /usr/bin/env python\nimport os\nimport sys\nimport copy\nimport time\nimport numpy as np\nimport rospy\nimport rospkg\nimport sys\nimport inspect\nfrom ur_control import transformations, spalg\nfrom sensor_msgs.msg import JointState\nfrom pyquaternion import Quaternion\n\n... | [
[
"numpy.dot",
"numpy.ones_like",
"numpy.minimum",
"numpy.clip",
"numpy.lexsort",
"numpy.diff",
"numpy.zeros_like",
"numpy.identity",
"numpy.array"
]
] |
Zhicheng-Liu/mykrobe | [
"9cfe80d9cb6424f3fbdef2434388a13bf9ee8edb"
] | [
"src/mykrobe/cmds/amr.py"
] | [
"from __future__ import print_function\n\nimport logging\nimport tempfile\n\nlogger = logging.getLogger(__name__)\n\nimport json\n\nimport numpy as np\nimport random\nimport sys\nimport time\nfrom mykrobe.mformat import json_to_csv\nfrom mykrobe.typing import CoverageParser\nfrom mykrobe.typing import Genotyper\nfr... | [
[
"numpy.random.binomial",
"numpy.random.poisson",
"numpy.log10"
]
] |
Jingyuying/pc_compress | [
"0db6f7df53f6294585d84921b5102dc6ffdeb9fe"
] | [
"src/compression_model_256.py"
] | [
"# coding=utf-8\r\nimport tensorflow.compat.v1 as tf\r\nimport tensorflow_compression as tfc\r\nimport os\r\nimport sys\r\nimport math\r\nimport numpy as np\r\n# tf.enable_eager_execution()\r\nfrom collections import namedtuple\r\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\r\nROOT_DIR = os.path.dirname(B... | [
[
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.sqrt",
"tensorflow.compat.v1.group",
"tensorflow.compat.v1.summary.merge_all",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.maximum",
"tensorflow.compat.v1.variable_scope",
... |
pbizopoulos/signal2image-modules-in-deep-neural-networks-for-eeg-classification | [
"804cb3702d8d054ea7b5ecd299dc22794ddeb241"
] | [
"main.py"
] | [
"import collections\nimport os\nfrom shutil import rmtree\n\nimport numpy as np\nimport onnx\nimport pandas as pd\nimport requests\nimport torch\nfrom matplotlib import pyplot as plt\nfrom onnx_tf.backend import prepare\nfrom PIL import Image\nfrom scipy.signal import spectrogram\nfrom tensorflowjs.converters impor... | [
[
"torch.nn.functional.max_pool1d",
"torch.zeros",
"torch.load",
"torch.cat",
"numpy.around",
"torch.utils.data.DataLoader",
"pandas.DataFrame",
"torch.nn.functional.adaptive_avg_pool1d",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.cuda.is_available",
"... |
youjibiying/-GTOT-Tuning | [
"5d3c346bda1ad5fe1d88723a4919ebcc437667ed"
] | [
"chem/splitters.py"
] | [
"import torch\nimport random\nimport numpy as np\nfrom itertools import compress\nfrom rdkit.Chem.Scaffolds import MurckoScaffold\nfrom collections import defaultdict\nfrom sklearn.model_selection import StratifiedKFold\n\n\n# splitter function\n\ndef generate_scaffold(smiles, include_chirality=False):\n \"\"\"\... | [
[
"pandas.read_csv",
"sklearn.model_selection.StratifiedKFold",
"torch.tensor",
"numpy.testing.assert_almost_equal",
"numpy.random.RandomState",
"numpy.where"
]
] |
kornia/limbus | [
"4ff4f60dc9627199175592dc826b1f54e8a7eab3"
] | [
"tests/core/test_component.py"
] | [
"from numpy import isin\nimport pytest\nimport typing\n\nimport limbus.core.component\nfrom limbus.core import Params, Component, Pipeline, NoValue\nfrom limbus.core.component import Container, Param, IterableContainer, IterableInputContainers, IterableParam\nimport torch\n\n\nclass TestContainer:\n def test_smo... | [
[
"torch.tensor"
]
] |
AlexShypula/preTrainingJoeynmt | [
"bf426c79a8625f259e1a44b04ca8e255ac880b3c"
] | [
"joeynmt/decoders.py"
] | [
"# coding: utf-8\n\n\"\"\"\nVarious decoders\n\"\"\"\nfrom typing import Optional\n\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\nfrom joeynmt.attention import BahdanauAttention, LuongAttention\nfrom joeynmt.encoders import Encoder\nfrom joeynmt.helpers import freeze_params, ConfigurationError, su... | [
[
"torch.Size",
"torch.nn.Dropout",
"torch.cat",
"torch.zeros",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.no_grad"
]
] |
tracholar/economics-data | [
"bdb85d6baa663f7df0cf1193177f02a80aec407f"
] | [
"fund/analysis/plot_acc_net_value.py"
] | [
"# coding:utf-8\n# 绘制基金净值图\nfrom __future__ import print_function\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom fund.fund_info import get_fund_acc_net_value_by_time\nfrom os.path import dirname\n\n__ROOT__ = dirname(__file__)\n\ndf = get_fund_acc_net_value_by_time()\ndt = df.index >= '2017-01-01'\ndf ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.gcf"
]
] |
grow-yhq/PyTorch-Encoding | [
"06cb3098f67a6daa2d7a3b772d9f799a506cc5ff"
] | [
"encoding/nn/customize.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Hang Zhang\n## ECE Department, Rutgers University\n## Email: zhang.hang@rutgers.edu\n## Copyright (c) 2017\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root directory... | [
[
"torch.nn.functional.normalize",
"torch.Size",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.ReLU"
]
] |
EchooooAi/gsrl | [
"1cfc73fe052c09fe05df09c92c5232e7341e9ad0"
] | [
"utils/utils.py"
] | [
"import torch\nfrom matplotlib import pyplot as plt\nimport os\nfrom sklearn.metrics import pairwise_distances, pairwise_distances_argmin\n# from sklearn.utils.linear_assignment_ import linear_assignment\nfrom scipy.optimize import linear_sum_assignment\nimport numpy as np\nimport networkx as nx\n\nimport warnings ... | [
[
"sklearn.metrics.pairwise_distances",
"matplotlib.pyplot.scatter",
"numpy.power",
"numpy.asarray",
"torch.sum",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.close",
"numpy.transpose",
"numpy.exp",
"numpy.zeros",
"matplotlib.pyplot.fi... |
jonathanfrawley/PyAutoFit | [
"818384a6eb3926b18247e16efcf0db6008193bd4"
] | [
"autofit/mock/mock.py"
] | [
"import numpy as np\r\n\r\nimport autofit as af\r\nfrom autoconf import conf\r\nfrom autofit.non_linear.samples import Sample\r\n\r\n\r\nclass MockAnalysis(af.Analysis):\r\n prior_count = 2\r\n\r\n def __init__(self):\r\n super().__init__()\r\n self.fit_instances = list()\r\n\r\n def log_like... | [
[
"numpy.subtract",
"numpy.sqrt",
"numpy.divide"
]
] |
tisaac/GME | [
"097bbf06b547c1428a2e25b0364ef6dae35d9642"
] | [
"gme/estimate/combine_sector_results.py"
] | [
"__Author__ = \"Peter Herman\"\n__Project__ = \"gme.estimate\"\n__Created__ = \"04-30-2018\"\n\nimport pandas as pd\nfrom typing import Dict\ndef combine_sector_results(result_dict:dict = None,\n write_path:str = None,\n significance_stars: bool = False,\n ... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
Iwan-Zotow/runEGS | [
"d95952d48c01866ee44ff40814c49e0fbd2489ad"
] | [
"XcMath/linint.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport logging\n\nclass linint(object):\n \"\"\"\n Given the curve, produce linearly interpolated values\n \"\"\"\n \n def __init__( self, points ):\n \"\"\"\n Construct interpolator from the curve\n \n Parameters\n --... | [
[
"numpy.float32"
]
] |
ABonnefoy/solopython | [
"ec49e924c977f9a91697e9d5c21da73c55a55fb1"
] | [
"main_solo8.py"
] | [
"# coding: utf8\nimport numpy as np\nimport argparse\nimport math\nfrom time import clock, sleep\nfrom utils.viewerClient import viewerClient\nfrom solo8 import Solo8\n\ndef example_script(name_interface):\n viewer = viewerClient()\n device = Solo8(name_interface,dt=0.001)\n nb_motors = device.nb_motors\n\... | [
[
"numpy.array"
]
] |
shashikg/model-tools | [
"f4cf9b39830270ca671ead368e07b33d59f77a11"
] | [
"tests/brain_transformation/test_search.py"
] | [
"import functools\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom pytest import approx\n\nfrom model_tools.brain_transformation import ModelCommitment\nfrom model_tools.activations import PytorchWrapper\nimport brainscore\nimport brainio_collection\nfrom brainscore.model_interface import ... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
devitocodes/Devitoboundary | [
"6e4b0b02848b06336a13c6e20a6acd36df006150"
] | [
"examples/seismic_topography_example.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom devito import Grid, TimeFunction, Eq, solve, Operator, ConditionalDimension\nfrom devitoboundary import ImmersedBoundary, BoundaryConditions\nfrom examples.seismic import TimeAxis, RickerSource\n\n# Parameters\nqc = False\ntoggle_normals = False\n\nC = 0.1 # Courant... | [
[
"numpy.save",
"pandas.DataFrame"
]
] |
floscha/prophet | [
"ad095ac690e153ddcbac99af8561100894e5095d"
] | [
"python/fbprophet/plot.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nfrom __futur... | [
[
"pandas.to_datetime",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"pandas.Timedelta",
"numpy.timedelta64",
"numpy.nanmean",
"pandas.date_range",
"matplotlib.dates.num2date",
"matplotlib.pyplot.figure"
]
] |
sidsvash26/fairseq | [
"566341e3aae9271facf6b9181b3f51b5120a2774"
] | [
"fairseq/models/roberta/model.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\"\"\"\nRoBERTa: A Robustly Optimized BERT Pretraining Approach.\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.funct... | [
[
"torch.nn.Dropout",
"torch.zeros",
"torch.nn.ModuleDict",
"torch.nn.Linear",
"torch.nn.functional.linear"
]
] |
Zikoat/musweeper | [
"07e3e5e5e5e4edad4d8b1b6bb05aee2f33f8d9cb"
] | [
"musweeper/musweeper/muzero/model/selfplay.py"
] | [
"from ..utils.game_history import game_event_history\nimport torch\nimport numpy as np\nfrom ..model.components import transform_input\nfrom ..tree.temperture import *\n\ndef play_game(model, env, self_play=False, custom_end_function=None, custom_reward_function=None, custom_state_function=None, extra_loss_tracker=... | [
[
"torch.tensor"
]
] |
RACT-CF/RaCT | [
"ced06c9e3398184c82aa42d5eb0cd5679c905375"
] | [
"utils/warp_utils.py"
] | [
"\"\"\"\nCreates a function to be used in tf.py_func, which produces a faithful\nrepresentation of the WARP loss (with margin set to 0) that runs in\nalmost linear time (aside from a sorting operation).\n\"\"\"\n\nimport numpy as np\n\nfrom time import time\nimport random\n\nclass timing_decorator:\n def __init_... | [
[
"numpy.cumsum",
"numpy.zeros_like",
"numpy.argsort",
"numpy.flip",
"numpy.zeros"
]
] |
ttktk/tensorflow | [
"43bd3c52ad6f5e68382218cf72a0aaa7edbee0a3"
] | [
"tensorflow/python/compat/compat.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.python.platform.tf_logging.warning",
"tensorflow.python.util.tf_export.tf_export"
]
] |
Nuevalgo/Feedbot | [
"96bdd150fcd92fa155dfc7b13d930bab394e8e47"
] | [
"site-packages/matplotlib-1.3.1/doc/sphinxext/gen_gallery.py"
] | [
"# -*- coding: UTF-8 -*-\nimport os\nimport re\nimport glob\nimport warnings\n\nimport sphinx.errors\n\nimport matplotlib.image as image\n\n\nexclude_example_sections = ['units']\nmultiimage = re.compile('(.*?)(_\\d\\d){1,2}')\n\n# generate a thumbnail gallery of examples\ngallery_template = \"\"\"\\\n{{% extends \... | [
[
"matplotlib.image.thumbnail"
]
] |
Complicateddd/CascadeRCNN | [
"019010e80411325dbde62f4d649e5a2ead8eabac"
] | [
"train_fpn.py"
] | [
"# --------------------------------------------------------\n# Pytorch FPN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jianwei Yang, based on code from faster R-CNN\n# --------------------------------------------------------\n# python train_fpn.py --dataset pascal_voc --net res101 --bs... | [
[
"torch.optim.Adam",
"torch.LongTensor",
"numpy.random.seed",
"torch.load",
"torch.cat",
"torch.randperm",
"torch.utils.data.DataLoader",
"torch.arange",
"torch.FloatTensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.optim.SGD",
"torch.nn.DataParallel",
... |
Sniper91/flink | [
"2b6dc382e495eb7ed883b1a631d73cff31e8db9d"
] | [
"flink-python/pyflink/table/tests/test_row_based_operation.py"
] | [
"################################################################################\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF lice... | [
[
"pandas.concat"
]
] |
uranc/arbitrary_style_transfer | [
"ca3ba7aa023ee06d29968c2237942c0c6c1acafb"
] | [
"infer.py"
] | [
"# Use a trained Image Transform Net to generate\n# a style transferred image with a specific style\n\nimport tensorflow as tf\n\nfrom style_transfer_net import StyleTransferNet\nfrom utils import get_images, save_images\nfrom datetime import datetime\n# import pdb\n\ndef stylize(contents_path, styles_path, output_... | [
[
"tensorflow.Graph",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.train.Saver"
]
] |
tommy19970714/fairseq | [
"ebf43d849f442f13e4c74f4f59d057363ed4d831"
] | [
"fairseq/trainer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nTrain a network across multiple GPUs.\n\"\"\"\n\nimport contextlib\nimport logging\nimport sys\nimport time\nfrom argparse i... | [
[
"torch.autograd.profiler.record_function",
"torch.abs",
"torch.cuda.get_device_capability",
"torch.cuda.memory_summary",
"torch.distributed.is_initialized",
"torch.cuda.DoubleTensor",
"torch.is_tensor",
"torch.cuda.empty_cache",
"torch.tensor",
"torch.zeros_like",
"torc... |
falkishi/Python-HWs | [
"04504c21a7fc5dc4b9fe7820549d9cdf98c7aa91"
] | [
"homework-3-su21-falkishi-main/testbin.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom problem1 import *\n\ndata = np.loadtxt('input.txt')\nlo = min(data)\nhi = max(data)\n\nprint('Uncomment the first segment to verify the histogram you have generated')\n\nhisto = plt.hist(data, 10, (lo, hi))[0]\nprint(histo)\n\n\n\nprint('Uncomment the secon... | [
[
"matplotlib.pyplot.hist",
"numpy.loadtxt"
]
] |
john-hawkins/textplainer | [
"89ab0ac21e4db0fd53184fb431dc730b7940de62"
] | [
"experiments/Pipeline_Simple_WordLabel_Count_LogisticReg.py"
] | [
"import pandas as pd\nimport numpy as np\nimport math\n\n##############################################################################################\n# Pipeline_Simple_WordLabel_Count_LogisticReg \n#\n# A Simple ML Pipeline for classifying text data.\n#\n# The fit function will train a model by applying the foll... | [
[
"numpy.dot",
"numpy.log",
"numpy.asarray",
"numpy.squeeze",
"numpy.vectorize",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
adrn/TwoBody | [
"3af41d642e3485aec9ddc18e582e73c561c4df96"
] | [
"twobody/tests/test_reference_plane.py"
] | [
"# Third-party\nimport astropy.units as u\nimport astropy.coordinates as coord\nfrom astropy.tests.helper import quantity_allclose\nimport numpy as np\nimport pytest\n\n# Project\nfrom ..reference_plane import ReferencePlaneFrame\n\n\ndef test_sanity():\n\n rep1 = coord.CartesianRepresentation(x=[0, 1.],\n ... | [
[
"numpy.random.RandomState"
]
] |
Zhong-J/azureml-examples | [
"5b9bbc5eb2a37d39d8f46ea9d88b320d298473d9"
] | [
"cli/jobs/pipelines/cifar-10/src/train-model/main.py"
] | [
"# Copyright (c) 2017 Facebook, Inc. All rights reserved.\n# BSD 3-Clause License\n#\n# Script adapted from: https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#sphx-glr-beginner-blitz-cifar10-tutorial-py\n# ==============================================================================\n\n# imports\n... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.Dropout",
"torch.utils.data.distributed.DistributedSampler",
"torch.nn.Conv2d",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.cuda.is_available",
"torch.device",
"torch.nn.parallel.DistributedDataParall... |
PesceJonathan/BlockShame | [
"bea3d3cfc91a0842a7f871ce2e6e5d417fea08cd"
] | [
"VirtualWebcam/VirtualWebcam.py"
] | [
"from threading import Thread\nfrom datetime import datetime\nimport csv\nimport cv2 as cv\nimport pyvirtualcam\nimport numpy as np\nimport win32api\nimport pathlib\nimport math\nfrom threading import Thread\nfrom queue import Queue, Empty\nfrom SpeechToText import main\nimport textwrap\n\n# Constants\nIMG_W = 640\... | [
[
"numpy.zeros"
]
] |
dragomirradev/ctc-gen-eval | [
"d26c24734626298ba2ed9062e2789594edfae347"
] | [
"ctc_score/scorer.py"
] | [
"import os\n\nfrom ctc_score.download import maybe_download\nfrom ctc_score.configs import ALIGNS, E_MODEL_CONFIGS, DR_MODEL_LINKS\n\nfrom ctc_score.models.discriminative_aligner import DiscriminativeAligner\nfrom ctc_score.models.bert_aligner import BERTAligner\nfrom ctc_score.models.bleurt_aligner_pt import BLEUR... | [
[
"torch.load"
]
] |
TomaszZamacinski/causalml | [
"10c766e6b12530bec39c9f85ffe87f14de738b12"
] | [
"causalml/metrics/classification.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport logging\nfrom sklearn.metrics import log_loss, roc_auc_score\n\nfrom .const import EPS\nfrom .regression import regression_metrics\n\n\nlogger = logging.getLogger('causalml')\n\n\ndef logloss(y, p... | [
[
"sklearn.metrics.log_loss"
]
] |
DavidGillsjo/bssc-net | [
"e1ffa643a2c8e3df34225f0756bad0dec9f801a2"
] | [
"ssc/data/suncg_mapping.py"
] | [
"import ssc.data.suncg as suncg\nimport yaml\nimport numpy as np\nfrom collections import OrderedDict\nimport os.path as osp\nfrom multiprocessing.managers import BaseManager\n\ndef setup_yaml():\n \"\"\" https://stackoverflow.com/a/8661021 \"\"\"\n represent_dict_order = lambda self, data: self.represent_mappin... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.flatnonzero"
]
] |
ishandutta2007/qiskit-sdk-py | [
"69ae9c3cb276e5aa097a5cc4ee4eabe31c4f04ca"
] | [
"qiskit/tools/visualization.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2017 IBM RESEARCH. 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\... | [
[
"numpy.matrix",
"numpy.amax",
"numpy.imag",
"numpy.sqrt",
"numpy.linspace",
"numpy.kron",
"matplotlib.pyplot.plot",
"matplotlib.patches.FancyArrowPatch.__init__",
"numpy.exp",
"numpy.trace",
"numpy.ones_like",
"numpy.arange",
"numpy.sin",
"scipy.linalg.eigh"... |
swipswaps/OpenBBTerminal | [
"9d33f638f10fdbc77ae461b1838462571faee138"
] | [
"bots/stocks/options/oi.py"
] | [
"import logging\n\nimport pandas as pd\nimport plotly.graph_objects as go\n\nfrom bots import imps\nfrom openbb_terminal.decorators import log_start_end\nfrom openbb_terminal.stocks.options import op_helpers, yfinance_model\n\nlogger = logging.getLogger(__name__)\n\n\n@log_start_end(log=logger)\ndef oi_command(\n ... | [
[
"pandas.merge"
]
] |
KWB-R/maxflow | [
"10230586838a794cfdbd639a359fc7cd40dfa96d"
] | [
"wellfield.py"
] | [
"import numpy as np\r\nimport os\r\nimport flopy\r\nimport pandas as pd\r\nimport flopy.utils.binaryfile as bf\r\nfrom create_model import *\r\nfrom analyse_model import *\r\nfrom get_layerBudget import *\r\n\r\n# 0) Creating MNW file with R (still open to be integrated!)\r\n\r\nLy = 5400.\r\nLx = 5000. \r\n\r\nupl... | [
[
"numpy.array",
"numpy.int_"
]
] |
duarteocarmo/CervicalCancer | [
"10b787d007ec6890c9c8c671287f9966f5146ae8"
] | [
"Characteristics/Normally_dist_fixed.py"
] | [
"from matplotlib.pyplot import (figure, hold, subplots, plot, xlabel, ylabel,\n xticks, yticks,legend, show, title, hist, savefig, close, setp, tight_layout, locator_params)\nimport numpy as np\n# requires data from exercise 4.1.1\nfrom Project_Clean_data import raw\nfrom Project_Clean... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"scipy.stats.norm.pdf"
]
] |
lemmonation/fcl-nat | [
"47069ca45bdf309f96ea3c60b52aa56e3fea8471"
] | [
"tensor2tensor/data_generators/problem.py"
] | [
"# coding=utf-8\n# Copyright 2017 The Tensor2Tensor 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 requir... | [
[
"tensorflow.concat",
"tensorflow.contrib.slim.tfexample_decoder.TFExampleDecoder",
"tensorflow.contrib.data.TFRecordDataset",
"tensorflow.logging.info",
"tensorflow.contrib.slim.parallel_reader.get_data_files",
"tensorflow.contrib.slim.tfexample_decoder.Tensor",
"tensorflow.VarLenFeatu... |
leonidas228/neurolib | [
"a7aa6f487db73c3b64471007ac5a965da4a65f9a"
] | [
"tests/test_evolutionUtils.py"
] | [
"import logging\nimport time\nimport sys\nimport unittest\nimport pytest\n\nimport random\nimport numpy as np\n\nfrom neurolib.utils.parameterSpace import ParameterSpace\nfrom neurolib.optimize.evolution import Evolution\n\nimport neurolib.optimize.evolution.evolutionaryUtils as eu\nimport neurolib.optimize.evoluti... | [
[
"numpy.nansum",
"numpy.random.random"
]
] |
gxz98/ARFlow | [
"a554d2367baf915e31321c124e9a41a046b8fcf6"
] | [
"trainer/kitti_trainer_ar.py"
] | [
"import time\nimport torch\nimport numpy as np\nfrom copy import deepcopy\nfrom .base_trainer import BaseTrainer\nfrom utils.flow_utils import load_flow, evaluate_flow\nfrom utils.misc_utils import AverageMeter\nfrom transforms.ar_transforms.sp_transfroms import RandomAffineFlow\nfrom transforms.ar_transforms.oc_tr... | [
[
"torch.cat",
"torch.zeros_like",
"numpy.concatenate",
"torch.no_grad",
"torch.nn.DataParallel",
"torch.ones_like"
]
] |
Tarang74/manim | [
"df34d6fc0470916cfba63534b023addb69cdec9a"
] | [
"from_3b1b/old/hilbert/section2.py"
] | [
"from manimlib.imports import *\nimport displayer as disp\nfrom hilbert.curves import \\\n TransformOverIncreasingOrders, FlowSnake, HilbertCurve, \\\n SnakeCurve, PeanoCurve\nfrom hilbert.section1 import get_mathy_and_bubble\nfrom scipy.spatial.distance import cdist\n\n\ndef get_time_line():\n length = 2.... | [
[
"scipy.spatial.distance.cdist"
]
] |
aptsunny/pycls | [
"a3caff1519891e5cf3a4032dd4b68b7330f8b321"
] | [
"pycls/utils/checkpoint.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"Functions that handle saving and loading of checkpoints.\"\"\"\n\nimport os\n\nimport pycls.utils.di... | [
[
"torch.load",
"torch.save"
]
] |
qingyuanchen1997/Dual-Model-Integration | [
"86b1166a1ccd3f7caf085e2737a4091b4d85de69"
] | [
"code/main_sunspot2_x.py"
] | [
"from PIL import Image\nfrom torchvision import models\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport numpy as np\nimport torch.nn.functional as F\nimport torchvision.transforms as transforms\nimport torch.utils.data as data\nimport os\n\n# set up gpu\nos.environ['CUDA_VISIBLE_DEVICES'] =... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.LogSoftmax",
"torch.nn.NLLLoss",
"torch.max",
"torch.Tensor",
"torch.utils.data.DataLoader",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.Linear",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
hdl730/Limbo | [
"ab60172ee35e3d4377d87869dacadd143ce449c9"
] | [
"model/vgg.py"
] | [
"# coding:utf-8\n\nimport tensorflow as tf\nimport scipy.io as sio\nimport numpy as np\nimport PIL.Image as Image\nimport scipy\nfrom model.swap import swap_batch\nfrom config import VGG_PATH\nimport os\nimport sys\n\ndata_path = VGG_PATH\nif not os.path.exists(data_path):\n print('Error: VGG-19 is not loaded be... | [
[
"tensorflow.clip_by_value",
"tensorflow.nn.relu",
"numpy.expand_dims",
"tensorflow.constant",
"numpy.clip",
"tensorflow.nn.max_pool",
"tensorflow.image.resize_images",
"tensorflow.cast",
"scipy.io.loadmat",
"tensorflow.expand_dims",
"numpy.cast",
"tensorflow.nn.avg_... |
muneebaadil/sisr-irl | [
"29ccf9ad970ade22fc8e158b83f952504db71a7b"
] | [
"code/loss/charbonnier.py"
] | [
"import torch \nimport torch.nn as nn\n\nclass Charbonnier(nn.Module):\n \"\"\"L1 Charbonnierloss.\"\"\"\n def __init__(self):\n super(Charbonnier, self).__init__()\n self.eps = 1e-6\n\n def forward(self, X, Y):\n diff = torch.add(X, -Y)\n error = torch.sqrt( diff * diff + self.... | [
[
"torch.sqrt",
"torch.mean",
"torch.add"
]
] |
dienthaipham103/Zalo_Challenge_2021 | [
"9a6159c6692bac5c2f090a91f691e798c52da2b5"
] | [
"lib/SSH_pytorch/model/utils/test_utils.py"
] | [
"# --------------------------------------------------------------------------------------------------\n# SSH: Single Stage Headless Face Detector\n# Utilities used in SSH test modules\n# Written by Mahyar Najibi\n# --------------------------------------------------------------------------------------------------\ni... | [
[
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.tight_layout",
"numpy.min",
"matplotlib.use",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.draw",
"numpy.round",
"numpy.max",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotl... |
lpereira95/geomstats | [
"c63a4cf28e6c09f6a6b9926e8a712838362017ba"
] | [
"geomstats/_backend/pytorch/autodiff.py"
] | [
"\"\"\"Automatic differentiation in PyTorch.\"\"\"\n\nimport numpy as _np\nimport torch as _torch\nfrom torch.autograd.functional import jacobian as _torch_jac\n\n\ndef detach(x):\n \"\"\"Return a new tensor detached from the current graph.\n\n Parameters\n ----------\n x : array-like\n Tensor to... | [
[
"torch.autograd.functional.jacobian",
"torch.from_numpy",
"numpy.array",
"torch.autograd.grad",
"torch.ones_like"
]
] |
krutarthjoshi18/CNN-for-Twitter-Sentiment-Analysis | [
"5c404aabb21dec4bb1b7c4fcb77cf4bc3f4d7661"
] | [
"eval.py"
] | [
"#! /usr/bin/env python\n\nimport csv\nimport os\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib import learn\n\nimport data_helpers\n\n# Parameters\n# ==================================================\n\n# Data Parameters\ntf.flags.DEFINE_string(\"positive_data_file\", \"./data/rt-polarity... | [
[
"tensorflow.flags.DEFINE_boolean",
"tensorflow.Graph",
"tensorflow.train.latest_checkpoint",
"tensorflow.flags.DEFINE_string",
"tensorflow.ConfigProto",
"numpy.concatenate",
"numpy.argmax",
"tensorflow.Session",
"numpy.array",
"tensorflow.contrib.learn.preprocessing.Vocabul... |
bubbliiiing/classification-pytorch | [
"1937599ae6e688ed7af7470f69964fb6f97241c4"
] | [
"utils/utils_fit.py"
] | [
"import torch\r\nimport torch.nn.functional as F\r\nfrom torch import nn\r\nfrom tqdm import tqdm\r\n\r\nfrom .utils import get_lr\r\n\r\n\r\ndef fit_one_epoch(model_train, model, loss_history, optimizer, epoch, epoch_step, epoch_step_val, gen, gen_val, Epoch, cuda):\r\n total_loss = 0\r\n total_accuracy... | [
[
"torch.nn.CrossEntropyLoss",
"torch.no_grad",
"torch.from_numpy",
"torch.nn.functional.softmax"
]
] |
bracca95/Probabilistic-Face-Embeddings | [
"23191e9b068dbf495a37daa071a1383f12f2799b"
] | [
"utils/utils.py"
] | [
"\"\"\"Utilities for training and testing\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2019 Yichun Shi\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, includi... | [
[
"numpy.square",
"numpy.log",
"numpy.min",
"numpy.linalg.norm",
"numpy.concatenate",
"numpy.array",
"numpy.sum"
]
] |
Digital-Twin-Operational-Platform/Cristallo | [
"20e21f6ae0f0f99002a229c8c966fd72020698c3",
"20e21f6ae0f0f99002a229c8c966fd72020698c3"
] | [
"dtApp/dtCode/unquant.py",
"dtLib/crossval/example.py"
] | [
"'''\n\n`dtApp/dtCode/unquant.py`\n\n\n:Author: \n Marco De Angelis\n\n:Organisation: \n University of Liverpool\n\n:Copyright: \n BSD Licence\n\nThis single python file ``unquant.py`` is the backend code for the uncertainty page.\n\nA single function ``unquant()`` wrangles all the data requests from the h... | [
[
"numpy.log10"
],
[
"numpy.array",
"pandas.read_csv"
]
] |
nephilim2016/AutoEncoder-for-GPR-Denoise | [
"b55be16bd0b6af785efcf072d68dd5523a72f964"
] | [
"DisplayForward.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 22 20:29:07 2020\n\n@author: nephilim\n\"\"\"\n\nimport numpy as np\nimport skimage.transform\nimport T_PowerGain\nimport DataNormalized\nfrom matplotlib import pyplot,cm\n\n\n# Read Target Profile\nProfileTarget=np.load('./GPR_Modelling/P... | [
[
"numpy.load",
"numpy.max",
"numpy.arange",
"numpy.min"
]
] |
canerturkmen/tensorseason | [
"d0b5331867705b388209e5f47122780a2b784bd1"
] | [
"src/tensorseason/experiment.py"
] | [
"import json\nfrom pathlib import Path\nfrom random import sample\nfrom typing import List, Dict, Type, Tuple, Callable\nfrom uuid import uuid4\n\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom .forecaster import (\n CPForecaster,\n DCTForecaster,\n DFTForecaster,\n FourierBasisR... | [
[
"pandas.concat",
"pandas.Timestamp",
"pandas.Series",
"numpy.prod"
]
] |
silviaclaire/image-classifier-for-flowers | [
"040a1d6425bde6f7f375890b1023f4d5be60843a"
] | [
"predict.py"
] | [
"import os\r\nimport glob\r\nimport json\r\nimport torch\r\nimport random\r\nimport argparse\r\nimport numpy as np\r\nfrom PIL import Image\r\n\r\nfrom model import create_model\r\nfrom utils import line, Params\r\n\r\n\r\nparser = argparse.ArgumentParser(description='Predict flower name from an image.')\r\n\r\npar... | [
[
"torch.load",
"torch.from_numpy",
"torch.exp",
"torch.device",
"numpy.array"
]
] |
nomad-coe/nomad-parser-quantum-espresso | [
"25362db6dc24fc106596fedc043c6ad564bc160f"
] | [
"quantumespressoparser/metainfo/quantum_espresso.py"
] | [
"#\n# Copyright The NOMAD Authors.\n#\n# This file is part of NOMAD.\n# See https://nomad-lab.eu for further info.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://w... | [
[
"numpy.dtype"
]
] |
ThornSun/optimizationLab | [
"5ce49933b23c9f3674bccbc16f12f0955a17de5e"
] | [
"algorithms/GA.py"
] | [
"import numpy\n\n\ndef ga(maxiteration, population, dimension, objf, lb, ub):\n crossRate = 0.8\n mutationRate = 0.1\n x = numpy.random.randint(2, size=(population,dimension))\n"
] | [
[
"numpy.random.randint"
]
] |
LilDataScientist/PyTorch-From-Scratch | [
"ae3c0bffc5a36a9a7c123b98f52bdaa32fbedef6",
"ae3c0bffc5a36a9a7c123b98f52bdaa32fbedef6"
] | [
"torch/metrics/accuracy_score.py",
"torch/nn/ReLU.py"
] | [
"import numpy as np\n\n\ndef accuracy_score(y_true, y_pred):\n a = np.argmax(y_true, axis=1)\n b = np.argmax(y_pred, axis=1)\n return np.count_nonzero(a == b) / y_true.shape[0]\n",
"import numpy as np\n\nfrom torch.nn import Module\n\n\nclass ReLU(Module):\n def __init__(self):\n super().__init... | [
[
"numpy.argmax",
"numpy.count_nonzero"
],
[
"numpy.array",
"numpy.maximum",
"numpy.multiply"
]
] |
chenying-wang/Fast-HEVC-Intra-Encoder | [
"ffa48c2d4f27882ac1411f415ec93d14fc9a2bde"
] | [
"src/cnn/bp.py"
] | [
"import tensorflow as tf\n\nimport util\n\n_fc_with_dropout = util.fc_with_dropout\n\ndef bp(features, features_size, keep_prob = 1.0):\n\thidden1 = _fc_with_dropout(\n\t\tinput = features,\n\t\tinput_size = features_size,\n\t\toutput_size = 32,\n\t\tkeep_prob = keep_prob,\n\t\tname = \"hidden1\"\n\t)\n\thidden2 = ... | [
[
"tensorflow.app.run"
]
] |
turingbirds/howland_vccs | [
"b4d69476f151a05d830396e152d06a93b6bc0e3f"
] | [
"data/spectrum_measurements/wave_generator.py"
] | [
"#!/usr/bin/python \n\nimport wave\nimport struct\nimport numpy as np\nimport scipy\nimport scipy.signal\nimport scipy.io.wavfile\n\n\nfreq = 100. # [Hz]\nvolume = 1.\nduration = 10 * 60. # [s]\nsample_rate = 48000 # [Hz]\n\nprint(\"Generating...\")\ntimevec = np.arange(0., duration, 1/sample_rate)\nn_samples = l... | [
[
"numpy.arange",
"scipy.io.wavfile.write",
"numpy.empty",
"numpy.sin"
]
] |
sytelus/darts | [
"243b9dff94efaaa07891f9e449b1d0a8f28705cd"
] | [
"cnn/model_search.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom operations import OPS, FactorizedReduce, ReLUConvBN\nfrom genotypes import PRIMITIVES, Genotype\n\n\nclass MixedLayer(nn.Module):\n \"\"\"\n a mixtures output of 8 type of units. Each MixedLayer is one op (i.e. edge).\n T... | [
[
"torch.nn.functional.softmax",
"torch.cat",
"torch.randn",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.no_grad",
"torch.nn.BatchNorm2d"
]
] |
choupi/NDHUDLWorkshop | [
"63525f8dffacd3487c10ddb0d5dc389585833045"
] | [
"mnist/xgboost/predict_xg.py"
] | [
"'''Trains a simple convnet on the MNIST dataset.\n\nGets to 99.25% test accuracy after 12 epochs\n(there is still a lot of margin for parameter tuning).\n16 seconds per epoch on a GRID K520 GPU.\n'''\n\nfrom __future__ import print_function\nimport numpy as np\nnp.random.seed(1337) # for reproducibility\n\nfrom k... | [
[
"numpy.argmax",
"numpy.random.seed"
]
] |
waybarrios/Flow-Guided-Feature-Aggregation | [
"beb7f66798f1f7b08d4f8dd54d4a463f9fd049a5"
] | [
"lib/nms/setup_windows.py"
] | [
"# --------------------------------------------------------\n# Flow-Guided Feature Aggregation\n# Copyright (c) 2017 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Modified by Yuwen Xiong\n# --------------------------------------------------------\n# Based on:\n# py-faster-rcnn\n# Copyrigh... | [
[
"numpy.get_numpy_include",
"numpy.get_include"
]
] |
ka40/AE4350-assignment | [
"06e701cfffded6f7e9c34a64616df17c0cbed241"
] | [
"environments/vectorized_environment.py"
] | [
"from environments.worker import Worker\nimport multiprocessing as mp\nimport numpy as np\nimport random\n\nclass VectorizedEnvironment(object):\n \"\"\"\n Creates multiple instances of an environment to run in parallel.\n Each of them contains a separate worker (actor) all of them following\n the same ... | [
[
"numpy.zeros",
"numpy.zeros_like"
]
] |
linjieccc/PaddleHub | [
"27ef1d9286bf1682c0906c796260b9e91514b021"
] | [
"modules/image/object_detection/yolov3_darknet53_vehicles/module.py"
] | [
"# coding=utf-8\nfrom __future__ import absolute_import\n\nimport ast\nimport argparse\nimport os\nfrom functools import partial\n\nimport numpy as np\nimport paddle.fluid as fluid\nimport paddlehub as hub\nfrom paddle.fluid.core import PaddleTensor, AnalysisConfig, create_paddle_predictor\nfrom paddlehub.module.mo... | [
[
"numpy.array"
]
] |
xaviergonzalez/geotorch | [
"ba4ebe7c86d6678f903525606843f6341d1b7060"
] | [
"test/test_positive_semidefinite.py"
] | [
"from unittest import TestCase\nimport itertools\n\nimport torch\nimport torch.nn as nn\n\nimport geotorch.parametrize as P\n\nfrom geotorch.pssdlowrank import PSSDLowRank\nfrom geotorch.pssdfixedrank import PSSDFixedRank\nfrom geotorch.pssd import PSSD\nfrom geotorch.psd import PSD\n\n\nclass TestPSSDLowRank(TestC... | [
[
"torch.norm",
"torch.zeros",
"torch.random.manual_seed",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.symeig",
"torch.rand",
"torch.cuda.device_count"
]
] |
ecreager/beta-tcvae | [
"692d336927c0bf393e3b89e9e58ea299d93c660e"
] | [
"plot_latent_vs_true.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport torch\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nimport brewer2mpl\nbmap = brewer2mpl.get_map('Set1', 'qualitative', 3)\ncolors = bmap.mpl_colors\n\nplt.styl... | [
[
"torch.max",
"torch.Tensor",
"torch.cuda.set_device",
"torch.load",
"matplotlib.use",
"torch.min",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"torch.arange",
"matplotlib.pyplot.suptitle",
... |
sammympie/scitools | [
"776c5bbfb0752ef20f242a8d0ecaa66d9141282c"
] | [
"examples/streamline_demo3.py"
] | [
"#!/usr/bin/env python\n\n# Example taken from:\n# http://www.mathworks.fr/access/helpdesk/help/techdoc/ref/streamparticles.html\n\nfrom scitools.easyviz import *\nfrom time import sleep\nfrom scipy import io\n\nwind = io.loadmat('wind_matlab_v6.mat')\nx = wind['x']\ny = wind['y']\nz = wind['z']\nu = wind['u']\nv =... | [
[
"scipy.io.loadmat"
]
] |
williamsnider/objects | [
"c5dfc68947391e5cb8da19eb9a34a70c5d864a8a"
] | [
"objects/backbone.py"
] | [
"from splipy import Curve, BSplineBasis\nfrom objects.parameters import NUM_SAMPLES_FOR_REPARAMETERIZATION, ORDER, NUM_INTERPOLATION_POINTS, EPSILON\nfrom objects.utilities import open_uniform_knot_vector\nimport numpy as np\nfrom copy import deepcopy\n\n\nclass Backbone:\n def __init__(self, controlpoints, repa... | [
[
"numpy.dot",
"numpy.linspace",
"numpy.cumsum",
"numpy.linalg.norm",
"numpy.round",
"numpy.searchsorted",
"numpy.cross",
"numpy.array",
"numpy.zeros",
"numpy.isclose"
]
] |
jhpenas/RodasHackathonCCR | [
"8dc8c2e5dc5f960b1da040347a4b857417564e63"
] | [
"app1/interface.py"
] | [
"from kivy.app import App\nfrom kivy.uix.boxlayout import BoxLayout\nfrom kivy.uix.screenmanager import ScreenManager, Screen\nfrom kivy.core.window import Window\nfrom kivy.uix.label import Label\nfrom kivy.uix.behaviors.button import ButtonBehavior\nfrom kivy.graphics import Color, Ellipse, Rectangle, Triangle\nf... | [
[
"pandas.read_csv"
]
] |
ChristianLin0420/MNE | [
"3655af79d76099ff9cedf80021d549521a80aad7"
] | [
"Preprocessing/ArtifactDetection.py"
] | [
"### Overview of artifact detection ###\n\nimport os\nimport numpy as np\nimport mne\n\nsample_data_folder = mne.datasets.sample.data_path()\nsample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',\n 'sample_audvis_raw.fif')\nraw = mne.io.read_raw_fif(sample_data_... | [
[
"numpy.searchsorted",
"numpy.linspace"
]
] |
VivanVatsa/wave-apps | [
"3bcaa612205cbe9da0691e99e4387d452c6f9e44"
] | [
"explaining-ratings/src/config.py"
] | [
"import pandas as pd\n\n\nclass Configuration:\n \"\"\"\n Configuration file for Explain Ratings\n \"\"\"\n\n def __init__(self):\n self.color = \"#00A8E0\"\n self.image_path = \"static/icon.png\"\n self.title = \"Hotel Reviews\"\n self.subtitle = \"Explains the hotel reviews... | [
[
"pandas.read_csv"
]
] |
APMonitor/arduino | [
"4d9ea70688427e610228036c44560a11246930e1"
] | [
"2_Regression/Higher_order_MIMO/APM_Python/empirical_id.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom apm import *\r\n\r\n######################################################\r\n# Configuration\r\n######################################################\r\n# number of terms\r\nny = 3 # output coefficients\r\nnu = 3 # input coefficients\r\n# number of in... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.loadtxt",
"matplotlib.pyplot.figure"
]
] |
s0lvang/ideal-pancake | [
"f7a55f622b02b03a987d74cfdff1c51288bfb657"
] | [
"classifier/utils.py"
] | [
"import os\nfrom itertools import chain, combinations\nfrom comet_ml import ExistingExperiment, Experiment\nimport joblib\nfrom tensorflow.io import gfile\nfrom classifier import globals\nimport argparse\n\n\ndef upload_to_gcs(local_path, gcs_path):\n \"\"\"Upload local file to Google Cloud Storage.\n\n Args:... | [
[
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.GFile",
"tensorflow.io.gfile.copy"
]
] |
raikonenfnu/iree-samples | [
"4d265d8cddf2ed0124dee4ed67684cbfa9ad8fc5"
] | [
"tflitehub/mobilenet_v1_uint8_test.py"
] | [
"# RUN: %PYTHON %s\n# XFAIL: *\n\nimport absl.testing\nimport numpy\nimport test_util\n\nmodel_path = \"https://storage.googleapis.com/iree-model-artifacts/mobilenet_v1_224_1.0_uint8.tflite\"\n\nclass MobilenetV1Uint8Test(test_util.TFLiteModelTest):\n def __init__(self, *args, **kwargs):\n super(MobilenetV1Uint... | [
[
"numpy.isclose"
]
] |
drublackberry/prove-it | [
"61db9d2e39c7e75e4d715348245c7212fc02964e"
] | [
"financial/Markowitz.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nScript to show the Markowitz bullet working principle with two assets\r\nand different correlation coefficients\r\n\r\nCreated on Wed Oct 14 13:03:05 2015\r\n\r\n@author: Andreu Mora\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nx = [0.5, 0.5]\r\... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.linspace",
"matplotlib.pyplot.title",
"numpy.linalg.inv",
"matplotlib.pyplot.hold",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.text",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show",
"matplotli... |
fpbattaglia/ophys_io | [
"9fdc1507184a6dc815fe29e767bd8f50b2408933"
] | [
"oio/conversion.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Jun 15, 2014 23:40\n@author: <'Ronny Eichler'> ronny.eichler@gmail.com\n\nReads Open Ephys .continuous files and converts them to raw 16-bit .dat files\n\"\"\"\n\nimport os\nimport time\nimport logging\nimport os.path as op\nfrom contextlib import... | [
[
"numpy.zeros_like"
]
] |
derangedhk417/SpectrumPlot | [
"b315edf3db8d22812631614f79bc848ec20c1841"
] | [
"src/SpectrumPlot.py"
] | [
"# Author: Adam Robinson\n# Description: This script is designed to plot one or more vdat files \n# containing Raman or PL spectra. It includes cosmic ray removal, peak\n# detection and various other functionality.\n\nfrom datetime import datetime\nfrom glob import glob\nfrom scipy.integrate ... | [
[
"scipy.signal.find_peaks",
"scipy.ndimage.gaussian_filter",
"numpy.linspace",
"numpy.abs",
"scipy.integrate.trapz",
"matplotlib.pyplot.subplots",
"scipy.interpolate.interp1d",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
GCA-VH-lab/2019-NAR | [
"c355fc5f2ac414ab8c365397c2595ecd07b50020"
] | [
"scripts/hdf_2_bedgraph.py"
] | [
"#!/usr/bin/env python\n#\n# assumes *.h5 conains all positions in index for each chr\n# it is not practical but works for yeast\n#\nimport sys\nimport argparse\nimport pandas as pd\n#import numpy as np\n\nparser = argparse.ArgumentParser(description='Converts Ribo-Seq coverage to bedgraph format.')\nparser.add_arg... | [
[
"pandas.HDFStore",
"pandas.DataFrame"
]
] |
laurinwagner/grouploss_plus | [
"add9e3e7b4fcfccf0393124aeb6e1f35a442ed88"
] | [
"dataset/Inshop.py"
] | [
"\nimport numpy as np, os, sys, pandas as pd, csv, copy\nimport torch\nimport torchvision\nimport PIL.Image\nfrom .base import *\n\n\nclass Inshop_Dataset(torch.utils.data.Dataset):\n def __init__(self, root, mode, transform = None):\n self.root = root\n self.mode = mode\n self.transform = t... | [
[
"numpy.concatenate",
"pandas.read_table"
]
] |
google-research/prompt-tuning | [
"616f486d353fae596466c92d04dc326ed076c109"
] | [
"prompt_tuning/train/train_test.py"
] | [
"# Copyright 2022 Google.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to i... | [
[
"numpy.allclose",
"numpy.testing.assert_allclose"
]
] |
tianyu-su/torchfurnace | [
"2f4a9a0655a8d3c3e231c86611085f834e03c2f8"
] | [
"torchfurnace/utils/torch_summary.py"
] | [
"# -*- coding: utf-8 -*-\n# Date: 2020/3/18 11:50\n\n\"\"\"\nhttps://github.com/sksq96/pytorch-summary/blob/master/torchsummary/torchsummary.py\n\"\"\"\n\nfrom collections import OrderedDict\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\n\ndef summary(model, input_size, batch_size=-1, dtypes=None):\n... | [
[
"numpy.prod",
"torch.rand",
"torch.cuda.is_available"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.