repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
vadimkantorov/pydlpack
[ "c7194bd7364f58ce26fda9af14d0a7063cd162b4" ]
[ "dlpack.py" ]
[ "import ctypes\n\nclass DLDeviceType(ctypes.c_int):\n\tkDLCPU = 1\n\tkDLGPU = 2\n\tkDLCPUPinned = 3\n\tkDLOpenCL = 4\n\tkDLVulkan = 7\n\tkDLMetal = 8\n\tkDLVPI = 9\n\tkDLROCM = 10\n\tkDLExtDev = 12\n\nclass DLDataTypeCode(ctypes.c_uint8):\n\tkDLInt = 0\n\tkDLUInt = 1\n\tkDLFloat = 2\n\tkDLBfloat = 4\n\n\tdef __str_...
[ [ "numpy.asarray" ] ]
webertim/ray
[ "f21092e80a962b4479ad4fc7c267c37088acc593" ]
[ "python/ray/tests/test_object_spilling.py" ]
[ "import copy\nimport json\nimport platform\nimport random\nimport sys\nfrom datetime import datetime, timedelta\n\nimport numpy as np\nimport pytest\nimport ray\nfrom ray.tests.conftest import (\n file_system_object_spilling_config,\n buffer_object_spilling_config,\n mock_distributed_fs_object_spilling_con...
[ [ "numpy.random.rand", "numpy.array_equal", "numpy.zeros" ] ]
tzmhuang/vehicle_longitudinal_calibration
[ "85850feccb4163bcfbc5c3f187fe0ad3f19f2e17" ]
[ "LearningAlgorithms/throttle_3LdenseNN_sigmoid_MSE.py" ]
[ "import os, sys\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nimport util\n\n#CONFIGS\nmodel_name_ = 'throttle_3LdenseNN_sigmoid_MSE'\ndir_path_ = os.path.dirname(os.path.realpath(__file__))\nda...
[ [ "tensorflow.matmul", "numpy.min", "numpy.mean", "tensorflow.sqrt", "tensorflow.global_variables_initializer", "numpy.max", "tensorflow.Variable", "tensorflow.train.Saver", "numpy.arange", "numpy.array", "tensorflow.train.AdamOptimizer", "matplotlib.pyplot.title", ...
walzimmer/donkey
[ "b73596400040ce881c0a319b0a4cc3cbd05226da", "b73596400040ce881c0a319b0a4cc3cbd05226da" ]
[ "donkeycar/templates/train.py", "donkeycar/parts/camera_test.py" ]
[ "#!/usr/bin/env python3\r\n\"\"\"\r\nScripts to train a keras model using tensorflow.\r\nUses the data written by the donkey v2.2 tub writer,\r\nbut faster training with proper sampling of distribution over tubs. \r\nHas settings for continuous training that will look for new files as it trains. \r\nModify on_best_...
[ [ "tensorflow.set_random_seed", "numpy.array", "tensorflow.get_default_graph", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "tensorflow.ConfigProto", "matplot...
kangxue/P2P-NET
[ "8f6ebc0ecad0eeba61e78371f9e5e33777c52608" ]
[ "run.py" ]
[ "import argparse\nimport subprocess\nimport tensorflow as tf\nimport numpy as np\nfrom datetime import datetime\nimport json\nimport os\nimport sys\nimport datetime\nimport time\nimport collections\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\n\nimport P2PNET\nimport ioUtil\n\...
[ [ "numpy.concatenate", "numpy.array", "tensorflow.Graph", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.ConfigProto", "tensorflow.summary.FileWriter", "tensorflow.global_variables_initializer" ] ]
GLO3013-E4/COViRondelle2021
[ "f8d23903d0a906e93a7698a555d90ebecdf83969" ]
[ "station/robot_goal_and_obstacle_finder/detection/utils/track_bar_color.py" ]
[ "import cv2\nimport numpy as np\nimport stack_images\n\n\nclass TrackBarDetection:\n\n def on_track_bar_change(self, value):\n print(self, value)\n\n def start_track_bar(self):\n cv2.namedWindow(\"TrackBars\")\n cv2.resizeWindow(\"TrackBars\", 640, 240)\n cv2.createTrackbar(\"Hue M...
[ [ "numpy.array", "numpy.clip" ] ]
qurator-spk/sbb_ocr_postcorrection
[ "45e498108ca5ed459d0e5575cf59c83a76bb8a80", "45e498108ca5ed459d0e5575cf59c83a76bb8a80" ]
[ "qurator/sbb_ocr_postcorrection/feature_extraction/cli_feature.py", "qurator/sbb_ocr_postcorrection/helpers.py" ]
[ "import click\nimport io\nimport json\nimport numpy as np\nimport os\n\nfrom .encoding import add_padding, create_encoding_mappings, encode_sequence, find_longest_sequence, vectorize_encoded_sequences\nfrom .tokenization import WordpieceTokenizer\nfrom .wordpiece import WordpieceVocabGenerator\n\nfrom qurator.sbb_o...
[ [ "numpy.save" ], [ "matplotlib.pyplot.switch_backend", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure" ] ]
UTS-AAi/accelerated-gfmm
[ "7c04bcaf5eeeeade031736376a15ffee8ffafbfe" ]
[ "functionhelper/measurehelper.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat May 4 13:14:44 2019\n\n@author: Thanh Tung Khuat\n\nThis is a file to define all utility functions for measuring the performance \n\"\"\"\n\nfrom sklearn.preprocessing import LabelBinarizer\nfrom sklearn.metrics import roc_auc_score\n\n\ndef multiclass_roc_auc_score...
[ [ "sklearn.preprocessing.LabelBinarizer", "sklearn.metrics.roc_auc_score" ] ]
ozgurkara99/ISNAS-DIP
[ "bfe3c41459f8803de552a2549266074b84fe1e17" ]
[ "utils/funcs.py" ]
[ "import math\nfrom typing import Any, Optional, Dict, Callable, Tuple\n\nimport numpy as np\nfrom numpy.fft import fft2, fftshift\n\nfrom scipy.stats import wasserstein_distance\n\nfrom . import common_utils as cu\nfrom . import basic_utils as bu\nfrom . import image_utils as imu\nfrom .data_structures import Tree,...
[ [ "numpy.max", "numpy.histogram", "scipy.stats.wasserstein_distance", "numpy.log10", "numpy.fft.fft2", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.random.randn", "numpy.mean", "numpy.float64", "numpy.stack", "numpy.abs", "numpy.fft.fftshift", "numpy.li...
trislaz/SimCLR
[ "d7c8950a1afc8adad4e617e7ecd90a0d3828740f" ]
[ "modules/lars.py" ]
[ "\"\"\"\nLARS: Layer-wise Adaptive Rate Scaling\n\nConverted from TensorFlow to PyTorch\nhttps://github.com/google-research/simclr/blob/master/lars_optimizer.py\n\"\"\"\n\nimport torch\nfrom torch.optim.optimizer import Optimizer, required\nimport re\n\nEETA_DEFAULT = 0.001\n\nclass LARS(Optimizer):\n \"\"\"\n ...
[ [ "torch.zeros_like", "torch.norm", "torch.Tensor" ] ]
bluetyson/uncover-ml
[ "22ca6361b25a119dd8fab1f3d50475df70b35170" ]
[ "uncoverml/krige.py" ]
[ "import numpy as np\n# import warnings\nimport logging\nfrom scipy.stats import norm\nfrom sklearn.base import RegressorMixin, BaseEstimator\nfrom sklearn.metrics import r2_score\n\nfrom pykrige.ok import OrdinaryKriging\nfrom pykrige.uk import UniversalKriging\n\n# from uncoverml.mllog import warn_with_traceback\n...
[ [ "numpy.sum", "numpy.sqrt" ] ]
bzglinicki/Programowanie-I-R
[ "02a63a44bb9eeea2aa7dbbb0ec18c0462d692ef0" ]
[ "Rozwiazania-zadan/2_Seria-II/coviddata.py" ]
[ "# Programowanie I R\r\n# Zadania - seria 2.\r\n# Zadanie 4.\r\n\r\nimport urllib.request\r\nimport shutil\r\nfrom datetime import datetime\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\n#***********************************************************************************\r\n# Pobieranie pliku z danymi\r\n#**********...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
jatin837/PyBaMM
[ "837421bd5b251647a257c23540ceb2908a225bdb", "a31e2095600bb92e913598ac4d02b2b6b77b31c1" ]
[ "tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_compare_outputs.py", "examples/scripts/SPMe_SOC.py" ]
[ "#\n# Tests for the surface formulation\n#\nimport pybamm\nimport numpy as np\nimport unittest\nfrom tests import StandardOutputComparison\n\n\nclass TestCompareOutputs(unittest.TestCase):\n def test_compare_outputs_surface_form(self):\n # load models\n options = [\n {\"surface form\": c...
[ [ "numpy.linspace" ], [ "matplotlib.pyplot.subplots", "numpy.absolute", "matplotlib.pyplot.show", "numpy.linspace", "numpy.around" ] ]
seakers/NN_tutorial
[ "8b6166c87723b84b5844e63282fc04ddf1be406d" ]
[ "data_cleaning.py" ]
[ "import csv\nimport json\nimport os\nimport numpy as np\nimport spacy\nimport keras\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence import pad_sequences\nimport pickle\n\nnlp = spacy.load('en_core_web_sm')\n\n\ndef load_csv_data(filename):\n raw_array = []\n with open(os.pat...
[ [ "numpy.random.seed", "numpy.array", "numpy.reshape" ] ]
diatomicDisaster/neo
[ "1b6a3e1d80a58f561fd8c10ac0b11c13f4645584" ]
[ "readinput.py" ]
[ "import sys\nfrom numpy import pi, array, cos, sin, log10\n\ncases = [\"BODY\", \"SIMULATION\", \"VISUAL\"]\n\n# A dictionary of conversion factors.\nconvert = {\n \"au\" : 1.,\n \"AU\" : 1.,\n \"m\" : 1/149597870700.,\n \"km\" : 1/149597870.7,\n \"mE\" : 1.,\n \"mS\"...
[ [ "numpy.log10", "numpy.array", "numpy.sin", "numpy.cos" ] ]
acordonez/ENSO_metrics
[ "6b5a3c33ec89a5c6de147bf6dc03872a89b9da90" ]
[ "pmp_driver/PMPdriver_plot.py" ]
[ "# -*- coding:UTF-8 -*-\n# ---------------------------------------------------#\n# Aim of the program:\n# Create plots for ENSO_metrics\n# ---------------------------------------------------#\n\n\n# ---------------------------------------------------#\n# Import the right packages\n# ---------------------------...
[ [ "matplotlib.use", "matplotlib.pyplot.ioff" ] ]
joshuaskelly/1000-blades
[ "e5dbc4b608d632200b5f8791905f154865113f37" ]
[ "generate.py" ]
[ "import errno\nimport glob\nimport json\nimport os\nimport random\n\nimport numpy\nimport tracery\nfrom tracery.modifiers import base_english\n\nfrom PIL import Image\n\nfrom extended_english import extended_english\n\ndef calculate_image_possibilities():\n \"\"\"Computes the total possible combinations for swor...
[ [ "numpy.random.seed", "numpy.random.normal", "numpy.random.choice" ] ]
nasimrahaman/neural-interpreter
[ "17d46f0869f44e6a884ae740ba27ed3af4d384c7" ]
[ "neural_interpreters/core/kernels.py" ]
[ "from contextlib import contextmanager\nfrom typing import Optional, Callable\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.distributions as distries\n\n\ndef get_kernel(name):\n return globals()[name]\n\n\nclass Kernel(nn.Module):\n TRUNCATION_IMPLEMENTATIONS = {\"dire...
[ [ "torch.nn.functional.gumbel_softmax", "torch.nn.functional.normalize", "torch.einsum", "torch.no_grad", "torch.distributions.RelaxedBernoulli", "torch.log", "torch.exp", "torch.empty_like" ] ]
LukeKort/OCM
[ "674f73dcfeb86aa58d67fbe0abf8a997dff439a7" ]
[ "app/pso.py" ]
[ "# Particle Swarm (Aug. 04, 2021)\n\nimport time\nimport numpy as np\nimport random as rand\n\ndef pso(\n n_particles,\n n_variables,\n n_iterations,\n tolerance,\n a,\n b,\n pso_only_w,\n pso_only_c1,\n pso_only_c2,\n cdf_type,\n mttf,\n c_m,\n c_r,\n c_inc,\n t_ser,\n ...
[ [ "numpy.empty", "numpy.zeros" ] ]
m-toman/Tacotron-2
[ "8767a29b0421e88069b82a858340e1acb12394ff" ]
[ "wavenet_vocoder/models/modules.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom wavenet_vocoder.util import sequence_mask\n\nfrom .gaussian import gaussian_maximum_likelihood_estimation_loss\nfrom .mixture import discretized_mix_logistic_loss\n\n\nclass Embedding:\n\t\"\"\"Embedding class for global conditions.\n\t\"\"\"\n\tdef __init__(self, ...
[ [ "tensorflow.constant_initializer", "tensorflow.reshape", "tensorflow.nn.moments", "tensorflow.sqrt", "tensorflow.nn.embedding_lookup", "tensorflow.nn.tanh", "tensorflow.identity", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.shape", "tensorflow.nn.leaky...
Kaminyou/DeepImplicitTemplates
[ "cb6b65c198cdce2851c24e181f444864c61a8689" ]
[ "reconstruct_deep_implicit_templates.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2004-present Facebook. All Rights Reserved.\n\nimport argparse\nimport json\nimport logging\nimport os\nimport random\nimport time\nimport torch\nimport numpy as np\n\nimport deep_sdf\nimport deep_sdf.workspace as ws\n\n\ndef reconstruct(\n decoder,\n num_iterations,\n ...
[ [ "torch.zeros", "torch.var", "torch.cat", "numpy.random.seed", "torch.no_grad", "torch.optim.Adam", "torch.randperm", "torch.clamp", "torch.nn.L1Loss", "torch.random.manual_seed", "torch.ones", "torch.load", "torch.mean", "torch.nn.DataParallel" ] ]
pren1/keras_transformer_for_colab
[ "4862a113e75202fbc31523fae7f9121373518b36" ]
[ "keras_multi_head/scaled_dot_attention.py" ]
[ "import tensorflow.keras as keras\nimport tensorflow.keras.backend as K\n\n\nclass ScaledDotProductAttention(keras.layers.Layer):\n r\"\"\"The attention layer that takes three inputs representing queries, keys and values.\n\n \\text{Attention}(Q, K, V) = \\text{softmax}(\\frac{Q K^T}{\\sqrt{d_k}}) V\n\n Se...
[ [ "tensorflow.keras.backend.expand_dims", "tensorflow.keras.backend.sum", "tensorflow.keras.backend.epsilon", "tensorflow.keras.backend.arange", "tensorflow.keras.backend.batch_dot", "tensorflow.keras.backend.floatx", "tensorflow.keras.backend.shape", "tensorflow.keras.backend.max" ...
ddodds42/DS-Unit-3-Sprint-2-SQL-and-Databases
[ "0bcfa6fcd0fa9cc2d37b85b54d528679bc43f485" ]
[ "module1-introduction-to-sql/DAVID_DODDS_3_2_1_ rpg_queries.py" ]
[ "import sqlite3 as sql\nimport pandas as pd\n\nconn = sql.connect('rpg_db.sqlite3')\nprint('Connection: ', conn)\n\ncurs = conn.cursor()\nprint('Cursor: ', curs, '\\n')\n\n# Question 1: How many total Characters are there?\nquery = '''\nSELECT\ncount (distinct character_id)\nFROM charactercreator_character;\n'''\n\...
[ [ "pandas.DataFrame" ] ]
Mgosi/StackGAN-Text-to-Photo-Realistic-Image-Synthesis
[ "3198f577c2bc0d507575d8d8dd9752dee215618a" ]
[ "training.py" ]
[ "import torch, os, time, numpy as np\nimport torch.nn as nn\nimport torch.optim as optim\nfrom initValues import config\nfrom helper import GanHelper\nfrom tensorboard import summary\nimport datetime\nfrom torch.autograd import Variable\n\nclass Trainer(object):\n def __init__(self, outDir):\n self.curren...
[ [ "torch.autograd.Variable", "torch.rand", "torch.FloatTensor" ] ]
Williamspencer519/magenta_clone
[ "a298c2a11cccc20883d78d8a5314066ab017e44d" ]
[ "magenta/music/encoder_decoder.py" ]
[ "# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.random.choice", "numpy.log" ] ]
jlopezNEU/scikit-learn
[ "593495eebc3c2f2ffdb244036adf57fab707a47d", "593495eebc3c2f2ffdb244036adf57fab707a47d" ]
[ "sklearn/calibration.py", "sklearn/ensemble/_gb.py" ]
[ "\"\"\"Calibration of predicted probabilities.\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Balazs Kegl <balazs.kegl@gmail.com>\n# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>\n# Mathieu Blondel <mathieu@mblondel.org>\n#\n# License: BSD 3 clause\n\n...
[ [ "numpy.divide", "numpy.zeros_like", "numpy.dot", "numpy.array", "numpy.sum", "numpy.percentile", "scipy.special.expit", "scipy.optimize.fmin_bfgs", "matplotlib.pyplot.subplots", "numpy.digitize", "scipy.special.xlogy", "numpy.linspace", "numpy.unique", "nump...
Woodyet/keras-surgeon
[ "45f70bbeafe9dee37f0cb62066a7de1ca228d0a0" ]
[ "tests/test_utils.py" ]
[ "from tensorflow.keras.layers import (\n Conv2D,\n Activation,\n MaxPool2D,\n Flatten,\n Dense,\n Input,\n)\nfrom tensorflow.keras.models import Sequential\nimport numpy as np\nimport pytest\n\nfrom kerassurgeon.utils import (\n find_activation_layer,\n get_shallower_nodes,\n MeanCalculat...
[ [ "numpy.array", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.models.Sequential" ] ]
dr-benway/RevGAN
[ "fcaf4f837a58f20f787e442914d68194325c2ca6" ]
[ "scripts/evaluate_testcube.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport os\n\nimport argparse \nfrom sklearn.metrics import mean_absolute_error as compare_mae\nfrom skimage.measure import compare_psnr\nfrom skimage.measure import compare_ssim\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--result_dir\", type=str, require...
[ [ "numpy.std", "numpy.load", "numpy.mean" ] ]
TurgayPamuklu/GreenRAN
[ "9fb61ba709ab171e0d85def1b89caa72a9cfe312" ]
[ "green/baseStation.py" ]
[ "\"\"\"Base Station Module.\nThe Classes in this module are responsible for simulating a base station.\n\n\"\"\"\n\nimport numpy as np\n\nfrom constants import *\n\n\nclass Transmitter:\n \"\"\"This class represents the transmitter of a base station.\n\n * It is created by the CityGenerator Class at its initi...
[ [ "numpy.around", "numpy.log10", "numpy.sqrt" ] ]
mmlab-cv/Agglomerator
[ "441bbd126f03c5018556b622228ba967e18766f9" ]
[ "src/utils.py" ]
[ "import math\nfrom typing import Tuple\nfrom einops.einops import reduce, rearrange\nimport torch.nn as nn\nimport torch\nfrom functools import partial\nfrom einops.layers.torch import Rearrange\nfrom pytorch_lightning.callbacks.early_stopping import EarlyStopping\nimport pytorch_lightning as pl\nfrom typing import...
[ [ "torch.nn.Linear", "torch.device", "torch.sin", "torch.max", "torch.arange", "torch.unbind", "torch.eq", "torch.matmul", "numpy.arange", "numpy.power", "torch.ones_like", "torch.eye", "matplotlib.pyplot.show", "numpy.meshgrid", "torch.exp" ] ]
khodges42/tensorflow
[ "cb011e1dd8d79757fea01be39e19cb1155681e7e" ]
[ "tensorflow/contrib/distribute/python/combinations.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.eager.context.graph_mode", "tensorflow.contrib.distribute.python.one_device_strategy.OneDeviceStrategy", "tensorflow.contrib.tpu.python.tpu.device_assignment.DeviceAssignment", "tensorflow.python.keras.optimizer_v2.adam.Adam", "tensorflow.python.eager.context.eager_mode", ...
wverastegui/galaxytools
[ "95aa7106676770077d027cc67ea35ec3c15f71ea" ]
[ "tools/query/query.py" ]
[ "import json\r\nfrom typing import Tuple\r\n\r\nimport click\r\nimport pandas\r\nimport pandasql\r\nfrom pandas import DataFrame\r\n\r\n\r\ndef read(path: str, filetype: str, name: str) -> Tuple[str, DataFrame]:\r\n if filetype == 'csv':\r\n return name, pandas.read_csv(path)\r\n elif filetype in ('tsv...
[ [ "pandas.read_table", "pandas.read_sql", "pandas.read_hdf", "pandas.HDFStore", "pandas.read_csv", "pandas.read_parquet", "pandas.read_feather" ] ]
GunnerStone/AlgonautsChallenge_Fall2021
[ "c9d0b288dd3896ffeac4934423f47e43eea85c17" ]
[ "BDCN/datasets/dataset.py" ]
[ "import os\nimport cv2\nimport numpy as np\nfrom PIL import Image\nimport scipy.io\nimport torch\nfrom torch.utils import data\nimport random\nfrom io import StringIO\nfrom io import BytesIO\n\ndef load_image_with_cache(path, cache=None, lock=None):\n\tif cache is not None:\n\t\tif path not in cache:\n\t\t\twith op...
[ [ "numpy.array" ] ]
dafeda/DAPPER
[ "fc4ae95a3eb7c65387616f988b75559a9eacc048" ]
[ "dapper/mods/Lorenz96/spectral_obs.py" ]
[ "\"\"\"Settings for a \"spectral\" obs operator.\n\nLorenz-96 is highly sensitive to large gradients.\nTherefore, if we only observe every 4th (e.g.) state component,\nthe members might \"blow up\" during the forecast,\nbecause the assimilation created large gradients.\n(Of course, this will depend on R and dto).\n...
[ [ "numpy.sin", "numpy.zeros", "numpy.eye", "numpy.sqrt", "numpy.linspace" ] ]
Ninad-Chaudhari/models
[ "c739f883dd6221b965698a9845f46aadc962baa3" ]
[ "official/vision/beta/serving/semantic_segmentation_test.py" ]
[ "# Copyright 2021 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.TensorSpec", "tensorflow.train.BytesList", "tensorflow.zeros", "numpy.zeros", "tensorflow.constant", "tensorflow.test.main", "tensorflow.saved_model.save", "tensorflow.saved_model.load" ] ]
Remit/autoscaling-simulator
[ "091943c0e9eedf9543e9305682a067ab60f56def", "091943c0e9eedf9543e9305682a067ab60f56def" ]
[ "autoscalingsim/scaling/policiesbuilder/metric/forecasting/models/ssa.py", "experimentgenerator/experiment_generator.py" ]
[ "import warnings\nimport pandas as pd\nimport pymssa # https://github.com/kieferk/pymssa\n\nfrom autoscalingsim.scaling.policiesbuilder.metric.forecasting.forecasting_model import ForecastingModel\nfrom autoscalingsim.utils.error_check import ErrorChecker\n\n@ForecastingModel.register('ssa')\nclass SingularSpectrum...
[ [ "pandas.DataFrame" ], [ "pandas.Timedelta" ] ]
aTeK7/deep-stereo1.4
[ "dd2150097d0ed1c05791e4d80cf9b404f98a6880" ]
[ "reprojection/test_reprojection.py" ]
[ "import numpy as np\nnp.set_printoptions(suppress=True)\nimport unittest\nfrom reprojection import Reprojection\nfrom camera import Camera\nfrom PIL import Image\n\nclass ReprojectionTest(unittest.TestCase):\n\n def test_reproject_back(self):\n\n srcCam = Camera(\n intrinsics=np.array([\n ...
[ [ "numpy.set_printoptions", "numpy.array", "numpy.eye" ] ]
Skylarkin/PySyft
[ "f49e0a715722ad883f18d0c5f4d580b6ecd33e22" ]
[ "packages/syft/src/syft/core/tensor/autograd/backward_ops/pow.py" ]
[ "# stdlib\nimport uuid\n\n# third party\nimport numpy as np\n\n# relative\nfrom ...passthrough import is_acceptable_simple_type # type: ignore\nfrom ..tensor import AutogradTensor\nfrom .op import Op\n\n\nclass PowOp(Op):\n def forward(self, x: AutogradTensor, y: AutogradTensor) -> AutogradTensor: # type: igno...
[ [ "numpy.log" ] ]
yadala1998/Polygon-Computation-and-Triangulation
[ "000d61f90ebff46f8e8d2073b6a89f02e53f0ddf" ]
[ "triangulation.py" ]
[ "from reconstruction import Polygon\nimport matplotlib.pyplot as plt\nfrom collections import namedtuple\nimport sys\n\n\ndef main(expression, bounds, seg_length):\n p = Polygon(expression, bounds, seg_length)\n pts = p.get_pts()\n triangles = earclip(pts)\n for t in triangles:\n plt.plot([t[0][0...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
rheiland/pc4cancerimmune3D
[ "c59e866694985191e68790bb965e401c6c9b336a" ]
[ "bin/substrates.py" ]
[ "# substrates Tab\n\nimport os, math\nfrom pathlib import Path\nfrom shutil import copyfile\nfrom ipywidgets import Layout, Label, Text, Checkbox, Button, BoundedIntText, HBox, VBox, Box, \\\n FloatText, Dropdown, interactive\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import BoundaryNorm\nfrom mat...
[ [ "numpy.array", "matplotlib.pyplot.xlim", "matplotlib.ticker.MaxNLocator", "matplotlib.collections.PatchCollection", "numpy.broadcast", "matplotlib.colors.to_rgb", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.fabs", "numpy.issca...
marisanest/privacy-evaluator
[ "f0b9ad41270bea81255418743cf15a3b46fb5e1d" ]
[ "demo/train-cifar10-torch/data.py" ]
[ "import os\nimport torch\nimport torchvision\nimport numpy as np\nfrom typing import Tuple, Dict, Union, Optional\n\n\ndef dataset_downloader(\n dataset_name: str = \"CIFAR10\",\n) -> Tuple[torch.utils.data.Dataset, torch.utils.data.Dataset]:\n \"\"\"\n Download the corresponding dataset, skip if already d...
[ [ "torch.utils.data.ConcatDataset", "torch.utils.data.dataset.Subset", "torch.tensor", "numpy.where" ] ]
EnguerranVidal/Turbulent-Convection-with-Dedalus
[ "b8b0cc0782832802a67ec57283d52d0c18b997cf" ]
[ "plot_files.py" ]
[ "# plot_files.py\n\n# IMPORTS --------------------------------------------------\n# We first import the necessary libraries like mentionned.\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# FUNCTIONS -------------------------------------------\n\ndef plot_convection_file(Ra,Pr,Ta,Np):\n ''' Extracts...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xscale", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.draw", "matplotlib.pyplot.pause", "matplotlib.pyplot.ylabel...
dcaglayan/FINE
[ "17fa94cf4925f3fa3f087c88cce60b65da41d496" ]
[ "FINE/utils.py" ]
[ "\"\"\"\nLast edited: May 13 2018\n\n@author: Lara Welder\n\"\"\"\nimport warnings\nimport pandas as pd\n\n\ndef isString(string):\n \"\"\" Checks if the input argument is a string \"\"\"\n if not type(string) == str:\n raise TypeError(\"The input argument has to be a string\")\n\n\ndef equalStrings(re...
[ [ "pandas.DataFrame", "pandas.Series", "pandas.concat" ] ]
alexvishnevskiy/jigsaw
[ "7fc2c4cd3700a54e9c5cbc02870bf4057b0a9fe3" ]
[ "jigsaw/models/cnn_models/lightning_models.py" ]
[ "from ..base_module import RegressionModel, PairedModel\nfrom .base_model import CnnModel\nimport torch.nn as nn\n\n\nclass RegressionCnnModel(RegressionModel):\n def __init__(self, cfg, train_df = None, val_df = None, test_df = None):\n super().__init__(cfg, CnnModel(cfg), train_df, val_df, test_df)\n\n def f...
[ [ "torch.nn.MarginRankingLoss" ] ]
tuannamnguyen93/NMTGMinor
[ "acde3454343bda7060fae541c110d0ad1a8ac4f4" ]
[ "onmt/data/indexed_dataset.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport os\nimport stru...
[ [ "numpy.array", "numpy.copyto", "numpy.empty", "torch.from_numpy" ] ]
jennapederson/retail-demo-store
[ "87302caa2011109d9b4fdd0ee950243e76dfd24d" ]
[ "generators/datagenerator/users.py" ]
[ "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: MIT-0\n\nimport random\nimport datetime\nimport uuid\nimport json\nimport numpy as np\nimport gzip\nimport codecs\nimport bisect\nfrom faker import Faker\nfrom faker.providers import internet\nfrom faker.providers impo...
[ [ "scipy.stats.truncnorm" ] ]
jbeilstenedmands/cctbx_project
[ "c228fb15ab10377f664c39553d866281358195aa" ]
[ "mmtbx/validation/omegalyze.py" ]
[ "from __future__ import division\nfrom mmtbx.validation import residue, validation, atom\nimport iotbx.phil\nimport os.path\nfrom libtbx import slots_getstate_setstate\nimport numpy\nimport os, sys\n\nfrom mmtbx.conformation_dependent_library import generate_protein_fragments\n\n####################################...
[ [ "numpy.sin", "numpy.dot" ] ]
cai-yuqing/IA-flood-risk-129
[ "35d01feea31c7d1f1d6d37847ed508e7b6ac8cc1" ]
[ "floodsystem/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n# from.analysis import polyfit\nimport matplotlib\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n#Task 2E\ndef plot_water_levels(station, dates, levels):\n plt.plot(dates, levels)\n plt.xlabel('date')\n plt.ylabel('water level (m)')\n plt....
[ [ "numpy.poly1d", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "numpy.polyfit", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.dates.date2num", "matplotlib.pyplot.xt...
choasup/mmdetection
[ "72f6c5976e111e5160c77c210ec033257fec2de0" ]
[ "mmdet/models/roi_heads/transformer_roi_head.py" ]
[ "import torch\nfrom torch import nn\n\nfrom mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler\nfrom ..builder import HEADS, build_head, build_roi_extractor\nfrom .base_roi_head import BaseRoIHead\nfrom .test_mixins import BBoxTestMixin, MaskTestMixin\n\nfrom .roi_extractors.transformer_roi_extr...
[ [ "torch.nn.Linear", "torch.nn.Conv2d", "torch.nn.Embedding" ] ]
ThomasEgi/svox2
[ "a7bc133de968b869aebe26f8e9962586f4245a67" ]
[ "opt/opt.py" ]
[ "# Copyright 2021 Alex Yu\n\n# First, install svox2\n# Then, python opt.py <path_to>/nerf_synthetic/<scene> -t ckpt/<some_name>\n# or use launching script: sh launch.sh <EXP_NAME> <GPU> <DATA_DIR>\nimport torch\nimport torch.cuda\nimport torch.optim\nimport torch.nn.functional as F\nimport svox2\nimport json\nimp...
[ [ "numpy.concatenate", "numpy.random.seed", "torch.no_grad", "torch.from_numpy", "torch.manual_seed", "torch.nn.functional.mse_loss", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter" ] ]
Verose/NLP_CLPSYCH
[ "556d7e9741deaf23f58003de74eff32f792ab0d8" ]
[ "cosine_similarity/utils.py" ]
[ "import os\nimport string\n\nimport pandas as pd\n\nif not os.name == 'nt':\n import matplotlib\n matplotlib.use('agg')\nfrom matplotlib import pyplot as plt\n\nfrom common.utils import remove_females, remove_depressed, DATA_DIR, OUTPUTS_DIR\n\n\ndef get_medical_data(clean_data=False):\n medical_data = pd....
[ [ "matplotlib.use", "pandas.set_option", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.yticks", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "pandas.conca...
hivecell-io/federated_learning
[ "e251bfa65c32abd83359c2b6847b9d0b62c4f5c3" ]
[ "examples/tutorials/advanced/websockets_mnist/run_websocket_client.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as f\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nimport logging\nimport argparse\nimport sys\n\nimport syft as sy\nfrom syft.workers.websocket_client import WebsocketClientWorker\nfrom syft.workers.virtual import Virtua...
[ [ "torch.nn.Linear", "torch.device", "torch.no_grad", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.nn.functional.nll_loss", "torch.nn.functional.max_pool2d" ] ]
pyvista/pyvista
[ "cb31edb71be38aac3cb601917f2f26813b1fce9a" ]
[ "tests/test_common.py" ]
[ "# TODO: This file really should be named test_dataset.py\n\nimport pickle\n\nfrom hypothesis import HealthCheck, assume, given, settings\nfrom hypothesis.extra.numpy import array_shapes, arrays\nfrom hypothesis.strategies import composite, floats, integers, one_of\nimport numpy as np\nimport pytest\nimport vtk\nfr...
[ [ "numpy.isinf", "numpy.array", "numpy.isnan", "numpy.empty", "numpy.random.rand", "numpy.zeros", "numpy.sin", "numpy.ones", "numpy.hstack", "numpy.eye", "numpy.allclose", "numpy.any", "numpy.arange", "numpy.cos", "numpy.all", "numpy.random.random" ]...
tibigeri/LHYP
[ "d70b73f12cb3ff8db6d28301c394a5343f255228" ]
[ "TrainingKfold.py" ]
[ "from sklearn.model_selection import KFold\nimport torch\nimport json\nfrom torch.utils.data import Dataset, DataLoader, WeightedRandomSampler\nfrom torchvision import transforms, utils\nfrom Conv5Lin3withSigmoid import Conv5Lin3withSigmoid\nimport sklearn.metrics\nimport decimal\nfrom PatientDataset import Patient...
[ [ "torch.device", "torch.no_grad", "sklearn.model_selection.KFold", "torch.squeeze", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "torch.utils.data.Subset", "torch.utils.tensorboard.SummaryWriter" ] ]
shawwn/pixel-rnn-tensorflow
[ "e56488ee474330f8e5a27a12bf801ca2a251c062" ]
[ "ops.py" ]
[ "import logging\nlogging.basicConfig(format=\"[%(asctime)s] %(message)s\", datefmt=\"%m-%d %H:%M:%S\")\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.ops import rnn_cell\nfrom tensorflow.examples.tutorials.mnist import input_data\nfrom tensorflow.contrib.layers import variance_scaling_initia...
[ [ "tensorflow.nn.conv2d", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.reshape", "tensorflow.reverse", "tensorflow.zeros_like", "tensorflow.stack", "tensorflow.tanh", "tensorflow.add_to_collection", "tensorflow.concat", "tensorflow.sigmoid", "tensorflow.con...
joacorapela/svGPFA
[ "181c03f47a3b7023ac7f873c2ec98cba54a73feb" ]
[ "scripts/doPlotELLeLinkTermForParamValuesEstimatedParams.py" ]
[ "\nimport sys\nimport pdb\nimport math\nimport argparse\nimport pickle\nimport numpy as np\nimport torch\nimport plotly.io as pio\nsys.path.append(\"../src\")\nimport plot.svGPFA.plotUtilsPlotly\nimport lowerBoundVsOneParamUtils\n\ndef computeElinkTerm(model):\n eMeanAllTimes, eVarAllTimes = model._eLL._svEmbedd...
[ [ "numpy.empty", "numpy.arange", "torch.transpose", "torch.matmul", "torch.sum" ] ]
houseofai/readyml
[ "7c9464d1f9b1fd6deaa8bca91fe7a95c710bf0a7" ]
[ "readyml/imagerestoration.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport tensorflow as tf\nfrom mirnet.model import mirnet_model\nfrom mirnet.utils import closest_number\nfrom readyml.utils import model_utils\nimport os.path\nimport pathlib, requests\nfrom pathlib import Path\n\nclass MIRNet():\n def __init__(self):\n model_na...
[ [ "numpy.uint8", "tensorflow.keras.preprocessing.image.img_to_array", "numpy.shape", "numpy.expand_dims" ] ]
MinesNicaicai/large-scale-pointcloud-matching
[ "cfe140f2be1110ed75b6edd27538021e513a31c9", "cfe140f2be1110ed75b6edd27538021e513a31c9" ]
[ "model/Descriptor/visualize.py", "evaluation/global_localization.py" ]
[ "import matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\nimport open3d as o3d\nimport argparse\nimport os\nfrom model.Descriptor.descnet import *\nfrom model.Descriptor.descriptor_dataset import *\nimport h5py\n\nparser = argparse.ArgumentParser(description='DescriptorVisualize')\nparser.add_argumen...
[ [ "matplotlib.pyplot.get_cmap", "sklearn.decomposition.PCA" ], [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "scipy.spatial.transform.Rotation.from_matrix", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotl...
ckesanapalli/pysph
[ "4f815a738abad43531d02ac66f5bd0d9a1def52a", "ce0be549543c533200a4c6d6336dd2d772bc0891", "ce0be549543c533200a4c6d6336dd2d772bc0891", "ce0be549543c533200a4c6d6336dd2d772bc0891" ]
[ "old_examples/wind_tunnel.py", "pysph/sph/tests/test_multi_group_integrator.py", "pysph/sph/scheme.py", "pysph/base/utils.py" ]
[ "\"\"\"Demonstrate the windtunnel simulation using inlet and outlet feature in 2D\n\n inlet fluid outlet\n --------- -------- --------\n | * * * x | | | | |\n u | * * * x | | | | |\n ---> | * * * x | | airfoil...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.array", "numpy.ones_like", "numpy.linspace" ], [ "numpy.testing.assert_array_almost_equal", "numpy.linspace", "numpy.ones_like" ], [ "numpy.arange" ], [ "numpy.max", "numpy.ones", "numpy.asarray", "nump...
inconvergent/orbitals_speedup
[ "5a93e98dbb334946002df572d618d0d767a910a9" ]
[ "render.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport cairo\nimport gtk, gobject\nfrom speedup.speedup import pyx_connections\n\n\nclass Render(object):\n\n def __init__(self,color_path,back,alpha,grains,size):\n\n self.color_path = color_path\n self.size = size\n self.back = back\n self.grains = grain...
[ [ "numpy.random.random", "numpy.sin", "numpy.random.shuffle", "numpy.cos" ] ]
tyvich/pandas
[ "22de58e63f9271d4ddb2bf49d008c5a9550c5cc4" ]
[ "pandas/tests/indexes/categorical/test_indexing.py" ]
[ "import numpy as np\nimport pytest\n\nfrom pandas.errors import InvalidIndexError\n\nimport pandas as pd\nfrom pandas import (\n CategoricalIndex,\n Index,\n IntervalIndex,\n Timestamp,\n)\nimport pandas._testing as tm\n\n\nclass TestTake:\n def test_take_fill_value(self):\n # GH 12631\n\n ...
[ [ "numpy.array", "pandas.Index", "pandas.DatetimeIndex", "pandas.Interval", "pandas.Timedelta", "numpy.random.seed", "pandas.CategoricalIndex", "pandas.date_range", "pandas._testing.assert_almost_equal", "pandas._testing.assert_categorical_equal", "pandas.Timestamp", ...
felixnext/ds_recommender
[ "88b2485c319991fde54b097fae798c37ce51efdb" ]
[ "ask_watson/ml_helper.py" ]
[ "'''\nVarious helper function (especially in the pre-processing of the data)\n'''\n\nimport time\n# pre-processing\nfrom nltk import pos_tag, ne_chunk\nfrom nltk.tokenize import word_tokenize, sent_tokenize\nfrom nltk.corpus import stopwords, wordnet\nfrom nltk.stem import WordNetLemmatizer, PorterStemmer\nfrom nlt...
[ [ "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score" ] ]
adityag6994/pytorch_ssd_training
[ "404f3cbef815e314337ec2c1b4f06a2403a7ce03", "404f3cbef815e314337ec2c1b4f06a2403a7ce03" ]
[ "utils.py", "simple_view_image_exif.py" ]
[ "import json\nimport os\nimport torch\nimport random\nimport xml.etree.ElementTree as ET\nimport torchvision.transforms.functional as FT\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n# # Label map\n# voc_labels = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat...
[ [ "torch.zeros", "torch.cat", "torch.min", "torch.arange", "torch.max", "torch.FloatTensor", "torch.save", "torch.clamp", "torch.ones", "torch.cuda.is_available", "torch.LongTensor", "torch.log", "torch.exp", "torch.sort", "torch.cumsum" ], [ "matp...
RC-7/wearableDashboard
[ "277e76d5ca96877271ab15032f4cec1511090b9d" ]
[ "lambda/ingestionLambda/lambda_function.py" ]
[ "import pandas as pd\nimport json\nimport urllib.parse\nimport boto3\nfrom decimal import Decimal\n\n\nDBTableName = 'wearableData'\ns3 = boto3.client('s3')\n\ndef writeDfToDb (df):\n dynamodb = boto3.resource('dynamodb')\n table = dynamodb.Table(DBTableName)\n with table.batch_writer() as batch:\n ...
[ [ "pandas.read_csv" ] ]
tgdcat/vaex
[ "66fde01caad9c88d86a948c1c5e1801b2455daaf" ]
[ "packages/vaex-ml/vaex/ml/sklearn.py" ]
[ "import warnings\n\nimport numpy as np\n\nimport traitlets\n\nimport vaex\nimport vaex.serialize\nfrom vaex.ml import generate\nfrom vaex.ml import state\nfrom vaex.ml.state import serialize_pickle\n\n\n@vaex.serialize.register\n@generate.register\nclass Predictor(state.HasState):\n '''This class wraps any sciki...
[ [ "numpy.array", "numpy.asarray", "numpy.random.shuffle" ] ]
GabrieleLagani/HebbianLearningThesis
[ "0f98f7a3e380e55c9fca6340f4fb0cc5f24917d8" ]
[ "train.py" ]
[ "import time\nimport torch\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as sched\nimport torch.nn as nn\n\nimport params as P\nimport utils\nimport data\nfrom evaluate import launch_experiment, load_models, eval_pass, eval_batch\n\n\n# Perform a training pass of a model over a dataset and compute t...
[ [ "torch.manual_seed", "torch.nn.CrossEntropyLoss", "torch.set_grad_enabled", "torch.optim.lr_scheduler.MultiStepLR" ] ]
tk2lab/logbesselk
[ "6ffbc344c0b472d307a556e50de943a380616fb2" ]
[ "eval/fig7.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\nfrom . import common\n\n\ndef main(debug=False):\n fig = common.figure(figsize=(5.5, 2), box=debug)\n ax = fig.subplots(\n 1, 2,\n gridspec_kw=dict(width_ratios=(0.33,1.)),\n )\n\n df = pd...
[ [ "pandas.read_csv", "matplotlib.pyplot.setp", "pandas.concat" ] ]
maksymsur/probability
[ "331c943103e51df49a985895293c7e064a363ed5" ]
[ "tensorflow_probability/python/distributions/deterministic_test.py" ]
[ "# Copyright 2018 The TensorFlow Probability 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 required by a...
[ [ "numpy.array", "numpy.zeros", "numpy.random.RandomState", "tensorflow.compat.v2.TensorShape", "numpy.float32", "tensorflow.compat.v2.Variable", "tensorflow.compat.v2.GradientTape", "tensorflow.compat.v1.placeholder_with_default", "tensorflow.compat.v2.constant", "tensorflow...
tsakim/bipcm
[ "51eb441f866ca04db236352c3af20b25788e85f4" ]
[ "src/bipcm.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Apr 05 10:00:21 2016\n\nModule:\n bipcm - Bipartite Partial Configuration Model\n\nAuthor:\n Mika Straka\n\nDescription:\n Implementation of the Bipartite Partial Configuration Model with one-sided\n constraint (BiPCM) for binary undirected bipartite netw...
[ [ "numpy.logical_or", "numpy.array", "numpy.empty", "numpy.diag_indices_from", "numpy.zeros", "numpy.savetxt", "numpy.sum", "numpy.triu_indices_from", "numpy.save", "numpy.transpose", "scipy.stats.binom" ] ]
microsoft/SparseSC
[ "f56880cbc42cf7d867390ab7d8a33f0618829f41", "f56880cbc42cf7d867390ab7d8a33f0618829f41" ]
[ "src/SparseSC/utils/misc.py", "src/SparseSC/utils/match_space.py" ]
[ "# Allow capturing output\n# Modified (to not capture stderr too) from https://stackoverflow.com/questions/5136611/\nimport contextlib\nimport sys\n\nfrom .print_progress import it_progressbar, it_progressmsg\n\n@contextlib.contextmanager\ndef capture():\n STDOUT = sys.stdout\n try:\n sys.stdout = Dumm...
[ [ "numpy.mean" ], [ "numpy.square", "sklearn.linear_model.LassoCV", "numpy.empty", "numpy.argmin", "sklearn.linear_model.MultiTaskLassoCV", "numpy.random.seed", "numpy.log", "numpy.where", "tensorflow.compat.v1.logging.set_verbosity", "numpy.abs", "tensorflow.pyth...
AdrianDickeson/sstspack
[ "2e5108addfc890fdd7a7cb7211d49aedbcbef1f5" ]
[ "tests/test_DynamicLinearGaussianModelClass.py" ]
[ "from pandas import Series, NA\nfrom numpy import full, inf, ones, zeros, identity, isinf, NAN, nan, NaN, array\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\nimport sstspack.GaussianModelDesign as md\nfrom sstspack.DynamicLinearGaussianModelClass import DynamicLinearGaussianModel as DL...
[ [ "numpy.isinf", "numpy.full", "numpy.array", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.identity", "numpy.testing.assert_array_almost_equal", "pandas.Series" ] ]
omshri22121999/training
[ "4f97c909f3aeaa3351da473d12eba461ace0be76", "4f97c909f3aeaa3351da473d12eba461ace0be76" ]
[ "object_detection/pytorch/maskrcnn_benchmark/structures/bounding_box.py", "reinforcement/tensorflow/minigo/ml_perf/train_loop.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\n\n# transpose\nFLIP_LEFT_RIGHT = 0\nFLIP_TOP_BOTTOM = 1\n\n\nclass BoxList(object):\n \"\"\"\n This class represents a set of bounding boxes.\n The bounding boxes are represented as a Nx4 Tensor.\n In order to unique...
[ [ "torch.as_tensor", "torch.cat", "torch.device" ], [ "tensorflow.io.gfile.listdir", "tensorflow.gfile.Open", "tensorflow.gfile.Glob" ] ]
qq443452099/WaveRNN
[ "db5fcc9af52d2ba4bdcbfc8fe390d89c0104b385" ]
[ "notebooks/models/wavernn.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass WaveRNN(nn.Module) :\n def __init__(self, hidden_size=896, quantisation=256) :\n super(WaveRNN, self).__init__()\n \n self.hidden_size = hidden_size\n self.split_size = hidden_size // 2\n \n ...
[ [ "torch.nn.Linear", "torch.nn.functional.sigmoid", "torch.cat", "torch.zeros", "torch.distributions.Categorical", "torch.stack", "torch.split", "torch.no_grad", "torch.LongTensor", "torch.nn.functional.softmax", "torch.nn.functional.tanh" ] ]
ggjy/PyTorchCV
[ "84da3d570023642ce4855f0fd7aff5a5ef10c4ba" ]
[ "loss/modules/cls_modules.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You(youansheng@gmail.com)\n# Loss function for Image Classification.\n\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch.nn as nn\n\n\nclass CrossEntropyLoss(nn.Module):\n ...
[ [ "torch.nn.CrossEntropyLoss" ] ]
LittleLebowskiUrbanAchievers/octagon
[ "a6bcbf9559bee00502a46d6b83ad4ae8b3d105e2" ]
[ "UFCML/ufcml.py" ]
[ "######### Base Imports #############\nimport pandas as pd\nimport psycopg2\nimport math\nimport pickle\nimport numpy as np\nimport os\n\n################# Sklearn Imports #####################\nfrom sklearn import datasets\n# Our Classifier\nfrom sklearn.naive_bayes import GaussianNB\n# Get the accuracy score of t...
[ [ "numpy.array", "sklearn.ensemble.AdaBoostClassifier", "sklearn.ensemble.RandomForestClassifier", "sklearn.neighbors.KNeighborsClassifier", "sklearn.neural_network.MLPClassifier", "sklearn.naive_bayes.GaussianNB", "sklearn.svm.SVC", "sklearn.preprocessing.scale", "sklearn.metric...
kirk86/ML-From-Scratch
[ "75fed5cb108302f46bc2a7681a06ea59bebf0e11" ]
[ "mlfromscratch/examples/mdn.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Import helper functions\nfrom mlfromscratch.deep_learning import NeuralNetwork\nfrom mlfromscratch.deep_learning.layers import MDN, Dense, Activation\nfrom mlfromscratch.deep_learning.optimizers import Adam\nfrom mlfrom...
[ [ "numpy.sin", "numpy.reshape", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.random.uniform", "matplotlib.pyplot.scatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace", "n...
junhyeokahn/tf_rbdl
[ "b3ec5db4baace60720deb18a81bfb2bd6cc10cef" ]
[ "examples/general_usage.py" ]
[ "from tqdm import tqdm\nimport numpy as np\nfrom mujoco_py import load_model_from_path, MjSim, functions, MjViewer\nimport numpy as np\nnp.set_printoptions(precision=4)\nimport os\nimport sys\nsys.path.append(os.getcwd())\n\nfrom tf_rbdl.utils import *\nfrom tf_rbdl.kinematics import *\nfrom tf_rbdl.dynamics import...
[ [ "numpy.zeros", "numpy.set_printoptions", "numpy.copy", "numpy.eye", "numpy.random.uniform" ] ]
therne/logue
[ "4526a1812b2a859ed9746d95830515861c4a96fd" ]
[ "models/tdnn.py" ]
[ "\"\"\" Time-delayed Neural Network (cf. http://arxiv.org/abs/1508.06615v4)\n Codes from https://github.com/carpedm20/lstm-char-cnn-tensorflow.\"\"\"\n\nimport tensorflow as tf\n\ndef conv2d(input_, output_dim, k_h, k_w,\n stddev=0.02, name=\"conv2d\"):\n\n with tf.variable_scope(name):\n w =...
[ [ "tensorflow.truncated_normal_initializer", "tensorflow.concat", "tensorflow.nn.conv2d", "tensorflow.expand_dims", "tensorflow.variable_scope", "tensorflow.squeeze", "tensorflow.tanh" ] ]
istefano82/alabala
[ "484bc34035cae6ba636b2828e06285bde49d1f90" ]
[ "ludwig/models/model.py" ]
[ "#! /usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, 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/LICENS...
[ [ "tensorflow.set_random_seed", "numpy.concatenate", "numpy.pad", "numpy.array", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.reset_default_graph", "tensorflow.Variable", "tensorflow.train.Saver", "numpy.logical_and", "numpy.exp", "tensorflow.placehold...
M4rkD/pl_curves
[ "60d721f6f525d3c9955b4667981eac26f89d4c37" ]
[ "tests/test_check_columns.py" ]
[ "#!/usr/bin/env python3\nfrom pl_curve import check_columns\nimport pandas\n\n\ndef test_check_columns_correct():\n '''FIXME: Implement this test\n Tests check_columns correctly checks items summing to 1.0 returns true\n '''\n df = pandas.DataFrame([0.2, 0.8])\n assert check_columns(df) is True\n\n\n...
[ [ "pandas.DataFrame" ] ]
Ignacio-Losada/Log-v-3LPF
[ "cd5eaae7c2128da220a126c990b20e153a2f4b87" ]
[ "logv3lpf/math_functions.py" ]
[ "import numpy as np\r\n\r\ndef rmse(predictions, targets):\r\n return np.sqrt(((predictions - targets) ** 2).mean())\r\n\r\ndef polar_to_cartesian(z,theta):\r\n return z*np.exp(1j*np.deg2rad(theta))\r\n\r\ndef cartesian_to_polar(Z):\r\n x = Z.real\r\n y = Z.imag\r\n z = np.sqrt(x**2 + y**2)\r\n th...
[ [ "numpy.array", "numpy.arctan2", "numpy.abs", "numpy.sqrt", "numpy.deg2rad" ] ]
praiseG/Decision-Trees
[ "a56edf37fa4ad425ea74569be33663832f40a1a9" ]
[ "tools/email_preprocess.py" ]
[ "#!/usr/local/bin/python3\n\nimport pickle\nimport numpy\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_selection import SelectPercentile, f_classif\n\n\n\ndef preprocess(words_file = \"tools/word_data.pkl\", authors_file=\"...
[ [ "sklearn.model_selection.train_test_split", "sklearn.feature_selection.SelectPercentile", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
kai-zhang-er/TomoIQA
[ "eb77bc533d7609dcc32f5936750d5914517d977f" ]
[ "tf1/train_rank.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\n\"\"\"\n create by ranjiewen at 20190108 in whu\n\"\"\"\nimport sys\nimport argparse\nimport os\nfrom datetime import datetime\nimport time\nimport tensorflow as tf\n\nfrom src.datasets.load_dataset import Dataset\nfrom src.net.model import VggNetModel\nfrom src.los...
[ [ "tensorflow.trainable_variables", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.Session", "tensorflow.global_variables", "tensorflow.placeholder", "tensorflow.name_scope", "tensorflow.Summary.Value", "tensorflow.summary.merge...
UCL-dataspring/cluster-code
[ "8e0d9f24f150537c1712de4cbe768bf53b7d6986" ]
[ "bluclobber/test/harness/test_mapreduce.py" ]
[ "from ...harness.mapreduce import MapReduce\nimport numpy as np\nfrom mpi4py import MPI\nimport logging\nfrom ...harness.utils import *\n\nperfLogger=logging.getLogger('performance')\ncommunicator=MPI.COMM_WORLD\nperfLogger.setLevel(logging.DEBUG)\nstdout=logging.StreamHandler()\nstdout.setFormatter(logging.Formatt...
[ [ "numpy.arange" ] ]
wkiri/simcalib
[ "5a39d3cf5b5f3c273029b5d17bded99d7790dc20" ]
[ "simcalib/simcalib.py" ]
[ "# Similarity-based Calibration methods\n# Also includes Platt scaling and temperature scaling\n# for comparison.\n#\n# Kiri Wagstaff\n\nimport sys\nimport numpy as np\nimport scipy\nfrom progressbar import ProgressBar, Bar, ETA\nfrom progressbar import Counter as pCounter\nfrom sklearn.metrics.pairwise import cosi...
[ [ "sklearn.metrics.pairwise.rbf_kernel", "numpy.exp", "numpy.mean", "numpy.min", "numpy.where", "sklearn.metrics.pairwise.euclidean_distances", "numpy.max", "numpy.zeros_like", "numpy.log", "numpy.eye", "numpy.argmax", "sklearn.ensemble.IsolationForest", "numpy.sq...
daiyaanarfeen/kospeech
[ "5aff5c7647e5cceceddf7b22c991777fc3792400" ]
[ "test/test_jasper_recognize.py" ]
[ "# Copyright (c) 2021, Soohwan Kim. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b...
[ [ "torch.device", "torch.cuda.is_available", "torch.LongTensor", "torch.rand" ] ]
komorowskilab/funMotifs
[ "551cabcf8a47b978e8f67abb9830452f2f0919be" ]
[ "src_helpers/GenerateMotifsFIMO.py" ]
[ "'''\nCreated on Feb 16, 2017\n\n@author: husensofteng\n'''\nimport sys\nimport os.path, subprocess\nfrom subprocess import STDOUT,PIPE\nimport shlex\nimport numpy as np\nfrom multiprocessing import Pool\nimport argparse\n\ndef get_sig_motif_instances(instances_file_fimo_format,\n bed_inp...
[ [ "numpy.std", "numpy.mean", "numpy.floor" ] ]
quqixun/MLAlgorithms
[ "1ad46a899a6280a08c196fb4eb0931408c8636c7" ]
[ "NaiveBayes/src/NaiveBayes.py" ]
[ "# Conventional Machine Learning Algorithms\n# Class of \"NaiveBayes\".\n# Author: Qixun Qu\n# Create on: 2018/04/23\n# Modify on: 2018/04/25\n\n# ,,, ,,,\n# ;\" '; ;' \",\n# ; @.ss$$$$$$s.@ ;\n# `s$$$$$$$$$$$$$$$'\n# $$$$$$$$$$$$$$$$$$\n# $$$$P\"\"Y$$$Y\"\"W$$$$$\n# $$$$ p\"$$$\"q ...
[ [ "numpy.array", "numpy.exp", "numpy.mean", "numpy.where", "numpy.std", "numpy.sqrt" ] ]
ChangChunHe/VASP-calculation-process
[ "99268479f826f2f31a59d92daff443aeec688fb2" ]
[ "pyvaspflow/vasp/test_para.py" ]
[ "#!/usr/bin/env python3.6\n# -*- coding: utf-8 -*-\n\n\nfrom pyvaspflow.vasp import prep_vasp,run_vasp\nfrom pyvaspflow.io.vasp_input import Kpoints\nfrom pyvaspflow.utils import is_2d_structure\nfrom pyvaspflow.io.vasp_out import ExtractValue\nfrom sagar.io.vasp import read_vasp\nfrom os import makedirs,path,chdir...
[ [ "numpy.arange", "numpy.savetxt" ] ]
rekon/CarND-Behavioral-Cloning
[ "d2da8f767cec4aa6ea5500c736a98ec00987e8b9" ]
[ "drive.py" ]
[ "import argparse\nimport base64\nfrom datetime import datetime\nimport os\nimport shutil\n\nimport numpy as np\nimport socketio\nimport eventlet\nimport eventlet.wsgi\nfrom PIL import Image\nfrom flask import Flask\nfrom io import BytesIO\n\nfrom keras.models import load_model\nimport h5py\nfrom keras import __vers...
[ [ "numpy.asarray" ] ]
bariscansecim/CarND-Capstone
[ "76a7587ba8fe1aa80ad58e26d286ede119ec5031" ]
[ "ros/src/waypoint_updater/waypoint_updater.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nimport numpy as np\nfrom geometry_msgs.msg import PoseStamped\nfrom styx_msgs.msg import Lane, Waypoint\nfrom std_msgs.msg import Int32\nfrom scipy.spatial import KDTree\n\n\nimport math\n\n'''\nThis node will publish waypoints from the car's current position to some `x` dist...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.dot" ] ]
jborchma/dask
[ "a555c76fff593f1c4437b91a28e7328ef5e50bc6" ]
[ "dask/array/routines.py" ]
[ "import inspect\nimport math\nimport warnings\nfrom collections.abc import Iterable\nfrom functools import wraps, partial\nfrom numbers import Real, Integral\nfrom distutils.version import LooseVersion\nfrom typing import List\n\nimport numpy as np\nfrom tlz import concat, sliding_window, interleave\n\nfrom ..compa...
[ [ "numpy.promote_types", "numpy.min", "numpy.where", "numpy.apply_along_axis", "numpy.cumsum", "numpy.gradient", "numpy.bincount", "numpy.histogram", "numpy.count_nonzero", "numpy.empty", "numpy.vectorize", "numpy.take", "numpy.unravel_index", "numpy.ndim", ...
j-kota/LP-QAP
[ "8b972d754f916b1905f4d89d995b6e9cce093595" ]
[ "qap-lp/main.py" ]
[ "#!/usr/bin/python\r\n# -*- coding: UTF-8 -*-\r\n\r\nimport numpy as np\r\nimport os\r\n# import dependencies\r\nfrom data_generator import Generator\r\nfrom aligned_data_generator import Aligned_Generator\r\nfrom model import Siamese_GNN, Siamese_Matcher, GNN_Matcher\r\nfrom Logger import Logger\r\nimport time\r\n...
[ [ "matplotlib.use", "torch.cuda.manual_seed", "torch.arange", "torch.manual_seed", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ]
Asap7772/visual_foresight
[ "13c631dc76ca1b61d7159473b3f2207ce2a3da04" ]
[ "visual_mpc/agent/benchmarking_agent.py" ]
[ "from .general_agent import GeneralAgent\nfrom visual_mpc.utils.im_utils import resize_store\nimport pickle as pkl\nimport numpy as np\nimport cv2\nimport os\nimport shutil\n\n\nclass BenchmarkAgent(GeneralAgent):\n def __init__(self, hyperparams):\n self._start_goal_confs = hyperparams.get('start_goal_co...
[ [ "scipy.misc.imread", "numpy.zeros" ] ]
faisalnawazmir/Copulas
[ "2a85d6639aee73770dcdcaffdadfb45c2c1b7f86" ]
[ "copulas/bivariate/base.py" ]
[ "\"\"\"This module contains a base class for bivariate copulas.\"\"\"\n\n\nimport json\nfrom enum import Enum\n\nimport numpy as np\nfrom scipy import stats\n\nfrom copulas import EPSILON, NotFittedError, random_state\n\nCOMPUTE_EMPIRICAL_STEPS = 50\n\n\nclass CopulaTypes(Enum):\n \"\"\"Available copula families...
[ [ "scipy.stats.kendalltau", "numpy.add", "numpy.array", "numpy.asarray", "numpy.sum", "numpy.linspace", "numpy.logical_and", "numpy.random.uniform", "numpy.argmax", "numpy.power", "numpy.column_stack" ] ]
Near32/SymbolicBehaviourBenchmark
[ "d1f9f14ed186292e22802781f4737e6747cd8c64" ]
[ "symbolic_behaviour_benchmark/utils/agent_wrappers.py" ]
[ "from typing import List, Optional\nimport copy\nimport numpy as np \n\nclass RuleBasedAgentWrapper(object):\n def __init__(\n self, \n ruleBasedAgent:object, \n player_idx:int, \n nbr_actors:int\n ):\n self.nbr_actors = nbr_actors\n self.action_space_dim = ruleBa...
[ [ "numpy.arange", "numpy.zeros" ] ]
ddddwee1/TorchSUL
[ "775832049564d8ee7c43e510b57bd716e0a746dd" ]
[ "example/BtmUpPose/Multi3D/test/run_img.py" ]
[ "from tqdm import tqdm \nimport numpy as np \nimport torch \nfrom TorchSUL import Model as M \nimport cv2 \nimport pickle \nimport testutil\n\nimport config \nimport network \nimport loss \nimport visutil.util as vutil \nimport matplotlib.pyplot as plt \nimport visutil2 \n\ndef get_pts(pts, roots, rels):\n\troots =...
[ [ "numpy.random.random", "torch.no_grad", "numpy.zeros", "torch.from_numpy" ] ]
UCSC-nanopore-cgl/signalAlign
[ "90041772403fe9f7142abc8a9103a7696e70f445" ]
[ "src/signalalign/singleNucleotideProbabilities.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Run signal-to-reference alignments\n\"\"\"\nfrom __future__ import print_function\n\nimport numpy as np\nimport glob\nimport shutil\nimport subprocess\nimport os\nimport sys\nimport pysam\nfrom argparse import ArgumentParser\nfrom random import shuffle\nfrom contextlib import closing\...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.mean", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
andreaspts/DRL_Tennis_Project
[ "fe741cdd4b870964243173ad878fd7808dd06203" ]
[ "maddpg_agent.py" ]
[ "# Based in part on the DDPG algorithm as provided by Udacity's DRL course.\n\nimport numpy as np\nimport random\nimport copy\nfrom collections import namedtuple, deque\n\nfrom model import Actor, Critic\n\nfrom noise import OUNoise, GaussianNoise, GeometricBrownianNoise\n\nfrom memory import ReplayBuffer\n\nimport...
[ [ "numpy.zeros", "torch.no_grad", "torch.from_numpy", "torch.nn.functional.mse_loss", "torch.cuda.is_available", "numpy.clip" ] ]
xiaomi1122/astropy
[ "8876e902f5efa02a3fc27d82fe15c16001d4df5e", "8876e902f5efa02a3fc27d82fe15c16001d4df5e", "8876e902f5efa02a3fc27d82fe15c16001d4df5e" ]
[ "astropy/io/fits/file.py", "astropy/vo/client/tests/test_vo.py", "astropy/io/registry.py" ]
[ "# Licensed under a 3-clause BSD style license - see PYFITS.rst\n\nfrom __future__ import division, with_statement\n\nimport gzip\nimport mmap\nimport os\nimport tempfile\nimport urllib\nimport warnings\nimport zipfile\n\nimport numpy as np\nfrom numpy import memmap as Memmap\n\nfrom .util import (isreadable, iswri...
[ [ "numpy.memmap", "numpy.dtype" ], [ "numpy.testing.assert_array_equal" ], [ "numpy.any" ] ]