repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
vencia/gym-gomoku
[ "521bb2872d6a201ac5d1ee0881bcd4e996897d14" ]
[ "gym_gomoku/envs/gomoku.py" ]
[ "import numpy as np\nimport gym\nfrom gym import spaces\nfrom gym import error\nfrom gym.utils import seeding\nfrom six import StringIO\nimport sys, os\nimport six\n\nfrom gym_gomoku.envs.util import gomoku_util\nfrom gym_gomoku.envs.util import make_random_policy\nfrom gym_gomoku.envs.util import make_beginner_pol...
[ [ "numpy.array", "numpy.ones", "numpy.zeros" ] ]
evvanErb/facialRecognitionCommandLineProgram
[ "2a4404626795bf835883bda89bc5adc106f794ac" ]
[ "main.py" ]
[ "#Python 3.x\n\nimport face_recognition\nimport cv2\nimport numpy as np\nimport os\nimport sys\n\nfrom settings import *\nfrom facialDetection import haarDetectFaceLocations, hogDetectFaceLocations\nfrom utilityFunctions import setupDatabase, detectAndRecognizeFacesInImage\n\ndef addPhoto(fileName, personName):\n ...
[ [ "numpy.savetxt" ] ]
goodlux/tutorials
[ "bbd7c7b83413164baf7a86b03b56c57a7ec3e75b" ]
[ "advanced_source/numpy_extensions_tutorial.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreating extensions using numpy and scipy\n=========================================\n**Author**: `Adam Paszke <https://github.com/apaszke>`_\n\n**Updated by**: `Adam Dziedzic` [https://github.com/adam-dziedzic](https://github.com/adam-dziedzic)\n\nIn this tutorial, we shall go thr...
[ [ "numpy.sum", "numpy.fft.irfft2", "torch.from_numpy", "torch.randn", "numpy.fft.rfft2", "torch.autograd.gradcheck.gradcheck" ] ]
aleatory-science/pyro
[ "4ed1d8a9cbc989f6f63afacc7cd98fae50761247" ]
[ "examples/visual_rama.py" ]
[ "import logging\nimport math\nimport pickle\nimport sys\nimport warnings\nfrom math import pi\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nfrom numpy import array\n\nimport pyro\nfrom pyro import poutine\nfrom pyro.distributions import (\n Beta,\n Categorical...
[ [ "numpy.array", "torch.stack", "numpy.set_printoptions", "numpy.rint", "numpy.random.shuffle", "torch.ones", "matplotlib.pyplot.MultipleLocator", "torch.cuda.is_available", "numpy.argmax", "torch.tensor", "matplotlib.pyplot.show", "numpy.arange", "matplotlib.pypl...
vkazei/autokeras
[ "c66fc7be562ee4f704adedcfd935cb9522cf2e1d" ]
[ "autokeras/tuner.py" ]
[ "import os\nimport copy\nimport inspect\n\nimport kerastuner\nimport tensorflow as tf\n\n\nclass AutoTuner(kerastuner.Tuner):\n \"\"\"Modified KerasTuner base class to include preprocessing layers.\"\"\"\n\n def run_trial(self, trial, hp, fit_args, fit_kwargs):\n \"\"\"Preprocess the x and y before cal...
[ [ "tensorflow.keras.callbacks.EarlyStopping" ] ]
theroyakash/MedicalDataLeakageInspector
[ "ef43303a1cafbb1e8f2068b69987d2f9a1d1ca51" ]
[ "tests.py" ]
[ "import unittest\nimport pandas as pd\nimport LeakageInspector\n\nclass Test(unittest.TestCase):\n def test_case_1(self):\n df1 = pd.DataFrame({'patient_id': [0, 1, 2]})\n df2 = pd.DataFrame({'patient_id': [2, 3, 4]})\n self.assertEqual(LeakageInspector.LeakageInspector(df1, df2, 'patient_id...
[ [ "pandas.DataFrame" ] ]
PacktPublishing/TensorFlow-for-Machine-Learning-Solutions-
[ "3f258ee117bffaf18f5420fc4e6eefaab604fa02" ]
[ "Section 1/How TensorFlow Works.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import ops\nops.reset_default_graph()\n\nsess = tf.Session()\n\nmy_tensor = tf.zeros([1,20])\n\nsess.run(my_tensor)\n\nmy_var = tf.Variable(tf.zeros([1,20]))\n\nsess.run(my_var.initializer)\nsess.run(my_var)\n\nrow_dim = 2\ncol_dim = 3\n\nzero_var = tf.Vari...
[ [ "tensorflow.zeros", "tensorflow.range", "tensorflow.linspace", "tensorflow.random_uniform", "tensorflow.Session", "tensorflow.ones", "tensorflow.ones_like", "tensorflow.fill", "tensorflow.constant", "tensorflow.zeros_like", "tensorflow.python.framework.ops.reset_default...
TortillasAlfred/rl-starter-files
[ "a781c2f145d72ebddb2185df5b0f9b5348f35ad1" ]
[ "scripts/visualize.py" ]
[ "import argparse\nimport time\nimport numpy\nimport torch\n\nimport utils\n\n\n# Parse arguments\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\n \"--model\", required=True, help=\"name of the trained model (REQUIRED)\"\n)\nparser.add_argument(\"--seed\", type=int, default=0, help=\"random seed (def...
[ [ "numpy.array", "torch.cuda.is_available" ] ]
tkkawa/nngp-copy
[ "42a5fb523653c0a213851628bc3ca0b78a2e8d1c" ]
[ "load_dataset.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.array", "numpy.dot", "numpy.random.rand", "numpy.random.seed", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "numpy.random.shuffle", "numpy.mean", "numpy.where", "numpy.argmax" ] ]
Akulen/mangaki-zero
[ "5eb2de06b8684ed948b8b903e9f567f06c35e3ef" ]
[ "zero/als3.py" ]
[ "from zero.recommendation_algorithm import (RecommendationAlgorithm,\n register_algorithm)\nfrom scipy.sparse import coo_matrix\nfrom collections import defaultdict\nimport numpy as np\n\n\n@register_algorithm('als3', {'nb_components': 20})\nclass MangakiALS3(Recommendation...
[ [ "scipy.sparse.coo_matrix", "numpy.random.normal", "numpy.zeros", "numpy.eye" ] ]
tensorflow/tfx-common
[ "988549bb50c6174d1a2e2cb4208f355826724842" ]
[ "tfx_bsl/tfxio/tensor_representation_util.py" ]
[ "# Copyright 2019 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 applicable law or agreed ...
[ [ "tensorflow.io.RaggedFeature.UniformRowLength", "tensorflow.io.FixedLenFeature", "numpy.prod", "tensorflow.io.VarLenFeature", "tensorflow.io.RaggedFeature", "tensorflow.io.RaggedFeature.RowLengths" ] ]
cclauss/incubator-mxnet
[ "5df5467adeb6ede4b3c8d4d027e6a46f8212b5fb" ]
[ "python/mxnet/symbol/symbol.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.prod", "numpy.hypot", "numpy.dtype" ] ]
RobinLu1209/PyTorch-Template
[ "1a444fa18ac4a4bf96c6a06edfa86021acdc558d" ]
[ "models/unet.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom configs.default_config import LIDCConfig as cfg\n\nfrom torch.nn import Conv3d\nclass Conv2_5d(nn.Conv3d):\n def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True):\n kernel...
[ [ "torch.nn.Dropout", "torch.nn.Sequential", "torch.nn.MaxPool3d", "torch.nn.Upsample", "torch.nn.ReLU", "torch.nn.BatchNorm3d" ] ]
orcasound/orca-autoencoder
[ "8e66c9b45c74d642db0d8c93add75586cf5b6871" ]
[ "CNN/ferlitschAutoenc.py" ]
[ "# Copyright 2019 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 ...
[ [ "tensorflow.keras.datasets.mnist.load_data", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Model", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.Input", "...
felix-wt/DynamicHandPose
[ "2fef3ab17627f5bd517f7baa6d555a7bab0b657e" ]
[ "main.py" ]
[ "import os\nimport sys\nimport json\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch import optim\nfrom torch.optim import lr_scheduler\n\nfrom opts import parse_opts_offline\nfrom model import generate_model\nfrom mean import get_mean, get_std\nfrom spatial_transforms import *\nfrom temporal_tra...
[ [ "numpy.array", "torch.save", "torch.optim.SGD", "torch.ones", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
nicolas-racchi/digit_recognizer
[ "e9bf7bcb587ca110128ac8106a178ad88a7966c4" ]
[ "flask_3/model/load.py" ]
[ "import tensorflow as tf \nfrom scipy.misc import imread, imresize, imshow\nfrom keras.models import model_from_json\nimport keras.models\nimport numpy as np \nimport re \nimport os\nimport base64\n\n\n\t# CARICAMENTO MODELLO\ndef init():\n\tjson_file = open('model/model.json', 'r')\n\tloaded_model_json = json_file...
[ [ "scipy.misc.imread", "numpy.invert", "scipy.misc.imresize", "tensorflow.get_default_graph" ] ]
data301-2020-winter2/course-project-group_1024
[ "e93f12b30010bb1d448917761eed7ccedfcca506" ]
[ "analysis/scripts/.ipynb_checkpoints/project_functions-checkpoint.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\ndef load_and_process(path):\n\n # Method Chain 1 (Load data and deal with missing data)\n df1 = (\n pd.read_csv(path)\n .loc[lambda x: ~x['Marital_Status'].str.contains(\"Unknown\", na=False)]\n...
[ [ "pandas.read_csv" ] ]
AustralianConservationFoundation/gnaf-loader
[ "3ff645fbdcbc191106bf0242bfadbc87bc4acc15" ]
[ "testing/weather/xx_process_weather_rain.py" ]
[ "# script gets all Australian BoM weather station observations\r\n# ... and applies an interpolated temperature to all GNAF points in a 100m grid\r\n\r\n# TODO:\r\n# 1. remove temperature biases due to altitude differences\r\n# a. Add SRTM altitudes to GNAF\r\n# b. Add interpolated altitude from weathe...
[ [ "pandas.DataFrame" ] ]
syrte/halotools
[ "73ecde657373deb61fc19cb16ec5be7f10df697d", "73ecde657373deb61fc19cb16ec5be7f10df697d" ]
[ "halotools/sim_manager/user_supplied_ptcl_catalog.py", "halotools/mock_observables/pairwise_velocities/velocity_marked_npairs_xy_z.py" ]
[ "\"\"\" Module containing the UserSuppliedPtclCatalog class.\n\"\"\"\nimport numpy as np\nimport os\nfrom warnings import warn\nimport datetime\n\nfrom astropy.table import Table\n\ntry:\n import h5py\nexcept ImportError:\n warn(\"Most of the functionality of the sim_manager \"\n \"sub-package require...
[ [ "numpy.all", "numpy.empty", "numpy.string_" ], [ "numpy.max", "numpy.sum" ] ]
hehuanlin123/DeepLearning
[ "6b7feabbbde9ac9489f76da4c06eeb6703fb165a" ]
[ "Kaggle/Playgroud/RiskPrediction/Home-Credit-Default-Risk-master/py/trash/803_cv_lgb.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 17 11:15:57 2018\n\n@author: kazuki.onodera\n\"\"\"\n\nimport gc, os\nfrom tqdm import tqdm\nimport pandas as pd\nimport sys\nsys.path.append(f'/home/{os.environ.get(\"USER\")}/PythonLibrary')\nimport lgbextension as ex\nimport lightgbm as...
[ [ "pandas.read_csv", "pandas.read_feather" ] ]
bnmajor/hexrdgui
[ "d19f7cf4a4469b0d3b6978f2f65c5e8a6bd81785" ]
[ "hexrd/ui/calibration/panel_buffer_dialog.py" ]
[ "import os\n\nfrom PySide2.QtCore import Signal, QObject, QSignalBlocker\nfrom PySide2.QtWidgets import QFileDialog, QMessageBox\nimport numpy as np\n\nfrom hexrd.ui import enter_key_filter\n\nfrom hexrd.ui.hexrd_config import HexrdConfig\nfrom hexrd.ui.ui_loader import UiLoader\n\nCONFIG_MODE_BORDER = 'border'\nCO...
[ [ "numpy.load", "numpy.isscalar" ] ]
pratik2508/Tacotron-Indian-English
[ "d3e4bf46c1da1c0e10918618662ef8175983b886" ]
[ "datasets/datafeeder.py" ]
[ "import numpy as np\nimport os\nimport random\nimport tensorflow as tf\nimport threading\nimport time\nimport traceback\nfrom text import cmudict, text_to_sequence\nfrom util.infolog import log\n\n\n_batches_per_group = 32\n_p_cmudict = 0.5\n_pad = 0\n\n\nclass DataFeeder(threading.Thread):\n '''Feeds batches of d...
[ [ "numpy.pad", "tensorflow.FIFOQueue", "tensorflow.placeholder" ] ]
pratikk-bulani/Attribute-and-Simile-Classifiers-for-Face-Verification
[ "653d9ab257482bc2bb3ea7514134a2072496d283" ]
[ "src/neural network (BONUS)/attr_net.py" ]
[ "import torchvision.transforms as transforms\nfrom torch.utils.data.sampler import SubsetRandomSampler\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import TensorDataset, DataLoader, Dataset\nimport torchvision\nfrom torchvision import models\nimport torch.optim as opt...
[ [ "torch.nn.Linear", "torch.round", "numpy.array", "torch.nn.Dropout", "numpy.random.choice", "numpy.asarray", "torch.nn.MSELoss", "torch.nn.Sigmoid", "torch.utils.data.random_split", "torch.Tensor.cpu", "numpy.where", "torch.cuda.is_available", "torch.tensor", ...
LasalJayawardena/Neural-Network-Projects
[ "de10a53c0cc385eca770dfb19fef6c01838549bc" ]
[ "Neural_Networks_Pytorch/utils.py" ]
[ "import matplotlib.pyplot as plt \nimport numpy as np \nimport torch \n\n\ndef multiclass_accuracy(y_pred,y_true):\n top_p,top_class = y_pred.topk(1,dim = 1)\n equals = top_class == y_true.view(*top_class.shape)\n return torch.mean(equals.type(torch.FloatTensor))\n\ndef view_classify(img, ps):\n\n ps = ...
[ [ "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
computationalmodelling/fidimag
[ "07a275c897a44ad1e0d7e8ef563f10345fdc2a6e" ]
[ "tests/test_two_particles_neb_method.py" ]
[ "from __future__ import print_function\nimport pytest\n\n# FIDIMAG:\nfrom fidimag.micro import Sim\nfrom fidimag.common import CuboidMesh\nfrom fidimag.micro import UniformExchange, UniaxialAnisotropy\nfrom fidimag.common.nebm_spherical import NEBM_Spherical\nfrom fidimag.common.nebm_geodesic import NEBM_Geodesic\n...
[ [ "numpy.max", "numpy.abs" ] ]
akolobov/robomimic
[ "104f00e84f915b3b618bc0fb9b849cfeb61e8e8e" ]
[ "robomimic/utils/dataset.py" ]
[ "\"\"\"\nThis file contains Dataset classes that are used by torch dataloaders\nto fetch batches from hdf5 files.\n\"\"\"\nimport os\nimport h5py\nimport numpy as np\nfrom copy import deepcopy\nfrom contextlib import contextmanager\n\nimport torch.utils.data\n\nimport robomimic.utils.tensor_utils as TensorUtils\nim...
[ [ "numpy.array", "numpy.zeros", "numpy.sqrt" ] ]
foobarbecue/meshcut_python3
[ "222bd484efd69246d6c45a2d73ea17fc7410eb6f" ]
[ "meshcut.py" ]
[ "\"\"\"\nFunctions to slice a mesh. For now, computes planar cross-section\n\"\"\"\nimport numpy as np\nimport numpy.linalg as la\nimport collections\n\n# ---- Geometry datastructures\n\n\ndef make_edge(v1, v2):\n \"\"\"\n We store edges as tuple where the vertex indices are sorted (so\n the edge going fro...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.sign", "numpy.fabs" ] ]
esgyu/AI_PROJECT_SERVER
[ "b0c1d1ac44bd88d5a32920065bfbc3844c649fbc" ]
[ "src/friends_dataprep.py" ]
[ "'''\nThis Program is a Face Identification model,\nI built to detect my friends faces. The system uses\nMTCNN to detect faces, then we use the FaceNet model\nand an SVM to predict the identity of the faces\n'''\nfrom os import listdir\nfrom os.path import isdir\nfrom matplotlib import pyplot\nfrom keras.models imp...
[ [ "numpy.asarray", "numpy.zeros", "numpy.savez_compressed", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.imread", "matplotlib.pyplot.subplot" ] ]
profxj/mwh_analysis
[ "bb3854ee9e6deee7be270967fe5a7e15a7636819" ]
[ "mhw_analysis/scripts/show_system.py" ]
[ "\"\"\" Script to show an MHW System\"\"\"\n\nfrom IPython import embed\n\ndef parser(options=None):\n import argparse\n # Parse\n parser = argparse.ArgumentParser(description='Show an MHW System')\n parser.add_argument(\"dataset\", type=str, help=\"MHW System set: orig, vary\")\n parser.add_argumen...
[ [ "numpy.logical_not", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.get_cmap", "numpy.min", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.show", "matplotlib.pyplot.clf", "matplotlib.pyplot.gca" ] ]
allrod5/extra-trees
[ "ba7d94bd8a77daaa2357241f343c3b571a900131" ]
[ "tests/tree/test_tree.py" ]
[ "import numpy as np\n\nfrom extra_trees.tree.tree import ExtraTreeClassifier\nfrom extra_trees.tree.tree import ExtraTreeRegressor\n\n\ndef test_extra_tree_regressor(circles):\n X, y = circles\n indices = np.random.permutation(len(X.data))\n X_train = X[indices[:-10]]\n y_train = y[indices[:-10]]\n X...
[ [ "numpy.unique" ] ]
arshadzahangirchowdhury/TomoEncoders
[ "9c2b15fd515d864079f198546821faee5d78df17" ]
[ "scratchpad/tomostream_roi/tomostream/tomostream3d.py" ]
[ "\n'''\nAdaptation of Tomostream orthoslice code for doing full 3d reconstructions\nThen to apply DL-based image processing or computer vision steps. \n\n\n'''\n\n\nimport pvaccess as pva\nimport numpy as np\nimport queue\nimport time\nimport h5py\nimport threading\nimport signal\n\nimport util\nimport log\nfrom e...
[ [ "numpy.where", "numpy.linalg.norm", "numpy.mod", "numpy.zeros" ] ]
vivekmathema/peakonly
[ "4dfbd053dc14289b790b1320ea6e02db85a6a5d2" ]
[ "run_batch.py" ]
[ "import sys\nimport os\nimport torch\nfrom tqdm import tqdm\nfrom utils.roi import get_ROIs\nfrom utils.models import Classifier, Integrator\nfrom utils.matching import construct_mzregions, rt_grouping, align_component\nfrom utils.run_utils import find_mzML, classifier_prediction, border_prediction,\\\n correct_...
[ [ "torch.cuda.is_available", "torch.load" ] ]
kant/DL_Segmention_Template
[ "cd791d79fefb1f9a7ee4fbd691c09f1f23180a9a" ]
[ "experiments/data_loaders/standard_loader.py" ]
[ "\"\"\"\nCopyright (c) 2018. All rights reserved.\nCreated by Resnick Xing on 2018/5/10\n\"\"\"\nimport glob,cv2,numpy as np\nimport matplotlib.pyplot as plt\nfrom perception.bases.data_loader_base import DataLoaderBase\nfrom configs.utils.utils import write_hdf5,load_hdf5\n\nclass DataLoader(DataLoaderBase):\n\tde...
[ [ "numpy.max", "numpy.min", "numpy.asarray", "matplotlib.pyplot.imread" ] ]
AlexBruBuxo/TFG--ASC-Deep-Learning
[ "589ec7179e99ddb27b1f0a77e084d556db9fc75f" ]
[ "venv/Lib/site-packages/librosa/feature/spectral.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Spectral feature extraction\"\"\"\n\nimport numpy as np\nimport scipy\nimport scipy.signal\nimport scipy.fftpack\n\nfrom .. import util\nfrom .. import filters\nfrom ..util.exceptions import ParameterError\nfrom ..util.decorators import moved\n\nfrom ..core.tim...
[ [ "numpy.dot", "numpy.subtract.outer", "numpy.mean", "numpy.where", "numpy.sort", "numpy.cos", "numpy.cumsum", "numpy.zeros_like", "numpy.log", "numpy.nanmin", "numpy.logical_and", "numpy.arange", "numpy.multiply.outer", "numpy.polyfit", "numpy.flatnonzero...
colineRamee/UTM_simulator
[ "fe0cb59b1a3a64f279fbc12f90c33455a2522d50" ]
[ "scripts/example_analysis.py" ]
[ "import os\nimport numpy as np\nimport json\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nfrom scripts.analyses import efficiency, severity_per_valid_los, los_per_agent, los_per_agent_flight_hour, nmac_per_agent_flight_hour, average_throughput, ground_delay, time_to_think, coline_boxplot\nimport pickl...
[ [ "numpy.concatenate", "matplotlib.ticker.ScalarFormatter", "matplotlib.pyplot.subplots", "numpy.mean", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show" ] ]
awentzonline/tartangan
[ "2d36a81fa0ae91fe6b9b4e1f26763285630837fb" ]
[ "tartangan/models/losses.py" ]
[ "import torch\nimport torch.nn.functional as F\n\n\n# Found these hinge loss functions in this BigGAN repo:\n# https://github.com/ajbrock/BigGAN-PyTorch\ndef discriminator_hinge_loss(real, fake):\n loss_real = torch.mean(F.relu(1. - real))\n loss_fake = torch.mean(F.relu(1. + fake))\n return loss_real, los...
[ [ "torch.nn.functional.relu", "torch.mean" ] ]
WISDEM/WOMBAT
[ "260611a5f2d78f9f6e96865be34f5248acf07079" ]
[ "wombat/windfarm/windfarm.py" ]
[ "\"\"\"Creates the Windfarm class/model.\"\"\"\n\nimport os # type: ignore\nimport numpy as np\nimport pandas as pd # type: ignore\nimport logging # type: ignore\nimport networkx as nx # type: ignore\nfrom math import fsum\nfrom geopy import distance # type: ignore\nfrom itertools import chain, combinations\n\...
[ [ "numpy.array", "numpy.fill_diagonal", "numpy.triu_indices_from", "pandas.DataFrame", "pandas.read_csv" ] ]
tubs-eis/VANAGA
[ "4a4084b97720b2820cd20c1f4c42263360921f2f" ]
[ "pareto_selection_nano.py" ]
[ "import numpy as np\nimport config as cf\nfrom crowding_nano import reduce_by_crowding\n\n\ndef identify_pareto(scores, population_ids):\n \"\"\"Identifies a single Pareto front, and returns the\n population IDs of the selected solutions\"\"\"\n\n population_size = scores.shape[0]\n # Create a starting ...
[ [ "numpy.hstack", "numpy.ones", "numpy.arange" ] ]
srinivasakumar-a/trading_calendars
[ "3e528d063531c78e0ac2d7dd374cd95a6d079584" ]
[ "trading_calendars/xbkk_holidays.py" ]
[ "from datetime import timedelta\n\nimport pandas as pd\nfrom pandas.tseries.holiday import (\n Holiday,\n next_monday_or_tuesday,\n sunday_to_monday,\n weekend_to_monday,\n)\nfrom pytz import UTC\n\nfrom .common_holidays import european_labour_day, new_years_day, new_years_eve\nfrom .trading_calendar im...
[ [ "pandas.to_datetime", "pandas.tseries.holiday.weekend_to_monday", "pandas.tseries.holiday.Holiday", "pandas.tseries.holiday.next_monday_or_tuesday", "pandas.Timestamp" ] ]
m-salewski/stay_classification
[ "e3f9deadf51c97029a0f9a4bb669a5af68abf7c6" ]
[ "src/stay_classification/bounding_box_classifier/bounding_box_classifier_maxloc.py" ]
[ "import numpy as np\n\nimport matplotlib.pyplot as plt\n\ndef get_max_loc_(d_thresh):\n \n \"\"\"\n Get the approximate location of the largest cluster, ie that with the most events\n \"\"\"\n \n def meth(arr):\n \n loc = None\n \n # Try the bins using the steps in the ...
[ [ "numpy.histogram", "matplotlib.pyplot.subplot", "numpy.where", "matplotlib.pyplot.figure" ] ]
JoonHyeongPark/IMMethyl
[ "bb4aa43475460b0ce0dd8b46606f3e61c672ee8f" ]
[ "CpG site Correlation/Separation Version/P_Code_Server4_PANCANCER.py" ]
[ "# -*- coding: utf-8 -*-\ncancerlist = [\"PANCANCER\"] # server1\n\nfrom operator import itemgetter\nfrom scipy import stats\nimport numpy as np\n\nbetavalue_arr = []\ncytoact_arr = []\n\nprobe_name = []\nsample_id = []\n\nstart_number = 180000\n\nSEP_NAME = \".SEP_4.\"\n\nprobe_count = 60000\nsample_count = 0\n\np...
[ [ "scipy.stats.spearmanr", "scipy.stats.pearsonr" ] ]
jordyantunes/Imagine
[ "783cedaa53635b21e18ef41ab1524d56e368d120" ]
[ "src/imagine/rl/actor_critic.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom torch.distributions import Normal\n\n\"\"\"\nthe input x in both networks should be [o, g], where o is the observation and g is the goal.\n\n\"\"\"\n\nclass Feedforward(torch.nn.Module):\n def __init__(self, input_siz...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.init.kaiming_uniform_", "torch.mul", "torch.nn.ModuleList", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.ReLU", "torch.nn.init.zeros_" ] ]
ianbtr/pandas
[ "e4c17f79ba7fc07bf7a3d66e4637a1eb3cdfea4d" ]
[ "pandas/core/series.py" ]
[ "\"\"\"\nData structure for 1-dimensional cross-sectional and time series data\n\"\"\"\nfrom io import StringIO\nfrom shutil import get_terminal_size\nfrom textwrap import dedent\nfrom typing import (\n IO,\n TYPE_CHECKING,\n Any,\n Callable,\n Iterable,\n List,\n Optional,\n Tuple,\n Typ...
[ [ "pandas.core.ops.add_flex_arithmetic_methods", "pandas.core.common.asarray_tuplesafe", "pandas.core.construction.extract_array", "pandas.core.ops.get_op_result_name", "pandas.core.common.any_none", "pandas.core.algorithms.mode", "pandas.compat.numpy.function.validate_argmin_with_skipna...
neurospin/deep_folding
[ "4c580314dfa4ae87c5d115f211c42185ae183f64" ]
[ "deep_folding/anatomist_tools/dataset_gen_pipe.py" ]
[ "#!python\n# -*- coding: utf-8 -*-\n#\n# This software and supporting documentation are distributed by\n# Institut Federatif de Recherche 49\n# CEA/NeuroSpin, Batiment 145,\n# 91191 Gif-sur-Yvette cedex\n# France\n#\n# This software is governed by the CeCILL license version 2 under\n# French la...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.zeros" ] ]
DeppMeng/HRNet-MaskRCNN-Benchmark
[ "63bc0fcf9e98137c0e07c27ee134b67f2b46004d" ]
[ "maskrcnn_benchmark/modeling/backbone/hrnet.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch.nn as nn\nfrom maskrcnn_benchmark.layers import FrozenBatchNorm2d\nfrom maskrcnn_benchmark.layers import Conv2d\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(sel...
[ [ "torch.nn.ModuleList", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Upsample", "torch.nn.Conv2d" ] ]
rudyn2/tsad
[ "d606fc60c35772bc9052cf4283ea06c64bbd61d3", "d606fc60c35772bc9052cf4283ea06c64bbd61d3" ]
[ "models/ActorCritic.py", "utils/join_datasets.py" ]
[ "import numpy as np\nimport torch.nn\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom typing import Union\n\n__HLCNUMBER_TO_HLC__ = {\n 0: 'right',\n 1: 'left',\n 2: 'straight',\n 3: 'follow_lane'\n}\n\n\nclass TwoLayerMLP(nn.Module):\n\n def __init__(self, input_dim: int, hidden_size: i...
[ [ "torch.nn.Linear", "numpy.random.random", "torch.nn.MSELoss", "torch.nn.ReLU" ], [ "numpy.array" ] ]
agacera/udacity_mle_word2vec_recommender
[ "289c9a5754dd3833bfbd3424b888ae7e3b32db23" ]
[ "word2vec_recommender/explorer.py" ]
[ "#AUTOGENERATED! DO NOT EDIT! File to edit: dev/04_explorer.ipynb (unless otherwise specified).\n\n__all__ = ['create_dash_app']\n\n#Cell\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\n\nfrom functools import lru_cache\nfrom pathli...
[ [ "pandas.read_csv", "numpy.load" ] ]
eulloa10/work-automation-projects
[ "6a25b4507317e7072c23e2fb8ae6b632174140e9" ]
[ "excel_workbook_automation/revenue/revenue_data.py" ]
[ "import pandas as pd \nimport datetime\n\nbegin_time = datetime.datetime.now()\n\nreport_dl_date = '010621'\nhyphen_mm_yy = '05-21'\nlast_hyphen_mm_yy = '04-21' \nyyyy_mm = '202105'\ncurr_mth_name = 'May'\nmm_dd = '0531'\ncurr_yyyy = '2021'\nhyphen_yyyy_mm = '2021-05'\n\n#US Oracle Reports\ndefrev_us = f'deferred_r...
[ [ "pandas.read_excel", "pandas.ExcelWriter" ] ]
HEPcodes/MG5_aMC
[ "aeb96510d1cf204bfd4e753569a8cc7becb62275" ]
[ "madgraph/various/process_checks.py" ]
[ "################################################################################\n#\n# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors\n#\n# This file is a part of the MadGraph5_aMC@NLO project, an application which \n# automatically generates Feynman diagrams and matrix elements for arb...
[ [ "matplotlib.cm.ScalarMappable", "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlabel", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.savefig", "matplotlib.pyplot.rc", "matplot...
sugartom/tf-pose-estimation
[ "84d3d87bd6c5a757e3106245440f1582b9ae0d69" ]
[ "run_test_export.py" ]
[ "import time\n\nimport sys\nsys.path.append('/home/yitao/Documents/fun-project/tensorflow-related/tf-pose-estimation/')\nfrom tf_pose import common\nimport cv2\nimport numpy as np\nfrom tf_pose.estimator import TfPoseEstimator\nfrom tf_pose.networks import get_graph_path, model_wh\n\n# Yitao-TLS-Begin\nimport tenso...
[ [ "tensorflow.saved_model.signature_def_utils.build_signature_def", "tensorflow.app.flags.DEFINE_integer", "tensorflow.saved_model.utils.build_tensor_info", "tensorflow.python.saved_model.builder.SavedModelBuilder", "tensorflow.tables_initializer", "tensorflow.python.util.compat.as_bytes" ...
aringler-usgs/normal_mode_GSN
[ "e3e593466c0ed7a1741a3bd433a9ef2dc34a2acf" ]
[ "figure4.py" ]
[ "#!/usr/bin/env python\nimport glob\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport matplotlib as mpl\n\nmpl.rc('font', family='serif')\nmpl.rc('font', serif='Times')\nmpl.rc('text', usetex=True)\nmpl.rc('font', size=18)\n\nmodes = ['0S2', '0S3', '0S4', '0S5']\nletters = ['(a)', '(b)', '(c)', '(d)']\...
[ [ "numpy.array", "matplotlib.pyplot.savefig", "numpy.mean", "matplotlib.pyplot.subplots", "matplotlib.rc" ] ]
universe-hcy/Elastic-Federated-Learning-Solution
[ "4e047fbbe6ae9809cd631499b7d3a3855dfe2208" ]
[ "efls-train/python/efl/example/paillier_mnist/leader_weight.py" ]
[ "# Copyright (C) 2016-2021 Alibaba Group Holding Limited\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 ...
[ [ "tensorflow.compat.v1.cast", "tensorflow.compat.v1.reshape", "tensorflow.compat.v1.one_hot", "tensorflow.compat.v1.losses.softmax_cross_entropy", "tensorflow.compat.v1.train.GradientDescentOptimizer", "tensorflow.compat.v1.metrics.accuracy", "tensorflow.compat.v1.feature_column.numeric...
yongdd/deep-langevin-fts
[ "70eebb2172b2fbc971ee9abaa441b2cb9675d262" ]
[ "run_simulation.py" ]
[ "import numpy as np\r\nimport yaml\r\nfrom scipy.io import *\r\nimport scipy.ndimage\r\nfrom langevinfts import *\r\nfrom saddle_net import *\r\nfrom deep_langevin_fts import *\r\n\r\n#os.environ[\"CUDA_VISIBLE_DEVICES\"]= \"2\"\r\n\r\n# -------------- read input parameters and data --------------\r\nwith open('inp...
[ [ "numpy.prod", "numpy.reshape" ] ]
SOLINSIGHT/solinsight
[ "b0398c48e33a1f43a2ec4528477cc07e0b692bd6" ]
[ "tool/picture.py" ]
[ "'''\nDescription: \nLastEditTime: 2021-10-20 22:50:54\n'''\n# Output columnar stacking diagram of various vulnerabilities\n\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mtick \nfrom math import *\nimport numpy as np\nimport pandas as pd\nimport os\n\n\ncsv = pd.read_csv(\"\")# read a csv file\nti...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.bar" ] ]
mbkumar/pyoculus
[ "8c925b139e27fd016b37aa4fe4653276af67e0a5" ]
[ "pyoculus/solvers/fixed_point.py" ]
[ "## @file fixed_point.py\n# @brief class for finding fixed points\n# @author Zhisong Qu (zhisong.qu@anu.edu.au)\n#\n\nfrom .base_solver import BaseSolver\nimport numpy as np\n\n## Class that used to setup the fixed point finder.\nclass FixedPoint(BaseSolver):\n def __init__(\n self, problem, params=dict...
[ [ "numpy.random.rand", "matplotlib.pyplot.xlim", "matplotlib.pyplot.gcf", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots", "numpy.eye", "numpy.sqrt", "matplotlib.pyplot.gca", "numpy.mod", "matplotlib.pyplot.axis", "numpy.array", "numpy.zeros", "matplotlib...
unluckydan/deep_metric_learning
[ "5c2bb9e8a921ea6d492b2ab264d163bbd4764a4c" ]
[ "lib/datasets/cub200_2011_converter.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Dec 20 20:11:40 2016\n\n@author: sakurai\n\"\"\"\n\nimport os\nimport tarfile\nimport subprocess\nimport numpy as np\nfrom scipy.io import loadmat\nimport matplotlib.pyplot as plt\nimport h5py\nimport fuel\nfrom fuel.datasets.hdf5 import H5PYDataset\nfrom tqdm import...
[ [ "numpy.array", "numpy.loadtxt", "numpy.transpose", "numpy.unique" ] ]
njanakiev/onnx-tensorflow
[ "5a8f36e06187d8482830adeede8e5a3c9543dbd5" ]
[ "example/train_onnx_model.py" ]
[ "import os\nimport logging\nimport onnx\nimport numpy as np\n\nimport tensorflow as tf\nfrom tensorflow.keras import datasets, layers, models, regularizers\nimport onnx_tf\ntf_compat = tf.compat.v1\n\nbatch_size = 32\nepochs = 2\n\nsaved_model_path = './saved_model/'\nonnx_model_file = './onnx_model/model.onnx'\ntr...
[ [ "numpy.equal", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.keras.layers.Flatten", "tensorflow.argmax", "tensorflow.keras.layers.Activation", "numpy.mean", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Conv2D", "te...
comet-syt/BAPS
[ "96a347d759863510a81955122158f9fa6e42e005" ]
[ "deep_learning/code/VectorWithPytorch.py" ]
[ "import torch\n\nt = torch.FloatTensor([0., 1., 2., 3., 4., 5., 6.])\nprint(t)\n\nprint(f\"rank = {t.dim()}\") # -> 1\nprint(f\"shape = {t.shape}\") # -> print(torch.Size([7]))\nprint(f\"shape = {t.size()}\") # -> print(torch.Size([7]))\n\nprint(\"==============================\")\n\nprint(t[0], t[1], t[-1]) # -> t...
[ [ "torch.FloatTensor" ] ]
hawkingbeck/SARSCoV2HeronPipeline
[ "38b00daf68ee6c821b900684c77c728787cee42b" ]
[ "heronPipeline/src/images/mergeSampleExportFiles/app.py" ]
[ "import os\nimport json\nimport gzip\nimport shutil\nimport pandas as pd\nfrom sys import exit, stderr\nfrom datetime import datetime\nimport boto3\nfrom botocore.exceptions import ClientError\nfrom botocore.config import Config\nfrom boto3.dynamodb.conditions import Key\n\n\ndef extractValue(dict, param, key):\n ...
[ [ "pandas.DataFrame" ] ]
ntucllab/imbalanced-DL
[ "726e45ffb7a567d57a19688f1410e6b40d14f3df" ]
[ "imbalanceddl/net/network.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import Parameter\nimport imbalanceddl.net as backbone\n\nmodel_names = sorted(name for name in backbone.__dict__\n if name.islower() and not name.startswith(\"__\")\n and callable(backbone.__...
[ [ "torch.nn.Linear", "torch.nn.functional.normalize", "torch.cuda.set_device", "torch.Tensor", "torch.nn.DataParallel" ] ]
anvelezec/TensorFlowTTS
[ "ec2bbd4ebc20fc78b28ae718fab5a6504dad15d1" ]
[ "test/test_tacotron2.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 Minh Nguyen (@dathudeptrai)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.convert_to_tensor", "tensorflow.shape", "tensorflow.GradientTape", "numpy.zeros", "tensorflow.expand_dims", "tensorflow.keras.losses.MeanSquaredError", "tensorflow.random.uniform", "tensorflow.function", "tensorflow.debugging.assert_less", "tensorflow.constant",...
Ervin66/geopandas
[ "2a4601642d300433bb33224a6b5e4eda27eab783" ]
[ "geopandas/tests/test_plotting.py" ]
[ "import itertools\nimport warnings\n\nimport numpy as np\nimport pandas as pd\n\nfrom shapely.affinity import rotate\nfrom shapely.geometry import (\n MultiPolygon,\n Polygon,\n LineString,\n LinearRing,\n Point,\n MultiPoint,\n MultiLineString,\n GeometryCollection,\n)\n\n\nfrom geopandas i...
[ [ "numpy.array", "numpy.not_equal", "matplotlib.pyplot.get_cmap", "numpy.testing.assert_array_equal", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.mean", "pandas.Categorical", "numpy.arange", "numpy.cos", "pandas.Series", "matplotlib.pyplot.axes" ...
jspenmar/DeFeat-Net
[ "c3dc5e143c7f484b86cf1703a290c0f07256e3e7" ]
[ "main.py" ]
[ "from pathlib import Path\nimport sys\n\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport torch\nimport numpy as np\n\nroot_path = Path(__file__).resolve().parent\nif str(root_path) not in sys.path:\n sys.path.insert(0, str(root_path))\n\nfrom networks.defeat_net import DeFeatNet\nfrom utils import...
[ [ "numpy.array", "numpy.percentile", "torch.no_grad", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show" ] ]
csarron/lxmert
[ "b58933c61d2715391831a0a4dc4f5dbba7e433ba" ]
[ "src/lxrt/modeling.py" ]
[ "# coding=utf-8\n# Copyright 2019 project LXRT.\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 complia...
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "torch.nn.SmoothL1Loss", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "torch.sigmoid", "torch.nn.Softmax", "tensorflow.train.list_variables", "numpy.transpose", "torch.zeros_like", "tensorflow.train.load_vari...
coletamburri2112/flare_imp_study
[ "8f1480104f5874698cfc0881d43cb8872a1115b9" ]
[ "mid1_process.py" ]
[ "# !/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 9 12:15:45 2022\n\n@author: owner\n\"\"\"\nimport fl_funcs\nfrom fl_funcs import exponential\nfrom fl_funcs import exponential_neg\nimport numpy as np\n\nyear = 2013\nmo = 5\nday = 16\nsthr = 21\nstmin = 36\narnum = 11748\nxclnum = 1.3\n...
[ [ "numpy.argmax" ] ]
Semen52/nlp4u
[ "06d30b9d37d2d8d1e1b96d825b91c0731b67ab04" ]
[ "models/src/sentirueval.py" ]
[ "#!/usr/bin/ python\n# -*- coding: utf-8 -*-\n# *************************************** #\n#\n# Author: Semen Budenkov\n# Date: 27/02/2017\n#\n# *************************************** #\n\n\nimport sys\nimport csv\nimport pandas as pd\n\n\ndef load_as_csv(file_name):\n with open(file_name) as opened_file:...
[ [ "pandas.read_csv" ] ]
AnthonyQuantum/open_model_zoo
[ "7d235755e2d17f6186b11243a169966e4f05385a", "7d235755e2d17f6186b11243a169966e4f05385a" ]
[ "tools/accuracy_checker/accuracy_checker/annotation_converters/cvat_human_pose.py", "demos/python_demos/handwritten_japanese_recognition_demo/utils/codec.py" ]
[ "\"\"\"\nCopyright (c) 2019 Intel Corporation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or ag...
[ [ "numpy.zeros" ], [ "numpy.array", "numpy.argmax" ] ]
paarriagadap/Datos-COVID19
[ "055efdc391c4ba93db2a7b5773ddd23244697d96" ]
[ "src/UDD.py" ]
[ "'''\nMIT License\n\nCopyright (c) 2020 Sebastian Cornejo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modi...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.concat", "pandas.read_csv", "pandas.pivot_table" ] ]
sot/sparkles
[ "f48f00054679cf383f1550956ee3eb44377797ab" ]
[ "sparkles/tests/test_find_er_catalog.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport os\n\nimport warnings\nfrom proseco import get_aca_catalog\nfrom proseco.tests.test_common import mod_std_info\nimport numpy as np\nfrom Quaternion import Quat\nimport Ska.Sun\nimport agasc\n\n# Do not use the AGASC supplement in testing since...
[ [ "numpy.any", "numpy.isclose" ] ]
ShihengDuan/neuralhydrology
[ "1c735ffe3a1152a91f1ba549dcb4fcbd26ba8c41" ]
[ "neuralhydrology/modelzoo/tcnn.py" ]
[ "# definition of temporal neural network. details can be found https://doi.org/10.3389/frwa.2020.00028\n\nfrom typing import Dict\n\nimport torch\nfrom torch import nn\nfrom torch.nn.utils import weight_norm\n\nfrom neuralhydrology.modelzoo.basemodel import BaseModel\nfrom neuralhydrology.modelzoo.inputlayer import...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Flatten" ] ]
CyberZHG/keras-conv-vis
[ "5e342af591b7a9cec11b300fecbe601e947d432e" ]
[ "tests/test_get_gradient.py" ]
[ "from unittest import TestCase\n\nimport numpy as np\n\nfrom keras_conv_vis import (get_gradient, Categorical, replace_layers,\n split_model_by_layer, grad_cam)\nfrom keras_conv_vis.backend import keras, TF_KERAS\n\n\nclass TestGetGradient(TestCase):\n\n def test_get_gradient(self):\n ...
[ [ "numpy.random.random" ] ]
lsraei20/twitoff
[ "0fe36df4b45b6858fd7467f7a6ebdef9926310fd" ]
[ "twitoff/predict.py" ]
[ "\"\"\"Prediction of Users based on tweets embeddings.\"\"\"\nimport numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom .models import User\nfrom .twitter import BASILICA\n\n\ndef predict_user(user1_name, user2_name, tweet_text):\n \"\"\"\n Determine and return which user is more likely to...
[ [ "sklearn.linear_model.LogisticRegression", "numpy.array", "numpy.vstack" ] ]
ChristianDjurhuus/MLOpsExercise
[ "0ab95482cb29fb58f55046ccdcbfe9b1784a1048" ]
[ "src/models/predict_model.py" ]
[ "# -*- coding: utf-8 -*-\nimport logging\nfrom pathlib import Path\n\nimport click\nimport numpy as np\nimport torch\nfrom dotenv import find_dotenv, load_dotenv\nfrom model import MyAwesomeModel\n\n\n@click.command()\n@click.argument(\"model_name\", type=click.Path())\ndef evaluate(model_name):\n print(\"Evalua...
[ [ "torch.no_grad", "numpy.mean", "torch.load" ] ]
Camerash/cs231n
[ "5537cc79715fbeb26611b46236f6684bd65c09a7" ]
[ "Assignment2/cs231n/classifiers/cnn.py" ]
[ "from builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.fast_layers import *\nfrom cs231n.layer_utils import *\n\n\nclass ThreeLayerConvNet(object):\n \"\"\"\n A three-layer convolutional network with the following architecture:\n\n conv - relu - 2x2 max pool - affine -...
[ [ "numpy.square", "numpy.random.normal", "numpy.zeros" ] ]
MMohanram1/VidioPiksel
[ "cfcaccdfcfeefae29310bf8b290491e93a8d8158" ]
[ "AudioHash/fingerprint.py" ]
[ "import numpy as np\nimport matplotlib.mlab as mlab\nimport matplotlib.pyplot as plt\nfrom scipy.ndimage.filters import maximum_filter\nfrom scipy.ndimage.morphology import (generate_binary_structure,\n iterate_structure, binary_erosion)\nimport hashlib\nfrom operator import ite...
[ [ "scipy.ndimage.morphology.generate_binary_structure", "matplotlib.pyplot.gca", "matplotlib.pyplot.subplots", "scipy.ndimage.filters.maximum_filter", "numpy.where", "matplotlib.pyplot.show", "scipy.ndimage.morphology.iterate_structure", "numpy.log10", "scipy.ndimage.morphology.b...
mxsg/CMS-Model-Calibration
[ "f7f85e863190f7a7ef0922dca4d0a8f8178e5a9e" ]
[ "cmscalibration/utils/visualization.py" ]
[ "import math\n\nimport matplotlib.pyplot as plt\n\n\ndef draw_binned_data(counts, bins):\n fig, axes = plt.subplots()\n\n draw_binned_data_subplot(counts, bins, axes)\n\n return fig, axes\n\n\ndef draw_binned_data_subplot(counts, bins, axes, name=''):\n centroids = (bins[1:] + bins[:-1]) / 2\n total ...
[ [ "matplotlib.pyplot.subplots" ] ]
NeelayS/pose_tracking
[ "68d151eef0c6a84623348f7be76ece709e6ca57a" ]
[ "AlphaPose/detector/nms/nms_wrapper.py" ]
[ "import numpy as np\nimport torch\n\nfrom . import nms_cpu, nms_cuda\nfrom .soft_nms_cpu import soft_nms_cpu\n\n\ndef nms(dets, iou_thr, device_id=None):\n \"\"\"Dispatch to either CPU or GPU NMS implementations.\n\n The input can be either a torch tensor or numpy array. GPU NMS will be used\n if the input...
[ [ "torch.from_numpy" ] ]
olutosinbanjo/oneMKL_getrs
[ "072e036498a6fc4a0a801c316ce84925dac8b9d0" ]
[ "plots/heterogeneous_versions.py" ]
[ "\r\n\"\"\"\r\nTITLE: grouped bar plots\r\n@author: Oluwatosin S. Oluseyi , December 11, 2021; modified: February 06, 2022\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\n\r\nBUF_het = [1.8723, 3.1941, 12.2682, 83.4657]\r\nUSM_het1 = [1.9384, 3.0731, 10.8887...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.bar", "matplotlib.pyplot.yscale", "matplotlib.pyplot.xticks" ] ]
archeltaneka/cgp-cnn-PyTorch
[ "667a1e9c6e25a26dd8c3c094944a53bb95f379f0" ]
[ "cnn_train.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport time\nimport math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nimport torchvision.datasets as dset\n...
[ [ "torch.nn.init.orthogonal", "torch.nn.init.constant", "torch.nn.init.xavier_normal", "torch.autograd.Variable", "torch.max", "torch.nn.init.uniform", "torch.FloatTensor", "torch.nn.init.kaiming_normal", "torch.cuda.empty_cache", "torch.LongTensor", "torch.nn.CrossEntrop...
Hugo101/SPFlow
[ "daaeed819f3ef85e6632f2f7a3bf4f8bb663ff8c" ]
[ "src/spn/gpu/TensorFlow.py" ]
[ "'''\nCreated on March 27, 2018\n\n@author: Alejandro Molina\n'''\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.client import timeline\n\nfrom spn.algorithms.TransformStructure import Copy\nfrom spn.structure.Base import Product, Sum, eval_spn_bottom_up\nfrom spn.structure.leaves.histogram....
[ [ "numpy.max", "tensorflow.python.client.timeline.Timeline", "tensorflow.summary.FileWriter", "numpy.log", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.add_n", "tensorflow.RunMetadata", "tensorflow.constant", "tensorflow.variable_scope", "tensorflow...
teamdatatonic/tf-sampling
[ "2a86091e5d2b94d416601cfb8becb0bf8d6473ca" ]
[ "sampling/io/schema.py" ]
[ "\"\"\"Defines a Schema class for ingesting structured data.\"\"\"\n\nfrom google.cloud import bigquery, storage\nimport tensorflow as tf\nimport numpy as np\nimport json\nimport collections\n\nfrom ..gcp.api import get_credentials\nfrom ..util.dimensions import ensure_iterable\n\nDTYPE_DICT = {\n 'STRING': tf.s...
[ [ "tensorflow.shape", "tensorflow.decode_csv", "tensorflow.as_dtype", "tensorflow.estimator.export.ServingInputReceiver", "tensorflow.constant", "tensorflow.placeholder", "tensorflow.identity", "numpy.dtype" ] ]
alexchungio/IMDB-LSTM
[ "d7a5fbc84a24a2fd7b5fb945cf016e92bf7bcd98" ]
[ "train.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#------------------------------------------------------\n# @ File : train.py\n# @ Description: \n# @ Author : Alex Chung\n# @ Contact : yonganzhong@outlook.com\n# @ License : Copyright (c) 2017-2018\n# @ Time : 2020/9/7 下午2:34\n# @ Software :...
[ [ "tensorflow.keras.preprocessing.sequence.pad_sequences", "tensorflow.compat.v1.model_variables", "tensorflow.compat.v1.summary.FileWriter", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.summary.merge_all", "numpy.asarray", "numpy.zeros", "tensorflow.com...
clairvoyant/GamestonkTerminal
[ "7b40cfe61b32782e36f5de8a08d075532a08c294" ]
[ "gamestonk_terminal/stocks/backtesting/bt_view.py" ]
[ "\"\"\"bt view module\"\"\"\n__docformat__ = \"numpy\"\n\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom pandas.plotting import register_matplotlib_converters\n\nfrom gamestonk_terminal import feature_flags as gtff\nfrom gamestonk_terminal.config_plot import PLOT_DPI\nfr...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.ion", "numpy.seterr", "pandas.plotting.register_matplotlib_converters" ] ]
mschart/iblapps
[ "f7e36ddc102cb003d81e0c75d7871bfc666d7f32" ]
[ "atlaselectrophysiology/plot_data.py" ]
[ "from matplotlib import cm\r\nfrom pathlib import Path\r\nimport numpy as np\r\nimport alf.io\r\nfrom brainbox.processing import bincount2D\r\nfrom brainbox.population import xcorr\r\nimport scipy\r\nfrom PyQt5 import QtGui\r\n\r\nN_BNK = 4\r\nBNK_SIZE = 10\r\nAUTOCORR_BIN_SIZE = 0.25 / 1000\r\nAUTOCORR_WIN_SIZE = ...
[ [ "numpy.quantile", "numpy.median", "numpy.copy", "numpy.min", "numpy.mean", "numpy.where", "numpy.apply_along_axis", "numpy.max", "numpy.divide", "numpy.empty", "numpy.seterr", "numpy.take", "numpy.arange", "numpy.log10", "numpy.vstack", "numpy.array"...
cooper-sloan/PATEC
[ "422e0b039d87e68b7aee98b89e4747953cab31dd" ]
[ "train_netflix_teachers.py" ]
[ "import deep_recommender as dr\nimport tensorflow as tf\nimport torch\nfrom DeepRecommender.reco_encoder.data import input_layer, new_input_layer\nfrom DeepRecommender.reco_encoder.model import model\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import MultiStepLR\nimport torch.nn as nn\nfrom torch.au...
[ [ "torch.nn.Dropout", "torch.autograd.Variable", "torch.optim.lr_scheduler.MultiStepLR", "torch.load", "torch.Tensor.item", "torch.nn.DataParallel" ] ]
Mikma03/Optimization_in_Machine_Learning
[ "257d0455d4ae0b4fc7a762eda841a16611c49000", "257d0455d4ae0b4fc7a762eda841a16611c49000" ]
[ "Books/code/chapter_30/13_kfold_xgboost.py", "Books/code/chapter_14/17_sine.py" ]
[ "# xgboost with default hyperparameters for binary classification\nfrom numpy import mean\nfrom numpy import std\nfrom sklearn.datasets import make_classification\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.model_selection import RepeatedStratifiedKFold\nfrom xgboost import XGBClassifier\n# d...
[ [ "numpy.mean", "sklearn.model_selection.RepeatedStratifiedKFold", "numpy.std", "sklearn.model_selection.cross_val_score", "sklearn.datasets.make_classification" ], [ "numpy.sin", "scipy.optimize.curve_fit", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib....
sjwsl/taichi
[ "5211ec6c8f803d57327100b2aa1534740f86860d" ]
[ "python/taichi/lang/mesh.py" ]
[ "import json\n\nimport numpy as np\nfrom taichi._lib import core as _ti_core\nfrom taichi.lang import impl\nfrom taichi.lang.enums import Layout\nfrom taichi.lang.exception import TaichiSyntaxError\nfrom taichi.lang.field import Field, ScalarField\nfrom taichi.lang.matrix import MatrixField, _IntermediateMatrix\nfr...
[ [ "numpy.array" ] ]
ashigirl96/stable-baselines
[ "0c3478eb9917c0357131913215df7abca6c8d566" ]
[ "stable_baselines/common/tf_util.py" ]
[ "import copy\nimport os\nimport functools\nimport collections\nimport multiprocessing\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.client import device_lib\n\nfrom stable_baselines import logger\n\n\ndef switch(condition, then_expression, else_expression):\n \"\"\"\n Switches between...
[ [ "tensorflow.get_default_session", "tensorflow.nn.conv2d", "tensorflow.group", "tensorflow.gradients", "tensorflow.reshape", "tensorflow.clip_by_norm", "tensorflow.zeros_like", "tensorflow.cast", "tensorflow.InteractiveSession", "tensorflow.train.Saver", "tensorflow.glob...
drichardson/examples
[ "d8b285db4ad1cfd9a92091deab2eb385748f97c8" ]
[ "python/scipy/ode2.py" ]
[ "# Following along to https://www.youtube.com/watch?v=VV3BnroVjZo\n#\n# Example 2: Pass additional arguments to model\n#\nimport numpy as np\nfrom scipy.integrate import odeint\nimport matplotlib.pyplot as plt\n\n# function that returns dy/dt\ndef model(y, t, k):\n dydt = -k * y\n return dydt\n\n# initial con...
[ [ "scipy.integrate.odeint", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace" ] ]
ikergarcia1996/jiant-v1-legacy
[ "d1b5204bde2f03067e3f5176b6eedb8f03dc17fb" ]
[ "jiant/evaluate.py" ]
[ "\"\"\" Helper functions to evaluate a model on a dataset \"\"\"\nimport json\nimport logging as log\nimport os\nimport time\nfrom collections import defaultdict\nfrom csv import QUOTE_MINIMAL, QUOTE_NONE\nfrom typing import Dict, Iterable, List, Sequence, Tuple\n\nimport pandas as pd\nimport torch\nfrom allennlp.n...
[ [ "torch.stack", "pandas.DataFrame", "torch.no_grad", "torch.FloatTensor", "pandas.concat" ] ]
hengwei-chan/3D_SBDD
[ "eda6d51aaf01ef25581a46920a25161678fab76d" ]
[ "models/sample.py" ]
[ "import random\nimport torch\nimport numpy as np\nfrom torch.nn import functional as F\nfrom torch_geometric.data import Batch\nfrom tqdm.auto import tqdm\nfrom sklearn.cluster import DBSCAN, KMeans, OPTICS\n\nfrom .common import split_tensor_by_batch, concat_tensors_to_batch\n\n\nDEFAULT_FOLLOW_BATCH = ['protein_e...
[ [ "torch.rand", "torch.cat", "torch.cos", "torch.arccos", "torch.sin", "torch.arange", "numpy.sum", "torch.no_grad", "sklearn.cluster.KMeans", "torch.repeat_interleave", "numpy.mean", "torch.randn_like", "sklearn.cluster.DBSCAN", "torch.full" ] ]
iamDecode/scipy
[ "ed587fb097eeceb1cc8c804a659cc18347b28f22" ]
[ "scipy/optimize/_minimize.py" ]
[ "\"\"\"\nUnified interfaces to minimization algorithms.\n\nFunctions\n---------\n- minimize : minimization of a function of several variables.\n- minimize_scalar : minimization of a function of one variable.\n\"\"\"\n\n__all__ = ['minimize', 'minimize_scalar']\n\n\nfrom warnings import warn\n\nimport numpy as np\n\...
[ [ "numpy.zeros_like", "numpy.array", "numpy.asarray", "numpy.any", "numpy.atleast_1d", "numpy.atleast_2d" ] ]
qboticslabs/dragonfly
[ "f5166a2c6afa6a95ab05353b62a58f09d33874d4" ]
[ "dragonfly/distributions/unittest_continuous.py" ]
[ "\"\"\"\n Unit tests for continuous distributions.\n -- kvysyara@andrew.cmu.edu\n\"\"\"\nfrom __future__ import absolute_import\n\n# pylint: disable=no-self-use\n\nimport numpy as np\nimport warnings\n\n# Local imports\nfrom .continuous import Beta, ContinuousUniform, Exponential, \\\n ...
[ [ "numpy.cov", "numpy.mean", "numpy.identity", "numpy.arange", "numpy.var" ] ]
rolando-contribute/dask
[ "a7e7ef16475e0486f3d3e8e80016f9a23f62c710" ]
[ "dask/utils.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nfrom collections import Iterator\nfrom contextlib import contextmanager\nfrom errno import ENOENT\nimport functools\nimport io\nimport os\nimport sys\nimport shutil\nimport struct\nimport tempfile\nimport inspect\nimport codecs\nimport math\nfrom ...
[ [ "numpy.empty", "numpy.random.RandomState", "numpy.allclose", "numpy.cumsum", "numpy.iinfo" ] ]
fastscape-lem/ipyfastscape
[ "d430ae66d510d4cb16005299603681686b33c55d" ]
[ "src/ipyfastscape/tests/conftest.py" ]
[ "import numpy as np\nimport pytest\nimport xarray as xr\n\nfrom ipyfastscape.xr_accessor import WidgetsAccessor # noqa: F401\n\n\n@pytest.fixture\ndef dataset() -> xr.Dataset:\n x = np.array([0, 1, 2])\n y = np.array([0, 1, 2])\n time = np.array([0, 100, 200])\n batch = np.array([1, 2, 3])\n\n eleva...
[ [ "numpy.array", "numpy.ones_like" ] ]
goodhamgupta/EpidemiOptim
[ "a4fe3fcfc2d82a10db16a168526982c03ca2c8d3" ]
[ "epidemioptim/environments/gym_envs/epidemic_discrete.py" ]
[ "import numpy as np\nimport gym\nfrom epidemioptim.environments.gym_envs.base_env import BaseEnv\n\n\nclass EpidemicDiscrete(BaseEnv):\n def __init__(\n self,\n cost_function,\n model,\n simulation_horizon,\n ratio_death_to_R=0.005, # death ratio among people who were infected...
[ [ "numpy.product", "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.sum", "numpy.random.randint", "numpy.arange", "numpy.atleast_2d" ] ]
marco-cardoso/pandas-profiling
[ "e7ea34547087d5ecf792604efb57facee2ec609a" ]
[ "pandas_profiling/model/base.py" ]
[ "\"\"\"Common parts to all other modules, mainly utility functions.\"\"\"\nimport sys\n\nimport pandas as pd\nfrom enum import Enum, unique\nfrom urllib.parse import urlparse\n\n\nfrom pandas_profiling.config import config\nfrom pandas_profiling.utils.data_types import str_is_path\n\n\n@unique\nclass Variable(Enum)...
[ [ "pandas.api.types.is_bool_dtype", "pandas.api.types.is_datetime64_dtype", "pandas.api.types.is_numeric_dtype" ] ]
pulasthi/twister2
[ "40b73bdf7dcb778d957c3f146baf825a97dceae5" ]
[ "deeplearning/pytorch/src/main/python/examples/twister2worker.py" ]
[ "import numpy as np\nimport mpi4py\nimport torch\n\nmpi4py.rc(initialize=False, finalize=False)\nfrom mpi4py import MPI\n\nMPI.Init()\n\ncomm = MPI.COMM_WORLD\nparent = comm.Get_parent()\nworld_rank = parent.Get_rank()\nworld_size = parent.Get_size()\n\nrecv_data = np.array([0, 0, 0, 0], dtype=\"i\")\nif world_rank...
[ [ "numpy.array", "numpy.ones", "torch.from_numpy" ] ]
anairabeze/simfempy
[ "144362956263cb9b81f4bade15664d9cc640f93a" ]
[ "simfempy/tools/analyticalfunction.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\n\"\"\"\n\nimport numpy as np\nimport sympy\n\n\n#=================================================================#\nclass AnalyticalFunction():\n \"\"\"\n computes numpy vectorized functions for the function and its dericatives up to two\n for a given expression, deriv...
[ [ "numpy.linspace", "numpy.random.rand" ] ]
atksh/datasets
[ "814058b31ebd99e418114016d60ab4d6f8f82070" ]
[ "tensorflow_datasets/image/places365_small.py" ]
[ "# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets 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 ...
[ [ "tensorflow.io.gfile.GFile" ] ]