repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
tdchaitanya/kornia | [
"6dd16563f66f979c7a95846ef86678894b7d54fd"
] | [
"kornia/filters/filter.py"
] | [
"from typing import Tuple, List\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom kornia.filters.kernels import normalize_kernel2d\n\n\ndef compute_padding(kernel_size: Tuple[int, int]) -> List[int]:\n \"\"\"Computes padding tuple.\"\"\"\n # 4 ints: (padding_left, padding_right,pa... | [
[
"torch.nn.functional.conv2d",
"torch.nn.functional.pad"
]
] |
rryan/transformers | [
"f382a8decda82062bb6911f05b646f404eacfdd4"
] | [
"examples/run_glue.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.utils.data.DataLoader",
"torch.cuda.manual_seed_all",
"torch.no_grad",
"numpy.random.seed",
"torch.cuda.is_available",
"torch.distributed.init_process_group",
"torch.save",
"torch.cuda.device_count",
"torch.nn.DataParallel",
"torch.utils.data.RandomSampler",
"tor... |
amanaster2/landlab | [
"ea17f8314eb12e3fc76df66c9b6ff32078caa75c",
"ea17f8314eb12e3fc76df66c9b6ff32078caa75c"
] | [
"tests/components/erosion_deposition/test_general_erodep.py",
"landlab/components/profiler/base_profiler.py"
] | [
"import numpy as np\nimport pytest\nfrom numpy import testing\n\nfrom landlab import RasterModelGrid\nfrom landlab.components import ErosionDeposition, FlowAccumulator\n\n\ndef test_Ff_too_high_vals():\n \"\"\"\n Test that instantiating ErosionDeposition with a F_f value > 1 throws a\n ValueError.\n \"\... | [
[
"numpy.ones",
"numpy.zeros"
],
[
"matplotlib.pyplot.gca",
"matplotlib.collections.LineCollection"
]
] |
lasdasdas/tensorflow | [
"673b993983f37f332ff70cdb642305f69089337d"
] | [
"tensorflow/python/distribute/parameter_server_strategy_v2.py"
] | [
"# Lint as: python3\n# Copyright 2020 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... | [
[
"tensorflow.python.framework.ops.colocate_with",
"tensorflow.python.platform.tf_logging.info",
"tensorflow.python.util.tf_export.tf_export",
"tensorflow.python.eager.remote.connect_to_cluster",
"tensorflow.python.platform.tf_logging.debug",
"tensorflow.python.training.server_lib.ClusterDev... |
SeanTater/rsvp | [
"2f136ee8aac2d9401427d4d4f0d78f74eb757f15"
] | [
"demo.py"
] | [
"#!/usr/bin/python3\nimport cv2\nimport numpy as np\nimport sqlite3\nimport time\n\nclass QualityCheck:\n def __init__(self):\n \"\"\" Record model runs \"\"\"\n self.db = sqlite3.connect(\"logs.db\", isolation_level=None)\n self.db.execute(\"\"\"\n CREATE TABLE IF NOT EXISTS Mode... | [
[
"numpy.sign",
"numpy.moveaxis",
"numpy.abs",
"numpy.linalg.svd",
"numpy.clip",
"numpy.log",
"numpy.array",
"numpy.dot",
"numpy.random.randint",
"numpy.frombuffer"
]
] |
pschafhalter/pylot | [
"712fd504f9e2669cfc9876eaed4954fbf2b31f20"
] | [
"pylot/perception/detection/detection_operator.py"
] | [
"\"\"\"Implements an operator that detects obstacles.\"\"\"\nimport logging\nimport time\n\nimport erdos\n\nimport numpy as np\n\nimport pylot.utils\nfrom pylot.perception.detection.obstacle import Obstacle\nfrom pylot.perception.detection.utils import BoundingBox2D, \\\n OBSTACLE_LABELS, load_coco_bbox_colors, ... | [
[
"numpy.zeros",
"tensorflow.gfile.GFile",
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.import_graph_def",
"tensorflow.GPUOptions",
"tensorflow.ConfigProto",
"tensorflow.GraphDef"
]
] |
Sohl-Dickstein/learned_optimization | [
"cd929359a51d09444665021387c058aac11b63ba"
] | [
"learned_optimization/baselines/run_archive.py"
] | [
"# coding=utf-8\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"numpy.asarray"
]
] |
wull566/tensorflow_demo | [
"c2c45050867cb056b8193eb53466d26b80b0ec13"
] | [
"tutorials/2_tensorflow_old/numpy&pandas/17_merge.py"
] | [
"# View more 3_python 2_tensorflow_old on my Youtube and Youku channel!!!\n\n# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg\n# Youku video tutorial: http://i.youku.com/pythontutorial\n\n\"\"\"\nPlease note, this code is only for 3_python 3+. If you are using 3_python 2+, please m... | [
[
"pandas.DataFrame",
"pandas.merge"
]
] |
dohmatob/adversarial-robustness-toolbox | [
"7d3ba7d2d6690be69c08754fbc632947c2d10a97"
] | [
"art/classifiers/classifier.py"
] | [
"# MIT License\n#\n# Copyright (C) IBM Corporation 2018\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, ... | [
[
"numpy.array",
"numpy.asarray"
]
] |
kashif/spinningup-pytorch | [
"8f3389c239c94b3ff46453f359061ae30d851ce8"
] | [
"fireup/algos/ddpg/ddpg.py"
] | [
"import time\n\nimport gym\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom fireup.algos.ddpg import core\nfrom fireup.utils.logx import EpochLogger\n\n\nclass ReplayBuffer:\n \"\"\"\n A simple FIFO experience replay buffer for DDPG agents.\n \"\"\"\n\n def __init__(self, obs_d... | [
[
"torch.nn.functional.mse_loss",
"numpy.zeros",
"torch.manual_seed",
"numpy.random.seed",
"numpy.random.randn",
"numpy.clip",
"numpy.random.randint",
"torch.Tensor"
]
] |
marinarierav-uab/foveabox | [
"1f313fd14aaf018aadb0c6b3de163eb0a3b1fbd5"
] | [
"tools/challenge_validation.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\nfrom PIL import Image\nfrom matplotlib import pyplot as plt\nfrom scipy.ndimage.measurements import label\n\n\ndef calculate_average_classif_results(results_dict: dict, thresholds, output_file):\n avg = pd.DataFrame(columns=[\"Thr\", \"TP\", \"FP\", \"TN\", ... | [
[
"numpy.zeros",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.asarray",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title",
"numpy.array",
"matplotlib.pyplot.plot",
"scipy.ndimage.measurements.label",
"pandas.DataFrame.from_dict"
]
] |
dorlivne/PoPS | [
"088425d1a40a4c2e6856b07744281cd8ab9bce3b"
] | [
"Pacman/processor.py"
] | [
"import numpy as np\nfrom PIL import Image\nfrom copy import deepcopy\nINPUT_SHAPE = (84, 84)\n\n\ndef init_state():\n # return np.zeros((84, 84, 4))\n return np.zeros((4, 84, 84))\n\ndef append_frame(state, frame):\n # new_state = deepcopy(state)\n # new_state[:, :, :-1] = state[:, :, 1:]\n # new_st... | [
[
"numpy.array",
"numpy.clip",
"numpy.asarray",
"numpy.zeros"
]
] |
kim-com/tensorflow | [
"4301e3f34b8da528c58bdafe05cd66c8a55fce9e"
] | [
"tensorflow/python/eager/function_cache.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.core.function.trace_type.SignatureContext",
"tensorflow.python.framework.func_graph.device_stack_has_callable",
"tensorflow.python.util.memory.dismantle_ordered_dict",
"tensorflow.python.framework.ops.get_default_graph",
"tensorflow.python.saved_model.save_context.get_save_options"... |
skye/flax | [
"23a91dbc27dd182e26f196546468d33238ca5735"
] | [
"examples/lm1b/train.py"
] | [
"# Copyright 2020 The Flax 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 applicable law or a... | [
[
"numpy.array",
"tensorflow.compat.v2.enable_v2_behavior"
]
] |
albertomancino/elliot | [
"339c6421b86646c7a5a1f5001b08a16550ed1d37"
] | [
"elliot/run.py"
] | [
"\"\"\"\nModule description:\n\n\"\"\"\n\n__version__ = '0.3.1'\n__author__ = 'Vito Walter Anelli, Claudio Pomo'\n__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it'\n\nimport importlib\nimport sys\nfrom os import path\n\nimport numpy as np\nfrom hyperopt import Trials, fmin\n\nimport elliot.hyperopti... | [
[
"numpy.random.RandomState",
"numpy.argmin"
]
] |
DigitalPhonetics/SpeechRepresentationFinetuning | [
"11d7130919888d0a27de61f5075e72f4a024673b"
] | [
"Combine/models.py"
] | [
"\"\"\"\nAdapt from:\nhttps://github.com/facebookresearch/barlowtwins/blob/main/main.py\n\"\"\"\nimport torch\nimport torch.nn as nn\nfrom transformers import Wav2Vec2Model\nfrom transformers.models.wav2vec2.modeling_wav2vec2 import _compute_mask_indices\n\n\ndef off_diagonal(x):\n \"\"\"\n For the purpose of... | [
[
"torch.sum",
"torch.nn.Linear",
"torch.nn.BatchNorm1d",
"torch.diagonal",
"torch.from_numpy",
"torch.full_like",
"torch.nn.Sequential",
"torch.nn.Identity",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.mean",
"torch.nn.CosineSimilarity"
]
] |
HawChang/PaddleHub | [
"9894fbb1dc8575ae1fa74f32a23cc1363467461b"
] | [
"hub_module/modules/image/text_recognition/chinese_text_detection_db_server/module.py"
] | [
"# -*- coding:utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport ast\nimport math\nimport os\nimport time\n\nfrom paddle.fluid.core import AnalysisConfig, create_paddle_predictor, PaddleTensor\nfrom paddlehub.common.lo... | [
[
"numpy.linalg.norm",
"numpy.argsort",
"numpy.max",
"numpy.min",
"numpy.array",
"numpy.fromstring"
]
] |
SoulaimenTheGreat/Wine-Prediction | [
"0e692ee430c09f90e7b49a3d3fb6450b6e25b663"
] | [
"src/data/fetch_database.py"
] | [
"# import motor.motor_asyncio\nfrom pymongo import MongoClient\nfrom dotenv import load_dotenv\nimport os\nimport pandas as pd\nfrom dagster import solid\n\n\ndef load_env_variables():\n \"\"\"\n Function to load environment variables from .env file\n :return: database password and database name\n \"\"\... | [
[
"pandas.DataFrame.from_records"
]
] |
josephedradan/algorithms | [
"6caa107b0df245653eab81143ebf0d9c7e5515fb"
] | [
"algorithms/miniumum_edit_distance.py"
] | [
"\"\"\"\nCreated by Joseph Edradan\nGithub: https://github.com/josephedradan\n\nDate created: 2/15/2021\n\nPurpose:\n\nDetails:\n\nDescription:\n\nNotes:\n\nIMPORTANT NOTES:\n\nExplanation:\n\nReference:\n Minimum Edit Distance Algorithm in Python in 2020 (EXPLAINED)\n Notes:\n Using Rylan Fowe... | [
[
"pandas.DataFrame"
]
] |
MahdiSajedei/Searching-for-activation-functions | [
"031ef131df7fe84fa2cafadc946b5a33df8925ec"
] | [
"src/utils.py"
] | [
"import os\nimport shutil\nimport numpy as np\nimport tensorflow as tf\n\ndef path_exists(path, overwrite=False):\n if not os.path.isdir(path):\n os.mkdir(path)\n elif overwrite == True :\n shutil.rmtree(path)\n return path\n\ndef remove_dir(path):\n os.rmdir(path)\n return True\n\ndef ... | [
[
"tensorflow.zeros",
"tensorflow.ones",
"numpy.sprt",
"tensorflow.random_uniform",
"tensorflow.argmax",
"numpy.sqrt",
"tensorflow.random_normal",
"tensorflow.maximum"
]
] |
gem763/crawly | [
"df41e5fc67a4e5092120a1bfe459d57e201849b8"
] | [
"newscrawler/record.py"
] | [
"import pandas as pd\nimport pandas_gbq as gbq\nimport json\nfrom google.oauth2 import service_account\nfrom IPython.core.debugger import set_trace\nfrom pathlib import Path\nimport time\nfrom . import accounts\n\n'''\nConfiguration\n'''\nproj = 'global-news-crawl'\ntable_downloaded = 'news_dataset.downloaded'\ntab... | [
[
"pandas.DataFrame.from_dict"
]
] |
sriniiyer/concode | [
"864e30807f6988731ac3b4b98af6562c18bb42ff"
] | [
"ConcodeDecoder.py"
] | [
"import torch\nfrom torch import nn\nfrom GlobalAttention import GlobalAttention\nfrom torch.autograd import Variable\nfrom Beam import TreeBeam\nfrom UtilClass import bottle, unbottle\nfrom preprocess import rhs, CDDataset\nfrom decoders import DecoderState, Prediction\nimport torch.nn.functional as F\n\nclass Con... | [
[
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.Dropout"
]
] |
ngohaily/geopandas | [
"2725f346e430edb6a5164c21dd707de328329f31"
] | [
"geopandas/tests/test_geom_methods.py"
] | [
"from __future__ import absolute_import\n\nimport string\n\nimport numpy as np\nfrom pandas import Series, DataFrame, MultiIndex\nfrom shapely.geometry import (\n Point, LinearRing, LineString, Polygon, MultiPoint)\nfrom shapely.geometry.collection import GeometryCollection\nfrom shapely.ops import unary_union\n... | [
[
"pandas.MultiIndex",
"numpy.sqrt",
"pandas.Series",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"numpy.asanyarray",
"pandas.MultiIndex.from_tuples",
"numpy.array",
"pandas.util.testing.assert_frame_equal"
]
] |
terryjx/FunFact | [
"595c3b68bac7cc92c802969f207f060c1242a88b"
] | [
"funfact/legacy/rbf/_base.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom collections import namedtuple\nimport dill\nimport numpy as np\nimport pycuda.driver as cuda\nfrom funfact.cuda import context_manager, ManagedArray\n\n\nclass RBFExpansionBasePyCUDA:\n\n def __init__(self):\n context_manager.autoinit()\n\n @staticm... | [
[
"numpy.array",
"numpy.expand_dims",
"numpy.prod"
]
] |
houzeyu2683/IRRHW | [
"c44298ad14c468eff36bc75ebc63abdc9ba24d55"
] | [
"HW/2/script/download.py"
] | [
"\n\n##\n## The packages.\nfrom selenium import webdriver\nimport pandas, os, tqdm, time\n\n\n##\n## The arguments.\n# keyword = [\"Covid-19\", \"Stroke\", \"Myocardial Infarction\", \"influenza\", \"asthma\", \"chest cavity\"]\nkeyword = [\"chest cavity\"]\nfor k in keyword:\n\n platform = \"pubmed\"\n si... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.concat"
]
] |
eraofelix/PV-RCNN | [
"6361ec99cc1c92120263ef56b2c2b003c2cd7264"
] | [
"pvrcnn/inference.py"
] | [
"import copy\nimport os\nimport os.path as osp\nimport numpy as np\nimport torch\nimport sys\nsys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')\nsys.path.append('/opt/ros/kinetic/lib/python2.7/dist-packages')\nimport cv2\nfrom tqdm import tqdm\nimport time\nfrom pvrcnn.core import cfg, Preprocessor\nf... | [
[
"numpy.fromfile",
"torch.load",
"torch.no_grad",
"torch.exp",
"torch.cat"
]
] |
luizapozzobon/myo_project | [
"ce35149c444dee5a13dc7d1f1915046066ba47e2"
] | [
"primeiros_models/dense_features.py"
] | [
"from sklearn.model_selection import train_test_split\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\n\ndef load_compilado(arquivo):\n path = '/home/luiza/UFSM/Myo/myo_project/datasets/oficial/' + arquivo\n df = pd.read_csv(path)\n return df\n\ndf = load_... | [
[
"tensorflow.keras.models.Sequential",
"tensorflow.keras.optimizers.Adam",
"pandas.read_csv",
"tensorflow.keras.layers.Activation",
"numpy.argmax",
"tensorflow.keras.layers.Dense",
"sklearn.model_selection.train_test_split"
]
] |
alexborio/Projects | [
"a85ad4aab370b009de14e3696e06aad92ca4859f"
] | [
"VAE/vae.py"
] | [
"\nfrom tensorflow.examples.tutorials.mnist import input_data\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nencoder_layers = []\ndecoder_layers = []\n\nNormal = tf.contrib.distributions.Normal\nBernoulli = tf.contrib.distributions.Bernoulli\n\nclass Layer(object):\n def __init_... | [
[
"tensorflow.contrib.distributions.Bernoulli",
"tensorflow.matmul",
"tensorflow.InteractiveSession",
"matplotlib.pyplot.imshow",
"tensorflow.random_normal",
"tensorflow.reduce_sum",
"tensorflow.global_variables_initializer",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.pow",... |
bhgedigital/probability | [
"df70fe68491f839df438628fa79cb3378888039e"
] | [
"tensorflow_probability/python/distributions/inverse_gamma.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... | [
[
"tensorflow.compat.v1.assert_positive",
"tensorflow.python.util.deprecation.deprecated",
"tensorflow.ones",
"tensorflow.convert_to_tensor",
"tensorflow.identity",
"tensorflow.math.log",
"tensorflow.random.gamma",
"tensorflow.constant",
"tensorflow.nn.softplus",
"tensorflow.... |
brynhayder/metapop | [
"2a5f25a904cba7133c398c9ce7fff6ad7a5d8705"
] | [
"src/plot.py"
] | [
"from argparse import ArgumentParser\nimport os\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\nfilenames = \"susceptible.csv exposed.csv infected.csv recovered.csv\".split()\n\n\ndef title(ax, region):\n return ax.set_title(region, x=0.95, y=0.9, ha=\"right\", va=\"top\")\n\n\ndef legend(fig, ax):\... | [
[
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout"
]
] |
dequadras/pandas | [
"8a7fbbeb8e3a88f8e355093eb1b68f361e65b6aa",
"8a7fbbeb8e3a88f8e355093eb1b68f361e65b6aa"
] | [
"pandas/tests/io/generate_legacy_storage_files.py",
"pandas/tests/indexing/test_floats.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nself-contained to write legacy storage pickle files\n\nTo use this script. Create an environment where you want\ngenerate pickles, say its for 0.20.3, with your pandas clone\nin ~/pandas\n\n. activate pandas_0.20.3\ncd ~/\n\n$ python pandas/pandas/tests/io/generate_legacy_storage_... | [
[
"pandas.timedelta_range",
"pandas.tseries.offsets.MonthEnd",
"pandas.Series",
"pandas.core.sparse.api.SparseArray",
"pandas.tseries.offsets.Hour",
"pandas.bdate_range",
"pandas.Period",
"pandas.tseries.offsets.FY5253",
"pandas.Categorical",
"pandas.RangeIndex",
"pandas.... |
egryaznov/nlpmovies | [
"4f2c5ffbcff12f279dc2622471e1b19175607f67"
] | [
"Assignment 2/Second Part/russian_classifier.py"
] | [
"# IMDB Movie Review Sentiment Classification\n# Second Assignment Solution\n# NLP Course, Innopolis University, Spring 2017\n# Author: Evgeny Gryaznov\n\nimport numpy\nimport ru_otzyv as ru\nimport matplotlib.pyplot as plt\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers impo... | [
[
"matplotlib.pyplot.legend",
"numpy.random.seed",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
remtav/SpaceNet7_Multi-Temporal_Solutions | [
"ee535c61fc22bffa45331519239c6d1b044b1514"
] | [
"1-lxastro0/code_local/utils/create_dataset.py"
] | [
"import collections\nimport logging\nimport os\nimport warnings\nfrom pathlib import Path\nfrom typing import List, Union\n\nimport h5py\nfrom torch.utils.data import Dataset\nimport numpy as np\n\nimport models.coordconv\nfrom utils.utils import get_key_def, ordereddict_eval, compare_config_yamls\nfrom utils.geout... | [
[
"numpy.float32",
"numpy.insert",
"numpy.full",
"numpy.isscalar",
"numpy.unique"
]
] |
artek0chumak/hivemind | [
"c6b2b2d84ccfc890314a2bfece8eef238372d410"
] | [
"hivemind/compression/quantization.py"
] | [
"import math\nimport os\nfrom abc import ABC, abstractmethod\nfrom concurrent.futures import ThreadPoolExecutor\nfrom typing import Tuple\n\nimport numpy as np\nimport torch\n\nfrom hivemind.compression.base import CompressionBase, CompressionInfo\nfrom hivemind.proto import runtime_pb2\n\nEXECUTOR = ThreadPoolExec... | [
[
"torch.bucketize",
"numpy.quantile",
"torch.as_tensor",
"numpy.asarray",
"torch.finfo",
"torch.quantize_per_tensor",
"torch.zeros",
"numpy.linspace",
"numpy.frombuffer"
]
] |
PangYunsheng8/CGIPool | [
"2cf22019bad510804021f768c6a0d76bf79b62f6"
] | [
"train.py"
] | [
"import os\r\nimport torch\r\nimport torch.nn.functional as F\r\nimport csv\r\nimport glob\r\nimport argparse\r\n\r\nfrom datasets.dataloader import build_loader\r\n\r\n\r\nparser = argparse.ArgumentParser(description=\"Graph Pooling\")\r\nparser.add_argument('--model', type=str, default=\"SAGNet\", help='model nam... | [
[
"torch.cuda.manual_seed",
"torch.nn.functional.nll_loss",
"torch.manual_seed",
"torch.cuda.is_available"
]
] |
rwilliams251/taichi | [
"442710331be55baf5af17f9667db650c19cbb0b2"
] | [
"python/taichi/examples/simulation/mpm3d.py"
] | [
"export_file = '' # use '/tmp/mpm3d.ply' for exporting result to disk\n\nimport numpy as np\n\nimport taichi as ti\n\nti.init(arch=ti.gpu)\n\n#dim, n_grid, steps, dt = 2, 128, 20, 2e-4\n#dim, n_grid, steps, dt = 2, 256, 32, 1e-4\ndim, n_grid, steps, dt = 3, 32, 25, 4e-4\n#dim, n_grid, steps, dt = 3, 64, 25, 2e-4\n... | [
[
"numpy.array",
"numpy.sin",
"numpy.radians",
"numpy.cos"
]
] |
deno750/VRP_Optimization | [
"653c950b59acb3a1cd96d1e96bb334c90655eaa2"
] | [
"other_codes/perfProf.py"
] | [
"#!/usr/bin/env python2\n\nfrom __future__ import print_function\nimport numpy as np\nimport matplotlib\n#matplotlib.use('PDF')\nimport matplotlib.pyplot as plt\nimport sys\n\nfrom optparse import OptionParser\n\n# parameters\ndefLW = 1.2 # default line width\ndefMS = 7 # default marker size\ndashes = ['-', # so... | [
[
"matplotlib.pyplot.legend",
"numpy.empty",
"matplotlib.pyplot.semilogx",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.axis",
"numpy.arange",
"matplotlib.pyplot.title",
"numpy.array",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
martonlanga/deepchem | [
"1c007fbae899a49fe3c40f41e7273ed21867fef9"
] | [
"deepchem/feat/base_classes.py"
] | [
"\"\"\"\nFeature calculations.\n\"\"\"\nimport logging\nimport types\nimport numpy as np\nimport multiprocessing\n\n__author__ = \"Steven Kearnes\"\n__copyright__ = \"Copyright 2014, Stanford University\"\n__license__ = \"BSD 3-clause\"\n\n\ndef _featurize_complex(featurizer, mol_pdb_file, protein_pdb_file, log_mes... | [
[
"numpy.array",
"numpy.asarray"
]
] |
avelez93/tfx | [
"75fbb6a7d50e99138609be3ca4c3a204a13a2195"
] | [
"tfx/benchmarks/tft_benchmark_chicago_taxi.py"
] | [
"# Copyright 2019 Google LLC. 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 appl... | [
[
"tensorflow.python.platform.test.main"
]
] |
parvex/residual-continual-learning-benchmark | [
"8eeb2e57ecf0711e075eb02e8ed06fc8e7b9f20d"
] | [
"dataloaders/wrapper.py"
] | [
"from os import path\nimport torch\nimport torch.utils.data as data\n\n\nclass CacheClassLabel(data.Dataset):\n \"\"\"\n A dataset wrapper that has a quick access to all labels of data.\n \"\"\"\n def __init__(self, dataset):\n super(CacheClassLabel, self).__init__()\n self.dataset = datas... | [
[
"torch.save",
"torch.load",
"torch.unique"
]
] |
Davjes15/ardas_platform | [
"d962e7280ac4477fc3ee71280e90aeab58f74bd6"
] | [
"hs_logisticregression.py"
] | [
"# Implementation of Random Forest model to classify failures in a hydraulic process\n# Hydraulic system can be found : https://archive.ics.uci.edu/ml/datasets/Condition+monitoring+of+hydraulic+systems\n# The data set contains raw process sensor data (i.e. without feature extraction) which are structured as matrice... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split"
]
] |
NCIA-Diffusion/ScoreSDE | [
"b5a562908daf66e6dcf0b791beb83f1fcb61174b"
] | [
"run_lib.py"
] | [
"import os\nimport logging\nimport copy\nfrom tqdm import trange\nfrom datetime import datetime\nimport numpy as np\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torchvision.utils import save_image\n\nfrom utils import ema\nfrom lib.dataset import DataLooper \nfrom lib.sde import VPSDE\nfro... | [
[
"torch.randn_like",
"torch.no_grad",
"torch.utils.tensorboard.SummaryWriter",
"torch.nn.DataParallel",
"torch.cat"
]
] |
joshfp/fastai | [
"794365cd7f734b5e1027d7e19c99e648fbb9a12b"
] | [
"tests/test_core.py"
] | [
"import pytest, torch\nimport numpy as np\nfrom fastai import *\nfrom tempfile import TemporaryDirectory\n\ndef test_cpus(): assert num_cpus() >= 1\n\n@pytest.mark.parametrize(\"p, q, expected\", [\n (5 , 1 , [5]),\n (5 , [1,1], [5, 5]),\n ([5], 1 , [5]),\n ([5], [1,1], [5, 5]),\n (\"ab\" , ... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
bratao/-PySeqLab | [
"fea1c4bd4d43565b1bb20a789d78946e1022d0ff"
] | [
"pyseqlab/utilities.py"
] | [
"\"\"\"\n@author: ahmed allam <ahmed.allam@yale.edu>\n\"\"\"\nimport os\nimport pickle\nimport shutil\nfrom datetime import datetime\nfrom copy import deepcopy\nfrom itertools import combinations\nimport heapq\nimport numpy\n\n\nclass SequenceStruct(object):\n r\"\"\"class for representing each sequence/segment\... | [
[
"numpy.append",
"numpy.ceil",
"numpy.exp",
"numpy.arange",
"numpy.max"
]
] |
r-peng/pyscf | [
"9a14f9bcc63bc75f5939cb4d00eb47861d8d8989"
] | [
"pyscf/cc/__init__.py"
] | [
"# Copyright 2014-2018 The PySCF Developers. 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 r... | [
[
"numpy.iscomplexobj"
]
] |
toobaz/statsmodels | [
"2d4aad9a14619ce0c84d4c7bca9dacd66b2be566"
] | [
"statsmodels/tsa/vector_ar/irf.py"
] | [
"\"\"\"\nImpulse reponse-related code\n\"\"\"\n\nfrom __future__ import division\n\nimport numpy as np\nimport numpy.linalg as la\nimport scipy.linalg as L\n\nfrom scipy import stats\n\nfrom statsmodels.tools.decorators import cache_readonly\nfrom statsmodels.tools.tools import chain_dot\n#from statsmodels.tsa.api ... | [
[
"numpy.sqrt",
"numpy.eye",
"numpy.tile",
"numpy.linalg.matrix_power",
"numpy.zeros",
"numpy.dot",
"numpy.diag",
"numpy.copy",
"scipy.linalg.inv",
"numpy.linalg.cholesky",
"numpy.argmax",
"numpy.ravel",
"numpy.size",
"numpy.shape",
"numpy.sort",
"nump... |
elischwat/hsfm-geomorph | [
"ddd7cd8a5434d04fef9cab7f16f15e7efde868c8"
] | [
"identify-imagery/nagap/identify-imagery-70s-90s.py"
] | [
"# -*- coding: utf-8 -*-\n# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:light\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.5.2\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name... | [
[
"pandas.Series",
"pandas.read_csv",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.subplots",
"pandas.to_datetime",
"matplotlib.pyplot.subplots_adjust",
"pandas.concat"
]
] |
shreyasahasram08/growth-too-marshal | [
"f3fbf0043b50d3ffe56e6b4e06b0c1472fc10220"
] | [
"growth/too/tests/test_gcn.py"
] | [
"import datetime\nfrom unittest import mock\n\nfrom astropy import time\nfrom astropy import units as u\nimport gcn\nimport lxml.etree\nimport numpy as np\nimport pkg_resources\nimport pytest\n\nfrom .. import models\nfrom ..jinja import btoa\nfrom ..flask import app\nfrom ..gcn import handle, listen\nfrom . import... | [
[
"numpy.array",
"numpy.isclose"
]
] |
zgongaware/gonzo | [
"290eae429eb115793cdac3d0be69a064eb73f9a2"
] | [
"goza/chart.py"
] | [
"import matplotlib.pyplot as plt\n\n\nclass Chart:\n \"\"\"\n Chart class to create and format a basic pyplot figure\n \"\"\"\n def __init__(self, title=None, xlabel=None, ylabel=None, figsize=None):\n\n self.title = title if title else \"Unnamed Chart\"\n self.xlabel = xlabel if xlabel el... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
luomou97/ELMoForManyLangs | [
"3e97600baa3a4dde229c1e78c513785e7d50e8e1"
] | [
"elmoformanylangs/modules/lstm.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import unicode_literals\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport copy\n\n\n# \\ref page 4, layers=2, forward + backward, concat[forward_projection, backward_projection]\nclass LstmbiLm(... | [
[
"torch.nn.LSTM",
"torch.nn.Linear"
]
] |
rahuln/adapter-transformers | [
"ac3284547064686d31b95e5e1b078447a2199779"
] | [
"src/transformers/adapters/model_mixin.py"
] | [
"import logging\nimport os\nimport warnings\nfrom abc import ABC, abstractmethod\nfrom collections import defaultdict\nfrom os.path import join\nfrom typing import Iterable, List, Optional, Tuple, Union\n\nimport torch\nfrom torch import nn\n\nfrom .composition import AdapterCompositionBlock, Fuse, Stack, parse_com... | [
[
"torch.load",
"torch.save",
"torch.nn.Embedding.from_pretrained",
"torch.nn.Embedding",
"torch.zeros",
"torch.nn.ModuleDict"
]
] |
aaron8tang/qtrader | [
"e5c1e175e19b20381f9140fb76c30ad5cb81f01c",
"e5c1e175e19b20381f9140fb76c30ad5cb81f01c"
] | [
"qtrader/simulation/aaft.py",
"qtrader/agents/pretrainer/objectives.py"
] | [
"import numpy as np\nimport pandas as pd\n\n\ndef AAFT(df, random=np.random.uniform, random_state=None):\n \"\"\"Amplitude Adjusted Fourier Transform Baseline Generator.\"\"\"\n # set random seed\n np.random.seed(random_state)\n # Operate on numpy.ndarray\n ts = df.values\n # 2d time-series format... | [
[
"numpy.empty_like",
"numpy.fft.rfft",
"numpy.random.seed",
"numpy.fft.irfft"
],
[
"numpy.dot",
"numpy.abs"
]
] |
camila-contreras/CD4ML-Scenarios | [
"806f812990c7cf33b5f78456f0065012b5b4cd35"
] | [
"cd4ml/model_tracking/validation_metrics.py"
] | [
"from sklearn import metrics\nimport numpy as np\nimport logging\nlogger = logging.getLogger(__name__)\n\n# TODO: add others\n# TODO: add ability to include generic functions\n\n\ndef r2_score(true_target, prediction):\n # R2 metric\n return metrics.r2_score(y_true=true_target, y_pred=prediction)\n\n\ndef rms... | [
[
"numpy.array",
"sklearn.metrics.r2_score"
]
] |
yumorozov/scikit-learn-intelex | [
"7a39c0a0e208b49f209168b01fb50206f962175f"
] | [
"examples/daal4py/dbscan_spmd.py"
] | [
"#===============================================================================\n# Copyright 2014 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:... | [
[
"numpy.loadtxt"
]
] |
Alex-Roudjiat/Federated-ML-AI-Federated-ML- | [
"8ccc24cf2c01b868988f5d5bd65f1666cf5526bc"
] | [
"fedml_api/model/cv/darts/utils.py"
] | [
"import os\nimport shutil\n\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\n\n\nclass AvgrageMeter(object):\n\n def __init__(self):\n self.reset()\n\n def reset(self):\n self.avg = 0\n self.sum = 0\n self.cnt = 0\n\n def update(self, val, n=1):\n s... | [
[
"numpy.ones",
"torch.load",
"torch.save",
"numpy.clip",
"torch.from_numpy",
"numpy.random.randint"
]
] |
alexbarcelo/dislib | [
"989f81f235ae30b17410a8d805df258c7d931b38",
"989f81f235ae30b17410a8d805df258c7d931b38"
] | [
"examples/linear_regression_plot.py",
"tests/test_decision_tree.py"
] | [
"import numpy as np\nfrom pylab import scatter, plot, show\n\nimport dislib as ds\nfrom dislib.regression import LinearRegression\n\n\ndef main():\n \"\"\"\n Linear regression example with plot\n \"\"\"\n\n # Example data\n x = np.array([1000, 4000, 5000, 4500, 3000, 4000, 9000, 11000, 15000,\n ... | [
[
"numpy.array"
],
[
"numpy.array",
"numpy.random.RandomState",
"numpy.bincount",
"numpy.array_equal"
]
] |
JeffreyLuu/apexe3-api | [
"081da51370e8b01b1e8169e4137a99636ea71866"
] | [
"examples/python/real_time_insights.py"
] | [
"'''\n/**\n * real_time_insights.py\n * \n * Streams a real-time insights for the supplied pair\n * An example of the real-time insights is available here:\n * https://app.ae3platform.com/insights\n * \n * Disclaimer:\n * APEX:E3 is a financial technology company based in the United Kingdom https://www.apexe3.com\n... | [
[
"pandas.DataFrame"
]
] |
Ravi-0809/question-generation | [
"9065a3b47293b8a69a0548af1f6bedd4a4aa7f9c"
] | [
"src/discriminator/instance.py"
] | [
"import sys,json,time,os\nsys.path.insert(0, \"/Users/tom/Dropbox/msc-ml/project/src/\")\nsys.path.insert(0, \"/cs/student/msc/ml/2017/thosking/dev/msc-project/src/\")\n\nimport tensorflow as tf\nimport numpy as np\n\nimport discriminator.config\nfrom discriminator.model import Model\nfrom discriminator.prepro impo... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.ylabel",
"tensorflow.GPUOptions",
"matplotlib.pyplot.plot",
"tensorflow.summary.FileWriter",
"matplotlib.pyplot.xticks",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"sklearn.metrics.auc... |
ProhardONE/python_primer | [
"211e37c1f2fd169269fc4f3c08e8b7e5225f2ad0"
] | [
"ch_5/plot_w.py"
] | [
"# Exercise 5.35\n# Author: Noah Waterfield Price\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef f(x):\n r = np.zeros(len(x))\n r[x < 0] = -x[x < 0] - 5\n r[x >= 0] = x[x >= 0] - 5\n return abs(r)\n\nx = np.linspace(-10, 10, 101)\nplt.plot(x, f(x))\nplt.show()\n"
] | [
[
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
KevinMMendez/cimcb_lite | [
"1e6cf7137cd04d6be4ad1ba6fd317077ace08ee8"
] | [
"cimcb_lite/model/BaseModel.py"
] | [
"from abc import ABC, abstractmethod, abstractproperty\nimport numpy as np\nimport pandas as pd\nimport scipy\nfrom bokeh.layouts import widgetbox, gridplot, column, row, layout\nfrom bokeh.models import HoverTool, Band\nfrom bokeh.models.widgets import DataTable, Div, TableColumn\nfrom bokeh.models.annotations imp... | [
[
"sklearn.metrics.roc_curve",
"pandas.DataFrame",
"numpy.insert",
"scipy.stats.mannwhitneyu",
"numpy.array",
"numpy.concatenate",
"numpy.round",
"numpy.unique"
]
] |
qzchenwl/tensorboard | [
"e59ca8d45746f459d797f4e69377eda4433e1624"
] | [
"tensorboard/util/test_util.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v1.get_default_graph",
"tensorflow.compat.v1.Graph",
"tensorflow.python.tf2.enabled"
]
] |
DragonMyth/MyDartEnv | [
"5a5c40d0104e22e0493f823c41734776fb2e6790"
] | [
"gym/envs/dart/flatworm_swim_straight_reduced.py"
] | [
"import numpy as np\nfrom gym import utils\nfrom gym.envs.dart import dart_env\nfrom .simple_water_world import BaseFluidSimulator\n\n\nclass DartFlatwormSwimStraightReducedEnv(dart_env.DartEnv, utils.EzPickle):\n def __init__(self):\n control_bounds = np.array([[1.0] * 12, [-1.0] * 12])\n self.act... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.abs",
"numpy.array",
"numpy.concatenate",
"numpy.isfinite"
]
] |
cysmnl/geometric_cognition | [
"473c0cf585aaf49904bfb87c35ea706e12f67f8a"
] | [
"torch_geometric/read/planetoid.py"
] | [
"import sys\nimport os.path as osp\nfrom itertools import repeat\n\nimport torch\nfrom torch_sparse import coalesce\nfrom torch_geometric.data import Data\nfrom torch_geometric.read import read_txt_array\nfrom torch_geometric.utils import remove_self_loops\n\ntry:\n import cPickle as pickle\nexcept ImportError:\... | [
[
"torch.zeros",
"torch.tensor",
"torch.cat",
"torch.Tensor"
]
] |
lichnost/latent-pose-reenactment | [
"ee2719355f1db3d0b927f9b10b0d42d1fd07d4c9"
] | [
"embedders/FSTH.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn.utils import spectral_norm\nfrom generators.common import blocks\n\nclass Wrapper:\n @staticmethod\n def get_args(parser):\n parser.add('--embed_padding', type=str, default='zero', help='zero|reflection')\n parser.add('--embed_num_blocks', type=... | [
[
"torch.relu",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.ReLU",
"torch.cat"
]
] |
aimldl/coding | [
"70ddbfaa454ab92fd072ee8dc614ecc330b34a70"
] | [
"python/en/_matplotlib/gallery/text_labels_and_annotations/auto-wrapping_text.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\ntext_labels_and_annotations/auto-wrapping_text.py\nMatplotlib > Gallery > Text, labels and annotations> Auto-wrapping text\nhttps://matplotlib.org/3.1.1/gallery/text_labels_and_annotations/autowrap.html#sphx-glr-gallery-text-labels-and-annotations-autowrap-p... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
"matplotlib.pyplot.text"
]
] |
geetakumri/Moview_Review_Sentiment_Analysis | [
"41f4c17d9115633b000f52268ac768cfe013e808"
] | [
"model_build.py"
] | [
"from sklearn.model_selection import train_test_split\nimport pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer, TfidfTransformer, CountVectorizer\nfrom sklearn import svm\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.pipeline import ... | [
[
"sklearn.naive_bayes.MultinomialNB",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.linear_model.SGDClassifier",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.metrics.accuracy_score",
"pandas.concat",
"sklearn.pipeline.Pipeline",
"sklearn.model_selection.train_test_s... |
wfondrie/diadem | [
"cf42449ccd305b7fd040f9b03129256f60f13949"
] | [
"diadem/align.py"
] | [
"\"\"\"\nThis module contains the my implementation of the FastDTW algorithm.\n\nThe algorithm is described in http://cs.fit.edu/~pkc/papers/tdm04.pdf.\nThis implementation is losely based on the python package from this\nGitHub repository: https://github.com/slaypni/fastdtw.\n\nMy code deviates from this repositor... | [
[
"numpy.finfo",
"numpy.linalg.norm",
"numpy.dot"
]
] |
tclarkin/shread_dash | [
"a45e2f2946c74526e69c087587676aaa4cb15fba"
] | [
"plot_lib/snow_plot.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jan 27, 2022\n\nSHREAD Dash Snow Plot\n\nScript for running the snow plot in the dashboard (shread_dash.py)\n\n@author: buriona, tclarkin (2020-2022)\n\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport plotly.graph_objects as go\nfrom plot_lib.utils import i... | [
[
"numpy.nanmax",
"pandas.DataFrame",
"pandas.date_range"
]
] |
tblut/NNFS | [
"75320c546043bc74f368a7a6edcd8bb70aa90dc4"
] | [
"nnfs/model.py"
] | [
"import numpy as np\nfrom nnfs.layers import Linear\nfrom nnfs.optimizers import SGD\n\n\nclass Model:\n def __init__(self, layers, loss, optimizer=SGD(lr=0.01)):\n self.layers = layers\n self.loss = loss\n self.optimizer = optimizer\n\n def save_weights(self, filename):\n weights ... | [
[
"numpy.load",
"numpy.savez"
]
] |
mozhumz/machine_learning_py | [
"880f6778ac16b0a16a80b31972a35304caa91dc1"
] | [
"demoDay25_CNNAndWord2Vec/boston_multi.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\n\n#加载数据集\nboston_housing = tf.keras.datasets.boston_housing\n(train_x,train_y),(test_x,test_y) = boston_housing.load_data()\n\nnum_train=len(train_x) #训练集和测试机中样本的数量\nnum_test=len(test_x)\n\n#对训练样本和测试样本进行标准化(归一化),这里有用到张量的广播运算机制\nx_train... | [
[
"numpy.ones",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.random.seed",
"numpy.random.randn",
"tensorflow.matmul",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"tensorflow.GradientTape",... |
tak-sakumoto/formatomato | [
"4713338135b2ac3960cc2f9a6f017199853cdc52"
] | [
"for_imagenet/make_df_imagenet.py"
] | [
"import pandas as pd\nfrom PIL import Image\nfrom pathlib import Path\n\ndef make_df_imagenet(dataset):\n \"\"\"\n Making Pandas Dataframes of the extracted data\n \"\"\"\n # Making lists of class columns\n classes = list(Path(dataset).iterdir())\n classes = [p.stem for p in classes if p.is_dir()]... | [
[
"pandas.DataFrame"
]
] |
cyber-meow/Robotic_state_repr_learning | [
"d74fe372bea0b1cf42107450a8c3344a99279e91"
] | [
"utility.py"
] | [
"\n\"\"\"\nUtility functions\n\"\"\"\n\nimport numpy as np\n\n\ndef set_all_args(obj, argdict):\n for k in argdict.keys():\n if hasattr(obj, k):\n setattr(obj, k, argdict[k])\n else:\n print(\"Warning: parameter name {} not found!\".format(k))\n\ndef div0(a,b):\n with np.er... | [
[
"numpy.nan_to_num",
"numpy.true_divide",
"numpy.errstate"
]
] |
yashbonde/GAN-textures | [
"7e9bfa61c474f17812bad2430e63a2383ac85067"
] | [
"mgan.py"
] | [
"\nimport os\nimport time\nimport random\nimport argparse\nimport numpy as np\nfrom tqdm import trange\nfrom types import SimpleNamespace\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torchvision.utils impo... | [
[
"torch.utils.data.DataLoader",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.nn.Upsample",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"torch.utils.tensorboard.SummaryWriter",
"torch.nn.Sigmoid",
"torch.nn.BatchNorm2d",
"torch.nn.init.normal_",
"torch.from... |
Gerzer/coremltools | [
"47e2010a68668bd1960dca040f5f87c0e66a0cbd"
] | [
"examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py"
] | [
"from __future__ import print_function\nimport os\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data # Import MINST data\n\ndef linear_model(x):\n # x is the image input\n # mnist data image of shape 28*28=784\n\n # Set model weights\n W = tf.Variable(tf.zeros([784, 10]))\n b ... | [
[
"tensorflow.placeholder",
"tensorflow.zeros",
"tensorflow.global_variables_initializer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.matmul",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.train.Saver",
"tensorflow.Session",
"tensorflo... |
mlopstemplates/Ignitedemo | [
"9a8329d8aaa4c82b0f322b6e677df5b1769050ea"
] | [
"code/train/train.py"
] | [
"import os\nimport argparse\nimport itertools\nimport numpy as np\nimport joblib\nimport matplotlib.pyplot as plt\n\nfrom sklearn import datasets\nfrom sklearn.svm import SVC\nfrom sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score\nfrom sklearn.model_selection import train_test_split\... | [
[
"sklearn.svm.SVC",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"sklearn.metrics.f1_score",
"matplotlib.pyplot.imshow",
"sklearn.metrics.precision_score",
"matplotlib.pyplot.ylabel",
"sklearn.model_sele... |
ktian08/6784-drugs | [
"7c3ae9f65ce60b031008b0026bb9b954575315fa"
] | [
"datasetIO.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nAndrew D. Rouillard\nComputational Biologist\nTarget Sciences\nGSK\nandrew.d.rouillard@gsk.com\n\"\"\"\n\nimport os\nimport gzip\nimport pickle\nimport numpy as np\nimport dataclasses as dc\n\ndef load_datasetinfo(datasetspath):\n dataset_info = []\n with open(datasetspath, m... | [
[
"numpy.array",
"numpy.zeros"
]
] |
0xLiso/DeepLearningFromScratch | [
"997e94953b9e5e1ffd8c38af9277e7925e0b4ea7"
] | [
"solutions/python/Lesson02-03/Operation.py"
] | [
"import numpy as np\n\nfrom Tensor import Tensor\n\n\nclass Operation:\n\tresult = None\n\tdef forward(self):\n\t\traise NotImplementedError\n\tdef backward(self, gradOutput: Tensor):\n\t\traise NotImplementedError\n\n\nclass Negative(Operation):\n\tdef __init__(self, A: Tensor,B:Tensor):\n\t\tself.A = A\n\t\t\n\n\... | [
[
"numpy.sum",
"numpy.matmul",
"numpy.prod"
]
] |
OliverSchmitz/lue | [
"da097e8c1de30724bfe7667cc04344b6535b40cd"
] | [
"source/data_model/python/test/lue_test/test_case.py"
] | [
"import os\nimport shlex\nimport subprocess\nimport unittest\nimport numpy\nimport lue\nimport lue_test\n\n\nclass TestCase(unittest.TestCase):\n\n @classmethod\n def dataset_name(self,\n module_name,\n filename):\n return \"{}.lue\".format(\n os.path.join(os.path.dirna... | [
[
"numpy.testing.assert_equal"
]
] |
xrael/orbit-predictor | [
"9ff616122be0b33e43144bd32a055e1f676801dd"
] | [
"tests/test_numerical_predictor.py"
] | [
"import datetime as dt\nfrom unittest import TestCase\n\nimport numpy as np\nfrom numpy.testing import assert_allclose, assert_almost_equal\nimport pytest\n\nfrom orbit_predictor.locations import ARG\nfrom orbit_predictor.predictors.numerical import (\n J2Predictor, InvalidOrbitError, R_E_KM, is_sun_synchronous\... | [
[
"numpy.array",
"numpy.testing.assert_allclose"
]
] |
PingjunChen/ThyroidRule | [
"1213cf0783c84da5917ca903c156e5e4280402f5"
] | [
"utils/wsi_util.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os, sys, pdb\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.utils.data as data\nfrom torchvision import datasets, transforms\n\nimport numpy as np\nimport cv2, copy, time\nimport matplotlib.pyplot as plt\nfrom scipy.ndimage impo... | [
[
"torch.utils.data.DataLoader",
"numpy.ones",
"numpy.zeros",
"scipy.ndimage.binary_fill_holes",
"torch.nn.functional.softmax",
"torch.no_grad",
"numpy.argsort",
"numpy.floor"
]
] |
shawnkx/NAT-with-Local-AT | [
"16b29e068ad568e3a020f1309e140aa0dbc38479"
] | [
"Mask-Predict/fairseq/data/language_pair_context_mask.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 numpy as np\nim... | [
[
"numpy.argsort",
"numpy.random.RandomState",
"numpy.array",
"numpy.concatenate",
"torch.LongTensor",
"torch.cat"
]
] |
sooftware/Fairseq-Listen-Attend-Spell | [
"9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04"
] | [
"fairseq_las/data/data_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\n\n\ndef calc_mean_invstddev(feature):\n if len(feature.size()) != 2:\n raise ValueError(\"We expect the inpu... | [
[
"torch.sum",
"torch.sqrt",
"torch.arange",
"torch.max",
"torch.Tensor"
]
] |
colesbury/awkward-1.0 | [
"d036ab18eb54de8a2571d9f179d315ac8ee22119",
"d036ab18eb54de8a2571d9f179d315ac8ee22119"
] | [
"tests/test_0006-deep-iteration.py",
"tests/test_0074-argsort-and-sort.py"
] | [
"# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE\n\n\nimport sys\n\nimport pytest # noqa: F401\nimport numpy as np # noqa: F401\nimport awkward as ak # noqa: F401\n\n\ndef test_iterator():\n content = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3]))\n offsets = ak.lay... | [
[
"numpy.array",
"numpy.asarray"
],
[
"numpy.array",
"numpy.sort",
"numpy.argsort"
]
] |
naoyam/lbann | [
"d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4"
] | [
"bamboo/unit_tests/test_unit_layer_squared_difference.py"
] | [
"import functools\nimport operator\nimport os\nimport os.path\nimport sys\nimport numpy as np\n\n# Bamboo utilities\ncurrent_file = os.path.realpath(__file__)\ncurrent_dir = os.path.dirname(current_file)\nsys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python'))\nimport tools\n\n# ============... | [
[
"numpy.random.normal",
"numpy.finfo",
"numpy.random.seed",
"numpy.mean"
]
] |
hizb-resume/LTD-local-track-to-detect-for-VID | [
"7147ac7c6cd4b22a956aaaabaa151e5ed5410c68"
] | [
"projects/adnet/mains/ADNet2.py"
] | [
"import _init_paths\nimport tensorflow as tf\ntf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)\nfrom trainers.adnet_train_sl import adnet_train_sl\nimport argparse\nfrom options.general2 import opts\nfrom models.ADNet import adnet\nfrom utils.get_train_videos import get_train_videos\nfrom trainers.adn... | [
[
"torch.nn.DataParallel",
"torch.multiprocessing.set_start_method",
"tensorflow.compat.v1.logging.set_verbosity"
]
] |
ruclion/Fantasy_Mix-Lingual_Tacotron_Version_7_NOVAE-Phoneme-HCSI-NOLID_DBMIX | [
"baa4c8c3f3ba80acf68cec88aed53084a97c8aa1"
] | [
"tacotron/models/tacotron.py"
] | [
"import tensorflow as tf \nfrom tacotron.utils.symbols import symbols\nfrom tacotron.utils.symbols import tone_stress_symbols_max_no\nfrom tacotron.utils.symbols import symbols_tag\nfrom infolog import log\nfrom tacotron.models.helpers import TacoTrainingHelper, TacoTestHelper\nfrom tacotron.models.modules import *... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.nn.l2_loss",
"tensorflow.abs",
"tensorflow.one_hot",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.train.replica_device_setter",
"tensorflow.... |
blthayer/ecen-667 | [
"cf609fa230b94e5b98af7afe554250a0824c2e11"
] | [
"hw6.py"
] | [
"import numpy as np\n\n\ndef main():\n p1()\n p2()\n p6()\n\n\ndef p1():\n # Do part 1.\n print('*' * 80)\n print('Problem 8.8, Part 1')\n a1 = np.array([\n [3, 8],\n [2, 3]\n ])\n\n _get_participation(a1)\n\n # Now part 2.\n print('*' * 80)\n print('Problem 8.8, Pa... | [
[
"numpy.sqrt",
"numpy.matmul",
"numpy.arcsin",
"numpy.argsort",
"numpy.cos",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.sin",
"numpy.linalg.eig"
]
] |
nhutnamhcmus/datacamp-playground | [
"25457e813b1145e1d335562286715eeddd1c1a7b"
] | [
"introduction-to-data-visualization-in-python/4. Analyzing time series and images/script_1.py"
] | [
"# Multiple time series on common axes\r\n\r\n# Import matplotlib.pyplot as plt\r\nimport matplotlib.pyplot as plt\r\n\r\n# Plot the aapl time series in blue\r\nplt.plot(aapl, color='blue', label='AAPL')\r\n\r\n# Plot the ibm time series in green\r\nplt.plot(ibm, color='green', label='IBM')\r\n\r\n# Plot the csco t... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks"
]
] |
dimon58/miptlabs | [
"538f6c410210a6e3405ca5b61dc7bc41d251cdf8"
] | [
"src/miptlabs/interpolators/interpolators.py"
] | [
"from numpy import linspace\nfrom scipy.interpolate import interp1d\n\n\nclass Interpolator:\n \"\"\"\n Базовый класс интерполятора\n \"\"\"\n\n def __init__(self, points=100):\n self.points = points\n\n def interpolate(self, x, y):\n pass\n\n\nclass Quadratic(Interpolator):\n \"\"\"... | [
[
"numpy.linspace",
"scipy.interpolate.interp1d"
]
] |
NeuroML/Documentation | [
"06e355a8268c848b872b4e4c44d990b77b1fcb37"
] | [
"source/Userdocs/NML2_examples/izhikevich-single-neuron.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nSimulating a regular spiking Izhikevich neuron with NeuroML.\n\nFile: izhikevich-single-neuron.py\n\"\"\"\n\nfrom neuroml import NeuroMLDocument\nfrom neuroml import Izhikevich2007Cell\nfrom neuroml import Population\nfrom neuroml import Network\nfrom neuroml import PulseGenerator\n... | [
[
"numpy.loadtxt"
]
] |
WesleyBatista/fklearn | [
"7a606d246545de5ab68b2d9f38d0fdbeec6ca630"
] | [
"src/fklearn/metrics/pd_extractors.py"
] | [
"import collections\nfrom datetime import datetime\nfrom itertools import chain, repeat\n\nimport pandas as pd\nfrom toolz import curry\nfrom numpy import nan\n\n\n@curry\ndef evaluator_extractor(result, evaluator_name):\n metric_value = result[evaluator_name] if result else nan\n return pd.DataFrame({evaluat... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
JustinACoder/H22-GR3-UnrealAI | [
"1fa4cd6a566c8745f455fc3d2273208f21f88ced",
"1fa4cd6a566c8745f455fc3d2273208f21f88ced",
"1fa4cd6a566c8745f455fc3d2273208f21f88ced"
] | [
"Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py",
"Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/python/ops/random_ops.py",
"Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/python/train... | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\... | [
[
"tensorflow.python.ops.array_ops.reverse",
"tensorflow.python.ops.io_ops.TextLineReader",
"tensorflow.python.framework.tensor_shape.TensorShape",
"tensorflow.python.ops.state_ops.is_variable_initialized",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.estimator.esti... |
ebrunet28/MultiDecoder-DPRNN | [
"36fd6c35e730379e4f676a25eac451409a01f068"
] | [
"src/data.py"
] | [
"\"\"\"\nDataset classes for variable number of speakers\nAuthor: Junzhe Zhu\n\"\"\"\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nfrom librosa import load\nfrom time import time\nimport glob\nimport os\nimport random\nimport json\nfrom tqdm import tqdm\ndef load_json(filename):\n with open... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"numpy.stack",
"torch.Tensor"
]
] |
cimat-ris/OF-PathPred | [
"85ca275707e5988491d0a510b9d31883824411db"
] | [
"path_prediction/utils/process_file_trajnetplusplus.py"
] | [
"import os, glob, sys, logging, math\nfrom tqdm import tqdm\nimport numpy as np\nfrom .interaction_optical_flow import OpticalFlowSimulator\nfrom .obstacles import load_world_obstacle_polygons\n# Since it is used as a submodule, the trajnetplusplustools directory should be there\nsys.path.append(\"../../trajnetplus... | [
[
"numpy.zeros_like",
"numpy.arctan2",
"numpy.ones",
"numpy.isinf",
"numpy.cos",
"numpy.isnan",
"numpy.array",
"numpy.sin"
]
] |
Jimmy-INL/OpenPNM | [
"1546fa1ac2204443bde916f2037fac383c5069ae"
] | [
"openpnm/io/Pandas.py"
] | [
"import numpy as np\nimport scipy as sp\nfrom flatdict import FlatDict\nfrom collections import namedtuple\nfrom openpnm.io import Dict, GenericIO\nfrom openpnm.utils import sanitize_dict, logging\nlogger = logging.getLogger(__name__)\n\n\nclass Pandas(GenericIO):\n r\"\"\"\n Combines all data arrays into a P... | [
[
"numpy.shape",
"numpy.split"
]
] |
krmurtha/fw-heudiconv | [
"cf41f7e6eb770317ab7c0aec051b4567ab634d01"
] | [
"fw_heudiconv/backend_funcs/convert.py"
] | [
"import logging\nimport re\nimport pdb\nimport operator\nimport pprint\nimport mimetypes\nimport flywheel\nimport json\nimport pandas as pd\nfrom os import path\nfrom pathvalidate import is_valid_filename\nfrom pathlib import Path\nfrom fw_heudiconv.cli.export import get_nested\n\nlogger = logging.getLogger('fw-heu... | [
[
"pandas.DataFrame"
]
] |
StadlerMaximilian/Detectron.pytorch | [
"b7a7c053b15da21418f53d9e97f4652d0d139523"
] | [
"tools/train_net.py"
] | [
"\"\"\" Training Script \"\"\"\n\nimport argparse\nimport distutils.util\nimport os\nimport sys\nimport pickle\nimport resource\nimport traceback\nimport logging\nfrom collections import defaultdict\n\nimport numpy as np\nimport yaml\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport ... | [
[
"torch.cuda.empty_cache",
"torch.utils.data.DataLoader",
"torch.optim.SGD",
"torch.load",
"torch.cuda.device_count",
"torch.optim.Adam",
"torch.cuda.is_available"
]
] |
inspurer/ImageProcess | [
"f826c36f3ae17bee5694c3f1748f9e5319a46fd9"
] | [
"codes/3_1.py"
] | [
"# -*- coding: utf-8 -*-\n# pc_type lenovo\n# create_time: 2019/11/9 15:15\n# file_name: 3_1.py\n\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport random\n# 设置中文字体和负号正常显示\nplt.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体\nplt.rcParams['axes.... | [
[
"numpy.sum",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.random.normal",
"numpy.median",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"numpy.clip",
"numpy.array"
]
] |
koheikawata/objectdetectiontest | [
"a4cb01911fa3d0e10bd2c9aa3fd985113af10b1b"
] | [
"research/object_detection_inference_test1.py"
] | [
"import numpy as np\nimport os\nimport tensorflow as tf\nimport time\nimport json\n\nfrom PIL import Image\nfrom object_detection.utils import ops as utils_ops\nfrom object_detection.utils import label_map_util\n\nTHRESHOLD = 0.6\nLABEL_PATH = 'object_detection/test1/pascal_label_map.pbtxt'\nMODEL_PATH = 'object_de... | [
[
"tensorflow.gfile.GFile",
"numpy.expand_dims",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.get_default_graph",
"tensorflow.GraphDef"
]
] |
ManeeshaPerera/forecast-framework | [
"60a22af4a97aec10c8bbea7f3f833061283382cb"
] | [
"run_combinations.py"
] | [
"from combinations.equal_weight import EqualWeight\nfrom combinations.pso_model import PSO\nfrom combinations.recursive_method import RecursiveEnsemble\nimport constants as const\nimport pandas as pd\nimport numpy as np\n\n\ndef run_combinations(horizon, forecast, forecast_test, data_train, data_out_sample):\n w... | [
[
"numpy.array",
"pandas.DataFrame",
"pandas.concat"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.