repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
MingjunZhong/keras-ncp
[ "84eb8fb91d37c979deaeb9a3f147ed83aef6791c" ]
[ "kerasncp/ltc_cell.py" ]
[ "# Copyright 2020 Mathias Lechner\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 ag...
[ [ "tensorflow.expand_dims", "tensorflow.keras.constraints.NonNeg", "tensorflow.keras.initializers.RandomUniform", "matplotlib.patches.Patch", "tensorflow.reduce_sum", "numpy.abs", "tensorflow.nn.sigmoid", "tensorflow.keras.initializers.Constant" ] ]
chandra168/NeoFinRL
[ "c2b9da5918ac2905bc31c42f5e17a45159afd47f" ]
[ "neo_finrl/yahoo_finance/stocktrading_env.py" ]
[ "import numpy as np\nimport os\nimport numpy.random as rd\nimport gym\n\n\nclass StockTradingEnv(gym.Env):\n metadata = {'render.modes': ['human']}\n\n \"\"\"FinRL\n Paper: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance\n https://arxiv.org/abs/2011.09607...
[ [ "numpy.hstack", "numpy.random.uniform", "numpy.load", "numpy.zeros" ] ]
cmashraf/cnns4qspr
[ "cfb6f10a59b79c6d336bb8f8bd3647972b05b190" ]
[ "run.py" ]
[ "from cnns4qspr.loader import voxelize\nfrom cnns4qspr.visualizer import plot_field, plot_internals\nfrom cnns4qspr.featurizer import featurize, gen_feature_set\nfrom cnns4qspr.trainer import Trainer, CNNTrainer\nimport argparse\nimport numpy as np\n\ndef run():\n voxels = voxelize('examples/sample_pdbs', path_t...
[ [ "numpy.random.rand" ] ]
hongweilibran/DALM
[ "34a946f12291b394aaad91702cfafca1024efe5e" ]
[ "load_data_all.py" ]
[ "from scipy.io import loadmat\nimport numpy as np\nfrom PIL import Image\nimport os\nimport random\nfrom imgaug import augmenters as iaa\n\ndef load_data(train_list, val_list, augment=True):\n augment_size = 150 #define how many times the augmented dataset comparing to the original images.\n ## one-hot conve...
[ [ "numpy.concatenate", "numpy.max", "numpy.uint8", "numpy.asarray", "numpy.zeros", "numpy.min", "numpy.float32" ] ]
x-y-z/HugeCTR
[ "c55a63401ad350669ccfcd374aefd7a5fc879ca2", "c55a63401ad350669ccfcd374aefd7a5fc879ca2" ]
[ "sparse_operation_kit/documents/tutorials/DLRM_Benchmark/preprocess/parquet_to_binary.py", "sparse_operation_kit/unit_test/test_scripts/tf2/dense_models.py" ]
[ "# Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.iinfo", "pandas.read_parquet" ], [ "tensorflow.TensorSpec", "tensorflow.concat", "tensorflow.keras.layers.Reshape", "tensorflow.reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.nn.embedding_lookup" ] ]
radical-experiments/campaign_manager
[ "337660cf07a97933b9b516d6612353bd3f6592a8", "337660cf07a97933b9b516d6612353bd3f6592a8" ]
[ "Scripts/heft/static_resources_exp4.py", "Scripts/ga/perc_050/dynamic_resources_exp4.py" ]
[ "from radical.cm.planner import HeftPlanner\nimport pandas as pd\nimport sys\nfrom time import time\n\n\ndef df_to_lists(cmp, size):\n\n tmp_workflows = list()\n tmp_numoper = list()\n for i in range(size):\n point = cmp.loc[i] \n workflow = {'description': None}\n workflow['id'] = int...
[ [ "pandas.DataFrame", "pandas.read_csv" ], [ "pandas.DataFrame", "pandas.read_csv", "numpy.load" ] ]
Anshul044/Project-NN
[ "ef080846715a95b735f0381e4f60742e40791630" ]
[ "TL-ERC/bert_model/solver.py" ]
[ "from itertools import cycle\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.nn import functional as F\r\nimport models\r\nfrom util import to_var, time_desc_decorator\r\nimport os\r\nfrom tqdm import tqdm\r\nfrom math import isnan\r\nimport re\r\nimport math\r\nimport pickle\r\nimport ...
[ [ "torch.no_grad", "numpy.mean", "sklearn.metrics.classification_report", "torch.cuda.is_available", "torch.LongTensor", "torch.load", "torch.nn.init.orthogonal_", "torch.nn.CrossEntropyLoss" ] ]
mintusf/land_cover_tracking
[ "e1c389729fdb628e4d34e0d427f43f6317eba4ee" ]
[ "ai_engine/train_utils/utils.py" ]
[ "import torch\n\n\ndef load_checkpoint(checkpoint_path: str, device: str):\n \"\"\"Load checkpoint from file.\n Args:\n checkpoint_path (str): Path to checkpoint file\n device (str): Device to load checkpoint on\n \"\"\"\n if \"cpu\" in device:\n checkpoint = torch.load(checkpoint_p...
[ [ "torch.device", "torch.load" ] ]
psarka/uplift
[ "57be8a7bfe2364a28c76d51e2f88e515c52c657b" ]
[ "uplift/base.py" ]
[ "\"\"\"Base classes for all estimators.\"\"\"\n\n# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>\n# License: BSD 3 clause\n\nimport copy\nimport warnings\n\nimport numpy as np\nfrom scipy import sparse\nfrom inspect import signature\n\n\n#####################################################################...
[ [ "scipy.sparse.issparse", "numpy.get_printoptions", "numpy.set_printoptions", "numpy.all" ] ]
candeiasalexandre/FaceBoxes.PyTorch
[ "43b07439410dcc81353a34aaaeb143d4d4d04405" ]
[ "layers/functions/prior_box.py" ]
[ "#https://github.com/zisianw/FaceBoxes.PyTorch/issues/5 - added to work on python2 - there was a problem in tensors shape\nfrom __future__ import print_function, division\nimport torch\nfrom itertools import product as product\nimport numpy as np\nfrom math import ceil\n\nclass PriorBox(object):\n def __init__(s...
[ [ "torch.Tensor" ] ]
mfk3138/jiant
[ "6e67ff1ecb1bb98533c1019a86af4ad2c04c6a64" ]
[ "jiant/tasks/evaluate/core.py" ]
[ "import itertools\nimport json\n\nfrom dataclasses import dataclass\n\nimport numpy as np\nimport pandas as pd\nimport seqeval.metrics as seqeval_metrics\nimport torch\n\nfrom scipy.stats import pearsonr\nfrom scipy.stats import spearmanr\nfrom sklearn.metrics import f1_score\nfrom sklearn.metrics import matthews_c...
[ [ "numpy.concatenate", "numpy.array", "sklearn.metrics.matthews_corrcoef", "pandas.DataFrame", "scipy.stats.spearmanr", "numpy.exp", "numpy.mean", "scipy.stats.pearsonr", "numpy.stack", "numpy.argmax", "torch.cuda.is_available", "numpy.arange", "sklearn.metrics.f1...
mfeffer/lale
[ "57b58843c7c14dc2e5658244280f2c1918bf030b", "57b58843c7c14dc2e5658244280f2c1918bf030b" ]
[ "lale/lib/autogen/quantile_transformer.py", "lale/operators.py" ]
[ "from numpy import inf, nan\nfrom sklearn.preprocessing import QuantileTransformer as Op\n\nfrom lale.docstrings import set_docstrings\nfrom lale.operators import make_operator\n\n\nclass _QuantileTransformerImpl:\n def __init__(self, **hyperparams):\n self._hyperparams = hyperparams\n self._wrappe...
[ [ "sklearn.preprocessing.QuantileTransformer" ], [ "sklearn.pipeline.FeatureUnion", "sklearn.base.clone", "sklearn.pipeline.make_pipeline", "sklearn.pipeline.if_delegate_has_method" ] ]
BoberSA/bioinformatics_contest_2021
[ "dec8f73cc2c3263ffc1bb4916a0e05928acbe212" ]
[ "q1.py" ]
[ "#%%\r\n# Solution for Qualification, Problem 1, Epigenomic Marks 2\r\n# https://stepik.org/lesson/541851/step/1?unit=535312\r\n\r\n#%%\r\nimport numpy as np\r\n\r\nfile = '1'\r\n#file = '2'\r\n\r\nwith open(file + '.txt', 'rt') as f:\r\n lines = f.readlines()\r\n\r\nt = int(lines[0])\r\n\r\ni = 1\r\n\r\nwith op...
[ [ "numpy.fromstring", "numpy.arange", "numpy.unique" ] ]
mwong009/RRM-PoE
[ "6820a4fc12ebb333afea5e11944cd0f80d8d9218" ]
[ "rrm2010.py" ]
[ "########################################\r\n#\r\n# @file rrm2010.py\r\n# @author: Melvin Wong\r\n# @date: Tue Jun 05 10:23:00 2018\r\n#\r\n#######################################\r\n\r\nfrom biogeme import *\r\nfrom headers import *\r\nfrom loglikelihood import *\r\nfrom statistics import *\r\n\r\nimport numpy as ...
[ [ "numpy.array", "numpy.asarray" ] ]
shregar1/DPED_GAN
[ "9722fee134053c5f0454a7c72a1b61dd2dc56ff0" ]
[ "src/losses/loss.py" ]
[ "import torch\nimport kornia\nimport torch.nn as nn\nimport torchvision.models as models\n\nvgg_model = models.vgg16(pretrained=True)\n\nfor param in vgg_model.features.parameters():\n param.requires_grad = False\nif torch.cuda.is_available():\n vgg_model.cuda()\n\nclass LossModel(nn.Module):\n def __init_...
[ [ "torch.nn.MSELoss", "torch.nn.L1Loss", "torch.nn.SmoothL1Loss", "torch.cuda.is_available", "torch.sum" ] ]
sartaajkhan/pySolution
[ "10863fe3857857e7ed52f37e4fb2c57c12eb8e50" ]
[ "pySolution/core/helper_functions.py" ]
[ "import pandas as pd\nimport numpy as np\nimport pickle\nfrom math import *\nfrom scipy.optimize import fsolve\nimport multiprocessing as mp\nfrom joblib import Parallel, delayed\nimport proplot as pplt\nimport random\nimport itertools\nfrom itertools import product\nimport scipy.integrate as integrate\nimport scip...
[ [ "pandas.read_excel", "numpy.sqrt" ] ]
M4I-nanoscopy/tpx3-event-localisation
[ "1cbaf3f4c736230a034d6620253a01b4f6276950" ]
[ "pixels/combine_freq_tot.py" ]
[ "import sys\nimport h5py\nimport numpy as np\n\nw = h5py.File(sys.argv[-1], 'w')\n\nfreq_tot = np.zeros((512 * 512, 1024), dtype='uint32')\n\nfor idx, filename in enumerate(sys.argv[1:-1]):\n f = h5py.File(filename, 'r')\n\n freq_chunk = f['freq_tot'][()]\n freq_tot += freq_chunk\n\n f.close()\n\nw.crea...
[ [ "numpy.zeros" ] ]
mcx/rl-reliability-metrics
[ "f91a671ef00fc49803b67b2fd420e7a703dfdba2" ]
[ "rl_reliability_metrics/analysis/stats.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Authors of RL Reliability Metrics.\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# U...
[ [ "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.median", "numpy.percentile", "numpy.mean", "numpy.where", "numpy.abs" ] ]
DVL-Sejong/COVID_DataProcessor
[ "00b9bd0533b169c357d98dc719c4608cad78165a" ]
[ "COVID_DataProcessor/preprocess/preprocess.py" ]
[ "from COVID_DataProcessor.datatype import Country, PreprocessInfo, PreType\nfrom COVID_DataProcessor.io import load_links, load_population, load_origin_data\nfrom COVID_DataProcessor.io import save_preprocessed_dict, save_setting, save_sird_dict\nfrom COVID_DataProcessor.util import get_period, generate_dataframe\n...
[ [ "numpy.concatenate", "numpy.full", "numpy.ones_like", "pandas.DataFrame", "numpy.ones", "numpy.trim_zeros", "numpy.arange", "numpy.cumsum" ] ]
Kzra/PyKrev
[ "8c2ad7305cfa2ec3f5c288ea655882c61f5d4de3" ]
[ "pykrev/formula/nominal_oxidation_state.py" ]
[ "import numpy as np\nfrom .element_counts import element_counts\ndef nominal_oxidation_state(msTuple):\n \"\"\" \n\tDocstring for function pyKrev.nominal_oxidation_state\n\t====================\n\tThis function takes an msTuple and returns the nominal oxidatate state of C.\n \n\tUse\n\t----\n\tnominal_oxidati...
[ [ "numpy.array", "numpy.append" ] ]
nla-group/LSTMs
[ "807b5accc1d2fa13fdb9b785758017743cc24287" ]
[ "AttentionLSTM_keras.py" ]
[ "import numpy as np\nimport os, logging\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\"\nlogging.getLogger(\"tensorflow\").setLevel(logging.CRITICAL)\nlogging.getLogger(\"tensorflow_hub\").setLevel(logging.CRITICAL)\nimport keras as K\nimport copy\n\nclass AttentionLSTM_keras(object):\n \"\"\" Attention LSTM imple...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.argmax", "numpy.hstack" ] ]
FoxNeo/MyPythonProjects
[ "3499ef0853f0087f6f143e1633b0a88a3d7b9818" ]
[ "src/PandasModule/hierarchy_index.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\n\r\nlist_values = np.random.rand(6)\r\nlist_index = [[1,1,1,2,2,2], ['a', 'b', 'c', 'a', 'b', 'c']]\r\nseries = pd.Series(list_values, index=list_index)\r\nfirst = series[1]\r\n\r\ndataframe = series.unstack()\r\nprint(dataframe)\r\n\r\nlist_values = np.arange(16).resha...
[ [ "pandas.DataFrame", "numpy.arange", "numpy.random.rand", "pandas.Series" ] ]
drdrpyan/gan_tutorial
[ "389a65e2384581b3da443b3a1fe6ec9790217b17" ]
[ "2.dcgan/dcgan2/main.py" ]
[ "import data_feeder\nimport trainer4\nimport net\nimport dcgan2\n\nimport tensorflow as tf\n\nimport os\n\n#mnist_config = {'data_shape':[28, 28, 1], \n# 'noise_shape':[1, 1, 100],\n# 'data_path':os.path.normpath('D:/dataset/mnist/train-images.idx3-ubyte'),\n# 'epoch':10...
[ [ "tensorflow.InteractiveSession" ] ]
shinsei66/pytorch-nested-unet
[ "87ac6c553d4824cdae6fa2944b28c9c2fef75d9f" ]
[ "train.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport time\nimport os\nimport math\nimport argparse\nfrom glob import glob\nfrom collections import OrderedDict\nimport random\nimport warnings\nfrom datetime import datetime\n\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom sklearn.model_selection import train_test_split\nfrom skima...
[ [ "torch.no_grad", "torch.cuda.empty_cache", "torch.utils.data.DataLoader", "torch.nn.BCEWithLogitsLoss", "sklearn.model_selection.train_test_split" ] ]
jiahuei/moses
[ "7546d45b8d4160f4f40747525dc81b50431c8749" ]
[ "scripts/merge_binding_data.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 14 Apr 2020 01:00:52\n\n@author: jiahuei\n\"\"\"\nimport os\nimport pandas as pd\n\npjoin = os.path.join\n\ndata_root = pjoin('/mol_data', 'DeepAffinity')\npair_files = ['EC50_protein_compound_pair.tsv',\n 'IC50_protein_compound_pair.tsv',\n 'Kd...
[ [ "pandas.read_csv" ] ]
WiproOpenSourcePractice/keras-contrib
[ "3e77ba234f46b82997271996946b731bc774fb9f" ]
[ "keras_contrib/datasets/coco.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n\"\"\"\nThis is a script for downloading and converting the microsoft coco dataset\nfrom mscoco.org. This can be run as an independent executable to download\nthe dataset or be imported by scripts used for larger experiments.\n\"\"\"\nfrom __future__ import division, print_fu...
[ [ "numpy.array", "numpy.savetxt", "numpy.zeros", "numpy.sum", "numpy.save", "numpy.shape", "numpy.where" ] ]
spokV/adversarial-attacks-pytorch
[ "2fa41799e38de2e318f4ba5f7815fba6610fc9af" ]
[ "torchattacks/attacks/mifgsm.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom ..attack import Attack\n\n\nclass MIFGSM(Attack):\n r\"\"\"\n MI-FGSM in the paper 'Boosting Adversarial Attacks with Momentum'\n [https://arxiv.org/abs/1710.06081]\n\n Distance Measure : Linf\n\n Arguments:\n model (nn.Module): model to attack.\n ...
[ [ "torch.clamp", "torch.autograd.grad", "torch.zeros_like", "torch.nn.CrossEntropyLoss", "torch.nn.Flatten" ] ]
kimkwangho82/ClovaCall
[ "ec9649bc40468f5256b4b406e027e9ac299fd3ec" ]
[ "api/api_server.py" ]
[ "#!env python\n\nfrom flask import Flask\nfrom flask import request\nfrom flask import jsonify\n\nfrom werkzeug.utils import secure_filename\n\nimport json\nimport time\nimport os\n\nfrom pprint import pprint\n\n\n#################################\nimport torch\nimport numpy as np\nimport librosa\nimport scipy\n\nf...
[ [ "torch.stack", "torch.FloatTensor", "torch.no_grad", "numpy.mean", "numpy.log1p", "numpy.std", "torch.cuda.is_available", "torch.load", "numpy.clip" ] ]
psorianom/emnlp2017-bilstm-cnn-crf
[ "d36e7008db3cba5c45122341fe3e684185e2209f" ]
[ "util/preprocessing.py" ]
[ "from __future__ import (division, absolute_import, print_function, unicode_literals)\nimport os\nimport numpy as np\nimport gzip\nimport os.path\nimport nltk\nimport logging\n\nfrom nltk import FreqDist\n\nfrom .WordEmbeddings import wordNormalize\nfrom .CoNLL import readCoNLL\n\nimport sys\n\nif (sys.version_info...
[ [ "numpy.array", "numpy.random.uniform", "numpy.zeros", "pandas.read_csv" ] ]
jjccero/rl
[ "45d1a464ec661278372fce2c1d972d02457e21f6" ]
[ "pbrl/competitive/runner.py" ]
[ "import time\nfrom typing import List\n\nimport numpy as np\nfrom pbrl.algorithms.ppo.policy import Policy\n\n\nclass MultiPolicyRunner:\n def __init__(\n self,\n env,\n policy_num,\n episode_num,\n render=None\n ):\n self.env = env\n self.e...
[ [ "numpy.zeros" ] ]
abollu779/brain_language_nlp
[ "92383f6de16fc7457d4784f01dcb216fe0ec2c48" ]
[ "utils/utils.py" ]
[ "import numpy as np\nfrom sklearn.decomposition import PCA\nfrom scipy.stats import zscore\nimport time\nimport csv\nimport os\nimport os.path\nimport nibabel\nfrom sklearn.metrics.pairwise import euclidean_distances\nfrom scipy.ndimage.filters import gaussian_filter\n\nfrom utils.global_params import n_folds, n_ep...
[ [ "scipy.stats.zscore", "numpy.dot", "numpy.random.choice", "numpy.load", "scipy.ndimage.filters.gaussian_filter", "numpy.mean", "numpy.where", "numpy.nanmean", "numpy.full", "numpy.zeros_like", "numpy.nan_to_num", "numpy.save", "numpy.arange", "sklearn.decomp...
b-winter30/pl_curves
[ "a3f20125d05553ffb110e44df30844a942ecb5c6" ]
[ "tests/test_sort_bins.py" ]
[ "#!/usr/bin/env python3\n\nfrom pl_curve import sort_bins\nimport pandas\nimport numpy as np\n\n\ndef test_sort_bins():\n '''\n test the sort_bins function\n '''\n data = np.array([['', 'Col1', 'Col2'],\n ['Row1', 1, 2],\n ['Row2', 3, 4],\n ['Row3...
[ [ "pandas.DataFrame", "numpy.array" ] ]
federated-learning-experiments/federated
[ "ba258f53ff28574375cc5e5a8a80da1a2cd57290" ]
[ "tensorflow_federated/python/learning/federated_sgd.py" ]
[ "# Lint as: python3\n# Copyright 2018, The TensorFlow Federated 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# ...
[ [ "tensorflow.nest.pack_sequence_as", "tensorflow.keras.optimizers.SGD", "tensorflow.shape", "tensorflow.GradientTape", "tensorflow.nest.flatten", "tensorflow.nest.map_structure", "tensorflow.constant", "tensorflow.zeros_like" ] ]
akshitj1/tensor2tensor
[ "a76b0f0afe24c966e26d0112356eb66f5a8a37aa" ]
[ "tensor2tensor/layers/common_layers_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.exp", "numpy.ones_like", "numpy.random.rand", "tensorflow.constant_initializer", "tensorflow.ones", "tensorflow.matmul", "tensorflow.ones_like", "tensorflow.gradients", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.to_float", "tensorflow....
stlslm/MultiObjectiveOptimization
[ "5d8e8343c56cf3184081f71cc4a661af64e7cf7e" ]
[ "multi_task/loaders/celeba_loader.py" ]
[ "import os\nimport torch\nimport numpy as np\nimport scipy.misc as m\nimport re\nimport glob\n\nfrom torch.utils import data\n\n\nclass CELEBA(data.Dataset):\n def __init__(self, root, split=\"train\", is_transform=False, img_size=(32, 32), augmentations=None):\n \"\"\"__init__\n\n :param root:\n ...
[ [ "numpy.array", "matplotlib.pyplot.close", "scipy.misc.imresize", "matplotlib.pyplot.subplots", "scipy.misc.imread", "torch.from_numpy", "numpy.transpose", "torch.utils.data.DataLoader", "matplotlib.pyplot.show" ] ]
Scouttman/SuperPoint
[ "12fc6d3d8d48bda38cbc71973308eefdfc39ea9c" ]
[ "superpoint/datasets_V2/synthetic_shapes.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport cv2\nimport os\nimport tarfile\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport shutil\n\nfrom .base_dataset import BaseDataset\nfrom superpoint.datasets_V2 import synthetic_dataset\nfrom .utils import pipeline\nfrom .utils.pipeline import parse_primitive...
[ [ "numpy.pad", "tensorflow.shape", "numpy.random.choice", "tensorflow.data.Dataset.from_tensor_slices", "numpy.array", "numpy.random.RandomState", "tensorflow.io.read_file", "tensorflow.TensorShape", "tensorflow.reshape", "numpy.shape", "tensorflow.image.decode_png", ...
shakes76/jax-vision
[ "18e940dd098ac4adef06ab870be6895283d058f1" ]
[ "test_resnet_cifar.py" ]
[ "'''\nTest CIFAR classifications with JAX and Haiku using a ResNet\n\n@author Shakes\n'''\nimport haiku as hk\nimport jax\nimport numpy as np\nimport jax.numpy as jnp\nimport optax\nimport tensorflow as tf\nimport tensorflow_datasets as tfds #stable\nfrom typing import Mapping, Tuple, NamedTuple\nimport time\n\n#lo...
[ [ "tensorflow.random.Generator.from_seed" ] ]
creyesp/houses-project
[ "12c0629666d54784877d3ff3fbcc98a97f8c18ef" ]
[ "notebooks/handson.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.metrics import median_absolute_error\nfrom sklearn.metrics import r2_score\n\n\ndef info(data):\n \"\"\"Get info about dataset.\...
[ [ "sklearn.metrics.mean_squared_error", "pandas.DataFrame", "matplotlib.pyplot.subplots", "sklearn.metrics.median_absolute_error", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.r2_score" ] ]
jerryzhao173985/SMARTS
[ "c8473049b4b52ad3eb29f7c7eb93753c2d70df55" ]
[ "ultra/ultra/baselines/common/state_preprocessor.py" ]
[ "# MIT License\n#\n# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without ...
[ [ "numpy.hstack", "torch.empty", "numpy.asarray", "torch.from_numpy" ] ]
AirHorizons/cond_rnn
[ "8b6625e6b6f608f12e84f6249877a84b87124c31" ]
[ "examples/dummy_stations_example.py" ]
[ "import numpy as np\nfrom tensorflow.keras import Input\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.models import Sequential\n\nfrom cond_rnn import ConditionalRNN\n\n# This is an example with dummy to explain how to use CondRNN.\n# _________________________...
[ [ "numpy.array", "numpy.random.seed", "numpy.mean", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "numpy.random.uniform", "numpy.abs", "tensorflow.keras.Input", "numpy.diag" ] ]
haleqiu/tf-pose-estimation
[ "9e185553acabc3b593d4f41b2026967a6018601b" ]
[ "run_batch.py" ]
[ "\nmodel = \"mobilenet_thin\"\nimage = \"/data/drone_filming/images/forest_person_far_0.jpg\"\nto_write_path = \"human_pose.txt\"\n\nimport argparse\nimport logging\nimport sys\nimport time\n\nfrom tf_pose import common\nimport cv2\nimport os, glob\nimport numpy as np\nfrom tf_pose.estimator import TfPoseEstimator\...
[ [ "matplotlib.pyplot.savefig", "numpy.array", "matplotlib.pyplot.figure" ] ]
chenwydj/dynamic_foggy_unfolding
[ "b8d5d784503e09c9e910f61a8d5ebbac15cd4cf6" ]
[ "bdd/experiments/segmentation/option.py" ]
[ "###########################################################################\n# Created by: CASIA IVA \n# Email: jliu@nlpr.ia.ac.cn \n# Copyright (c) 2018\n###########################################################################\n\nimport os\nimport argparse\nimport torch\n\nclass Options():\n def __init__(se...
[ [ "torch.cuda.is_available", "torch.cuda.device_count" ] ]
drewrisinger/Cirq
[ "0882abb751005191f12d9bae410c9851ea705041" ]
[ "cirq/optimizers/two_qubit_to_fsim_test.py" ]
[ "import itertools\nimport random\nfrom typing import Any\n\nimport numpy as np\nimport pytest\n\nimport cirq\nfrom cirq.optimizers.two_qubit_to_fsim import (\n _decompose_two_qubit_interaction_into_two_b_gates,\n _decompose_xx_yy_into_two_fsims_ignoring_single_qubit_ops,\n _sticky_0_to_1,\n)\n\nUNITARY_OBJ...
[ [ "numpy.eye" ] ]
mcx/d3rlpy
[ "9867803a096b8a90e376443a0ffabb4765f38145" ]
[ "tests/models/torch/test_imitators.py" ]
[ "import pytest\nimport torch\nimport torch.nn.functional as F\n\nfrom d3rlpy.models.encoders import DefaultEncoderFactory\nfrom d3rlpy.models.torch.imitators import (\n ConditionalVAE,\n DeterministicRegressor,\n DiscreteImitator,\n ProbablisticRegressor,\n)\n\nfrom .model_test import DummyEncoder, chec...
[ [ "torch.rand", "torch.nn.functional.log_softmax", "torch.nn.functional.mse_loss", "torch.ones", "torch.randint", "torch.nn.functional.nll_loss" ] ]
nd7141/deepr
[ "57a6b647893f2be8eda753720b05e65c32ca690b" ]
[ "deepr/examples/movielens/jobs/evaluate.py" ]
[ "# pylint: disable=no-value-for-parameter\n\"\"\"Evaluate MovieLens.\"\"\"\n\nimport logging\nfrom dataclasses import dataclass\nfrom typing import List, Union, Optional\n\nimport numpy as np\n\nimport deepr as dpr\nfrom deepr.utils import mlflow\n\ntry:\n import faiss\nexcept ImportError as e:\n print(f\"Fai...
[ [ "numpy.concatenate", "numpy.ascontiguousarray", "numpy.sum", "numpy.ones", "numpy.load", "numpy.mean", "numpy.stack", "numpy.arange", "numpy.intersect1d", "numpy.unique" ] ]
kozistr/improved-ContentDisentanglement
[ "53d80abe197363fb74c0e14ba69d6fc06234f0b3" ]
[ "train.py" ]
[ "import argparse\nimport os\n\nimport torch\nimport torchvision.transforms as transforms\nfrom torch import nn\nfrom torch import optim\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\n\nfrom models import E1\nfrom models import E2\nfrom models import Disc\nfrom models import Decoder\n...
[ [ "torch.cat", "torch.nn.MSELoss", "torch.nn.utils.clip_grad_norm_", "torch.autograd.Variable", "torch.optim.Adam", "torch.full", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.BCELoss" ] ]
ernie55ernie/AnomalyFirewallRuleDetectionAndResolution
[ "d74d2997b82e0e8cbe4a788c46e4eb31f1ce2cbc" ]
[ "anomaly_resolver.py" ]
[ "# Firewall Rule Anomaly Resolver for Ryu restfull firewall \n# https://github.com/osrg/ryu/blob/master/ryu/app/rest_firewall.py\nimport logging\nimport logging.handlers\nimport itertools\nimport ctypes\nfrom netaddr import IPSet, IPRange, IPNetwork, IPGlob\nfrom netaddr import\tcidr_merge, valid_ipv4, valid_glob, ...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
ds-wook/pyuba
[ "b64ffda4d0a41a71be2698515fb73e35356de2e9" ]
[ "pyuba/data/make_dataset.py" ]
[ "import random\n\nimport numpy as np\nimport pandas as pd\n\n\n# make dataset function\ndef load_dataset(index_range: int = 10000, id_range: int = 5000) -> pd.DataFrame:\n \"\"\"\n make growth hacking dataset\n :param index_range: (int)\n make index random information\n :param id_rang...
[ [ "pandas.date_range", "numpy.arange" ] ]
napoler/deepke
[ "4d32527a22b7664600fe06fb5e24e1bedaaba97d" ]
[ "deepke/model/Transformer.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nfrom deepke.model import BasicModule, Embedding\n\n\nclass DotAttention(nn.Module):\n '''\n \\text {Attention }(Q, K, V)=\\operatorname{softmax}\\left(\\frac{Q K^{T}}{\\sqrt{d_{k}}}\\right) V\n '''\n def __init__(self, dropout=0.0):\n super(DotAt...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.nn.Softmax", "torch.manual_seed", "torch.nn.ReLU", "torch.matmul", "torch.randn" ] ]
ayyoobimani/GNN-POSTAG
[ "47eb4bc6d64de565e87ee7cb8e9c5020d936138c" ]
[ "pos_evaluation/create_train.py" ]
[ "\"\"\"\n\nCreate train from bronze data\nExample call:\n$ python3 create_train.py --bronze_file /mounts/work/ayyoob/results/gnn_align/yoruba/POSTgs_hin-x-bible-bsi_15lngs-POSFeatTruealltgts_trnsfrmrTrue6LResTrue_trainWEFalse_mskLngTrue_E1_traintgt0.8_TypchckTrue_TgBsdSlctTrue_tstamtall_20220502-155236_ElyStpDlta0-...
[ [ "torch.load" ] ]
hyoiutu/Miriabot_learning
[ "fe0f5cb7a48542c9e710853609fc0282fefeef42" ]
[ "fine_tuning.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.app.flags.DEFINE_integer", "tensorflow.app.flags.DEFINE_string", "tensorflow.compat.as_bytes", "tensorflow.Graph", "tensorflow.Session", "tensorflow.app.flags.DEFINE_boolean", "tensorflow.train.get_checkpoint_state", "tensorflow.gfile.GFile", "tensorflow.train.check...
GabrielUSMC/Mars_web_scraping_project
[ "fdaf1f05ca82aff08ff9e44387fd80a61c639ed3" ]
[ "Missions_to_Mars/scrape_mars.py" ]
[ "from splinter import Browser\nfrom bs4 import BeautifulSoup as bs\nimport requests\nimport pandas as pd\nimport time\n\n\ndef scrape():\n py_dict = {}\n# %%\n# URL of page to be scraped\n url = 'https://mars.nasa.gov/news/'\n\n\n# %%\n# Retrieve page with the requests module\n response = requests.get(url)...
[ [ "pandas.read_html" ] ]
shyams2/jax-fenics-adjoint
[ "19e51719adc4a816192b3b0719e1c0208d4ff242" ]
[ "tests/fenics/test_assemble.py" ]
[ "from pytest_check import check\nimport jax\nfrom jax.config import config\nimport jax.numpy as np\nimport numpy as onp\n\nimport fenics\nimport fenics_adjoint as fa\nimport ufl\n\nimport fdm\n\nfrom jaxfenics_adjoint import build_jax_fem_eval\n\nconfig.update(\"jax_enable_x64\", True)\n\nmesh = fa.UnitSquareMesh(3...
[ [ "numpy.random.normal" ] ]
SilverKnightVGM/Mask_RCNN-Multi-Class-Detection
[ "f1ce0c987f1fdf62df909ee2697ceb69a69ae3f5" ]
[ "mrcnn/model.py" ]
[ "\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict...
[ [ "tensorflow.exp", "numpy.random.choice", "tensorflow.image.non_max_suppression", "numpy.copy", "tensorflow.unique", "tensorflow.reshape", "numpy.where", "tensorflow.sqrt", "numpy.sort", "tensorflow.stack", "tensorflow.control_dependencies", "numpy.broadcast_to", ...
coleygroup/Graph2SMILES
[ "1b87f9ffdb739346b94853dfe8e5d63ac0198a38" ]
[ "utils/data_utils.py" ]
[ "import logging\nimport os.path\n\nimport networkx as nx\nimport numpy as np\nimport re\nimport selfies as sf\nimport sys\nimport time\nimport torch\nfrom rdkit import Chem\nfrom torch.utils.data import Dataset\nfrom typing import Dict, List, Tuple\nfrom utils.chem_utils import ATOM_FDIM, BOND_FDIM, get_atom_featur...
[ [ "numpy.concatenate", "numpy.array", "numpy.count_nonzero", "numpy.fill_diagonal", "numpy.zeros", "numpy.matmul", "numpy.sum", "numpy.ones", "numpy.load", "numpy.random.shuffle", "numpy.stack", "numpy.arange", "torch.tensor", "numpy.argsort", "numpy.cumsu...
kateiyas/Brancher
[ "144f5bdfc3b1e6839543ac49f88f27d6daccb540" ]
[ "examples/advanced_autoregressive.py" ]
[ "import chainer\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom brancher.variables import RootVariable, RandomVariable, ProbabilisticModel\nfrom brancher.standard_variables import NormalVariable, LogNormalVariable, BetaVariable\nfrom brancher import inference\nimport brancher.functions as BF\n\n# Proba...
[ [ "numpy.array", "matplotlib.pyplot.subplots", "numpy.mean", "matplotlib.pyplot.show", "numpy.var" ] ]
The-SocialLion/Prediction-of-Quality-Of-Red-Wine-using-SVM
[ "5ca81f6d16b1943b8df7003c867bcccb2c2e35ea" ]
[ "WQL.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Untitled38.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1D8Trl4wwfawf_9i_HM6zq7lHgGVmKLTv\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndataset=pd.read_csv('wineq...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.metrics.accuracy_score", "sklearn.svm.SVC", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
Maxprofs/Cerebrum
[ "b4f88cd467233443c47d699efd30defd8c464166" ]
[ "cerebrum/neuralnet/developmentExamples/neurolab-newelm.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\" \nExample of use Elman recurrent network\n=====================================\n\nTask: Detect the amplitudes\n\n\"\"\"\n\nimport neurolab as nl\nimport numpy as np\n\n# Create train samples\ni1 = np.sin(np.arange(0, 20))\ni2 = np.sin(np.arange(0, 20)) * 2\n\nt1 = np.ones([1, 20])\...
[ [ "numpy.array", "numpy.ones", "numpy.arange" ] ]
djcaminero/MoSQITo-FDP
[ "f6b966523156731bd82cfeb9b1d38aeb69e89106" ]
[ "mosqito/functions/hearing_model/segmentation_blocks.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: Daniel Jiménez-Caminero Costa\r\n\"\"\"\r\n\r\nimport numpy as np\r\n\r\n\r\ndef segmentation_blocks(band_pass_signal_hr, sb, sh, dim):\r\n \"\"\" Function used for the segmentation of the signal into smaller parts of audio (blocks). This has been implemented\r\n ...
[ [ "numpy.concatenate", "numpy.zeros" ] ]
ksangeeta2429/Edgel3
[ "b05892cf7c5be079639b8cccd51ead93fe1eae1a" ]
[ "edgel3/core.py" ]
[ "import os\nimport resampy\nimport traceback\nimport sklearn.decomposition\nimport soundfile as sf\nimport numpy as np\nfrom numbers import Real\nimport warnings\nimport keras\nfrom edgel3.models import load_embedding_model\nfrom edgel3.edgel3_exceptions import EdgeL3Error\nfrom edgel3.edgel3_warnings import EdgeL3...
[ [ "numpy.pad", "numpy.lib.stride_tricks.as_strided", "numpy.mean", "numpy.savez", "numpy.arange", "numpy.all" ] ]
dovletov/scaling-potato
[ "59facff4b0a52c4540c5ce2e112ad73d43eec180" ]
[ "tmp.py" ]
[ "from __future__ import print_function\nimport torch\n\nx = torch.empty(5,3)\nprint(x)\nprint(\"x - \", x.dtype)\n\ny = torch.rand(5,3)\nprint(y)\nprint(\"y - \", y.dtype)\n\nz = torch.zeros(5,3, dtype=torch.long)\nprint(z)\nprint(\"z - \", z.dtype)\n\na = torch.tensor([5.5, 3])\nprint(a)\nprint(\"a - \", a.dtype)\...
[ [ "torch.zeros", "torch.rand", "torch.device", "numpy.add", "numpy.ones", "torch.add", "torch.from_numpy", "torch.randn_like", "torch.cuda.is_available", "torch.tensor", "torch.ones_like", "torch.empty", "torch.randn" ] ]
victorjoos/lightning-metrics
[ "f06488faf79d4f4792cd392e964870d4898dde45" ]
[ "tests/classification/test_average_precision.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.zeros_like", "sklearn.metrics.average_precision_score", "torch.tensor" ] ]
StatsGary/audio
[ "0a701058b432dd602bba3461866bfb3c3a352e04" ]
[ "torchaudio/_extension.py" ]
[ "import os\nimport warnings\nfrom pathlib import Path\n\nimport torch\nfrom torchaudio._internal import module_utils as _mod_utils # noqa: F401\n\n_LIB_DIR = Path(__file__).parent / 'lib'\n\n\ndef _get_lib_path(lib: str):\n suffix = 'pyd' if os.name == 'nt' else 'so'\n path = _LIB_DIR / f'{lib}.{suffix}'\n ...
[ [ "torch.ops.load_library", "torch.classes.load_library" ] ]
wuchih-amazon/sagemaker-python-sdk
[ "716b2591d7c050a1ecb26d91cda1733302dd38a5" ]
[ "tests/integ/test_pytorch.py" ]
[ "# Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th...
[ [ "numpy.random.rand", "numpy.zeros" ] ]
Nacho114/bivariate-causal-inference
[ "a54fe2ba13e1637d870c18f06e4c823ab053f08b", "a54fe2ba13e1637d870c18f06e4c823ab053f08b" ]
[ "twintest/viz.py", "benchmark/tueb_data.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nimport causality\n\nCONFIG = {\n 'alpha': .7\n}\n\ndef pretty_scatter(x, y, x_label=None, y_label=None, fname=None):\n plt.scatter(x, y, alpha=CONFIG['alpha'])\n\n if x_label:\n plt.xlabel(x_label)\n\n if y_label:\n plt.ylabel(y_label...
[ [ "matplotlib.colors.to_rgb", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", "numpy.linspace" ], [ "pandas.read_csv", ...
AmanDaVinci/Universal-Sentence-Representations
[ "e51d9e28233629094f88212a688b23fb4789b807" ]
[ "models/bi_lstm.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_padded_sequence\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass BiLSTM(nn.Module):\n \n def __init__(self, embeddings, batch_size, hidden_size, device, num_layers=1):\n super().__init__()\n self.emb = nn.Em...
[ [ "torch.nn.Embedding.from_pretrained", "torch.cat", "torch.nn.LSTM", "torch.max", "numpy.sum", "matplotlib.pyplot.title", "torch.nn.utils.rnn.pack_padded_sequence", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.bar", "torch.randn", "matplot...
yl305237731/number_detection_recognition
[ "643b98d559f61b93c3db17a1d484bfbb1745bdca" ]
[ "location/predict.py" ]
[ "import numpy as np\nfrom PIL import Image, ImageDraw\nfrom keras.preprocessing import image\nfrom keras.applications.vgg16 import preprocess_input\nimport cv2\nimport cfg\nfrom network import East\nfrom preprocess import resize_image\nfrom nms import nms\nimport os\n\n\ndef sigmoid(x):\n \"\"\"`y = 1 / (1 + exp...
[ [ "numpy.reshape", "numpy.exp", "numpy.greater_equal", "numpy.where", "numpy.amin", "numpy.squeeze", "numpy.expand_dims" ] ]
wangbq18/nlp_xiaojiang
[ "c5dade4b4d22406eb3c77a120619b8347a892eb4" ]
[ "ClassificationText/bert/keras_bert_classify_text_cnn.py" ]
[ "# -*- coding: UTF-8 -*-\r\n# !/usr/bin/python\r\n# @time :2019/5/18 23:51\r\n# @author :Mo\r\n# @function :classify text of bert and (text-cnn、r-cnn or avt-cnn)\r\n\r\nfrom __future__ import division, absolute_import\r\n\r\nfrom keras.objectives import sparse_categorical_crossentropy, categorical_crossentrop...
[ [ "sklearn.metrics.classification_report", "numpy.array", "numpy.argmax" ] ]
Amamgbu/sentiment-analysis
[ "7c520c84507a143726c15b5fc97411f3459e45f2" ]
[ "app.py" ]
[ "from flask import Flask,render_template,jsonify,request\nimport keras\nfrom keras.models import load_model\nfrom preprocessing import detect_and_resize\nimport cv2 as cv\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom keras.preprocessing.image import img_to_array\n\na...
[ [ "numpy.expand_dims", "numpy.argmax", "matplotlib.pyplot.imread" ] ]
vkola-lab/ncomms2022
[ "9dc198d48e49807fe07aa927932ca5d030f096ca" ]
[ "FigureTable/RadioRegions/scatter_plots.py" ]
[ "import csv\nimport os\nfrom collections import defaultdict\nfrom scipy import stats\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\nimport scipy\nimport numpy as np\n\nfrom matplotlib import rc, rcParams\nrc('axes', linewidth=1)\nrc('font', weight='bold', size=20)\n...
[ [ "matplotlib.path.Path", "numpy.sin", "pandas.DataFrame.from_dict", "scipy.stats.spearmanr", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.rc", "scipy.stats.pearsonr", "numpy.cos", "numpy.linspace" ] ]
migperfer/nnAudio
[ "2d4fb69b6ab259c76e2f9b9b0818b554b1474eb1" ]
[ "Installation/nnAudio/features/cqt.py" ]
[ "import torch.nn as nn\nimport torch\nimport numpy as np\nfrom time import time\nfrom ..utils import *\nfrom ..utils import *\n\n\nclass CQT1992(nn.Module):\n \"\"\"\n This alogrithm uses the method proposed in [1], which would run extremely slow if low frequencies (below 220Hz)\n are included in the frequ...
[ [ "numpy.ceil", "torch.cat", "torch.stack", "numpy.float", "torch.nn.ConstantPad1d", "torch.nn.Parameter", "torch.atan2", "torch.tensor", "torch.nn.ReflectionPad1d" ] ]
ai-aksoyoglu/supermarket-simulation_Markov-chain
[ "d52fda1001df3b4fd5bf300deb189e25bdbe32d0" ]
[ "libraryof4.py" ]
[ "import pandas as pd\nimport numpy as np\n\ndef construct_freq_df(df_copy):\n '''\n Construct a dataframe such that indices are seperated by delta 1 min from the Market Data\n and put it in a format that markov matrices can be obtained by the pd.crosstab() method\n '''\n \n #This is here in case u...
[ [ "pandas.to_datetime", "numpy.array", "numpy.random.choice", "pandas.Timedelta", "pandas.DataFrame", "pandas.crosstab", "pandas.to_timedelta", "pandas.concat", "numpy.vstack" ] ]
Jammy2211/PyAutoModel
[ "02f54e71900de9ec12c9070dc00a4bd001b25afa" ]
[ "test_autogalaxy/profiles/test_point_sources.py" ]
[ "from __future__ import division, print_function\r\nimport numpy as np\r\n\r\nimport autogalaxy as ag\r\n\r\ngrid = np.array([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0], [2.0, 4.0]])\r\n\r\n\r\nclass TestPointFlux:\r\n def test__constructor(self):\r\n\r\n point_source = ag.ps.PointFlux(centre=(0.0, 0.0), flux=0.1...
[ [ "numpy.array" ] ]
akbokha/image-colorization
[ "eb0dd370f42c5f7fe8fefc76513d8c3428cfc68e" ]
[ "src/ps/dist_model.py" ]
[ "from __future__ import absolute_import\nimport numpy as np\nimport torch\nfrom torch import nn\nimport os\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nimport itertools\nfrom scipy.ndimage import zoom\nimport fractions\nimport functools\nimport skimage.transform\nfrom IPython import em...
[ [ "numpy.concatenate", "numpy.array", "torch.autograd.Variable", "numpy.sum", "torch.optim.Adam", "numpy.mean", "torch.clamp", "numpy.argsort", "numpy.cumsum", "torch.load", "scipy.ndimage.zoom", "torch.mean" ] ]
AyoubEssrifi/Data-Structures-Algorithms
[ "d903bccba46cd8f2a35728f47cdfc836d5dfdf1a" ]
[ "arrays/sorting/bubble_sort.py" ]
[ "import numpy as np\n\ndef bubble_sort(arr):\n \"\"\"\n Performs a bubble sort algorithm\n - Time complexity: O(n²)\n \n Args:\n arr (list): List to sort\n\n Returns:\n (list): Sorted list\n \"\"\"\n j = len(arr) - 1\n while j >= 0:\n i = 0\n while i < j:\n ...
[ [ "numpy.random.randint" ] ]
pratham-web/jina
[ "09da614f4d4a14b38e5355352961ad40735e9cde" ]
[ "tests/unit/drivers/test_segmenter_driver.py" ]
[ "from typing import Dict, List\n\nimport numpy as np\nimport pytest\n\nfrom jina.drivers.craft import SegmentDriver\nfrom jina.drivers.helper import array2pb\nfrom jina.executors.crafters import BaseSegmenter\nfrom jina.proto import jina_pb2, uid\n\n\nclass MockSegmenter(BaseSegmenter):\n def __init__(self, *arg...
[ [ "numpy.array" ] ]
VictorSayoan/Projetos-De-Analise-De-Dados
[ "d5d0e2c56711af388330ed458207b735881f2dae" ]
[ "Projeto04-Indicadores_Principais_Bolsas_De_ Valores/Func_grafico.py" ]
[ "import matplotlib.pyplot as plt\n\n\ndef controi_grafico(prop1, prop2, dado1, dado2, estilo, cor, marcador, titulo, msg_x, msg_y):\n plt.figure(figsize=(prop1, prop2))\n plt.plot(dado1, dado2, linestyle=estilo, color=cor, marker=marcador)\n plt.title(titulo)\n plt.xlabel(msg_x)\n plt.ylabel(msg_y)\n...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
limaries30/Binanace-trading-simulation
[ "9646dccceea5c1735b987057b008d6e8eb0e6cca" ]
[ "agent/PPO/custom_trading_env.py" ]
[ "import os\nimport logging\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom colour import Color\n\nclass TradingEnv:\n def __init__(self, custom_args, env_id, obs_data_len, step_len, sample_len,\n df, fee, i...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.array", "matplotlib.style.use", "matplotlib.pyplot.ion", "pandas.DataFrame", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause", "matplotlib.pyplot.show" ] ]
jt7960/FB
[ "3e06b633d2674d6b500b5d9ea0a1363de26ea8fb" ]
[ "Scraper/stats.py" ]
[ "##scrapes nba.com/stats\n\n#import the libraries\nfrom bs4 import BeautifulSoup\nimport requests\nimport numpy\nimport pyodbc\nimport pandas as pd\n#from datetime import *\n#from dateutil.relativedelta import *\n\nnba_months = ['october', 'november', 'december', 'january', 'feburary', 'march', 'april', 'june']\n\n...
[ [ "pandas.read_html" ] ]
quanghuy17111999/LMTracker
[ "221ff8ff97e8d81ad03c0bab187ef1dbbad42c12" ]
[ "model.py" ]
[ "from distutils.log import WARN\nfrom pdb import post_mortem\nfrom typing import Dict, List, Optional, Tuple\n\nimport torch\nfrom torch import Tensor\nfrom torch.nn import Embedding\nfrom torch.utils.data import DataLoader\nfrom torch_sparse import SparseTensor\n\nfrom torch_geometric.typing import EdgeType, NodeT...
[ [ "torch.sigmoid", "torch.cat", "torch.stack", "sklearn.linear_model.LogisticRegression", "torch.tensor", "torch.zeros_like", "torch.nn.Embedding" ] ]
jdmunday/SchoolHouseholdNetworksCOVID
[ "91ec9f07b2fdc784bab5038c9f975de5227ab1a3" ]
[ "UK_pupil_data_functions/filt_agg_pupildata.py" ]
[ "\nimport numpy as np\nimport pandas as pd\n\nimport os\n\nfrom scipy.sparse import coo_matrix\n\n\nfrom pathlib import Path\n\np = Path(os.getcwd()).parents[0]\n\n# set file paths \nschooldatapath = '/Users/lsh1514285/jdrive/SCDATA/'\nfilename = 'Autumn_Census_Addresses_2020.txt'\nfilename_hh_id = 'aut_hh_v2.csv'\...
[ [ "pandas.DataFrame", "pandas.read_csv", "numpy.array", "pandas.read_table" ] ]
Narquelion/LingTube
[ "840ae6b58a1606beecb5823fe7f6953d309aa764" ]
[ "base/4-correct-captions.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nfrom os import listdir, makedirs, path\nimport pandas as pd\nimport shutil\nfrom re import sub, match\nimport sys\nimport webbrowser\nimport subprocess\n\nfrom glob import glob\n\ntry:\n import Tkinter as tk # Python2\nexcept ImportError:\n import tkinter as tk # ...
[ [ "pandas.read_csv" ] ]
trungnt13/bigarray
[ "4c9bcdd48da495cb1f919730dc52165c5d3c8703" ]
[ "tests/test_mmaparray.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport os\nimport unittest\nimport zlib\nfrom io import BytesIO\nfrom multiprocessing import Pool\nfrom tempfile import mkstemp\n\nimport numpy as np\n\nfrom bigarray import MmapArray, MmapArrayWriter\n\nnp.random.seed(8)\n\n\n# ==================...
[ [ "numpy.concatenate", "numpy.random.rand", "numpy.random.seed", "numpy.arange", "numpy.random.randint", "numpy.frombuffer", "numpy.all" ] ]
bermanmaxim/pytorch-image-models
[ "1d7f2d93a68bdc3c5d8d634d869709f6cdd7cecd" ]
[ "timm/models/helpers.py" ]
[ "import torch\nimport torch.utils.model_zoo as model_zoo\nimport os\nfrom collections import OrderedDict\n\n\ndef load_checkpoint(model, checkpoint_path, use_ema=False):\n if checkpoint_path and os.path.isfile(checkpoint_path):\n checkpoint = torch.load(checkpoint_path)\n state_dict_key = ''\n ...
[ [ "torch.utils.model_zoo.load_url", "torch.load" ] ]
sirCamp/tensorflow-kernels
[ "e3d459406f463bb646e150c3bab89d8410f86f16" ]
[ "kernels/experimental/p_spectrum_kernel.py" ]
[ "import tensorflow as tf\n\nfrom kernels.base import BaseKernel\n\ntf.enable_eager_execution()\ntf.executing_eagerly()\n\nimport numpy as np\n\n__author__ = \"Stefano Campese\"\n\n__version__ = \"0.1.2\"\n__maintainer__ = \"Stefano Campese\"\n__email__ = \"sircampydevelop@gmail.com\"\n\n\nclass PSpectrumKernel(Base...
[ [ "tensorflow.convert_to_tensor", "tensorflow.size", "tensorflow.strings.length", "tensorflow.range", "tensorflow.Variable", "tensorflow.reshape", "tensorflow.executing_eagerly", "tensorflow.enable_eager_execution", "tensorflow.contrib.lookup.MutableHashTable", "tensorflow.st...
ml-research/Learning-to-Break-Deep-Perceptual-Hashing
[ "12148e8ecd47faa1f816f52f56662c47cd240cc1" ]
[ "adv3_robustness_check.py" ]
[ "import argparse\nimport os\nfrom pathlib import Path\n\nimport torch\nfrom torch.utils.data import DataLoader\nimport torchvision.transforms as T\nfrom tqdm import tqdm\nfrom torchvision.datasets import CIFAR10, CIFAR100, STL10, ImageNet, ImageFolder\nimport numpy as np\nimport pandas as pd\n\nfrom models.neuralha...
[ [ "torch.device", "numpy.array", "numpy.log", "pandas.DataFrame", "torch.no_grad", "torch.sign", "torch.utils.data.DataLoader", "torch.load", "numpy.linspace", "numpy.logspace", "numpy.flip" ] ]
janekfleper/Qcodes
[ "c3b3749c1fd9e5171da9313a9a630a3b54812700" ]
[ "qcodes/tests/dataset/measurement/test_measurement_context_manager.py" ]
[ "import json\nimport logging\nimport os\nimport re\nimport traceback\nfrom time import sleep\n\nimport hypothesis.strategies as hst\nimport numpy as np\nimport pytest\nfrom hypothesis import HealthCheck, given, settings\nfrom numpy.testing import assert_allclose, assert_array_equal\nfrom unittest.mock import patch\...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.random.randn", "numpy.tile", "numpy.allclose", "numpy.prod", "numpy.arange", "numpy.linspace", "...
alexandrx/pykitti
[ "0e5fd7fefa7cd10bbdfb5bd131bb58481d481116" ]
[ "pykitti/odometry.py" ]
[ "\"\"\"Provides 'odometry', which loads and parses odometry benchmark data.\"\"\"\n\nimport datetime as dt\nimport glob\nimport os\nfrom collections import namedtuple\n\nimport numpy as np\n\nimport pykitti.utils as utils\n\n__author__ = \"Lee Clement\"\n__email__ = \"lee.clement@robotics.utias.utoronto.ca\"\n\n\nc...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.reshape", "numpy.eye", "numpy.fromstring", "numpy.linalg.inv", "numpy.vstack" ] ]
linlih/colorization-pytorch
[ "f3fd558d4b99d253988ea7ac8389f6842daa4315" ]
[ "models/networks.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\n\n###############################################################################\n# Helper Functions\n###############################################################################\n\n\ndef get...
[ [ "torch.cat", "torch.optim.lr_scheduler.StepLR", "torch.nn.LeakyReLU", "torch.nn.init.kaiming_normal_", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.sum", "torch.nn.Softmax", "torch.nn.init.constant_", "torch.nn.ConvTranspose2d", "torch.abs", "torch.nn....
bgoldbeck/ldraw
[ "61a3fde105d0c0841a571037537ec3347bae8808" ]
[ "src/rendering/basic_mesh_object.py" ]
[ "# Copyright (C) 2018\n# This notice is to be included in all relevant source files.\n# \"Brandon Goldbeck\" <bpg@pdx.edu>\n# “Anthony Namba” <anamba@pdx.edu>\n# “Brandon Le” <lebran@pdx.edu>\n# “Ann Peake” <peakean@pdx.edu>\n# “Sohan Tamang” <sohan@pdx.edu>\n# “An Huynh” <an35@pdx.edu>\n# “Theron Anderson” <athero...
[ [ "numpy.array" ] ]
omartin2010/jetson-motion-driver
[ "8d781026f6c86f5becf1fe6d2ae1e96ed7685b1f" ]
[ "src/armlink.py" ]
[ "# flake8: ignore=E501\r\nfrom logger import RoboLogger\r\nimport threading\r\nfrom ev3dev2.motor import SpeedDPS # , SpeedPercent\r\nfrom mymotor import MyMotor\r\nfrom gyrosensor import GyroSensor\r\nimport traceback\r\n# import asyncio\r\nimport time\r\nfrom exceptions import ControlerRunningTooLongException,...
[ [ "numpy.radians", "numpy.degrees" ] ]
sbrice/HARK
[ "90562104182e9d91b0d013534d26f1024a730ae6" ]
[ "HARK/ConsumptionSaving/ConsIndShockModel.py" ]
[ "'''\nClasses to solve canonical consumption-savings models with idiosyncratic shocks\nto income. All models here assume CRRA utility with geometric discounting, no\nbequest motive, and income shocks are fully transitory or fully permanent.\n\nIt currently solves three types of models:\n 1) A very basic \"perfec...
[ [ "numpy.max", "numpy.logical_or", "numpy.array", "numpy.dot", "numpy.asarray", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.min", "scipy.optimize.newton", "numpy.arange", "numpy.linspace", "numpy.insert" ] ]
mkim55/BleedDetection
[ "93eb5c08ab210b76ae554a5d7b3ffc8bdc7e3180" ]
[ "exec.py" ]
[ "#!/usr/bin/env python\n# Copyright 2018 Division of Medical Image Computing, German Cancer Research Center (DKFZ).\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://...
[ [ "torch.no_grad", "torch.cuda.get_device_name", "torch.cuda.device", "torch.optim.lr_scheduler.ReduceLROnPlateau", "pandas.concat" ] ]
cmougan/sktools
[ "dd750a7ffb882709b827a07fb5a768cf5e9dabca" ]
[ "tests/test_encoders.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"Tests for `sktools` package.\"\"\"\n\nimport unittest\n\nimport sktools\nimport pandas as pd\nfrom category_encoders import MEstimateEncoder\nimport numpy as np\n\n\nclass TestQuantileEncoder(unittest.TestCase):\n \"\"\"Tests for percentile encoder.\"\"\"\n\n def setUp(self):\n...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "pandas.DataFrame", "pandas.Series" ] ]
trestripes-com/mobius
[ "cd96e53b6ad7923cdab62781c0aeef182e062db2" ]
[ "mobius_data_augmentation/mobius_admissable.py" ]
[ "import numpy as np\nimport random\nfrom collections import defaultdict\nfrom numpy import *\n\nfrom random import random\ncounts = defaultdict(int)\nheight =32\nwidth = 32\nM=2\nstd = 0.05\nfor i in range(0,1000):\n print(i)\n zp=[complex(height*random(),width*random()), complex(height*random(),width*random(...
[ [ "numpy.absolute" ] ]
LaoKpa/reinforcement_trader
[ "1465731269e6d58900a28a040346bf45ffb5cf97" ]
[ "prof/Src/q_learning_stock/train_rl7.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport tensorflow as tf\nfrom copy import deepcopy\nfrom tqdm import tqdm\nfrom pathlib import Path\nfrom sklearn.preprocessing import MinMaxScaler\nimport datetime\nimport sys\nimport math\nimport util\nimport config\nimport indicators\n\nw...
[ [ "numpy.random.rand", "tensorflow.matmul", "tensorflow.train.get_checkpoint_state", "numpy.concatenate", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.global_variables_initializer", "numpy.max", "tensorflow.compat.v1.train.AdamOptimizer", "pandas.DataFrame", "ten...
amitkumar05/ReinforcementLearning-Quadcopter
[ "b7b8985f348068af6b85c385a5fb5d8b8fff0f8f" ]
[ "catakin_proj/src/quad_controller_rl/src/quad_controller_rl/tasks/all.py" ]
[ "\"\"\"Takeoff task.\"\"\"\n\nimport numpy as np\nfrom gym import spaces\nfrom geometry_msgs.msg import Vector3, Point, Quaternion, Pose, Twist, Wrench\nfrom quad_controller_rl.tasks.base_task import BaseTask\n\nclass All(BaseTask):\n \"\"\"Simple task where the goal is to lift off the ground and reach a target ...
[ [ "numpy.random.normal", "numpy.array" ] ]
zhengzangw/Deep-Consensus-Finding
[ "9211a34da7415fae44847e0520210d4c89d3dafc" ]
[ "src/dna_dataset_v2.py" ]
[ "import os\n\nimport torch\nfrom torch.utils.data import DataLoader, Dataset\n\nmeta = torch.load(\"./data/meta_info_v2.pth\")\n# DICT = meta[\"dict\"] # {'A': 0, 'C': 1, 'G': 2, 'T': 3}\nchar_dict = meta[\"dict\"] # {'A': 0, 'C': 1, 'G': 2, 'T': 3}\nMAX_LEN = meta[\"max_len\"] # max length of a strand; typicall...
[ [ "torch.stack", "torch.arange", "torch.tensor", "torch.utils.data.DataLoader", "torch.load" ] ]
mdlama/pydstool
[ "3d298e908ff55340cd3612078508be0c791f63a8" ]
[ "PyDSTool/utils.py" ]
[ "\"\"\"\n User utilities.\n\"\"\"\nfrom __future__ import absolute_import, print_function\n\nfrom distutils.util import get_platform\nfrom numpy.distutils import misc_util\n\nfrom .errors import *\nfrom .common import *\nfrom .parseUtils import joinStrs\nfrom PyDSTool.core.context_managers import RedirectStdout\...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.argmin", "scipy.optimize.minpack.fsolve", "numpy.distutils.misc_util.get_shared_lib_extension", "scipy.optimize.minpack.bisection", "numpy.take", "scipy.optimize.minpack.fixed_point", "numpy.argsort", "nump...
derosejf/RedditHumorDetection
[ "48d93df7df82a8cab0fb3981a74b4c9448e7b555" ]
[ "eval.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport argparse\nimport csv\nimport logging\nimport os\nimport sys\nfrom collections import defaultdict\nimport pandas as pd\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import (DataLoader, SequentialSampler,\n ...
[ [ "numpy.sum", "torch.no_grad", "torch.utils.data.SequentialSampler", "torch.cuda.device_count", "torch.cuda.is_available", "numpy.argmax", "torch.utils.data.DataLoader", "torch.tensor", "numpy.append", "torch.load", "sklearn.metrics.precision_score", "sklearn.metrics...