repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
magicly/sample-factory | [
"32cd44a907653fdad40c026ba0a4fa4cca68554b",
"32cd44a907653fdad40c026ba0a4fa4cca68554b"
] | [
"plots/experiments/mean_std_plots_grid_complex_envs.py",
"examples/train_custom_env_custom_model.py"
] | [
"import os\nimport pickle\nimport sys\nfrom os.path import join\nfrom pathlib import Path\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom tensorboard.backend.event_processing.event_accumulator import EventAccumulator\n\nfrom plots.plot_utils import set_matplotlib_params\nfrom utils.u... | [
[
"numpy.max",
"numpy.array",
"numpy.min",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.std",
"numpy.stack",
"matplotlib.pyplot.margins",
"matplotlib.pyplot.tight_layout",
"matplotlib.ticker.FuncFormatter",
"matplotlib.pyplot.ticklabel_format"
],
[
"torch.nn... |
DrXiLu/elfi | [
"ac084766417367faf6fb8538080efff546eb1ce2"
] | [
"elfi/methods/smc.py"
] | [
"\"\"\"SMC sampling methods.\"\"\"\n\nimport logging\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom elfi.methods.utils import (GMDistribution, weighted_var, arr2d_to_batch)\n\nlogger = logging.getLogger(__name__)\n\n\n\ndef smc(n_samples, prior, iterations, params0, target, seed=0):\n \"\"\"Sampl... | [
[
"numpy.max",
"numpy.count_nonzero",
"numpy.random.RandomState",
"numpy.sum",
"numpy.ones",
"numpy.arange"
]
] |
warehouse-picking-automation-challenges/team_naist_panasonic | [
"999b8d20c5528f5510e43bf4a483215011f9871d"
] | [
"tnp_svm/script/lib/image_adjust.py"
] | [
"#\n# Version: 2017.07.31\n# Authors: Members of the Team NAIST-Panasonic at the Amazon Robotics Challenge 2017:\n# Gustavo A. Garcia R. <garcia-g at is.naist.jp> (Captain), \n# Lotfi El Hafi, Felix von Drigalski, Wataru Yamazaki, Viktor Hoerig, Arnaud Delmotte, \n# Akishige Yuguchi,... | [
[
"scipy.interpolate.UnivariateSpline",
"numpy.clip"
]
] |
thomaspinder/GPViz | [
"9196424e89c1a18d4c3f1837e4c37b3df4888b53"
] | [
"gpviz/utils.py"
] | [
"import numpy as np\nfrom typing import List\n\n\ndef tidy_legend(ax):\n \"\"\"\n Tidy up a plot's legend by removing duplicate entries\n\n :param ax: The matplotlib axes object where the legend labels reside.\n :return:\n \"\"\"\n handles, labels = ax.get_legend_handles_labels()\n labels, ids ... | [
[
"numpy.unique"
]
] |
Animadversio/FastSal | [
"8cc40654d627faee0ac0adc64ebd5deddffd6113"
] | [
"model/utils.py"
] | [
"import torch as t\nimport torch.nn as nn\nfrom torchvision.models import mobilenet_v2\n\nfrom .salgan_generator import create_model\n\nactivation = {}\ndef get_activation(name):\n def hook(model, input, output):\n activation[name] = output\n return hook\n\ndef decom_salgan(path):\n model = create_m... | [
[
"torch.nn.Sequential",
"torch.load"
]
] |
richardsheridan/imageio | [
"f80f068329123fc3c164c522391969ac8eeb0dd4"
] | [
"tests/test_spe.py"
] | [
"from datetime import datetime\n\nimport numpy as np\nimport pytest\n\nimport imageio\nfrom imageio.plugins import spe\n\n\ndef test_spe_format():\n for name in (\"spe\", \".spe\"):\n fmt = imageio.formats[name]\n assert isinstance(fmt, spe.SpeFormat)\n\n\ndef test_spe_reading(test_images):\n fn... | [
[
"numpy.ones_like",
"numpy.zeros",
"numpy.testing.assert_equal"
]
] |
luvalenz/time-series-variability-tree | [
"57ba881baa5caa6ec8b3dd27526c2d9d3368248b"
] | [
"feature_space_kdtree.py"
] | [
"import pandas\nimport os\nfrom sklearn.neighbors import KDTree\nfrom sklearn.decomposition import PCA\nimport time\nfrom scoring_utils import ndcg\nimport sys\nimport dill\nimport numpy as np\nimport random\nimport glob2\nimport os\nimport pandas as pd\n\n\nclass FatsKDTreeSearcher:\n\n def __init__(self, data_... | [
[
"numpy.array",
"numpy.matrix",
"pandas.DataFrame",
"numpy.where",
"pandas.concat",
"sklearn.neighbors.KDTree",
"pandas.read_csv",
"sklearn.decomposition.PCA"
]
] |
SeeYouMonday/SeeYouMonday | [
"d13d97f6ba4aa6374d1b30e0669476cbad2f1c08"
] | [
"get_doc.py"
] | [
"from crawl.monster_crawl import monster_crawl\nimport parse_pdf.PorterStemmer as PorterStemmer\nimport itertools\nimport bs4 as BeautifulSoup\nimport urllib.request\nimport urllib.parse\nimport numpy as np\nimport json\nimport re\nfrom tqdm import tqdm\nimport time\nfrom dict_reader import csv_to_dictList\nimport ... | [
[
"numpy.argsort"
]
] |
Pavivenkatesan/FaceMaskDetection | [
"a930e430e242454c4fd237b48dc7259c3b76ebe5"
] | [
"detect_mask_image.py"
] | [
"# USAGE\n# python detect_mask_image.py --image images/pic1.jpeg\n\n# import the necessary packages\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import img_to_array\nfrom tensorflow.keras.models import load_model\nimport numpy as np\nimport argp... | [
[
"numpy.array",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"tensorflow.keras.models.load_model",
"tensorflow.keras.preprocessing.image.img_to_array",
"numpy.expand_dims"
]
] |
Justincrum/FInAT | [
"c47206c14149fd5124eb34674e73ab93e42ea960"
] | [
"finat/tensorfiniteelement.py"
] | [
"from functools import reduce\n\nimport numpy\n\nimport gem\n\nfrom finat.finiteelementbase import FiniteElementBase\n\n\nclass TensorFiniteElement(FiniteElementBase):\n\n def __init__(self, element, shape, transpose=False):\n # TODO: Update docstring for arbitrary rank!\n r\"\"\"A Finite element w... | [
[
"numpy.prod"
]
] |
rayguan97/GANav-offroad | [
"f6c6d7af53395fdb7f1dc5c5b5672469338de1c4"
] | [
"mmseg/models/segmentors/encoder_decoder_map.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom mmseg.core import add_prefix\nfrom mmseg.ops import resize\nfrom .. import builder\nfrom ..builder import SEGMENTORS\nfrom .base import BaseSegmentor\n\n\n@SEGMENTORS.register_module()\nclass EncoderDecoder(BaseSegmentor):\n \"\"\"Enco... | [
[
"torch.onnx.is_in_onnx_export",
"torch.nn.ModuleList",
"torch.nn.functional.softmax"
]
] |
venkatesh551/pytorch-lightning | [
"088818fbc6b2cbc56858277020d70096e6804a29"
] | [
"pytorch_lightning/trainer/trainer.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... | [
[
"torch._C._log_api_usage_once",
"torch.no_grad",
"torch.autograd.set_detect_anomaly",
"torch.cuda.is_available",
"torch.set_grad_enabled"
]
] |
CarlosPena00/kaggle-datasciencebowl-2018 | [
"c234f03483142f618825812d5fa310375a7eb6fa"
] | [
"torchlib/netmodels/net.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\n\nfrom torch.utils import model_zoo\nfrom torchvision import models\n\n\nclass UNetEnc(nn.Module):\n\n def __init__(self, in_channels, features, out_channels):\n super().__init__()\n\n self.up = nn.... | [
[
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
pawsen/vib | [
"366b61f3066de6486438b9b803e510107633e40a"
] | [
"pyvib/statespace.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nfrom copy import deepcopy\n\nimport numpy as np\nfrom numpy.fft import fft\nfrom scipy.optimize import least_squares\nfrom scipy.signal.lti_conversion import abcd_normalize\nfrom scipy.signal.ltisys import dlsim\n\nfrom pyvib.common import lm, mmul_weight, weigh... | [
[
"numpy.array",
"numpy.dot",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.mean",
"numpy.fft.fft",
"scipy.signal.ltisys.dlsim",
"numpy.atleast_1d",
"numpy.arange",
"numpy.append",
"numpy.hstack",
"numpy.nanargmin",
"scipy.signal.lti_conversion.abcd_no... |
aksakalli/academy | [
"75b05da0be4a657856a2dc7bd7dc49bbbcf2dd08"
] | [
"advanced-ray/game_of_life_2.py"
] | [
"#!/usr/bin/env python\n\nimport ray\nimport numpy as np\nimport time, sys, os\nsys.path.append(\"..\")\nfrom util.printing import pd\n\n# A variation of the game of life code used in the Ray Crash Course.\n@ray.remote\nclass RayGame:\n # TODO: Game memory grows unbounded; trim older states?\n def __init__(se... | [
[
"numpy.random.randint"
]
] |
casimp/pyxe-patterns | [
"d9f9723ae3c5a31c59b029656d97bbcad0d382fd"
] | [
"pyxpb/intensity_factors.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\nimport pandas as pd\nimport os\n\nfname = os.path.join(os.path.dirname(__file__), 'data/form_factor.csv')\ndf = pd.read_csv(fname, index_col... | [
[
"numpy.sin",
"numpy.errstate",
"numpy.exp",
"numpy.cos",
"pandas.read_csv"
]
] |
Alfo5123/ConcreteDropout | [
"c442871553e20a2de078c0fbac7fa52302d50abf"
] | [
"experiments/rl/model-based/data.py"
] | [
"import torch\nimport torch.utils.data as data\nfrom torch.autograd import Variable\n\nimport numpy as np\n\n\ndef rollout(env, policy, dynamics=None, T=1, mode=None, init_particle=None):\n \"\"\"Generate one trajectory with NN or System dynamics, return transitions\"\"\"\n \n # Intial state\n if init_p... | [
[
"numpy.concatenate",
"numpy.array",
"torch.FloatTensor",
"numpy.random.shuffle"
]
] |
Exir-lxr/crldr-prune-pytorch | [
"adeb5e0b24ce66ff9531d4d947f72412c1b5c033"
] | [
"timm/models/conv2d_helpers.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\n\n\ndef _is_static_pad(kernel_size, stride=1, dilation=1, **_):\n return stride == 1 and (dilation * (kernel_size - 1)) % 2 == 0\n\n\ndef _get_padding(kernel_size, stride=1, dilation=1, **_):\n padding = ((stride - 1) + dilati... | [
[
"torch.cat",
"torch.split",
"torch.nn.Conv2d",
"torch.nn.functional.pad",
"torch.nn.functional.conv2d"
]
] |
Felix2048/VLN-CE | [
"4ea21f2af0d869ae65dd6677a53e788233f93761"
] | [
"habitat_extensions/measures.py"
] | [
"import gzip\nimport json\nimport pickle\nfrom typing import Any, List, Union\n\nimport numpy as np\nfrom dtw import dtw\nfrom fastdtw import fastdtw\nfrom habitat.config import Config\nfrom habitat.core.dataset import Episode\nfrom habitat.core.embodied_task import Action, EmbodiedTask, Measure\nfrom habitat.core.... | [
[
"numpy.isinf",
"numpy.zeros_like",
"numpy.array",
"numpy.linalg.norm",
"numpy.isnan",
"numpy.round",
"numpy.take"
]
] |
nedo0shki/fairseq-editor | [
"a87cafda718c7706e6f1694f0d39fc589ed2b264",
"a0f09787bc0d302be5833ec0dad3e568440f4551",
"a87cafda718c7706e6f1694f0d39fc589ed2b264",
"a0f09787bc0d302be5833ec0dad3e568440f4551"
] | [
"fairseq/data/concat_dataset.py",
"fairseq/logging/meters.py",
"examples/translation_moe/src/logsumexp_moe.py",
"examples/speech_recognition/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 bisect\n\nimport numpy as np\nfrom torch.utils.data.dataloader import default_collate\n\nfrom . import FairseqDataset\n\n\ncl... | [
[
"numpy.concatenate",
"torch.utils.data.dataloader.default_collate",
"numpy.tile",
"numpy.argsort"
],
[
"torch.is_tensor",
"numpy.ndim"
],
[
"torch.logsumexp"
],
[
"torch.sqrt",
"torch.arange",
"torch.max",
"torch.Tensor",
"torch.sum"
]
] |
cristicmf/Ax | [
"c940dd0ad3a7d01eec7d68f0e51de8b019a19615",
"c940dd0ad3a7d01eec7d68f0e51de8b019a19615"
] | [
"ax/models/torch/tests/test_mes.py",
"ax/benchmark/benchmark.py"
] | [
"#!/usr/bin/env python3\n# 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\nfrom unittest.mock import patch\n\nimport torch\nfrom ax.core.search_space import SearchSpaceDigest\nfrom ax... | [
[
"torch.tensor"
],
[
"torch.manual_seed",
"numpy.random.randn",
"numpy.random.seed"
]
] |
spestana/ribbit-network-dashboard | [
"8f04d07e97056d535bfbcabeed98f02800061dc6"
] | [
"app.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport dash_leaflet as dl\nimport dash_leaflet.express as dlx\nimport db\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\n\nfrom dash.dependencies import Output, Input\nfrom dash_extensions.javascript import... | [
[
"pandas.DataFrame",
"numpy.interp",
"numpy.mean"
]
] |
barrosm/Auto_TS | [
"e0a6634a727e44b4d5bbf6fbfefde99b6b3e8f86"
] | [
"auto_ts/test/test_var.py"
] | [
"\"\"\"\nUnit Tests for VAR Models\n\n----------------------\nTotal Combinations: 4\n----------------------\nSeasonality: NA\nUnivariate, Multivariate: Simple Independent Test for Univariate (1)\nCV: Yes, No (2)\n\"\"\"\n\nimport sys\nimport os\nimport unittest\nimport math\nimport numpy as np # type: ignore\nimpor... | [
[
"pandas.to_datetime",
"numpy.array",
"numpy.testing.assert_array_equal",
"pandas.Series",
"pandas.read_csv"
]
] |
sametz/nmrsim | [
"4a7eb86f728f0160a069b40a343be62414cbbfde"
] | [
"nmrsim/dnmr.py"
] | [
"\"\"\"The `dnmr` module provides functions for calculating DNMR line shapes, and\nclasses to describe DNMR systems.\n\nThe dnmr module provides the following classes:\n\n* `DnmrTwoSinglets`: a sumulation of the lineshape for two uncoupled nuclei\n undergoing exchange.\n* `DnmrAB`: a simulation of the lineshape fo... | [
[
"numpy.linspace"
]
] |
ChristopherDavisUCI/UCI-Math-10-W22 | [
"19efa7f9ff56d8aa1f6cc2af2873f85a771a4496"
] | [
"_build/jupyter_execute/Proj/StudentProjects/TylerBrown.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Can simple volume formulas predict mass of complex diamond shapes?\n# \n# Author: Tyler Brown\n# \n# Course Project, UC Irvine, Math 10, W22\n\n# ## Introduction\n\n# The project is going to based around the diamonds dataset. We will be looking for a correlation in dep... | [
[
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.linear_model.LinearRegression",
"numpy.where"
]
] |
565353780/caffe-fast-rcnn | [
"6ea51d2a60cc3fb3e8bb39bbdca3f23efb1b5d4b"
] | [
"python/caffe/test/test_solver.py"
] | [
"import unittest\r\nimport tempfile\r\nimport os\r\nimport numpy as np\r\nimport six\r\n\r\nimport caffe\r\nfrom test_net import simple_net_file\r\n\r\n\r\nclass TestSolver(unittest.TestCase):\r\n def setUp(self):\r\n self.num_output = 13\r\n net_f = simple_net_file(self.num_output)\r\n f = ... | [
[
"numpy.random.randint"
]
] |
mogh77/facenet0 | [
"5f20f3d8e28c3245a96bf2114d8b9bc2d671aeec"
] | [
"realtime_facenet_git.py"
] | [
"from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport tensorflow as tf\r\nfrom scipy import misc\r\nimport cv2\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport argparse\r\nimport facenet\r\nimport detect_face\r\nimport os\... | [
[
"numpy.asarray",
"numpy.zeros",
"tensorflow.get_default_graph",
"tensorflow.Graph",
"scipy.misc.imresize",
"tensorflow.ConfigProto",
"numpy.argmax",
"tensorflow.GPUOptions"
]
] |
lucienwang1009/benchmarks | [
"4c7b09ad87bbfc4b1f89650bcee40b3fc5e7dfed"
] | [
"scripts/tf_cnn_benchmarks/data_utils.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.data.python.ops.threadpool.PrivateThreadPool",
"tensorflow.data.Iterator.from_string_handle",
"tensorflow.contrib.data.python.ops.prefetching_ops.MultiDeviceIterator",
"tensorflow.data.Dataset.range",
"tensorflow.reshape",
"tensorflow.contrib.data.python.ops.prefetching... |
chidauri/featuretools | [
"1fd1df0765ab7c0af7c495496ea787345a9cab11"
] | [
"featuretools/entityset/deserialize.py"
] | [
"import json\nimport os\nimport tarfile\nfrom pathlib import Path\n\nimport boto3\nimport pandas as pd\n\nfrom featuretools.entityset.relationship import Relationship\nfrom featuretools.entityset.serialize import FORMATS\nfrom featuretools.utils.gen_utils import (\n check_schema_version,\n is_python_2,\n u... | [
[
"pandas.read_pickle",
"pandas.DataFrame",
"pandas.read_csv",
"pandas.read_parquet"
]
] |
Kecksbox/TransformerVIS | [
"874fdc04a8635a2fd733371d3b3f8b3669001456"
] | [
"src/Utilities/PositionalEncoding.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\ndef get_angles(pos, i, d_model):\n angle_rates = 1 / np.power(10000, (2 * (i // 2)) / np.float32(d_model))\n return pos * angle_rates\n\n\ndef positional_encoding(position, d_model):\n angle_rads = get_angles(np.arange(position)[:, np.newaxis],\n ... | [
[
"numpy.sin",
"numpy.float32",
"numpy.arange",
"numpy.cos",
"tensorflow.cast"
]
] |
omer957/IML.HUJI | [
"7fb60158e9d7b8c9318719d7acdfbb3b48896188"
] | [
"exercises/adaboost_scenario.py"
] | [
"import numpy as np\nfrom typing import Tuple\nfrom IMLearn.metalearners.adaboost import AdaBoost\nfrom IMLearn.learners.classifiers import DecisionStump\nfrom utils import *\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom IMLearn.metrics.loss_functions import accuracy\n\n\ndef g... | [
[
"numpy.max",
"numpy.array",
"numpy.random.rand",
"numpy.random.seed",
"numpy.sum",
"numpy.ones",
"numpy.linspace"
]
] |
vallard/YOLO-Detector | [
"5ea093a6dd48e7e346df00062467d117f0e5dd92"
] | [
"src/app.py"
] | [
"#!/usr/bin/env python\nimport colorsys\nimport os\n\nimport cv2 # using opencv 3\nimport sys\nimport random\nimport json\nimport datetime \nimport numpy as np\nfrom keras import backend as K\nfrom keras.models import load_model\nfrom PIL import Image, ImageFont, ImageDraw\nfrom yad2k.models.keras_yolo import yolo_... | [
[
"numpy.array",
"numpy.expand_dims",
"numpy.floor"
]
] |
ruizhaogit/alf | [
"be1e65afa5f8401236d98db8f85a5e27fa1e18dc"
] | [
"alf/networks/actor_network_test.py"
] | [
"# Copyright (c) 2019 Horizon Robotics. 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 requi... | [
[
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.test.main",
"numpy.all",
"tensorflow.python.framework.test_util.run_in_graph_and_eager_modes"
]
] |
jaypirates/Pull-Request-Predictor | [
"59a263159eb2c286698819ddba0b99499fc956a4"
] | [
"logistic_regression/pr_predictor.py"
] | [
"# AUTHOR : JAY PRABHUBHAI PATEl\n\n\"\"\"PR_predictor.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1fhgiTwXRJR22jB7HKXLHWxJeCBldD4XF\n\n# **Importing Essentials libraries**\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom skle... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.GridSearchCV",
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"sklearn.metrics.classification_report",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"numpy.... |
Koukyosyumei/NAIST-Experiments | [
"2795f6d7f59e7881ba4fe08a37881b8c2b7b4498"
] | [
"src/standalone/augmentations.py"
] | [
"import random\n\nimport numpy as np\nimport PIL\n\n\ndef ShearX(img, v=0.1, fixed=True, random_mirror=True):\n if not fixed:\n v = np.random.uniform(low=0.0, high=v)\n if random_mirror and random.random() > 0.5:\n v = -v\n return img.transform(img.size, PIL.Image.AFFINE, (1, v, 0, 0, 1, 0))\... | [
[
"numpy.array",
"numpy.uint8",
"numpy.ceil",
"numpy.zeros",
"numpy.random.randn",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.clip",
"numpy.floor"
]
] |
fiqgant/cvfiq | [
"7c5c6488d55fcfa4ae24d4b8ee2f6f71fd131f24"
] | [
"cvfiq/Utils.py"
] | [
"\"\"\"\nSupporting Functions for Computer vision using OpenCV\nBy: fiqgant\n\"\"\"\n\nimport cv2\nimport numpy as np\nimport copy\n\n\ndef stackImages(_imgList, cols, scale):\n \"\"\"\n Stack Images together to display in a single window\n :param _imgList: list of images to stack\n :param cols: the num... | [
[
"numpy.hstack",
"numpy.vstack",
"numpy.zeros"
]
] |
mayitbeegh/flytesnacks | [
"35fe9db45f08fce3d94923b4245b1a9980a915ef"
] | [
"cookbook/integrations/kubernetes/kfpytorch/pytorch_mnist.py"
] | [
"\"\"\"\nRunning Distributed Pytorch Training using KF PytorchOperator\n-------------------------------------------------------------------\nThis example is adapted from the default example available on Kubeflow's pytorch site.\n`here <https://github.com/kubeflow/pytorch-operator/blob/b7fef224fef1ef0117f6e74961b557... | [
[
"torch.nn.Linear",
"torch.device",
"torch.distributed.is_available",
"torch.distributed.init_process_group",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"torch.no_grad",
"torch.nn.functional.log_softmax",
... |
alcunha/inat2021ufam | [
"243c3e4b91d5756d1e7fcdf8ae75344a373d3b84"
] | [
"geoprior.py"
] | [
"# Copyright 2021 Fagner Cunha\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed... | [
[
"tensorflow.zeros",
"tensorflow.keras.layers.add",
"tensorflow.concat",
"tensorflow.shape",
"tensorflow.GradientTape",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.kera... |
tomfran/urban-sound-classification | [
"9516e9a4f6ed3af2c5847c13321f8c0624ff827d"
] | [
"src/data/dataset.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\n\nclass Dataset:\n \n def __init__(self, \n dataset_path, \n test_size=0.1):\n \"\"\"Initialize Dataset object\n\n Args:\n dataset_path (str): Dataset path t... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
StorWater/PdM_mockup | [
"f46d1dfe4528a15c101d7fc69af903991a20da6f"
] | [
"storpdm/make_dataset.py"
] | [
"# -*- coding: utf-8 -*-\nimport click\nimport logging\nfrom pathlib import Path\nfrom dotenv import find_dotenv, load_dotenv\nfrom typing import Union, Tuple\nimport requests, zipfile, io\nimport pandas as pd\n\n\ndef download_dataset(file_location: Union[str, Path] = \"data/raw/\"):\n \"\"\"Download and unzips... | [
[
"pandas.read_csv"
]
] |
antoine-spahr/X-ray-Anomaly-Detection | [
"850b6195d6290a50eee865b4d5a66f5db5260e8f"
] | [
"Code/scripts/AE/AE_DMSAD_scripts.py"
] | [
"import torch\nimport torch.cuda\nimport logging\nimport numpy as np\nimport pandas as pd\nimport random\nfrom datetime import datetime\nimport os\nimport sys\nsys.path.append('../../')\nimport click\n\nfrom src.datasets.MURADataset import MURA_TrainValidTestSplitter, MURA_Dataset\nfrom src.models.AE_DMSAD import A... | [
[
"torch.device",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available",
"pandas.read_csv",
"torch.set_num_threads"
]
] |
tanyafish/unicorn-hat-hd | [
"893679594a5f69f470cc3b5daddbe109618145dc"
] | [
"examples/forest-fire.py"
] | [
"#!/usr/bin/env python\n\nimport random\nfrom sys import exit\n\ntry:\n import numpy\nexcept ImportError:\n exit('This script requires the numpy module\\nInstall with: sudo pip install numpy')\n\nimport unicornhathd\n\n\nprint(\"\"\"Unicorn HAT HD: Forest Fire\n\nThis example simulates a forest fire.\n\nPress... | [
[
"numpy.mean"
]
] |
kickers18/caffe2 | [
"8f41717c46d214aaf62b53e5b3b9b308b5b8db91"
] | [
"caffe2/python/operator_test/pooling_test.py"
] | [
"# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"numpy.random.seed",
"numpy.max",
"numpy.random.rand"
]
] |
sithu31296/self-supervised-learning | [
"490f9dd4dc932ccd666caf85ea38ecce5221dd57"
] | [
"models/dino.py"
] | [
"import torch\nfrom torch import nn, Tensor\nfrom torch.nn import functional as F\n\n\nclass DINOHead(nn.Module):\n def __init__(self, c1, c2):\n super().__init__()\n self.mlp = nn.Sequential(*[\n nn.Linear(c1, 2048),\n nn.GELU(),\n nn.Linear(2048, 2048),\n ... | [
[
"torch.nn.Linear",
"torch.nn.functional.normalize",
"torch.cat",
"torch.tensor",
"torch.empty",
"torch.nn.GELU",
"torch.randn"
]
] |
JulinaM/PeterGAT | [
"30aa97ee8e2223826302ced832f51373c0b4d661"
] | [
"utils/layers.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nconv1d = tf.compat.v1.layers.conv1d\n\n\ndef attn_head(seq, out_sz, bias_mat, activation, in_drop=0.0, coef_drop=0.0, residual=False):\n with tf.name_scope('my_attn'):\n if in_drop != 0.0:\n seq = tf.nn.dropout(seq, 1.0 - in_drop)\n\n seq_f... | [
[
"tensorflow.compat.v1.sparse_add",
"tensorflow.nn.leaky_relu",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.compat.v1.sparse_softmax",
"tensorflow.transpose",
"tensorflow.compat.v1.sparse_tensor_dense_matmul",
"tensorflow.squeeze",
"tenso... |
zacharyburnettNOAA/PyOFS | [
"b534495fafd3d37f1104eb87a7c17e8c134e1923"
] | [
"PyOFS/observation/smap.py"
] | [
"from collections import OrderedDict\nfrom datetime import datetime\nfrom os import PathLike\nfrom pathlib import Path\nfrom typing import Collection\n\nimport fiona.crs\nimport numpy\nimport rasterio\nfrom rasterio.crs import CRS\nfrom rasterio.enums import Resampling\nimport rasterio.features\nimport shapely\nimp... | [
[
"numpy.isnan",
"numpy.datetime64",
"numpy.diff"
]
] |
geem-lab/orcinus | [
"3167fd0ba7f7f2a2672c028e9b08b081d5437406"
] | [
"orcinus/gui/questionnaire.py"
] | [
"#!/usr/bin/python3\n\n\"\"\"Widget that simplifies defining questionnaires.\"\"\"\n\nimport os\nimport pickle\nfrom tkinter import BooleanVar\nfrom tkinter import DoubleVar\nfrom tkinter import IntVar\nfrom tkinter import StringVar\nfrom tkinter import TclError\nfrom tkinter.ttk import Checkbutton\nfrom tkinter.tt... | [
[
"numpy.round"
]
] |
kcantosh/vasputil | [
"7332212dfe9d6ac1964ee04fd53efc58bab41961"
] | [
"vasputil/geometry.py"
] | [
"# -*- coding: utf-8 -*-\n# vim: set fileencoding=utf-8\n# Copyright (c) 2008, 2010 Janne Blomqvist\n\n# This source code file is subject to the terms of the MIT (Expat)\n# License. See the file LICENSE for details.\n\n\"\"\"This module defines a class that represents a plane in 3d space.\"\"\"\n\nimport numpy as n... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"numpy.empty",
"numpy.cross"
]
] |
skit-ai/dialogy | [
"fb60501351d2bfa8b91ded3963cec38a854819ee"
] | [
"tests/plugin/text/classification/test_xlmr.py"
] | [
"import json\nimport os\nimport pickle\nimport tempfile\nfrom typing import List, Optional\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport dialogy.constants as const\nfrom dialogy.plugins import MergeASROutputPlugin, XLMRMultiClass\nfrom dialogy.utils import load_file\nfrom dialogy.workflow impo... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
StanislawSwierc/Ax | [
"1dc24d52fcb21308f9559374409296260e1bfc79"
] | [
"ax/storage/sqa_store/decoder.py"
] | [
"#!/usr/bin/env python3\n# 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 inspect\nfrom collections import OrderedDict, defaultdict\nfrom enum import Enum\nfrom typing import ... | [
[
"pandas.read_json"
]
] |
auroua/SSNENAS | [
"65bdece174f0da2f9a3c716b86859abba077d279"
] | [
"nas_lib/predictors/predictor_unsupervised_siamese_ged.py"
] | [
"# Copyright (c) Xidian University and Xi'an University of Posts & Telecommunications. All Rights Reserved\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import Sequential, Linear, ReLU\nfrom gnn_lib import GINConv, global_mean_pool as gmp\n\n\nclass PredictorSiameseGED(nn.Mo... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.init.kaiming_uniform_",
"torch.nn.Sigmoid",
"torch.nn.init.constant_",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d"
]
] |
cdeil/streamlit | [
"173aa1cd5835174620e8246eb5d7116be2cb6ffc"
] | [
"e2e/scripts/st_pydeck_geo_layers.py"
] | [
"# Copyright 2018-2020 Streamlit Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ... | [
[
"pandas.DataFrame"
]
] |
periannath/ONE | [
"61e0bdf2bcd0bc146faef42b85d469440e162886"
] | [
"res/TensorFlowPythonExamples/examples/split_2/__init__.py"
] | [
"import tensorflow as tf\n\nin_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(4, 3), name=\"Hole\")\nop_ = tf.compat.v1.split(in_, [1, 2, 1])\n"
] | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.split"
]
] |
Tonicrespit/hmm_pos_tagger | [
"436b1f626f7f7dbcec1de49c1f5b3c3a1c5f3d79"
] | [
"HMM/Models/ViterbiDecoder.py"
] | [
"import numpy as np\nfrom . import Tagsets\n\n\nclass ViterbiDecoder:\n def __init__(self, hmm):\n \"\"\"\n\n :param hmm: Trained Hidden Markov Model\n \"\"\"\n self.hmm = hmm\n\n def viterbi(self, sentence):\n \"\"\"\n Using the traditional algorithm of Viterbi to ge... | [
[
"numpy.max",
"numpy.argmax"
]
] |
gromovnik1337/ROS_OD_SC | [
"e11ea0780e193a3b045b578d7bf3688ee4aa99f0"
] | [
"segmentation/SqueezeSegV3/src/backbones/SAC.py"
] | [
"# This file was modified from https://github.com/BobLiu20/YOLOv3_PyTorch\n# It needed to be modified in order to accomodate for different strides in the\nfrom __future__ import division\nimport torch\nimport torch.nn as nn\nfrom collections import OrderedDict\nimport torch.nn.functional as F\n\n\nclass SACBlock(nn... | [
[
"torch.nn.functional.unfold",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Dropout2d"
]
] |
zhiming-xu/weibo-emoji-predict | [
"5d4636a6f79ea88ec5da8d36592d605857ca37b4"
] | [
"bert_util.py"
] | [
"import numpy as np\nfrom mxnet.metric import Accuracy, F1, MCC, PearsonCorrelation, CompositeEvalMetric\nfrom mxnet.gluon.data import Dataset\nfrom gluonnlp.data import TSVDataset, BERTSentenceTransform\nfrom gluonnlp.data.registry import register\n\nclass BERTDatasetTransform(object):\n \"\"\"Dataset Transform... | [
[
"numpy.array"
]
] |
GuojinTseng/MY_MC_Generator | [
"421554d0b178cf2f0c8fbc721fec6f3941f399c3"
] | [
"MC_Event_Generator_with_Vegas/calc_dsigma.py"
] | [
"#==========================================================#\r\n# Process: e+e- -> Z/gamma -> mu+mu-\r\n\r\n# Author: Guojin Tseng\r\n# Date: 2018.7.16\r\n# Version: 1.0\r\n#==========================================================#\r\n\r\n#import guojin's module\r\nimport param_card, run_card\r\n\r\nimport numpy... | [
[
"numpy.sqrt"
]
] |
yejustme/WNTR | [
"4228853c84217392b57e99c486e878ddf7959bbd"
] | [
"wntr/tests/test_metrics_todini.py"
] | [
"from __future__ import print_function\nfrom nose.tools import *\nfrom os.path import abspath, dirname, join\nimport numpy as np\nimport wntr\n\ntestdir = dirname(abspath(str(__file__)))\ndatadir = join(testdir,'networks_for_testing')\nnet6dir = join(testdir,'..','..','examples','networks')\n\nimport functools\nfro... | [
[
"numpy.array",
"numpy.mean"
]
] |
Shubhashis-coder/ARYABHATTA_THE_GRAPH_MASTER | [
"01cf93b58a405eba7c60404b1a093cb6c35a6e4f"
] | [
"graph.py"
] | [
"from tkinter import *\r\nimport tkinter as tk\r\nimport tkinter.scrolledtext as st\r\nfrom tkinter import ttk\r\nfrom tkinter import messagebox\r\n#=================================================\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\", category=DeprecationWarning) \r\nimport parser\r\n#========... | [
[
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.minorticks_on",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.gca"
]
] |
ericmjl/protein-systematic-characterization | [
"3ac44d672380490d8e602aa024e40009fdf306b0"
] | [
"data/Luminometrics/htbayes.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Nov 30 17:56:58 2016\n\n@author: Vivian Zhong\n\"\"\"\n\nimport click\nimport pymc3 as pm\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport logging\n\n@click.command()\n@click.option('--filename', default='data.c... | [
[
"numpy.percentile",
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.unique",
"numpy.log10",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
pastewka/LBWithPython | [
"a913683afa55b77395189b4c5d95f836599a91cb"
] | [
"simulators/parallel_lid_drive_cavity/cavity_opt1.py"
] | [
"\"\"\"\nCopyright 2017-2018 Lars Pastewka, Andreas Greiner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, mo... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.roll",
"numpy.dtype"
]
] |
QuKunLab/SMAFS | [
"b635fc13c8d3bd6344f7d8bdfe9c96c27f20461e"
] | [
"figure2/res_OurPretreatment/code¶meter/scanpy_cluster_ourInitial.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 2019/5/9 10:55\n# @Author : YinLei Hu\nimport numpy as np\nimport pandas as pd\nimport scanpy as sc\nfrom os.path import join, exists\nfrom os import mkdir\n\nsc.settings.verbosity = 3 # verbosity: errors (0), warnings (1), info (2), hints (... | [
[
"numpy.random.seed",
"pandas.read_csv",
"numpy.transpose"
]
] |
do-wie-ching/Search-by-image | [
"f7b3d5e0ed28768f3def151f420c8873a1072160"
] | [
"ResNet-Tensorflow/Load/Convertion.py"
] | [
"# -*- coding: utf-8 -*-\nfrom keras.preprocessing.image import save_img\nimport numpy as np\nimport pickle\nimport argparse\nimport os\nimport threading as th\n\nNUM_CLASSES = 10\n\nparser = argparse.ArgumentParser(description='Process some integers.')\nparser.add_argument('--p', type=str, help='Enter dataset')\np... | [
[
"numpy.reshape"
]
] |
graziul/hist-census-gis | [
"558bf38cd0e444b5a91133dd70c88210da3cbbc9"
] | [
"build/lib/histcensusgis/text/stevemorse.py"
] | [
"from openpyxl import Workbook\nfrom histcensusgis.text.standardize import *\nimport urllib\nimport pandas as pd\nimport re\nimport pickle\nimport os\nimport histcensusgis\nimport time\nimport math\n\n# Use one year's CityInfo file to get list of states\nfile_path = '/home/s4-data/LatestCities'\npackage_path = os.p... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
yeshenpy/PMIC | [
"d9627f24fcc2b9d7b4a3a6f3b05e5c999c4305d8"
] | [
"algorithms/mpe_new_maxminMADDPG.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport math\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nimport os\nfrom torch import Tensor\n\nclass OUNoise:\n def __init__(self, action_dimension, scale=0.1, mu=0, theta=0.15, sigma=0.2):\... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.sqrt",
"torch.nn.functional.softplus",
"torch.nn.Tanh",
"torch.no_grad",
"numpy.ones",
"torch.FloatTensor",
"numpy.mean",
"torch.clamp",
"torch.nn.ReLU",
"torch.nn.functional.mse_loss",
"torch.nn.functional.linear",
"to... |
yumy-wang/smart_city | [
"a01a62221b294c1d274cd67cc9dc8b5bd77375e7"
] | [
"mmdet/core/evaluation/bbox_overlaps.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport numpy as np\n\n\ndef bbox_overlaps(bboxes1, bboxes2, mode='iou', eps=1e-6):\n \"\"\"Calculate the ious between each bbox of bboxes1 and bboxes2.\n\n Args:\n bboxes1(ndarray): shape (n, 4)\n bboxes2(ndarray): shape (k, 4)\n mode(str)... | [
[
"numpy.minimum",
"numpy.zeros",
"numpy.maximum"
]
] |
worldbeater/umap | [
"eb8c4b2bbb08c1fc9b6a983af8d50a8d03468735"
] | [
"umap/parametric_umap.py"
] | [
"import numpy as np\nfrom umap import UMAP\nfrom warnings import warn, catch_warnings, filterwarnings\nfrom numba import TypingError\nimport os\nfrom umap.spectral import spectral_layout\nfrom sklearn.utils import check_random_state\nimport codecs, pickle\nfrom sklearn.neighbors import KDTree\nimport sys\n\n\ntry:\... | [
[
"numpy.product",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.layers.InputLayer",
"tensorflow.ones",
"numpy.tile",
"numpy.min",
"numpy.mean",
"tensorflow.keras.Sequential",
"tensorflow.py_function",
"tensorflow.keras.layers.Dense",
"tensorflow.zeros_l... |
ranjeetkgupta/lda2vec_absa | [
"a00564ecff8a94ff40a55f3d3efcb22b979b7daf"
] | [
"build/lib/lda2vec/corpus.py"
] | [
"from collections import defaultdict\nimport numpy as np\nimport difflib\nimport pandas as pd\n\ntry:\n from pyxdameraulevenshtein import damerau_levenshtein_distance_withNPArray\nexcept ImportError:\n pass\n\n\nclass Corpus():\n _keys_frequency = None\n\n def __init__(self, out_of_vocabulary=-1, skip=-... | [
[
"numpy.argmin",
"numpy.tile",
"numpy.apply_along_axis",
"pandas.concat",
"numpy.concatenate",
"numpy.bincount",
"numpy.random.normal",
"numpy.zeros_like",
"numpy.arange",
"numpy.argmax",
"numpy.sqrt",
"numpy.array",
"numpy.allclose",
"numpy.argsort",
"nu... |
purduerov/X11-New | [
"e2884af3601b8ef824a4d3364c393d828d34172b"
] | [
"ros/src/control/scripts/Complex_1.py"
] | [
"from numpy import linalg\r\nimport numpy as np\r\nimport pprint as pp\r\nimport init_hw_constants\r\n\r\n\r\nclass Complex():\r\n \"\"\"\r\n This code is a rewrite of MutatorMatrix to simplify and clarify the code without removing the source\r\n This thrust-mapping works by solving the least squared solut... | [
[
"numpy.concatenate",
"numpy.matrix",
"numpy.sin",
"numpy.array",
"numpy.zeros",
"numpy.set_printoptions",
"numpy.linalg.pinv",
"numpy.transpose",
"numpy.cos",
"numpy.abs"
]
] |
ltstein/SCUTTLE | [
"dea3c35a5c3404c3f6d9b133515593e869fef96c"
] | [
"software/python/basics/L2_obstacle.py"
] | [
"# this program was designed for detecting obstacles using lidar.\n# it is a level 2 program.\n\nimport time\nimport L1_lidar as lidar # import the level 1 program\nimport numpy as np # for operating on arrays\n\np0 = np.asarray([0, 0]) # d... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.argmin",
"numpy.round",
"numpy.radians",
"numpy.sqrt"
]
] |
yoxu515/CFBI | [
"0bab1e3c9fc3e3ba0629f716d60221e8f8d9d586"
] | [
"networks/cfbi/ensembler.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom networks.layers.attention import IA_gate\nfrom networks.layers.gct import Bottleneck, GCT\nfrom networks.layers.aspp import ASPP\n\nclass CollaborativeEnsembler(nn.Module):\n def __init__(self,\n in_dim=256... | [
[
"torch.cat",
"torch.min",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.conv2d"
]
] |
matt12eagles/dragonpilot | [
"b88aa72960edb9f24303fde9a373446bbc24b27b"
] | [
"selfdrive/car/volkswagen/carstate.py"
] | [
"import numpy as np\nfrom cereal import car\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.car.interfaces import CarStateBase\nfrom opendbc.can.parser import CANParser\nfrom opendbc.can.can_define import CANDefine\nfrom selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, Tran... | [
[
"numpy.mean"
]
] |
Kevoen/AerialDetection | [
"84e035a70e5702f4b904acc5782654d67660af14"
] | [
"mmdet/models/losses/iou_loss.py"
] | [
"import math\n\nimport torch\nimport torch.nn as nn\n\nfrom mmdet.core import bbox_overlaps\nfrom ..builder import LOSSES\nfrom .utils import weighted_loss\n\n\n@weighted_loss\ndef iou_loss(pred, target, eps=1e-6):\n \"\"\"IoU loss.\n Computing the IoU loss between a set of predicted bboxes and target bboxes.... | [
[
"torch.stack",
"torch.min",
"torch.max",
"torch.any",
"torch.no_grad",
"torch.atan",
"torch.zeros_like",
"torch.where"
]
] |
omry/ParlAI | [
"61703c7b76dce45bc7f7282b20a35be64c6a0880"
] | [
"parlai/agents/fairseq/fairseq.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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\n\"\"\"\nParlAI has limited support for using models from\n`Fairseq <https://github.com/pytorch/fairseq>`_. Fa... | [
[
"torch.manual_seed",
"torch.cuda.get_device_capability",
"numpy.exp2"
]
] |
OliverLPH/PaddleNLP | [
"ddbae3d2baa7f6072d70e5e0dd90251c9149a36e"
] | [
"examples/language_model/bert/run_pretrain.py"
] | [
"# Copyright (c) 2020 PaddlePaddle 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 re... | [
[
"numpy.random.seed",
"numpy.full",
"numpy.asarray",
"numpy.expand_dims"
]
] |
StatMixedML/pytorch-ts | [
"4bc2d247c70c59479d359d13d2db5739227307e8"
] | [
"pts/modules/distribution_output.py"
] | [
"from abc import ABC, abstractmethod\nfrom typing import Callable, Dict, Optional, Tuple\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pts.core.component import validated\nfrom torch.distributions import (\n Distribution,\n Beta,\n NegativeBinomial,\n ... | [
[
"torch.nn.Linear",
"torch.sqrt",
"torch.nn.functional.softplus",
"torch.distributions.Normal",
"torch.distributions.NegativeBinomial",
"numpy.exp",
"torch.eye",
"torch.distributions.AffineTransform",
"torch.ones_like",
"torch.distributions.MultivariateNormal"
]
] |
acuacal/poreplex | [
"cd282cd689c30949ad1de21c70337ca92312c95b"
] | [
"training/barcodes/scripts/prepare_training_data.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright (c) 2018 Institute for Basic Science\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 limitation the ... | [
[
"numpy.array",
"pandas.read_table",
"numpy.median",
"numpy.save",
"numpy.abs"
]
] |
erikmannerfelt/xdem | [
"725a216f576642f2af4ac3228c9290cd85e47e17"
] | [
"tests/test_filters.py"
] | [
"\"\"\"Functions to test the filtering tools.\"\"\"\nfrom __future__ import annotations\n\nimport numpy as np\nimport pytest\n\nimport geoutils as gu\nimport xdem\n\n\nclass TestFilters:\n \"\"\"Test cases for the filter functions.\"\"\"\n\n # Load example data.\n dem_2009 = gu.georaster.Raster(xdem.exampl... | [
[
"numpy.max",
"numpy.isnan",
"numpy.copy",
"numpy.min",
"numpy.nanmin",
"numpy.random.randint",
"numpy.abs",
"numpy.isfinite",
"numpy.nanmax",
"numpy.vstack"
]
] |
AIARTSJTU/ToyGAN_Zoo | [
"086f309d474674cdc0c859f467d49ec88399e943"
] | [
"training/learnG_hinge.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport numpy as np\nimport random\nimport math\nimport sys\nimport datetime\nimport time\n\nfrom collections import namedtuple\n\ndef print_now(cmd, file=None):\n time_now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')\n if file... | [
[
"torch.FloatTensor"
]
] |
danoneata/deep_lip_reading | [
"bb46cd7ee2764e1d932d9ea95cc405bef0934332"
] | [
"lip_model/preproc_and_aug.py"
] | [
"from util.tf_util import shape_list\nfrom tensorflow.python.ops import array_ops, random_ops, math_ops, control_flow_ops\nimport tensorflow as tf\n\n\ndef wrap_in_training_phase(train_out, test_out, name=None):\n # This has been hardcoded for evaluation code where we only use the function for test\n # time a... | [
[
"tensorflow.python.ops.math_ops.less",
"tensorflow.python.ops.array_ops.reverse",
"tensorflow.map_fn",
"tensorflow.image.resize_image_with_crop_or_pad",
"tensorflow.random_crop",
"tensorflow.image.resize_images",
"tensorflow.python.ops.random_ops.random_uniform",
"tensorflow.identi... |
AIDA-Skoltech/LearnRLSK | [
"7d097999469b65886d91254f0d98e85277d088fd"
] | [
"presets/main_3wrobot_NI.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nPreset: a 3-wheel robot (kinematic model a. k. a. non-holonomic integrator).\n\n\"\"\"\n\nimport os, sys\nPARENT_DIR = os.path.abspath(__file__ + '/../..')\nsys.path.insert(0, PARENT_DIR)\nimport rcognita\n\nif os.path.abspath(rcognita.__file__ + \"/../..\")... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"numpy.ones",
"matplotlib.animation.FuncAnimation"
]
] |
Gerkinator/spinningup | [
"a4ccfb447329e89007a36908133a3b0867b5664c"
] | [
"spinup/utils/mpi_tf.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom mpi4py import MPI\nfrom spinup.utils.mpi_tools import broadcast\n\n\ndef flat_concat(xs):\n return tf.concat([tf.reshape(x,(-1,)) for x in xs], axis=0)\n\ndef assign_params_from_flat(x, params):\n flat_size = lambda p : int(np.prod(p.shape.as_list())) # the '... | [
[
"tensorflow.assign",
"numpy.zeros",
"tensorflow.py_func",
"tensorflow.group",
"tensorflow.global_variables",
"tensorflow.reshape",
"numpy.prod",
"tensorflow.control_dependencies",
"tensorflow.split",
"tensorflow.train.AdamOptimizer.__init__"
]
] |
pune-lug/DeepVideoAnalytics | [
"2650037040dca49b0f537df576af123dae8cef97"
] | [
"dvalib/ssd/datasets/pascalvoc_common.py"
] | [
"# Copyright 2015 Paul Balanca. 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 ap... | [
[
"tensorflow.FixedLenFeature",
"tensorflow.VarLenFeature"
]
] |
smly/nips17_adversarial_attack | [
"8c26af180c069a9a57f112e5a5f9cfb707b352d5"
] | [
"attack/dataset.py"
] | [
"# -*- coding: utf-8 -*-\nimport glob\nfrom pathlib import Path\n\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nfrom PIL import Image\n\n\nclass ReverseLeNormalize(object):\n # Normalzie to [0.0, 1.0]\n def __call__(self, tensor):\n pass\n\n\nclass LeNorma... | [
[
"torch.zeros"
]
] |
olagalal/multimedia-tasks | [
"52628f9b91bf63b942a736f37556c27b1b6e3916"
] | [
"rotate.py"
] | [
"import matplotlib.pyplot as plt\nimport math\n\nfont = {'color': 'red',\n 'size': 15}\n\nXcoordinate = [5, 12, 12, 4, 5]\nYcoordinate = [5, 4, 10, 10, 5]\nXcoordinate2 = [5, 12, 12, 4, 5]\nYcoordinate2 = [5, 4, 10, 10, 5]\n\nangle = int(input(\"Enter Angle of rotation in degree: \"))\n\nsinAngle = math.ceil... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
scooperstein/weaver | [
"94f9018c280cf5e01b2673ef5ea6f8a0353dcbb9"
] | [
"utils/data/preprocess.py"
] | [
"import time\nimport glob\nimport copy\nimport numpy as np\n\nfrom ..logger import _logger\nfrom .tools import _get_variable_names, _eval_expr\nfrom .fileio import _read_files\n\n\ndef _apply_selection(table, selection):\n if selection is None:\n return\n selected = _eval_expr(selection, table).astype(... | [
[
"numpy.histogram2d",
"numpy.nan_to_num",
"numpy.median",
"numpy.percentile",
"numpy.sum",
"numpy.min",
"numpy.clip"
]
] |
luisferreira97/autoautoml | [
"501d2de8b2153748b57e5c8cb247058c587ce29c"
] | [
"data/churn/autosklearn/run_sklearn.py"
] | [
"import json\nfrom datetime import datetime\n\nimport autosklearn.classification\nimport autosklearn.regression\nimport pandas as pd\nimport sklearn.metrics\nimport sklearn.model_selection\n\ndata_path = \"./data/churn/churn\"\n\ntarget = \"class\"\n\nfold1 = pd.read_csv(data_path + \"-fold1.csv\")\nfold2 = pd.read... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
HMarcos/SO-Threads-Python | [
"94de48140049ea43f59e9442284b85d5fd65ab1c"
] | [
"main.py"
] | [
"\"\"\"\nUso de Threads em Python em uma aplicação de Processamento de Imagens, que envolve o Realce de Imagens em Nível de Cinza.\n\nAo todo são criadas duas novas threads com as seguintes funções:\n -> Thread 1: Alargamento de Contraste; \n -> Thread 2: Equalização de Histograma\n\nEssa atividade faz parte ... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"numpy.amax",
"numpy.amin",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
agdc-research-trial/gdf | [
"82ed29c263eaf65f5c1fbb4e9207c99e9700b85c"
] | [
"datacube/utils/math.py"
] | [
"# This file is part of the Open Data Cube, see https://opendatacube.org for more information\n#\n# Copyright (c) 2015-2020 ODC Contributors\n# SPDX-License-Identifier: Apache-2.0\nfrom typing import Tuple, Union, Optional, Any, cast\nfrom math import ceil, fmod\n\nimport numpy\nimport xarray as xr\nfrom affine imp... | [
[
"numpy.ndindex",
"numpy.isnan",
"numpy.iinfo",
"numpy.dtype",
"numpy.full_like"
]
] |
AndrewPaulChester/rlkit | [
"0743c713d60250013803f7f158a38b431f6c9fa9"
] | [
"rlkit/core/logging.py"
] | [
"\"\"\"\nBased on rllab's logger.\n\nhttps://github.com/rll/rllab\n\"\"\"\nfrom enum import Enum\nfrom contextlib import contextmanager\nimport numpy as np\nimport os\nimport os.path as osp\nimport sys\nimport datetime\nimport dateutil.tz\nimport csv\nimport json\nimport pickle\nimport errno\n\nfrom torch.utils.ten... | [
[
"numpy.max",
"numpy.median",
"numpy.min",
"numpy.std",
"numpy.average",
"torch.utils.tensorboard.SummaryWriter"
]
] |
Panlichen/oneflow | [
"395da40885016d0b899f8a1eb87e5311a556a9b8"
] | [
"python/oneflow/test/modules/test_searchsorted.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap... | [
[
"numpy.array"
]
] |
mdboom/matplotlib-py3 | [
"32c57d7e5f79b298c1837c312a454a3100b949c9"
] | [
"lib/matplotlib/mlab.py"
] | [
"\"\"\"\n\nNumerical python functions written for compatability with MATLAB\ncommands with the same names.\n\nMATLAB compatible functions\n-------------------------------\n\n:func:`cohere`\n Coherence (normalized cross spectral density)\n\n:func:`csd`\n Cross spectral density uing Welch's average periodogram\n\n:... | [
[
"matplotlib.verbose.report",
"numpy.dot",
"matplotlib.cbook.is_numlike",
"numpy.random.rand",
"numpy.tile",
"numpy.exp",
"numpy.mean",
"numpy.resize",
"numpy.fft.fft",
"numpy.iscomplexobj",
"numpy.finfo",
"numpy.sign",
"matplotlib.cbook.dedent",
"numpy.conju... |
jfcrenshaw/LGSM | [
"f91a0e6952195e7358d340e52752267d2e4a6505"
] | [
"workflow/scripts/plot_model_predictions.py"
] | [
"\"\"\"Plots SED and photometry predictions for the trained LGS Model.\"\"\"\nimport pickle\n\nimport elegy\nimport jax.numpy as jnp\nimport matplotlib.pyplot as plt\nfrom jax import random, vmap\nfrom lgsm.plotting import plot_photometry, plot_sed\n\n# pylint: disable=undefined-variable\n# get the values injected ... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.subplots"
]
] |
avandekleut/drq | [
"afdc724aa3212ca5445a6d1ca84961b5f35deaac"
] | [
"train.py"
] | [
"import copy\nimport math\nimport os\nimport pickle as pkl\nimport sys\nimport time\n\nimport numpy as np\n\nimport dmc2gym\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport utils\nfrom logger import Logger\nfrom replay_buffer import ReplayBuffer\nfrom video import VideoRecorder\n\nfrom ... | [
[
"torch.device"
]
] |
bob80333/DMIT | [
"34edd301819e338bd713404afb139f9338107ae1"
] | [
"models/a2b_transfer_model.py"
] | [
"import torch\n\nfrom models.base_model import BaseModel\nfrom util.util import tensor2im\n\n\n################## SeasonTransfer #############################\nclass A2BTransferModel(BaseModel):\n def __init__(self, opt):\n BaseModel.__init__(self, opt)\n\n def prepare_data(self, data):\n img, a... | [
[
"torch.no_grad",
"torch.cat",
"torch.ones"
]
] |
tkc-morita/variational_inference_DP_mix_HDP_topic_ngram | [
"95d6c8ab2956501fc82b416bf423ee57fe77c73f"
] | [
"code/analysis/Japanese/old/list_grouped_segments.py"
] | [
"# coding: utf-8\n\nimport numpy as np\nimport pandas as pd\nimport sys, os.path\n\ndef get_grouped_segments(df_atom, base_counts, threshold=1):\n\tdf_atom = df_atom.sort_values('value')\n\tdf_grouped_segments = pd.DataFrame(columns=['sublex_id','cluster_id','active_segments','num_active_segments'])\n\tfor (sublex_... | [
[
"pandas.DataFrame"
]
] |
EricBoittier/graph-neural-networks-for-drug-discovery | [
"12fed5c6e7bbd716d9f713d34067ed83dd539b50"
] | [
"gnn/molgraph_data.py"
] | [
"import gzip\nimport numpy as np\nimport torch\nimport rdkit\nfrom rdkit import Chem\nfrom rdkit.Chem.rdchem import BondType\nfrom torch.utils import data\n\nfrom gnn.graph_features import atom_features\nfrom collections import defaultdict\n\n\nclass MolGraphDataset(data.Dataset):\n r\"\"\"For datasets consistin... | [
[
"torch.zeros",
"numpy.genfromtxt",
"torch.Tensor",
"numpy.zeros"
]
] |
Herbert-Gao/Driving-Style-Analysis | [
"a7f109266dfff8761c31131d7261e1845e340e80"
] | [
"Python_Code/draw_gamma.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport scipy.stats as st\r\n\r\nfrom matplotlib.font_manager import FontProperties\r\nzhfont = FontProperties(fname=r\"simhei.ttf\", size=18)\r\n\r\nfig = plt.figure(figsize=(6, 5)) # 确定绘图区域尺寸\r\nax1 = fig.add_subplot(1, 1, 1)\r\nx = np.arange(0.01, 20, 0.0... | [
[
"matplotlib.font_manager.FontProperties",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_params",
"numpy.arange",
"scipy.stats.gamma.pdf",
"matplotlib.pyplot.show"
]
] |
allywarner/ITK | [
"dc8765dbfbcd47124579fba04c8cf5101dd585b7"
] | [
"Wrapping/Generators/Python/itkExtras.py"
] | [
"#==========================================================================\n#\n# Copyright Insight Software Consortium\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... | [
[
"numpy.issubdtype"
]
] |
Chasearmer/deepchem | [
"eaedd4d79c69d42b840d416f7420634f558c4949",
"eaedd4d79c69d42b840d416f7420634f558c4949"
] | [
"deepchem/feat/graph_features.py",
"deepchem/models/tensorgraph/models/graph_models.py"
] | [
"from __future__ import division\nfrom __future__ import unicode_literals\n\nimport numpy as np\nfrom rdkit import Chem\n\nfrom deepchem.feat import Featurizer\nfrom deepchem.feat.mol_graphs import ConvMol, WeaveMol\n\n\ndef one_of_k_encoding(x, allowable_set):\n if x not in allowable_set:\n raise Exception(\"i... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.mean",
"numpy.stack",
"numpy.vstack"
],
[
"numpy.concatenate",
"numpy.square",
"numpy.array",
"tensorflow.shape",
"numpy.fill_diagonal",
"numpy.stack",
"numpy.arange",
"numpy.cumsum",
"numpy.o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.