repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
JosvanderWesthuizen/tensor2tensor | [
"7bb67a18e1e4a0cddd1d61c65c937f14c1c124e3"
] | [
"tensor2tensor/utils/decoding.py"
] | [
"# coding=utf-8\n# Copyright 2018 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.contrib.framework.nest.pack_sequence_as",
"tensorflow.train.get_checkpoint_state",
"tensorflow.reshape",
"tensorflow.logging.warning",
"numpy.uint8",
"tensorflow.shape",
"matplotlib.pyplot.savefig",
"tensorflow.logging.info",
"tensorflow.constant",
"tensorflow.g... |
jessecambon/advent_of_code_2021 | [
"1ace59f402cf956d373200788806bc10a51c23b3"
] | [
"day4/part1.py"
] | [
"import numpy as np\n\nbingo_boards = []\nbingo_square_txt = []\n\n# Read in bingo squares as 2d numpy arrays in a list\n# and bingo numbers as a single 1d numpy array\nwith open('input.txt') as f:\n line_index = 0\n for line in f:\n if line_index == 0:\n bingo_numbers = np.fromstring(line.s... | [
[
"numpy.isin",
"numpy.empty",
"numpy.append"
]
] |
daico007/openff-interchange | [
"d5a3da9701c66eddf49cacd6038342f413c04786"
] | [
"openff/interchange/tests/utils.py"
] | [
"from collections import defaultdict\nfrom typing import Dict, List, Tuple\n\nimport mdtraj as md\nimport numpy as np\nimport pytest\nfrom openff.toolkit.topology import Molecule\nfrom openff.utilities.utilities import has_executable\nfrom simtk import openmm\nfrom simtk import unit as simtk_unit\n\nfrom openff.int... | [
[
"numpy.asarray",
"numpy.eye"
]
] |
Filhagosa/dolo | [
"384a7b144f925e4edf149abf9828b16e1a0f8798"
] | [
"dolo/numeric/grids.py"
] | [
"from functools import reduce\nfrom operator import mul\nfrom quantecon import cartesian\nimport numpy as np\nfrom numpy import zeros\n\n\ndef prod(l): return reduce(mul, l, 1.0)\n\nfrom dolo.numeric.misc import mlinspace\n\nclass Grid:\n\n def __mul__(self, rgrid):\n return cat_grids(self, rgrid)\n\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
]
] |
nlhkh/mimic3-benchmarks | [
"f87a2040263c4d767f7e79768221685ec0331aa7"
] | [
"mimic3models/length_of_stay/utils.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import print_function\n\nfrom mimic3models import metrics\nfrom mimic3models import common_utils\nimport threading\nimport os\nimport numpy as np\nimport random\n\n\ndef preprocess_chunk(data, ts, discretizer, normalizer=None):\n data = [discretizer.transf... | [
[
"numpy.sum",
"numpy.array",
"numpy.expand_dims"
]
] |
plj1280/leaf-audio | [
"a509bd2149105c94147bab22ab764435d29a8b20"
] | [
"leaf_audio/convolution_test.py"
] | [
"# coding=utf-8\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"tensorflow.compat.v2.nn.convolution",
"tensorflow.compat.v2.random.normal",
"tensorflow.compat.v2.enable_v2_behavior",
"tensorflow.compat.v2.random.set_seed",
"tensorflow.compat.v2.test.main"
]
] |
parevalo/measures_collector | [
"056f2b393fcca9811718a6265c32195ca9b9d79a"
] | [
"tstools/measures.py"
] | [
"# Classes for individual projects\r\n\r\nimport tstools.utils as utils\r\nimport tstools.sql as sql\r\nimport tstools.sheets as sheets\r\nimport tstools.leaflet_tools as lft\r\nimport tstools.ccd as ccd_tools\r\nimport ipyleaflet\r\nimport os, datetime, sqlite3, time\r\nimport pandas as pd\r\nimport tstools.plots ... | [
[
"pandas.DataFrame"
]
] |
zubovskiii98/FairMOT | [
"618b47da278a7c580522739239649503e662aad4"
] | [
"src/track.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport _init_paths\nimport os\nimport os.path as osp\nimport cv2\nimport logging\nimport argparse\nimport motmetrics as mm\nimport numpy as np\nimport torch\n\nfrom tracker.multitracker import JDETrack... | [
[
"numpy.sum",
"numpy.dot",
"numpy.asarray",
"torch.from_numpy"
]
] |
xiaxx244/shadow_pose_estimation | [
"74cc1090ef0e7f6573fb64ce1f50c50123a1b335",
"74cc1090ef0e7f6573fb64ce1f50c50123a1b335"
] | [
"image_enhancement/Network.py",
"pose_estimation/tf_pose/estimator.py"
] | [
"import keras\r\nimport tensorflow as tf\r\nfrom keras.layers import Input, Conv2D, Conv2DTranspose, Concatenate\r\nfrom keras.applications. resnet50 import ResNet50\r\nfrom keras.models import Model\r\nfrom keras.utils import multi_gpu_model\r\nfrom keras.layers import Activation, Dense,BatchNormalization\r\nimpor... | [
[
"tensorflow.device"
],
[
"tensorflow.nn.pool",
"numpy.zeros",
"tensorflow.get_default_graph",
"tensorflow.GraphDef",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.equal",
"numpy.copy",
"tensorflow.gfile.GFile",
"tensorflow.global_variables",
"... |
yugeeklab/RSMix | [
"1cacbdd80dccd7cacd9702575b6f8ffdfa4a5887",
"1cacbdd80dccd7cacd9702575b6f8ffdfa4a5887"
] | [
"pointnet2_rsmix/modelnet_h5_dataset_origin.py",
"pointnet2_rsmix/models/pointnet2_cls_ssg_origin.py"
] | [
"'''\n ModelNet dataset. Support ModelNet40, XYZ channels. Up to 2048 points.\n Faster IO than ModelNetDataset in the first epoch.\n'''\n\nimport os\nimport sys\nimport numpy as np\nimport h5py\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nROOT_DIR = BASE_DIR\nsys.path.app... | [
[
"numpy.squeeze",
"numpy.zeros",
"numpy.random.shuffle"
],
[
"tensorflow.zeros",
"tensorflow.summary.scalar",
"tensorflow.Graph",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.reduce_mean",
"tensorflow.add_to_collection",
"ten... |
jeffcsauer/esda | [
"5a7e4ff67eb18bfc0a529fbac9d5a4aa1d90b2c0"
] | [
"esda/join_counts_local.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.base import BaseEstimator\nfrom libpysal import weights\nfrom esda.crand import crand as _crand_plus, njit as _njit, _prepare_univariate\n\n\nPERMUTATIONS = 999\n\n\nclass Join_Counts_Local(BaseEstimator):\n\n \"\"\"Univariate Local Join Count Statistic\"\"\... | [
[
"numpy.array",
"pandas.Series"
]
] |
dmholtz/cnn-cifar10-pytorch | [
"00246ab1f2694332328987fdff2e14bb106e2241"
] | [
"model/CNN6_FC2.py"
] | [
"\"\"\"\nConvolutional neural network with five convolutional layer and two fully-\nconnected layers afterwards\n\n@author: dmholtz\n\"\"\"\n\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n# define the CNN architecture\nclass Net(nn.Module):\n def __init__(self):\n super(Net, self).__init__()\... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d"
]
] |
geowat/flopy | [
"b6b110a8807e18dca9b0b7491db0a72b36709098"
] | [
"flopy/modflow/mfswi2.py"
] | [
"\"\"\"\r\nmfswi2 module. Contains the ModflowSwi2 class. Note that the user can access\r\nthe ModflowSwi2 class as `flopy.modflow.ModflowSwi2`.\r\n\r\nAdditional information for this MODFLOW package can be found at the `Online\r\nMODFLOW Guide\r\n<http://water.usgs.gov/ogw/modflow-nwt/MODFLOW-NWT-Guide/swi2_seawa... | [
[
"numpy.array"
]
] |
ltorres6/airlab | [
"83a2debebc4c880b51c545c2e95bc9c52e73f4ae"
] | [
"build/lib/airlab/registration/registration.py"
] | [
"# Copyright 2018 University of Basel, Center for medical Image Analysis and Navigation\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/LICE... | [
[
"torch.as_tensor"
]
] |
Darivian/FinRL | [
"e2853d9c2a0a126a9abfac421c59a224c0755607"
] | [
"finrl/trade/backtest.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\n\r\nfrom pyfolio import timeseries\r\nimport pyfolio\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.dates as mdates\r\nfrom copy import deepcopy\r\n\r\nfrom finrl.marketdata.yahoodownloader import YahooDownloader\r\nfrom finrl.config import config\r\n\r\n\r\nde... | [
[
"pandas.to_datetime",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.sign",
"pandas.Series",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"matplotlib.dates.DayLocator",
"matplotlib.pyplot.xticks"
]
] |
285219011/hello-world | [
"84bcff1e814ee5697b5980535583737f8e81d82f",
"314d9cd9b607460f8bfea80fc828b1521ca18443"
] | [
"tensorflow/python/training/supervisor.py",
"tensorflow/contrib/layers/python/layers/initializers.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.training.coordinator.Coordinator",
"tensorflow.python.training.saver.Saver",
"tensorflow.python.platform.tf_logging.log_first_n",
"tensorflow.python.framework.ops.get_collection",
"tensorflow.python.training.summary_io.SummaryWriter",
"tensorflow.python.ops.logging_ops.m... |
hcngdaniel/VAEFaceRecognition | [
"f13c95675998bb59c4efa1c197ffcaeadc4fd1ed"
] | [
"datasets/text_to_bytes.py"
] | [
"#!/usr/bin/env python3\nimport numpy as np\n\nwith open('landmarks_in_bytes.txt', 'w', encoding='latin1') as outfile:\n with open('landmarks.txt', 'r') as f:\n print('counting...')\n lines = list(iter(f))\n lines_len = len(lines)\n print(lines_len)\n print('start')\n al... | [
[
"numpy.array"
]
] |
SuperBruceJia/pytorch-flask-deploy-webapp | [
"a9484c22ad07f4fb7fa472c34344575e89493a77"
] | [
"Deploy-ML-Model-with-Apache/flask_demo/flask_predict_api.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport pickle\nfrom flask import Flask, request\n# pip install flasgger==0.8.1\nfrom flasgger import Swagger\nimport numpy as np\nimport pandas as pd\n\nwith open('/var/www/flask_predict_api/rf.pkl', 'rb') as model_file:\n model = pickle.load(model_file)\n \nap... | [
[
"numpy.array"
]
] |
ChristofDubs/DoubleBallBalancer | [
"6869220ed9f8c5234b00fc653bf05bb7e0bf6737"
] | [
"model_2d/scripts/crocoddyl_controller.py"
] | [
"\"\"\"Controller class for controlling 2D Double Ball Balancer\n\"\"\"\nimport numpy as np\n\nfrom model_2d.dynamics_2 import DynamicModel, StateIndex\n\nimport crocoddyl\n\n\nclass ActionModel(crocoddyl.ActionModelAbstract):\n def __init__(self, param):\n crocoddyl.ActionModelAbstract.__init__(self, cro... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.shape",
"numpy.cumsum"
]
] |
LegenDad/KTM_Lab | [
"09a1671b1dfe9b667008279ef41a959f08babbfc"
] | [
"LAB/05/0508_KNN.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 8 10:41:11 2018\n\n@author: ktm\n\"\"\"\n\nfrom sklearn.datasets import load_breast_cancer\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\nimport matplotlib.pyplot as plt... | [
[
"sklearn.datasets.load_breast_cancer",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"sklearn.model_selection.train_test_split"
]
] |
tudelft-eemcs-dml/fltk-testbed-gr-5 | [
"72afa24a37cd1f8f5f49665c83ccbd730d76ad21"
] | [
"fltk/util/arguments.py"
] | [
"import torch.nn.functional as F\n\nimport torch\nimport json\n\n# Setting the seed for Torch\nimport yaml\n\nfrom fltk.nets import Cifar10CNN, FashionMNISTCNN, Cifar100ResNet, FashionMNISTResNet, Cifar10ResNet, Cifar100VGG\n\nSEED = 1\ntorch.manual_seed(SEED)\n\nclass Arguments:\n\n def __init__(self, logger):\... | [
[
"torch.manual_seed"
]
] |
lkeab/gsnet | [
"69c418fd5c8ec9ee90b4298888f59d9ce5b37749"
] | [
"reference_code/GSNet-release/demo/predictor.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport atexit\nimport bisect\nimport multiprocessing as mp\nfrom collections import deque\nimport cv2\nimport torch\nimport os\n\nfrom detectron2.data import MetadataCatalog\nfrom detectron2.engine.defaults import DefaultPredictor\nfrom detect... | [
[
"torch.ones",
"torch.device",
"torch.cuda.device_count"
]
] |
jrmendeshurb/google-research | [
"662e6837a3efa0c40b11cb4122447c4b028d2115",
"662e6837a3efa0c40b11cb4122447c4b028d2115",
"662e6837a3efa0c40b11cb4122447c4b028d2115",
"662e6837a3efa0c40b11cb4122447c4b028d2115",
"662e6837a3efa0c40b11cb4122447c4b028d2115"
] | [
"meta_learning_without_memorization/pose_code/maml_bbb_2.py",
"uncertainties/sources/models/simple.py",
"soft_sort/ops_test.py",
"dble/resnet.py",
"l2tl/evaluate.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... | [
[
"tensorflow.nn.conv2d",
"tensorflow.contrib.layers.python.layers.batch_norm",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.gradients",
"tensorflow.to_float",
"tensorflow.control_dependencies",
"tensorflow.stop_gradient",
"tensorflow.random_normal",
"tensorflow.no_... |
cyrilbois/PFNET.py | [
"81d2fd911c6e6aae4c5de0d1739c6f5361799ce2"
] | [
"examples/functions.py"
] | [
"#***************************************************#\n# This file is part of PFNET. #\n# #\n# Copyright (c) 2015, Tomas Tinoco De Rubira. #\n# #\n# PFNET is released under the BSD 2-clau... | [
[
"numpy.random.randn"
]
] |
tdegeus/GMatElastoPlastic | [
"ace74265f46fbc83af16d237db84d147c57598fb"
] | [
"tests/compare_versions/Cartesian3d_check_v0.1.0.py"
] | [
"import h5py\nimport numpy as np\nimport GMatElastoPlastic.Cartesian3d as GMat\nimport unittest\n\nclass Test(unittest.TestCase):\n\n def test_main(self):\n\n with h5py.File('Cartesian3d_random.hdf5', 'r') as data:\n\n shape = data['/shape'][...]\n\n i = np.eye(3)\n I = np... | [
[
"numpy.ones",
"numpy.einsum",
"numpy.eye"
]
] |
ccwutw/rl-control | [
"39ec21871f3cb435841dfb4b0646bcb2cbbc79b7"
] | [
"sumoenv.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport numpy as np\n\nif 'SUMO_HOME' in os.environ:\n tools = os.path.join(os.environ['SUMO_HOME'], 'tools')\n sys.path.append(tools)\nelse:\n sys.exit(\"please declare environment variable 'SUMO_HOME'\")\n\nimport traci\n\nclass Sum... | [
[
"numpy.array",
"numpy.zeros",
"numpy.eye",
"numpy.clip",
"numpy.squeeze"
]
] |
behzad89/pochas-geoutils | [
"45323ee5e3f47a7f11b4f50cf01f3a8cb6e56623"
] | [
"geoutils/utils.py"
] | [
"import datetime as dt\nimport json\nimport os\n\nimport numpy as np\nimport numpy.ma as ma\nimport rioxarray\nimport xarray as xr\nfrom pyproj import CRS, Proj # type: ignore\n\n\n# ModisAPI.py utils:\ndef geometry_from_geojson(filepath: str):\n with open(filepath, \"r\") as f:\n json_obj = json.load(f)... | [
[
"numpy.dstack",
"numpy.array",
"numpy.mean",
"numpy.ma.masked_values"
]
] |
CK-Chaitanya/rasa_core | [
"acbf97ff1923a553eadd5cf881e64c50e622ae90"
] | [
"tests/conftest.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport logging\nimport os\nfrom builtins import str\n\nimport matplotlib\nimport pytest\nfrom pytest_localserver.http import WSGIServer\n\nfrom rasa_core import... | [
[
"matplotlib.use"
]
] |
candacelax/bottom-up-attention | [
"dea4e48d71aa7d9abba5a3b4a338e3d688a76a79"
] | [
"lib/fast_rcnn/config.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\n\"\"\"Fast R-CNN config system.\n\nThis file specifies defa... | [
[
"numpy.array"
]
] |
dimitar-petrov/pyfolio | [
"4b901f6d73aa02ceb6d04b7d83502e5c6f2e81aa",
"4b901f6d73aa02ceb6d04b7d83502e5c6f2e81aa"
] | [
"pyfolio/utils.py",
"pyfolio/perf_attrib.py"
] | [
"#\n# Copyright 2018 Quantopian, 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.DataFrame",
"pandas.Grouper",
"numpy.mean",
"numpy.std",
"pandas.concat",
"numpy.linspace"
],
[
"pandas.DataFrame",
"matplotlib.pyplot.gca",
"pandas.Series"
]
] |
ImranRiazChohan/ml_pipeline_using_kubeflow | [
"0c40355832b797734ae7cfac95000f35a722c1ff"
] | [
"preprocess_data/preprocess.py"
] | [
"from sklearn import datasets\r\nfrom sklearn.model_selection import train_test_split\r\nimport numpy as np\r\n\r\n\r\ndef _preprocess_data():\r\n x,y=datasets.load_boston(return_X_y=True)\r\n x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.33)\r\n np.save('x_train.npy', x_train)\r\n np.... | [
[
"sklearn.model_selection.train_test_split",
"numpy.save",
"sklearn.datasets.load_boston"
]
] |
janselE/SimCLR-2 | [
"8bec90bf718206cae4e894120f5b3a773b8049ef"
] | [
"simclr/simclr.py"
] | [
"import torch.nn as nn\nimport torch\n\nfrom simclr.modules.identity import Identity\n\n\nclass SimCLR(nn.Module):\n \"\"\"\n We opt for simplicity and adopt the commonly used ResNet (He et al., 2016) to obtain hi = f(x ̃i) = ResNet(x ̃i) where hi ∈ Rd is the output after the average pooling layer.\n \"\"\... | [
[
"torch.nn.Linear",
"torch.round",
"torch.sigmoid",
"torch.nn.Sigmoid",
"torch.nn.SiLU",
"torch.softmax",
"torch.nn.ReLU"
]
] |
nabihach/pytorch-transformers | [
"4c99a4eda5459e36ebb45355fa789bb6cc0bce71"
] | [
"examples/contrib/run_swag.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.distributed.get_world_size",
"torch.utils.data.RandomSampler",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.distributed.init_process_group",
"torch.manual_seed",
"numpy.argmax",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.distributed.get_rank"... |
gauthamp10/mldeploy | [
"556fe3ff5d19891f73bd9fb1295c4acc4ea6af8e"
] | [
"src/model/model_creator.py"
] | [
"#!/usr/bin/env python\n\"\"\"Linear Regression model\"\"\"\n# Importing libraries\nimport pandas as pd\nimport pickle\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import train_test_split\n# Loding the dataset\ndata = pd.read_csv('./dataset/weight-height.csv')\n# Preview of the d... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.linear_model.LinearRegression"
]
] |
raissabthibes/bmc | [
"840800fb94ea3bf188847d0771ca7197dfec68e3"
] | [
"courses/modsim2018/tasks/Tasks_DuringLecture18/BMC-master/functions/io_cortexmac.py"
] | [
"\"\"\"Read and write Cortex Motion Analysis Corporation ASCII related files.\n\n read_trc(fname, fname2='_2', units='', df_multi=True): Read .trc file.\n read_anc(fname): Read .anc file.\n read_cal(fname): Read .cal file.\n read_forces(fname): Read .forces file.\n write_trc(fname, header, df): Write... | [
[
"numpy.max",
"numpy.array",
"numpy.asarray",
"numpy.hsplit",
"pandas.DataFrame",
"numpy.diff",
"numpy.nanmean",
"numpy.arange",
"pandas.concat",
"numpy.hstack",
"pandas.read_csv"
]
] |
USTCEarthDefense/BNF_code | [
"4735085fce900f1230a623a0d3db16e8eff4d185"
] | [
"Code/BNF.py"
] | [
"import utils_funcs\nimport tensorflow as tf\nimport numpy as np\nfrom sklearn.cluster import KMeans\nimport joblib as jb\nfrom utils_funcs import FLOAT_TYPE, MATRIX_JITTER, DELTA_JITTER\nimport sys\nimport os\nfrom tensorflow import keras\n\n#np.random.seed(47)\n#tf.set_random_seed(47)\n\n# run as\nprint(\"usage :... | [
[
"tensorflow.exp",
"numpy.random.rand",
"numpy.exp",
"numpy.min",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"numpy.max",
"tensorflow.Variable",
"tensorflow.transpose",
"numpy.eye",
"tensorflow.constant",
"tensorflow.ConfigProto",
"tensorflow.v... |
ahiguera-mx/strax | [
"c2bcd5e34abe702666cd8bcb2bd6bba542ffb852"
] | [
"strax/storage/mongo.py"
] | [
"\"\"\"I/O format for MongoDB\n\nThis plugin is designed with data monitoring in mind, to put smaller\namounts of extracted data into a database for quick access. However\nit should work with any plugin.\n\nNote that there is no check to make sure the 16MB document size\nlimit is respected!\n\"\"\"\n\nimport strax\... | [
[
"numpy.dtype",
"numpy.zeros"
]
] |
lgyzngc/scvi | [
"b4472e7d02a3889c405078cdd7ab4d4378309c2c"
] | [
"scvi/models/modules.py"
] | [
"import collections\nfrom typing import Iterable, List\n\nimport torch\nfrom torch import nn as nn\nfrom torch.distributions import Normal\nfrom torch.nn import ModuleList\n\nfrom scvi.models.utils import one_hot\n\n\ndef reparameterize_gaussian(mu, var):\n return Normal(mu, var.sqrt()).rsample()\n\n\nclass FCLa... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.is_tensor",
"torch.distributions.Normal",
"torch.softmax",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.exp"
]
] |
astro-friedel/yggdrasil | [
"5ecbfd083240965c20c502b4795b6dc93d94b020"
] | [
"yggdrasil/metaschema/datatypes/tests/test_JSONArrayMetaschemaType.py"
] | [
"import copy\nimport numpy as np\nfrom yggdrasil import serialize\nfrom yggdrasil.tests import assert_equal\nfrom yggdrasil.metaschema.datatypes.JSONArrayMetaschemaType import (\n JSONArrayMetaschemaType)\nfrom yggdrasil.metaschema.datatypes.tests import test_MetaschemaType as parent\nfrom yggdrasil.metaschema.d... | [
[
"numpy.zeros"
]
] |
B-Czarnetzki/speechjoey | [
"97b0b98137bfaf0ffe15db9de6b38e37c7fb5572",
"97b0b98137bfaf0ffe15db9de6b38e37c7fb5572"
] | [
"test/unit/test_embeddings.py",
"test/unit/test_model_init.py"
] | [
"import torch\n\nfrom speechjoey.embeddings import Embeddings\nfrom .test_helpers import TensorTestCase\n\n\nclass TestEmbeddings(TensorTestCase):\n\n def setUp(self):\n self.emb_size = 10\n self.vocab_size = 11\n self.pad_idx = 1\n seed = 42\n torch.manual_seed(seed)\n\n de... | [
[
"torch.Size",
"torch.rand",
"torch.zeros",
"torch.manual_seed",
"torch.index_select",
"torch.Tensor"
],
[
"torch.manual_seed",
"torch.zeros",
"torch.ones"
]
] |
fboers/jumeg | [
"e04896989faf72f4dbe7adf136e4d158d212f24a",
"e04896989faf72f4dbe7adf136e4d158d212f24a"
] | [
"jumeg/decompose/group_ica.py",
"jumeg/gui/utils/jumeg_gui_utils_pdfs.py"
] | [
"# Authors: Lukas Breuer <l.breuer@fz-juelich.de>\n\n\"\"\"\n----------------------------------------------------------------------\n--- jumeg.decompose.group_ica.py -------------------------------------\n----------------------------------------------------------------------\n author : Lukas Breuer\n email ... | [
[
"numpy.concatenate",
"scipy.fftpack.ifft",
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.std",
"numpy.arange",
"numpy.sort",
"numpy.floor"
],
[
"numpy.where",
"numpy.array",
"numpy.zeros",
"numpy.unique"
]
] |
phil-hawkins/multiplayer-alphazero | [
"87732e18ec0f23469f6246de54388ef9cb324575"
] | [
"models/senet.py"
] | [
"import sys\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nsys.path.append(\"..\")\nfrom model import Model\n\n\nclass BasicBlock(nn.Module):\n def __init__(self, in_planes, planes, stride=1):\n super(BasicBlock, self).__init__()\n self.conv1 = nn.Conv2d(... | [
[
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"numpy.prod",
"torch.nn.functional.relu"
]
] |
Joey61Liuyi/AutoDL-Projects | [
"2092e144920e82d74753a7ac31e1890a150d41cf",
"2092e144920e82d74753a7ac31e1890a150d41cf"
] | [
"xautodl/trade_models/naive_v2_model.py",
"xautodl/datasets/math_dynamic_generator.py"
] | [
"##################################################\n# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021 #\n##################################################\n# A Simple Model that reused the prices of last day\n##################################################\nfrom __future__ import division\nfrom __future__ impor... | [
[
"numpy.square",
"numpy.array",
"numpy.isnan",
"numpy.random.seed",
"pandas.Series"
],
[
"numpy.random.uniform",
"numpy.random.multivariate_normal",
"numpy.stack",
"numpy.clip"
]
] |
SeunghwanByun/LBMNet | [
"90d05d5147d3b118ed869ba5781632173a8b528b"
] | [
"resnet_.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.utils.model_zoo import load_url as load_state_dict_from_url\n# from .utils import load_state_dict_from_url\n\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet50_888', 'resnet50_8816', 'resnet50_81616', 'resnet101',\n 'resnet152', 'resnext5... | [
[
"torch.nn.Linear",
"torch.flatten",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
Hakuyume/onnx-chainer | [
"3c46bd692ef38a7c0f45a2a09795d2023364e12b"
] | [
"onnx_chainer/functions/connection/linear.py"
] | [
"import os\n\nimport numpy as np\n\nfrom onnx import helper\nfrom onnx import numpy_helper\nfrom onnx_chainer import mapping\n\n\ndef convert_LinearFunction(\n func, input_names, param_names, parameters, input_tensors):\n input_names[input_names.index(id(func.W))] = param_names[id(func.W)]\n if hasattr... | [
[
"numpy.zeros"
]
] |
acezen/mars | [
"c6b4f6e5f9ab4caf9d8e82108e2dd49d312e39fd"
] | [
"mars/tensor/statistics/histogram.py"
] | [
"# Copyright 1999-2020 Alibaba Group Holding Ltd.\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... | [
[
"numpy.concatenate",
"numpy.result_type",
"numpy.isnan",
"numpy.asarray",
"numpy.subtract",
"numpy.isfinite",
"numpy.sqrt",
"numpy.issubdtype",
"numpy.log2",
"numpy.dtype"
]
] |
mathiasbockwoldt/TruSD | [
"7d0ec42e46e706eb9cf4de1b92a29f18a85159d9"
] | [
"trusd/cli.py"
] | [
"#!/usr/bin/env python3\n\n'''\nThis is the command line interface for TruSD and auxilliary scripts. As such,\nthis module is only meant for use from the command line. For information about\nTruSD, please refer to help(trusd) or https://github.com/mathiasbockwoldt/TruSD .\n'''\n\nimport argparse\nimport json\nimpor... | [
[
"numpy.arange",
"numpy.savetxt"
]
] |
A-Pot/tensorflow | [
"2d1cf8523b06ff29f53ddb8b6506e53660b51aed"
] | [
"tensorflow/python/kernel_tests/summary_ops_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.eager.context.graph_mode",
"tensorflow.python.ops.math_ops.equal",
"tensorflow.python.ops.summary_ops_v2.graph",
"tensorflow.python.ops.summary_ops_v2.audio",
"tensorflow.python.framework.tensor_util.MakeNdarray",
"tensorfl... |
touchylk/part_classification | [
"25d25377addf6b459240748b61b7458233814b68",
"25d25377addf6b459240748b61b7458233814b68"
] | [
"keras_frcnn/RoiPoolingConv.py",
"train_fgcnn_only.py"
] | [
"from keras.engine.topology import Layer\nimport keras.backend as K\nimport tensorflow as tf\n\n\n\nclass RoiPoolingConv(Layer):\n '''ROI pooling layer for 2D inputs.\n See Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition,\n K. He, X. Zhang, S. Ren, J. Sun\n # Arguments\n ... | [
[
"tensorflow.image.resize_images"
],
[
"numpy.random.choice",
"numpy.zeros",
"numpy.mean",
"numpy.where",
"numpy.random.randint",
"numpy.transpose",
"numpy.expand_dims"
]
] |
yyu1/SurfaceNet | [
"e59cf56d55d1be7295322d5a0f4a2aa244316d86"
] | [
"utils/mesh_util.py"
] | [
"'''\nmesh utils\nTianye Li\n'''\n\nimport numpy as np\n\n# -----------------------------------------------------------------------------\n\nclass Mesh():\n def __init__( self, v=None, f=None, vc=None, vn=None ):\n self.v = v\n self.f = f\n self.vc = vc # currently need manually specify\n ... | [
[
"numpy.ones_like",
"numpy.asarray"
]
] |
UBC-MDS/simplefit | [
"ba022b38a4479efe11261a292bacfa4bf441a5fa"
] | [
"tests/test_regressor.py"
] | [
"from simplefit.regressor import regressor\n\nimport pandas as pd\nfrom sklearn.model_selection import (train_test_split,)\nimport pytest\n\ndef test_regressor():\n \"\"\"Test regrssor function outputs with SpotifyFeatures.csv file.\"\"\"\n\n spotify_df = pd.read_csv(\"tests/data/SpotifyFeatures.csv\")\n t... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
shahin-trunk/NeMo | [
"a10ac29a6deb05bcfc672ad287f4a8279c1f9289",
"a10ac29a6deb05bcfc672ad287f4a8279c1f9289"
] | [
"workspace/riva_quickstart_v1.8.0-beta/examples/talk_stream.py",
"nemo/collections/nlp/models/language_modeling/megatron_base_model.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of c... | [
[
"numpy.frombuffer"
],
[
"torch._C._debug_set_autodiff_subgraph_inlining",
"torch._C._jit_set_profiling_executor",
"torch._C._jit_override_can_fuse_on_gpu",
"torch.cuda.set_device",
"torch._C._jit_set_nvfuser_enabled",
"torch._C._jit_set_profiling_mode",
"torch._C._jit_set_texpr... |
ZechangSun/VisHW | [
"7dc1bed84a67f2cdd523e7e4799a1ce31405de38"
] | [
"PCA/plot.py"
] | [
"from pyecharts import Scatter, Scatter3D\nfrom pyecharts import Page\nimport pyecharts\nimport numpy as np\nimport pandas as pd\n\n\nif __name__ == '__main__':\n data = pd.read_csv('img2d.csv', sep=',', names=['x', 'y'])\n pyecharts.configure(global_theme='shine')\n label = np.load('../data/sampled_label.... | [
[
"pandas.read_csv",
"numpy.load"
]
] |
rickyHong/MS-CNTK | [
"2bcdc9dff6dc6393813f6043d80e167fb31aed72"
] | [
"bindings/python/cntk/learners/tests/learner_test.py"
] | [
"# Copyright (c) Microsoft. All rights reserved.\n\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\nfrom __future__ import division, print_function\nimport numpy as np\nimp... | [
[
"numpy.array_equal",
"numpy.asarray",
"numpy.random.rand",
"numpy.random.seed",
"numpy.random.randn",
"numpy.allclose",
"numpy.random.randint",
"numpy.hstack"
]
] |
marisgg/evolutionary-potts | [
"7216bbac497697eba22cb4e877d70a73e22d8ed1"
] | [
"analyses/evolution_stats.py"
] | [
"import numpy as np\nimport os\nfrom matplotlib import pyplot as plt\n\n\nresult_dirs = {\"none\":[], \"medium\":[], \"high\":[]}\nfor filename in os.listdir(\"results/\"):\n filename = \"results/\"+filename\n if os.path.isdir(filename):\n print(filename)\n if filename.startswith(\"results\"):\n... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout"
]
] |
4rr0w/twitterSIte | [
"672f00030165eadd5eeebec0ba4f8a81a662eba2"
] | [
"flask_app/analyser/serve.py"
] | [
"import pandas as pd\n\nclass Serve:\n def __init__(self, username, since, end) -> None:\n since_day = pd.to_datetime(since)\n end_day = pd.to_datetime(end)\n self.df = pd.read_excel(\"./Sentimental/%s-tweets-analysed.xlsx\" % username, engine= 'openpyxl')\n self.df_filtered = self.df... | [
[
"pandas.to_datetime",
"pandas.read_excel"
]
] |
SherbyRobotics/PyRobotics | [
"86eb1189258f6f41642a149c813dd2fd6853bcc1"
] | [
"examples/projects/trajectory_optimisation/direct_collocation/double_stage.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Nov 16 12:05:08 2018\n\n@author: Alexandre\n\"\"\"\n###############################################################################\nimport numpy as np\n###############################################################################\nfrom pyro.dynamic import pendulu... | [
[
"numpy.array"
]
] |
IBM/hybrid-expert-intuition-model | [
"e21d7b4233458ebd0c4f73aac43e74d7d64f8cdb"
] | [
"src/prediction/GAN_Regression.py"
] | [
"# Copyright 2020 IBM 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 law or agreed ... | [
[
"matplotlib.pyplot.xlim",
"tensorflow.constant_initializer",
"tensorflow.matmul",
"numpy.mean",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer",
"tensorflow.random_normal_initializer",
"numpy.concatenate",
"tensorflow.trainable_variables",
... |
chetanchougle/chatbot2 | [
"99aece058e43b57e535146a0ee7b917b3eab7a2d"
] | [
"datasets/lm/tiny_shakespeare/data.py"
] | [
"EN_WHITELIST = '0123456789abcdefghijklmnopqrstuvwxyz ' # space is included in whitelist\nEN_BLACKLIST = '!\"#$%&\\'()*+,-./:;<=>?@[\\\\]^_`{|}~\\''\n\nFILENAME = 'input.txt'\n\nVOCAB_SIZE = 8000\n\nSEQ_LEN = 10\n\nimport random\nimport sys\n\nimport nltk\n\nimport numpy as np\n\nimport pickle\n\n'''\n read lines f... | [
[
"numpy.array",
"numpy.save",
"numpy.load",
"numpy.zeros"
]
] |
n-fallahinia/realtime-force-estimation | [
"f4718f4b7f011c1b7dba1e57bd4151c4de67a6dd"
] | [
"model/training.py"
] | [
"\"\"\"Tensorflow utility functions for training\"\"\"\n\nimport os\nimport datetime\nimport time\n\nfrom tqdm import tqdm\nimport tensorflow as tf\nimport numpy as np\nfrom time import sleep\n\nfrom model.utils.utils import save_dict_to_json\n\nclass Train_and_Evaluate():\n \n def __init__(self, train_model_... | [
[
"numpy.ceil",
"tensorflow.summary.image",
"tensorflow.GradientTape",
"tensorflow.keras.models.load_model",
"tensorflow.summary.create_file_writer",
"tensorflow.saved_model.save",
"tensorflow.keras.models.save_model"
]
] |
zengru001usst/acne | [
"ae652e814649e88034b3b506ccbe34432b1eb85a"
] | [
"utils.py"
] | [
"# Filename: utils.py\n# License: LICENSES/LICENSE_UVIC_EPFL\n\nimport gzip\nimport pickle\nimport numpy as np\nimport h5py\n\ndef np_skew_symmetric(v):\n\n zero = np.zeros_like(v[:, 0])\n\n M = np.stack([\n zero, -v[:, 2], v[:, 1],\n v[:, 2], zero, -v[:, 0],\n -v[:, 1], v[:, 0], zero,\n ... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.asarray",
"numpy.zeros",
"numpy.mean",
"numpy.stack",
"numpy.sqrt"
]
] |
zanderhinton/DSA_collaborative_prep | [
"8427255e0084c6d69031027492d847a90b970840"
] | [
"Problem_sets/spiral_matrix/test_script/test.py"
] | [
"import time\nimport numpy as np\nfrom test_script.solution import spiral_matrix\ntest_cases = [1, 2, 3, 4, 5] #insert test case objects into a list eg [test-case-1, test-case-2, test-case-3]\nloops = 10 # loops to be taken for calculating average time, for complex problems, lower this value.\n\ndef test_spiral_mat... | [
[
"numpy.mean"
]
] |
jmollard/typhon | [
"68d5ae999c340b60aa69e095b336d438632ad55c",
"68d5ae999c340b60aa69e095b336d438632ad55c"
] | [
"typhon/collocations/collocator.py",
"typhon/files/handlers/common.py"
] | [
"from collections import defaultdict\nfrom concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor\nfrom datetime import datetime, timedelta\nimport gc\nfrom multiprocessing import Process, Queue\nimport time\nimport traceback\n\nimport numpy as np\nimport pandas as pd\nfrom typhon.geodesy import great_ci... | [
[
"numpy.array",
"pandas.Timedelta",
"pandas.unique",
"pandas.DataFrame",
"pandas.Grouper",
"numpy.allclose",
"numpy.arange",
"numpy.abs",
"numpy.hstack",
"numpy.datetime64",
"numpy.array_split"
],
[
"pandas.read_csv"
]
] |
apayne19/DoubleAuctionMarket | [
"ab3e6116f52a2fccc1f64028f8cd1a727d2bda14"
] | [
"Environment/build_environment.py"
] | [
"import operator\nimport matplotlib.pyplot as plt # import matplotlib\nimport numpy as np # import numpy\nimport time\nimport random\nimport csv\n\nclass BuildMarketEnv(object):\n \"\"\" A class that makes a market\"\"\"\n env = {\"demand\": [], \"dem\": [], \"supply\": [], \"sup\": [], \"buyers\": {}, \"se... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.step",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel"
]
] |
jorgehatccrma/pygrfnn | [
"c67cb30c5cde579796ccbacc6338eb0631e81f6e"
] | [
"examples/example2.py"
] | [
"# 0. Preliminares\n\nimport sys\nsys.path.append('../') # needed to run the examples from within the package folder\n\nimport numpy as np\n\nfrom pygrfnn import Zparam, GrFNN, Model, make_connections\nfrom pygrfnn.vis import plot_connections\nfrom pygrfnn.vis import tf_detail\nfrom pygrfnn.vis import GrFNN_RT_plo... | [
[
"matplotlib.pyplot.ion",
"numpy.ones",
"matplotlib.pyplot.title",
"numpy.exp",
"numpy.real",
"numpy.arange",
"numpy.imag"
]
] |
SAKEverse/sake-plot | [
"a08973222109981b36d204a754d0bf34d95be192"
] | [
"processing/simulate_signals.py"
] | [
"####----------------------- IMPORTS ------------------- ######\nimport numpy as np\nfrom processing.stft import get_freq_index, Stft, Properties\n####--------------------------------------------------- ######\n\nclass SimSignal(Properties):\n \"\"\" Simulate eeg/lgp signals\n \"\"\"\n \n def __init__(s... | [
[
"numpy.sin",
"numpy.ceil",
"numpy.zeros",
"numpy.mean",
"numpy.arange",
"numpy.cumsum",
"numpy.convolve"
]
] |
renll/MonoDemand | [
"e3e5b8ffa4db53fc7203579eed68ca6b620bc508"
] | [
"baseline.py"
] | [
"# import some libraries\nimport numpy as np\nimport pandas as pd\nimport statsmodels.api as sm\nimport random\nfrom scipy.stats import t, f\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.utils.data as data\n\nfrom ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.cuda.manual_seed",
"torch.cuda.is_available",
"torch.load",
"numpy.random.normal",
"torch.utils.data.random_split",
"torch.manual_seed",
"torch.nn.init.normal_",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss"... |
yangzoudreamer/toolkit_test_gpu | [
"767debb3cd168f6cb33c9a2cf0b896268f85c586"
] | [
"src/test.py"
] | [
"import os\nimport torch\n#os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"11\"\n\nprint(torch.cuda.is_available())\n"
] | [
[
"torch.cuda.is_available"
]
] |
vsrad/caffe2onnx | [
"96576bd9340a89f64e14d52fe11244065a708db1"
] | [
"caffe2onnx/src/caffe2onnx.py"
] | [
"import caffe2onnx.src.OPs as op\nfrom caffe2onnx.src.c2oObject import *\nfrom onnx import helper\nimport copy\nimport numpy as np\nfrom caffe2onnx.src.op_layer_info import *\nimport random\nimport sys\nfrom typing import *\nimport onnx\n\nclass Caffe2Onnx():\n def __init__(self, net, model, onnxname):\n ... | [
[
"numpy.array",
"numpy.float",
"numpy.zeros",
"numpy.ones",
"numpy.shape"
]
] |
oshin94/PyEMD | [
"5859f5ea7e435ffc6e5130e5a1df9cd71784a75d",
"5859f5ea7e435ffc6e5130e5a1df9cd71784a75d"
] | [
"PyEMD/tests/test_checks.py",
"PyEMD/tests/test_splines.py"
] | [
"\"\"\"Tests for checks.py.\"\"\"\nimport unittest\n\nimport numpy as np\n\nfrom PyEMD.checks import energy, mean_period, significance_aposteriori, significance_apriori, whitenoise_check\n\n\nclass TestCase(unittest.TestCase):\n \"\"\"Test cases.\"\"\"\n\n def test_mean_period(self):\n \"\"\"Test to ch... | [
[
"numpy.full",
"numpy.array",
"numpy.sin",
"numpy.random.random",
"numpy.linspace"
],
[
"numpy.allclose",
"numpy.random.random",
"numpy.array",
"numpy.arange"
]
] |
dylanhross/lipydomics | [
"c7c3b72d4549a1a9937f287f3b314eff8e7ed054",
"c7c3b72d4549a1a9937f287f3b314eff8e7ed054"
] | [
"lipydomics/identification/characterize_lipid_ccs_pred.py",
"lipydomics/identification/train_lipid_rt_pred.py"
] | [
"\"\"\"\n lipydomics/identification/characterize_lipid_ccs_pred.py\n Dylan H. Ross\n 2019/10/09\n\n description:\n Characterizes performance of the predictive model for generating predicted CCS values by generating plots\n of predicted vs. measured CCS organized by lipid class (along with ... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.subplot"
],
[
"numpy.concatenate",
"numpy.array",
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression",
"sklea... |
drohde/deepr | [
"672772ea3ce9cf391f9f8efc7ae9c9d438957817",
"672772ea3ce9cf391f9f8efc7ae9c9d438957817"
] | [
"deepr/layers/size.py",
"deepr/hooks/log_variables_init.py"
] | [
"\"\"\"Size Layers\"\"\"\n\nimport tensorflow as tf\n\nfrom deepr.layers import base\n\n\nclass IsMinSize(base.Layer):\n \"\"\"Compare size of inputs to minimum\"\"\"\n\n def __init__(self, size: int, **kwargs):\n super().__init__(n_in=1, n_out=1, **kwargs)\n self.size = size\n\n def forward(... | [
[
"tensorflow.size"
],
[
"numpy.zeros_like",
"numpy.linalg.norm",
"numpy.sum",
"tensorflow.global_variables",
"numpy.mean",
"numpy.abs"
]
] |
wang-chen/lgl-feature-matching | [
"55bd17ee5e8699a06514bca09a6ef834808448a7"
] | [
"models/tool.py"
] | [
"#!/usr/bin/env python3\n\nimport time\nimport torch\n\n\nclass GlobalStepCounter():\n def __init__(self, initial_step=0):\n self._steps = initial_step\n\n @property\n def steps(self):\n return self._steps\n\n def step(self, step=1):\n self._steps += 1\n return self._steps\n\... | [
[
"torch.cuda.synchronize"
]
] |
jindi-tju/MRFasGCN | [
"41b94278b80bbcb256097a5a3dfb6a433d9dbdc7"
] | [
"build/lib/gcn/train.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport time\nimport tensorflow as tf\n\nfrom gcn.utils import *\nfrom gcn.models import GCN, MLP\n\n# Set random seed\nseed = 123\nnp.random.seed(seed)\ntf.set_random_seed(seed)\n\n# Settings\nflags = tf.app.flags\nFLAGS = flags.FLAGS\nflags... | [
[
"tensorflow.set_random_seed",
"tensorflow.sparse_placeholder",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.placeholder_with_default"
]
] |
yinghonglin/Projects | [
"5af56a4fc5ebfade3c0afbfd63a6300d92831a2b"
] | [
"Forecasting System/main.py"
] | [
"from Models import NN, DR, TM\nfrom Helper import helper\n\nimport pandas as pd\nimport datetime\nimport time\nimport numpy as np\nimport json\n\n\nclass LoadPred(object):\n\n def __init__(self, dataframe):\n self.data = dataframe.copy()\n self.NN = NN.NN(self.data)\n self.DR = DR.DR(self.d... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
fstroth/findthetail | [
"f4525a1393ab362886395bfb3a789446c1ac5143"
] | [
"findthetail/ftt.py"
] | [
"\"\"\"\n.. module:: ftt\n:platform: Unix, Windows\n:synopsis: Module for Paper XY.\n.. moduleauthor:: Frederik Strothmann <frstrothmann@gmail.com>\n\n\"\"\"\n\nimport os\nfrom multiprocessing import Pool\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import genpareto\nfrom jinja2 import E... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.random.seed",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"scipy.stats.genpareto.fit",
"numpy.arange",
"numpy.sort",
"scipy.stats.genpareto",
"numpy.unique"
]
] |
Jai-Doshi/Python-Project | [
"40a77ae1eb2c66444d94f40aef4dbda2bc8d957a"
] | [
"python/project/pandas_data.py"
] | [
"# IMPORTING LIBRARIES\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\nimport datetime\r\nimport warnings\r\n\r\n# IMPORTING DATASET\r\n\r\ndf = pd.read_csv('..//assets/data.csv')\r\n\r\n# FEATURES\r\n\r\n# Basic\r\n\r\ndf.head()\r\ndf.tail()\r\ndf.inf... | [
[
"pandas.read_csv"
]
] |
ufgtb24/IRL | [
"893377ac1f703be04af91e8923b4907045a1678c"
] | [
"maxent_irl.py"
] | [
"'''\nImplementation of maximum entropy inverse reinforcement learning in\n Ziebart et al. 2008 paper: Maximum Entropy Inverse Reinforcement Learning\n https://www.aaai.org/Papers/AAAI/2008/AAAI08-227.pdf\n\nAcknowledgement:\n This implementation is largely influenced by Matthew Alger's maxent implementation her... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.shape",
"numpy.random.uniform"
]
] |
NareTorosyan/Python_Introduction_to_Data_Science | [
"5912ab8ddb147c85f3a798aa9a1ee01aa8a97c40"
] | [
"src/second_month/task_2_3.py"
] | [
"import numpy as np\n#1Write a program to find maximum and minimum values of multidimensional NumPY massive\ndef max_min(array):\n return np.max(array), np.min(array)\n\n\n#2Write a program to find maximum and minimum values of the second column of multidimensional NumPY massive\ndef max_min_by_2nd_column(array)... | [
[
"numpy.max",
"numpy.array",
"numpy.dot",
"numpy.median",
"numpy.min",
"numpy.arange"
]
] |
Addi-11/Neural_Style_Transfer | [
"7570eb7deaaea5c18f58e908ac94319d87b3934d"
] | [
"old-approach/vgg19.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport scipy.io\nimport scipy.misc\nfrom utils import CONFIG\n\n\nclass VGG19:\n\n\tvgg = scipy.io.loadmat(CONFIG.PRE_TRAINED_PATH)\n\tvgg_layers = vgg['layers']\n\n\tdef _weights(self, layer, name):\n\t\t# matconvnet: weights are [width, height, in_channels, out_channe... | [
[
"numpy.reshape",
"tensorflow.nn.conv2d",
"tensorflow.nn.relu",
"numpy.zeros",
"tensorflow.constant",
"tensorflow.nn.avg_pool"
]
] |
dataframing/snorkel | [
"be6cec76f6758ed6f8d0ca5da7342af28ad5486c"
] | [
"test/map/test_core.py"
] | [
"import unittest\nfrom types import SimpleNamespace\nfrom typing import Any, Optional\n\nimport numpy as np\nimport pandas as pd\nimport spacy\n\nfrom snorkel.map import Mapper, lambda_mapper\nfrom snorkel.map.core import get_hashable\nfrom snorkel.types import DataPoint, FieldMap\n\n\nclass SplitWordsMapper(Mapper... | [
[
"numpy.array"
]
] |
QAlexBall/Learning_Py | [
"8a5987946928a9d86f6807555ed435ac604b2c44",
"8a5987946928a9d86f6807555ed435ac604b2c44"
] | [
"MachineLearning/Bayes/bayes_classifier.py",
"Three_Part_Moudule/Tensoflow-v2-beta/Eager_Execution/train_model.py"
] | [
"import numpy as np\nfrom sklearn import datasets\nfrom ..utils.dataset_operator import normalize, train_test_split\n\n\nclass NaiveBayes:\n\n def __init__(self):\n self.parameters = {}\n\n def fit(self, train_data, train_label):\n classes = np.unique(train_label)\n for category in classe... | [
[
"sklearn.datasets.load_digits",
"numpy.log",
"numpy.exp",
"numpy.mean",
"numpy.where",
"numpy.sqrt",
"numpy.var",
"numpy.unique"
],
[
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.GradientTape",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
... |
abahram77/mnistChallenge | [
"94dca5a6c54b16cac44f1a429d96a5182be64a31"
] | [
"L0_attack.py"
] | [
"\"\"\"\nImplementation of attack methods. Running this file as a program will\napply the attack to the model specified by the config file and store\nthe examples in an .npy file.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport cv2\ni... | [
[
"numpy.concatenate",
"tensorflow.train.latest_checkpoint",
"tensorflow.nn.relu",
"numpy.copy",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.train.Saver",
"tensorflow.Session",
"numpy.save",
"tensorflow.gradients",
"tensorflow.reduce_max",
... |
Andremartiny/AndreMartiny.github.io | [
"54d6ebadb735bc865ee152a59d6ee964a0cf9c0c"
] | [
"_drafts/Linalg/transponering.py"
] | [
"import numpy as np\n\ndef transp(matrise):\n return [[matrise[rad][kol] for rad in range(len(matrise))] for kol in range(len(matrise[0]))]\n\n\n\ndef matrisemult(mat1,mat2):\n # Bør sjekke om det går å multiplisere\n mat1rad = len(mat1) # Antall rader i matrise 1\n mat2kol = len(mat2[0]) # antall kolon... | [
[
"numpy.matrix"
]
] |
shahrukhqasim/HGCalML | [
"2808564b31c89d9b7eb882734f6aebc6f35e94f3",
"2808564b31c89d9b7eb882734f6aebc6f35e94f3"
] | [
"modules/pseudo_rs_op.py",
"clustering/testscript.py"
] | [
"import tensorflow as tf\n\ndef CreatePseudoRS(asso_idx, data):\n '''\n returns:\n - indices to gather_nd the data back to original sorting\n - pseudo row splits\n - resorted data, according to the pseudo RS\n \n '''\n ids = tf.range(tf.shape(asso_idx)[0],dtype='int32')\n args = tf.arg... | [
[
"tensorflow.shape",
"tensorflow.cumsum",
"tensorflow.expand_dims",
"tensorflow.gather_nd",
"tensorflow.argsort",
"tensorflow.zeros_like",
"tensorflow.gather",
"tensorflow.unique_with_counts"
],
[
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"t... |
ishine/AFRCNN-For-Speech-Separation | [
"2d2d20e23731279affd797441252e25401451f0d"
] | [
"norms.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass ChannelWiseLayerNorm(nn.LayerNorm):\n \"\"\"\n Channel wise layer normalization\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n super(ChannelWiseLayerNorm, self).__init__(*args, **kwargs)\n\n def forward(self, x):\n \"\"\"\n x: ... | [
[
"torch.zeros",
"torch.ones",
"torch.nn.BatchNorm1d",
"torch.transpose",
"torch.pow"
]
] |
bitsoal/auxiliary_scripts_for_vasp | [
"2c3e34d2cf062fd4cca4c31311db1a7c87e8812c"
] | [
"DOS_process/plot_DOS_by_elements/Plot_PDOS_by_elements.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n\nfrom pymatgen.io.vasp.outputs import Vasprun\n#from pymatgen.electronic_structure.plotter\nfrom pymatgen.io.vasp.outputs import Orbital, Spin\nfrom pymatgen import Structure\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n#%matplotlib inline\n\nimport os, glob\n\n\n# In[2... | [
[
"numpy.max",
"matplotlib.pyplot.xlim",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.cla",
"numpy.logical_and",
"matplotlib.pyplot.tick_params",
... |
xieenze/detr | [
"13bdf0bf59fead571cd793a01eae50e7620fc6a2"
] | [
"models/matcher.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nModules to compute the matching cost and solve the corresponding LSAP.\n\"\"\"\nimport torch\nfrom scipy.optimize import linear_sum_assignment\nfrom torch import nn\n\nfrom util.box_ops import box_cxcywh_to_xyxy, generalized_box_iou\nf... | [
[
"torch.cat",
"torch.no_grad",
"scipy.optimize.linear_sum_assignment",
"torch.as_tensor",
"torch.cdist"
]
] |
maxdel/CipherGAN | [
"367be620d56a0cdc88a49bcdc5123d5bc5e6f122"
] | [
"train_utils/lr_schemes.py"
] | [
"import tensorflow as tf\n\n_LR = dict()\n\n\ndef register(name):\n\n def add_to_dict(fn):\n global _LR\n _LR[name] = fn\n return fn\n\n return add_to_dict\n\n\ndef get_lr(params):\n return _LR[params.lr_scheme](params)\n\n\n@register(\"constant\")\ndef constant(params):\n return params.learning_rate\n... | [
[
"tensorflow.less",
"tensorflow.log",
"tensorflow.greater",
"tensorflow.to_float",
"tensorflow.train.exponential_decay",
"tensorflow.contrib.framework.get_global_step"
]
] |
nf-core/metapep | [
"a425e3c0602d5149a8a634b10b682d9f6ed924c8"
] | [
"bin/finalize_microbiome_entities.py"
] | [
"#!/usr/bin/env python3\n####################################################################################################\n#\n# Author: Leon Kuchenbecker\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free... | [
[
"pandas.read_csv"
]
] |
samueljsluo/scikit-opt | [
"9282fcb6aadff3d4fbf16a36d2523735bbd1343b"
] | [
"tests/test_x2gray.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2019/10/15\n# @Author : github.com/Agrover112 , github.com/guofei9987\n\nimport numpy as np\nfrom sko.GA import GA\nfrom sko.tool_kit import x2gray\n\nimport unittest\n\n\nclass TestX2Gray(unittest.TestCase):\n\n def test_x2gray(self):\n cases = [\n [2, [... | [
[
"numpy.allclose"
]
] |
Kinpzz/SANet-TMM | [
"46188e2f4b11727e8356b91b5e1e2453826e27fe"
] | [
"networks/decoder.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Decoder(nn.Module):\n def __init__(self, mix_size, low_level_inplanes, num_classes, BatchNorm):\n super(Decoder, self).__init__()\n\n self.conv1 = nn.Conv2d(low_level_inplanes, 48, 1, bias=False)\n se... | [
[
"torch.cat",
"torch.nn.Dropout",
"torch.nn.functional.softplus",
"torch.nn.functional.interpolate",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.zeros_"
]
] |
magis-slac/NeuS | [
"f3ef3c089b2076ea8d73679bf37a94ef44a08939"
] | [
"models/dataset.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport cv2 as cv\nimport numpy as np\nimport os\nfrom glob import glob\nfrom icecream import ic\nfrom scipy.spatial.transform import Rotation as Rot\nfrom scipy.spatial.transform import Slerp\nimport pickle\n\nimport diffoptics as optics\nfrom diffoptics import Rays\n... | [
[
"torch.isnan",
"torch.ones",
"numpy.radians",
"torch.eye",
"numpy.cos",
"torch.meshgrid",
"torch.sum",
"numpy.sin",
"torch.randint",
"torch.tensor",
"numpy.linalg.inv",
"torch.zeros",
"torch.device",
"numpy.array",
"torch.linspace",
"numpy.stack",
... |
nathanielchu/tensorflow | [
"92d160f610a6af39f644a265693cf16804ef78a9"
] | [
"tensorflow/python/data/experimental/ops/readers.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.framework.ops.convert_n_to_tensor",
"tensorflow.python.data.ops.dataset_ops.MapDataset",
"tensorflow.python.data.experimental.ops.shuffle_ops.shuffle_and_repeat",
"tensorflow.python.data.ops.dataset_ops.get_legacy_output_types",
"tensorflow.python.util.tf_export.tf_export",
... |
jiaojiaogou/UDSBC | [
"6f6c2be39c5d1fa718825f63787e28ed8f37dc1a"
] | [
"Gof_script.py"
] | [
"## this script writed to caculate the Gof (goodness of fit) of the GS streamflow data \r\n## writed by Jiaojiao Gou 2022-05-05\r\n\r\nimport os\r\nimport math\r\nimport string\r\nimport numpy as np\r\nimport pandas as pd\r\nimport xarray as xr\r\nfrom UDSBC.util import filter_nan\r\nfrom UDSBC.Postprocess import... | [
[
"numpy.where",
"pandas.read_csv",
"numpy.savetxt"
]
] |
DAIM-ML/autotf | [
"3f82d858f49c27d5ecb624cee555fb8fd47bf067",
"3f82d858f49c27d5ecb624cee555fb8fd47bf067"
] | [
"autotf/ensemble/ML/example/test_stacking/classification.py",
"autotf/ensemble/blend.py"
] | [
"from sklearn.datasets import load_digits\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.metrics import accuracy_score, log_loss\r\nfrom sklearn.ensemble import ExtraTreesClassifier\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nfrom xgboost import XGBClassifier\r\nfrom ensemble ... | [
[
"sklearn.datasets.load_digits",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.ExtraTreesClassifier"
],
[
"numpy.array",
"sklearn.utils.validation.check_X_y",
"sklearn.utils.validation.c... |
thautwarm/xylearn | [
"ade885eb145a750cfe6c7c30896806cee6dfef59"
] | [
"xylearn/feature_extraction/tfidf.py"
] | [
"from sklearn.feature_extraction.text import TfidfTransformer\nfrom collections import Counter\nfrom typing import List\nfrom sklearn.feature_extraction import DictVectorizer\nfrom nltk.tokenize import word_tokenize\n\nimport nltk\nimport numpy as np\nimport xython as xy\nimport pandas as pd\nimport string\n\nWord ... | [
[
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.feature_extraction.DictVectorizer"
]
] |
metabolize/lace | [
"75cee6a118932cd027692d6cfe36b3726b3a4a5c"
] | [
"lace/test_geometry.py"
] | [
"import unittest\nimport numpy as np\nfrom bltest import attr\nimport vg\nfrom lace.cache import sc, vc\nfrom lace.mesh import Mesh\n\nclass TestGeometryMixin(unittest.TestCase):\n debug = False\n\n @attr('missing_assets')\n def test_cut_across_axis(self):\n original_mesh = Mesh(filename=sc('s3://bo... | [
[
"numpy.array",
"numpy.negative",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_raises"
]
] |
elentail/Serving | [
"5aad0d310420bae31ab06972e4837b8309fda057"
] | [
"convert_tflite.py"
] | [
"import os\nimport numpy as np\nimport tensorflow as tf\n\n# fixed folder\nsaved_model_dir = \"tf_cnn_model/1/\"\ntarget_dir = \"tflite_cnn_model\"\n\ndef convert_tflite():\n \n if not os.path.exists(target_dir):\n os.makedirs(target_dir)\n \n converter = tf.lite.TFLiteConverter.from_saved_mo... | [
[
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.lite.TFLiteConverter.from_saved_model",
"tensorflow.argmax",
"numpy.sum",
"tensorflow.lite.Interpreter",
"numpy.expand_dims"
]
] |
dtauxe/hackcu-ad | [
"7870b741244f8f04cd87ae79896ef825425dcbd1"
] | [
"TxfmPlotWindow.py"
] | [
"# Window for plotting transform pairs\n\nimport sys\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import Qt\n\nfrom TxfmPlotHelper import TxfmPlotHelper\nfrom poleSeeker import poleSeeker\n\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as QMatFigCanvas\n#from matp... | [
[
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.