repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
KRR-Oxford/BERTMap | [
"26eb78288885b8749c5bd970d44fa0ec18c6f417"
] | [
"bertmap/map/bert_embeds_map.py"
] | [
"\"\"\"Mapping Generation on using Pretrained/Fine-tuned BERT with various pooling strategies and cosine-similarity.\n\"\"\"\n\nimport time\nfrom typing import List, Optional\n\nimport torch\nfrom bertmap.bert import BERTStatic\nfrom bertmap.map import OntoMapping\nfrom bertmap.onto import OntoBox\nfrom bertmap.uti... | [
[
"torch.topk",
"torch.cat",
"sklearn.metrics.pairwise.cosine_similarity",
"torch.tensor"
]
] |
ftrotter/aggStatModelsAndHumanJudgment_PUBL | [
"c35bb3b33136f3a7603f9885f4d25a69f916d6ab"
] | [
"data/predictionsStatsTable.py"
] | [
"#mcandrew\n\nimport sys\nimport numpy as np\nimport pandas as pd\n\nsys.path.append(\"../\")\nfrom mods.datahelp import grabData\n\ndef computeMedianAndIQR(d):\n\n stats = {\"quantile\":[], \"value\":[]}\n for quantile in [ 0.010, 0.025, 0.050, 0.100, 0.150, 0.200\n ,0.250, 0.300, 0.350,... | [
[
"pandas.DataFrame"
]
] |
haha94322/HMQAR | [
"b753348c2f076cbb16770f66f4503245cf507301"
] | [
"models/MQAR.py"
] | [
"import numpy as np\nimport itertools\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn.modules.module import Module\nimport torch.nn.functional as F\n\nclass MQAR(Module):\n def __init__(self, module_dim, num_objects, max_subset_size):\n super(MQAR, self).__init__()\n\n self.module_dim = modul... | [
[
"torch.nn.Dropout",
"torch.nn.MultiheadAttention",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.ELU",
"torch.nn.Linear"
]
] |
Heinlein-vi/simulated-unsupervised-tensorflow | [
"eafa49f0a98641c99b66c8eafbac48314363ae0f"
] | [
"model.py"
] | [
"import tensorflow as tf\nfrom tensorflow.contrib.framework import arg_scope\n\nfrom layers import *\nfrom utils import show_all_variables\n\nclass Model(object):\n def __init__(self, config, data_loader):\n self.data_loader = data_loader\n\n self.task = config.task\n self.debug = config.debug\n self.c... | [
[
"tensorflow.concat",
"tensorflow.train.AdamOptimizer",
"tensorflow.train.batch",
"tensorflow.Variable",
"tensorflow.clip_by_norm",
"tensorflow.name_scope",
"tensorflow.train.shuffle_batch",
"tensorflow.Print",
"tensorflow.image.resize_images",
"tensorflow.placeholder",
... |
wuyou33/broad | [
"01a4a653614c03850908372d064055a0ef45e35b"
] | [
"example_code/broad_utils.py"
] | [
"# SPDX-FileCopyrightText: 2021 Daniel Laidig <laidig@control.tu-berlin.de>\n#\n# SPDX-License-Identifier: MIT OR CC-BY-4.0\n\nimport numpy as np\nimport scipy.io as spio\n\n\ndef calculateErrorQuatEarth(imu_quat, opt_quat):\n \"\"\"\n Calculates quaternion that represents the orientation estimation error in ... | [
[
"numpy.sqrt",
"numpy.abs",
"numpy.asarray",
"scipy.io.loadmat",
"numpy.linalg.norm",
"numpy.mean",
"numpy.nanmean",
"numpy.argmin",
"numpy.cross",
"numpy.zeros"
]
] |
wangtz/models | [
"fcca91e05ae49b9e1bd2f325cfca3ba261e0b41e"
] | [
"official/mnist/mnist_tpu.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.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.nn.softmax",
"tensorflow.losses.sparse_softmax_cross_entropy",
"tensorflow.flags.DEFINE_string",
"tensorflow.train.get_global_step",
"tensorflow.contrib.tpu.TPUEstimatorSpec",
... |
maruidea/Super-SloMo | [
"6079be7cc6c0004f215777da3f490cbb117b0569"
] | [
"video_to_slomo.py"
] | [
"#!/usr/bin/env python3\nimport argparse\nimport os\nimport os.path\nimport ctypes\nfrom shutil import rmtree, move\nfrom PIL import Image\nimport torch\nimport torchvision.transforms as transforms\nimport model\nimport dataloader\nimport platform\nfrom tqdm import tqdm\n\n# For parsing commandline arguments\nparse... | [
[
"torch.sigmoid",
"torch.cat",
"torch.load",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
ricamo/FastDensityPeak | [
"e629efb64590e4816564ac48f664a4fa2e900573"
] | [
"datasets/datasets.py"
] | [
"\"\"\"\nThese functions servs to load properly the datasets included in the project.\nThey return the loaded dataframe (with some basic preprocessing, if needed),\nthe name of the class column and the ideal number of bins for discretizating the\nnumerical attributes (if any, else None).\n\"\"\"\nimport os\nimport ... | [
[
"sklearn.preprocessing.LabelEncoder",
"numpy.where",
"pandas.read_csv"
]
] |
nicolalandro/softpool | [
"ca77161ab70e5fe6c6505dc40f448bd8e1d78a48"
] | [
"GCN/layers_treegcn/gcn.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport math\n\nclass TreeGCN(nn.Module):\n def __init__(self, depth, features, degrees, support=10, node=1, upsample=False, activation=True):\n self.depth = depth\n self.in_feature = features[depth]\n self.out_feature = feat... | [
[
"torch.nn.Linear",
"torch.FloatTensor",
"torch.nn.LeakyReLU",
"torch.nn.init.calculate_gain"
]
] |
mrschweizer/PyThat | [
"61c411b0a3eb70be39d4c601b51a1eafc67b51dd"
] | [
"examples/example.py"
] | [
"from PyThat import MeasurementTree\n# from h5to_nc import MeasurementTree\nimport xarray as xr\nimport matplotlib.pyplot as plt\n\n# Define path to .h5 file\npath = r'D:\\Pycharm\\PyThat\\examples\\floquet_just_spectrum_analyzer_large_incomplete.h5'\n\nindex = (3, 0)\n# Optional: If the index is known beforehand, ... | [
[
"matplotlib.pyplot.show"
]
] |
therooler/qml | [
"d48c853af9abb6b6db58de830b8832122042adb7"
] | [
"demonstrations/tutorial_qaoa_intro.py"
] | [
"r\"\"\"\nIntro to QAOA\n=========================\n\n.. meta::\n :property=\"og:description\": Learn how to implement QAOA with PennyLane\n :property=\"og:image\": https://pennylane.ai/qml/_images/qaoa_layer.png\n\n.. related::\n\n tutorial_qaoa_maxcut QAOA for MaxCut\n\n*Author: Jack Ceroni. Posted: 18 No... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use"
]
] |
caisarl76/savn | [
"843b4bbed8aea4c1ff13e6b37515eb42da5c0985"
] | [
"runners/nonadaptivea3c_train.py"
] | [
"from __future__ import division\n\nimport time\n\nfrom datasets.data import get_data\nfrom datasets.glove import Glove\n\nimport setproctitle\n\nfrom models.model_io import ModelOptions\n\nfrom agents.random_agent import RandomNavigationAgent\n\nimport random\n\nfrom .train_util import (\n compute_loss,\n ne... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.set_device"
]
] |
scott-mao/CroP | [
"f1e0a25224e341683cf47e7ce451ce0fe996e950"
] | [
"main_seml.py"
] | [
"import sys\nimport warnings\n\nfrom models import GeneralModel\nfrom models.statistics.Metrics import Metrics\nfrom utils.config_utils import *\nfrom utils.model_utils import *\nfrom utils.system_utils import *\n# from rigl_torch.RigL import RigLScheduler\n\nwarnings.filterwarnings(\"ignore\")\n\nimport logging\nf... | [
[
"torch.optim.lr_scheduler.StepLR"
]
] |
javierggomez/capacity-estimator-via-dine | [
"003cba3b21719f2e6ab4850beb9d589a23c3c2b3"
] | [
"utils.py"
] | [
"import tensorflow as tf\r\nimport sys\r\nimport os\r\nimport logging\r\nimport time\r\nimport shutil\r\nfrom configs import ConfigAWGN, ConfigFF_MA_AGN, ConfigFB_MA_AGN\r\n\r\nlogger = logging.getLogger(\"logger\")\r\n\r\n\r\ndef define_configs(args):\r\n if args.config_name == \"awgn\":\r\n config = Con... | [
[
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.config.experimental.list_logical_devices",
"tensorflow.config.experimental.set_memory_growth"
]
] |
ntoussaint/fetalnav | [
"a6701a33f1ed8ac412f5ee09c0704d866ce7dad2"
] | [
"experiments/train.py"
] | [
"import argparse\nimport os\nimport sys\nfrom pkgutil import iter_modules\nimport numpy as np\n\nimport torch\nfrom torchvision import transforms as torchtransforms\n\nfrom fetalnav.transforms import itk_transforms as itktransforms\nfrom fetalnav.transforms import tensor_transforms as tensortransforms\nfrom fetalna... | [
[
"numpy.median",
"torch.utils.data.DataLoader",
"torch.cuda.is_available"
]
] |
liya2001/s3d.pytorch | [
"47240695a5f6947a24bcd28a10949af4747d27d5"
] | [
"tools/watershed.py"
] | [
"import os,sys\r\nimport time\r\nimport numpy as np\r\nfrom IPython import embed\r\nfrom operator import itemgetter\r\n\r\n\r\nclass Watershed(object):\r\n def __init__(self,type_='clips',num_classes=2):\r\n self.type=type_\r\n self.num_classes=num_classes\r\n\r\n def get_proposals(self,video_sc... | [
[
"numpy.zeros_like",
"numpy.ones"
]
] |
BenJamesbabala/ShuffleNet-2 | [
"1e0a062c684e37c72d9b776a605f446b108498d6"
] | [
"model.py"
] | [
"import tensorflow as tf\nfrom layers import shufflenet_unit, conv2d, max_pool_2d, avg_pool_2d, dense, flatten\n\n\nclass ShuffleNet:\n \"\"\"ShuffleNet is implemented here!\"\"\"\n\n def __init__(self, args):\n self.args = args\n self.X = None\n self.y = None\n self.logits = None\... | [
[
"tensorflow.nn.softmax",
"tensorflow.Variable",
"tensorflow.control_dependencies",
"tensorflow.get_collection",
"tensorflow.equal",
"tensorflow.placeholder",
"tensorflow.image.resize_bicubic",
"tensorflow.summary.merge_all",
"tensorflow.name_scope",
"tensorflow.pad",
"t... |
leozhoujf/tensorflow | [
"a5c2e20205089a1ef0edd497de1c4fb7f3c5ec4a"
] | [
"tensorflow/python/distribute/collective_all_reduce_strategy.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.distribute.distribute_lib.StrategyExtendedV1.__init__",
"tensorflow.python.distribute.cross_device_ops.reduce_non_distributed_value",
"tensorflow.python.distribute.numpy_dataset.SingleDevice",
"tensorflow.python.framework.ops.executing_eagerly_outside_functions",
"tensorflow... |
NanYoMy/brainstorm | [
"b6c20392ebfaf8472fbdc5ffb981948b9826404b"
] | [
"src/utils.py"
] | [
"import os\nimport re\nimport sys\n\nimport cv2\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nimport tensorflow as tf\nimport textwrap\n\n\nfrom src import networks\n\n\nimport medipy.metrics as medipy_metrics\nimport pynd.segutils as pynd_segutils\n\n#############################\n# File utils\... | [
[
"numpy.expand_dims",
"numpy.take",
"numpy.linspace",
"numpy.asarray",
"numpy.squeeze",
"numpy.concatenate",
"numpy.max",
"numpy.mean",
"numpy.any",
"numpy.where",
"numpy.clip",
"numpy.reshape",
"numpy.arange",
"numpy.unique",
"numpy.argmax",
"numpy.a... |
lujoba/utils | [
"dd15cff628b2b972a1138600129f5c7375fca65f"
] | [
"libs/image_orientator.py"
] | [
"import cv2\nimport numpy as np\n\n\nclass ImageOrientation(object):\n def __init__(self):\n pass\n\n @staticmethod\n def rotate_bound(image, angle):\n # grab the dimensions of the image and then determine the\n # center\n (h, w) = image.shape[:2]\n (c_x, c_y) = (w // 2, ... | [
[
"numpy.median",
"numpy.abs"
]
] |
aj-white/fcc_data_analysis | [
"4994718d9c61f099ed49555458f2fbf372cde0e2"
] | [
"Demographic_Data_Analyser/demographic_data_analyser.py"
] | [
"import pandas as pd\n\n\ndef calculate_demographic_data(print_data=True):\n # Read data from file\n df = pd.read_csv(r'adult.data.csv')\n\n df.columns = [x.replace('-', '_') for x in df.columns]\n\n # data cleaning to reduce memory\n df = (\n df\n .assign(\n workclass=df.wor... | [
[
"pandas.read_csv"
]
] |
wellbornbaba/konga-beta | [
"66799fdd09e3e3224bc628d8bc7c34de80d05d4a"
] | [
"linux/setup.py"
] | [
"from selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support.expected_conditions import presence_of_element_located\nfrom selenium.common.exceptions import Timeo... | [
[
"pandas.DataFrame"
]
] |
marcsv87/Deep-PDE-Solvers | [
"3322704f0291dc98e5bdf8c81c57a95cbfe70981"
] | [
"old/basket_options/emp_corr_max.py"
] | [
"import os\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.autograd as autograd\nimport time\nfrom numpy.linalg import norm\nimport copy\nimport math\nfrom numpy.linalg import cholesky\nimport argparse\n\n\nclass Net_timestep(nn.Module):\n \n def __init__(self, dim, nOut, n_layers, vNet... | [
[
"torch.mean",
"torch.max",
"torch.cat",
"torch.no_grad",
"torch.cuda.is_available",
"torch.save",
"torch.ones",
"torch.sqrt",
"numpy.arange",
"torch.randn",
"torch.tensor",
"torch.ones_like",
"torch.nn.BatchNorm1d",
"torch.exp",
"torch.nn.Linear",
"n... |
princeton-nlp/DeepSpeed | [
"b1669c0d8f6dbe65162b534f2c6967f64d143dc3"
] | [
"deepspeed/module_inject/replace_module.py"
] | [
"import copy\nimport torch\nimport deepspeed\nimport deepspeed.ops.transformer as transformer_inference\nfrom .replace_policy import HFBertLayerPolicy, MegatronLayerPolicy\nfrom .replace_policy import replace_policies\nfrom ..constants import INFERENCE_GENERIC_MODE, INFERENCE_SPECIALIZED_MODE\nfrom ..runtime.weight... | [
[
"torch.cat",
"torch.cuda.current_device",
"torch.distributed.is_initialized",
"torch.split",
"torch.chunk",
"torch.distributed.get_rank"
]
] |
wanshanhsieh/distiller | [
"2ae998c066b975bcb38b8ecc2927bf1015f634b9"
] | [
"examples/classifier_compression/compress_classifier.py"
] | [
"#\n# Copyright (c) 2018 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://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"numpy.arange"
]
] |
watchsea/Trd-Capsule-TF | [
"7424ad73a0f67a12e20fdf475be27fffe53e2970"
] | [
"utils.py"
] | [
"import os\nimport scipy\nimport numpy as np\nimport tensorflow as tf\n\nfrom config import cfg\nimport rb_data\n\n\ndef load_mnist(path, is_training):\n if is_training:\n data = rb_data.read_data_sets(\"\",one_hot=False)\n trX = data.train.images\n trY = data.train.labels\n return tr... | [
[
"numpy.zeros",
"tensorflow.train.shuffle_batch",
"tensorflow.train.slice_input_producer"
]
] |
NelleV/grave | [
"19aec1eacb2bd3577fd2660f6199dcab6f8d97c5"
] | [
"examples/plot_grid.py"
] | [
"\"\"\"\nLabeled 2D Grid\n---------------\n\nThis example shows both labels and custom layout.\n\"\"\"\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport random\nfrom grave import plot_network, style_merger\n\n\n\ndef degree_colorer(node_attributes):\n deg = node_attributes['degree']\n shape = 'o... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
melqkiades/machine-learning-framework | [
"25f88bfbce30ebe25ae1ce8830e1cb1945e16b8f"
] | [
"mini_projects/cat_in_the_dat/citd_create_folds.py"
] | [
"import pandas\nimport time\nfrom sklearn import model_selection\n\nfrom mini_projects.cat_in_the_dat.citd_constants import TRAINING_DATA_FOLDS, \\\n TRAINING_DATA\n\n\ndef create_folds():\n data_frame = pandas.read_csv(TRAINING_DATA)\n data_frame[\"kfold\"] = -1\n\n data_frame = data_frame.sample(frac=... | [
[
"pandas.read_csv",
"sklearn.model_selection.StratifiedKFold"
]
] |
szj2ys/deal_with_the_tasks_and_challenges | [
"94b9f4aad26c7e2ec5a59cf67e9e977bfa3d5221"
] | [
"demos/pandas/panda_merge.py"
] | [
"import pandas as pd\n\n#定义资料集\nleft = pd.DataFrame({\n 'key': ['K0', 'K1', 'K2', 'K3'],\n 'A': ['A0', 'A1', 'A2', 'A3'],\n 'B': ['B0', 'B1', 'B2', 'B3']\n})\nright = pd.DataFrame({\n 'key': ['K0', 'K1', 'K2', 'K3'],\n 'C': ['C0', 'C1', 'C2', 'C3'],\n 'D': ['D0', 'D1', 'D2', 'D3']\n})\n\n#依据key横向合... | [
[
"pandas.merge",
"pandas.DataFrame"
]
] |
fred3m/scarlet_test | [
"a33c6ae43e041c55353d1fcbed2d7a9533c197b5"
] | [
"scarlet_test/measure.py"
] | [
"import os\nfrom typing import List, Sequence, Dict, Tuple, Union\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import ticker as mticker\n\nfrom .core import __DATA_PATH__, get_filename, get_branches\n\n\ndef adjacent_values(vals: np.ndarray, q1: int, q3: int) -> Tuple[np.ndarray, np.ndarr... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.ticker.StrMethodFormatter",
"numpy.linspace",
"numpy.min",
"numpy.clip",
"matplotlib.pyplot.subplots",
"numpy.percentile",
"numpy.max",
"numpy.log10",
"numpy.array",
"numpy.where"
]
] |
MatD3mons/Multi_Face_Detector | [
"06c335856bd1ed45cfa1b620032f3fafbcc2baae"
] | [
"Train/python/coco_utils.py"
] | [
"import copy\nimport os\nfrom PIL import Image\n\nimport torch\nimport torch.utils.data\nimport torchvision\n\nfrom pycocotools import mask as coco_mask\nfrom pycocotools.coco import COCO\n\nimport python.transforms as T\n\n\nclass FilterAndRemapCocoCategories(object):\n def __init__(self, categories, remap=True... | [
[
"torch.zeros",
"torch.tensor",
"torch.as_tensor",
"torch.utils.data.Subset",
"torch.stack"
]
] |
truher/demos | [
"6fe9a325931519f04b121dc795c0ec367e84c0f7"
] | [
"interpolation_performance.py"
] | [
"import timeit\nimport numpy as np\nfrom typing import List, Iterable\nimport itertools\nimport collections\nfrom scipy.interpolate import interp1d #type:ignore\n\nloops=1000\n\n# data\nd = np.linspace(0,999,1000) \nfp = list(d)\nxp = np.linspace(0,999,1000)\n# interp x axis (in-between points)\nx = np.linspace(... | [
[
"scipy.interpolate.interp1d",
"numpy.interp",
"numpy.linspace"
]
] |
EverLookNeverSee/diag2model | [
"cba4f98483ada5fb72d00900f68df04245c7c7db"
] | [
"diagtomodel/xception/xception.py"
] | [
"\"\"\"\n An implementation of the Xception model architecture.\n Paper: https://arxiv.org/abs/1610.02357\n Author: Prakhar Srivastava - @prkhrsrvstv1\n\"\"\"\n\n\nfrom typing import Tuple\nfrom tensorflow.keras.models import Model\nfrom tensorflow.python.types.core import Tensor\nfrom tensorflow.keras.lay... | [
[
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow... |
1313e/e13Tools | [
"5a068dedb73fa063699745220f9ed1bf48c7bcc4"
] | [
"e13tools/tests/test_math.py"
] | [
"# -*- coding: utf-8 -*-\n\n# %% IMPORTS\n# Package imports\nimport numpy as np\nimport pytest\n\n# e13Tools imports\nfrom e13tools import ShapeError\nfrom e13tools.math import gcd, is_PD, lcm, nCr, nearest_PD, nPr\n\n\n# %% PYTEST FUNCTIONS\n# Do default test for gcd()-function\ndef test_gcd():\n assert gcd(18,... | [
[
"numpy.eye",
"numpy.array"
]
] |
zhfeng18/Schulich-AI2-Bitcoin-Predictions | [
"27bdb6a39b987cbab1376ac743141415cacd3d87"
] | [
"AI02hw2.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# <h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n# <div class=\"toc\"><ul class=\"toc-item\"></ul></div>\n\n# In[1]:\n\n\nfrom pandas import read_csv\nfrom matplotlib import pyplot\nfrom pandas_datareader import data\nimport matplotlib.pyplot as plt\nimport pan... | [
[
"numpy.concatenate",
"pandas.read_csv",
"numpy.zeros",
"numpy.diff"
]
] |
crazzle/production-ready-ds | [
"783b37b12b69591eda32d2d57e08ce9f71119940"
] | [
"01_classification_pipeline.py"
] | [
"from luigi.contrib.spark import PySparkTask\nfrom luigi.parameter import IntParameter, DateParameter\nfrom luigi import LocalTarget, Task, WrapperTask\n\n\nclass Fetch(Task):\n from datetime import date, timedelta\n\n # Ein Datum wird als Parameter uebergeben\n date = DateParameter(default=date.today())\n... | [
[
"pandas.DataFrame"
]
] |
themayankjha/MedX | [
"cdf295910f6e0a30e6738fcabbf458b8f3e9f9ae"
] | [
"API and AI Model/heartfail.py"
] | [
"\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\nimport sklearn.metrics\r\nfrom sklearn.ensemble import ExtraTreesClassifier\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nimport os\r\n\r\n\r\ndef heartfail(age, sex, anaemia, bp, diabetes, smoking, time):\r\n os.envi... | [
[
"sklearn.ensemble.ExtraTreesClassifier",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.RandomForestClassifier"
]
] |
mberr/ea-sota-comparison | [
"0f7bb679b61675bfb65a2cd7462854968d876df2"
] | [
"src/kgm/trainables/dgmc_matching.py"
] | [
"import copy\nimport logging\n\nimport torch\n\nfrom os import path as osp\n\nfrom typing import MutableMapping, Any, Mapping, Iterable\n\nfrom ray.tune.result import DONE\nfrom torch_geometric.data import Data\nfrom torch_geometric.datasets import DBP15K\n\nfrom dgmc import DGMC\nfrom dgmc.models import RelCNN\nfr... | [
[
"torch.manual_seed",
"torch.no_grad"
]
] |
sabraha2/uncertainty_estimation_deep_learning | [
"12e264f7fb18747352ffed6b4ff9883bc9d83dca"
] | [
"utils.py"
] | [
"'''Some helper functions for PyTorch, including:\n - get_mean_and_std: calculate the mean and std value of dataset.\n - msr_init: net parameter initialization.\n - progress_bar: progress bar mimic xlua.progress.\n'''\nimport os\nimport sys\nimport time\nimport torch\n\nimport torch.nn as nn\nimport torch.... | [
[
"torch.nn.init.kaiming_normal",
"torch.zeros",
"torch.utils.data.DataLoader",
"torch.nn.init.constant",
"torch.nn.init.normal"
]
] |
ritwik12/exoplanet-ml | [
"af443d3cd5e51f591527a7df51315b907057018c"
] | [
"exoplanet-ml/beam/astrowavenet/beam_prepare_inputs.py"
] | [
"# Copyright 2018 The Exoplanet ML 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 ... | [
[
"tensorflow.gfile.Open"
]
] |
Samyak2/practical-nlp | [
"15b9b278e958f1b98f21702b6889861747d41eeb"
] | [
"Ch6/Data/utils.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndef get_data(filename):\n df = pd.read_csv(filename,delim_whitespace=True,names=['word','label'])\n beg_indices = list(df[df['word'] == 'BOS'].index)+[df.shape[0]]\n sents,labels,intents = [],[],[]\n for i in range(len(beg_indices[:-1])):\n sents.append... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
stzwooju/rlcard | [
"52b51c5451fdec3cff053246c84c0c3641d38076"
] | [
"badugi_dqn.py"
] | [
"''' An example of learning a Deep-Q Agent on Texas Limit Holdem\n'''\n\nimport tensorflow as tf\n\nimport rlcard\nfrom rlcard.agents.badugi_dqn_agent import BadugiDQNAgent\nfrom rlcard.agents.random_agent import RandomAgent\nfrom rlcard.models.badugi_rule_models import BadugiRuleAgentV1\nfrom rlcard.utils.utils im... | [
[
"tensorflow.Variable",
"tensorflow.global_variables_initializer",
"tensorflow.Session"
]
] |
febriy/plant_segmentation | [
"8c59d8d61f6868f957319190b40071ff544a1ce9"
] | [
"segmentation_deep/convert_bg.py"
] | [
"import os\nfrom pathlib import Path\nimport pandas as pd\nimport cv2\nfrom torch.utils.data import DataLoader, Dataset, sampler\nfrom sklearn.model_selection import train_test_split\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\nbase_path = Path(__file__).parent.parent\ndata_path = Path(base_path / \... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
HimanshuRanka/ImprovedRD-550-2021 | [
"dbbad05babdb3e40c7c3745818bd557d91a4105a"
] | [
"data.py"
] | [
"import os, gc\nimport torch\nimport torch.utils.data\nimport numpy as np\nimport json\ndata_path = os.path.join('..', 'data')\ndevice = torch.device('cuda')\n\nclass MyDataset(torch.utils.data.Dataset): \n def __init__(self, instances):\n self.instances = instances\n \n def __len__(self):\n ... | [
[
"torch.zeros",
"torch.tensor",
"torch.device",
"numpy.array",
"numpy.zeros"
]
] |
kazakh-shai/SlowFast | [
"279350f7ad2355015f2d8c8c02160f04c89c460e"
] | [
"slowfast/models/ptv_model_builder.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\n\"\"\"Video models using PyTorchVideo model builder.\"\"\"\n\nfrom functools import partial\nimport torch.nn as nn\n\nfrom slowfast.models.batchnorm_helper import get_norm\nfrom slowfast.models.video_model_builder ... | [
[
"torch.nn.Softmax",
"torch.nn.Sigmoid"
]
] |
q-hwang/tacotron2 | [
"002e12fe968e1f3757de658de8e2975b8f7d43e3"
] | [
"train.py"
] | [
"import os\nimport time\nimport argparse\nimport math\nfrom numpy import finfo\n\nimport torch\nfrom distributed import DistributedDataParallel\nfrom torch.utils.data.distributed import DistributedSampler\nfrom torch.nn import DataParallel\nfrom torch.utils.data import DataLoader\n\nfrom fp16_optimizer import FP16_... | [
[
"torch.distributed.init_process_group",
"torch.cuda.manual_seed",
"torch.load",
"torch.utils.data.distributed.DistributedSampler",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"numpy.finfo",
"torch.nn.DataParallel",
"torch.no_grad",
"torch.cuda.is_available",
"to... |
tretherington/scipy | [
"6314c1c7d789d3a8323178cd91f581b589b2f11c"
] | [
"scipy/signal/wavelets.py"
] | [
"import numpy as np\nfrom numpy.dual import eig\nfrom scipy.special import comb\nfrom scipy.signal import convolve\n\n__all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'morlet2', 'cwt']\n\n\ndef daub(p):\n \"\"\"\n The coefficients for the FIR low-pass filter producing Daubechies wavelets.\n\n p>=1 ... | [
[
"numpy.dot",
"numpy.poly1d",
"numpy.take",
"numpy.sqrt",
"numpy.linspace",
"numpy.exp",
"numpy.dual.eig",
"numpy.clip",
"numpy.arange",
"numpy.roots",
"numpy.real",
"numpy.zeros",
"numpy.array",
"scipy.signal.convolve",
"numpy.sum",
"numpy.absolute",... |
andrewsanchez/GenBankQC-Workflow | [
"8e630ca89c3f1a3cd9d6b2c4987100e3552d831e"
] | [
"scripts/dmx.py"
] | [
"import pandas as pd\nfrom pathlib import Path\n\n\ndmx = pd.read_csv(snakemake.input.dmx, index_col=0, sep=\"\\t\")\nnames = [Path(i).name for i in dmx.index]\ndmx.index = names\ndmx.columns = names\ndmx.to_csv(snakemake.input.dmx, sep=\"\\t\")\ndmx.mean().to_csv(snakemake.output.mean_dist, sep=\"\\t\")\n"
] | [
[
"pandas.read_csv"
]
] |
jcrowley3/bots-for-atari-games | [
"c601ba60445b57835e76c4a0c90a7d5232bd69c2"
] | [
"src/bot_5_ls.py"
] | [
"\"\"\"\nBot 5 -- Build least squares q-learning agent for FrozenLake\n\"\"\"\n\nfrom typing import Tuple\nfrom typing import Callable\nfrom typing import List\nimport gym\nimport numpy as np\nimport random\nrandom.seed(0) # make results reproducible\nnp.random.seed(0) # make results reproducible\n\nnum_episodes ... | [
[
"numpy.random.random",
"numpy.random.seed",
"numpy.eye",
"numpy.random.normal",
"numpy.identity",
"numpy.mean",
"numpy.array"
]
] |
ajthor/socks | [
"77063064ceb5a5da3f01733bef0885b00d4b2bed"
] | [
"gym_socks/algorithms/control/common.py"
] | [
"\"\"\"Common functions for kernel control algorithms.\n\nThis file contains common functions used by the kernel optimal control algorithms, and\nimplements an LP solver to compute the probability vector :math:`\\gamma`. This\nfunctionality is accessed via the :py:func:``compute_solution`` function, which serves\na... | [
[
"numpy.negative",
"numpy.argmin",
"numpy.where",
"scipy.optimize.linprog"
]
] |
jishnupdas/SOM-Classifier-for-lightcurves | [
"150072921400efb15f435e38823f59dbd53ef82a"
] | [
"SOM_classifier.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 24 10:51:23 2019\n\n@author: jishnu\n\"\"\"\n\n#%%\nimport os\nimport glob\nimport pickle\nimport numpy as np\nimport seaborn as sns\nfrom minisom import MiniSom \nimport matplotlib.pyplot as plt\nfrom scipy import signal\n#%%\ndpath = '/h... | [
[
"sklearn.cluster.KMeans",
"numpy.linspace",
"numpy.isnan",
"numpy.invert",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"scipy.cluster.hierarchy.linkage",
"sklearn.cluster.AgglomerativeClustering",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use",
"numpy.... |
vijindal/cluspand | [
"a3676594354ab59991fe75fccecdc3a400c7b153"
] | [
"code/convex_hull.py"
] | [
"\"\"\"\nThis module provides the ConvexHull class.\n\"\"\"\n\nimport itertools\nimport numpy as np\nfrom typing import List, Sized, Union\nfrom scipy.interpolate import griddata\nfrom scipy.spatial import ConvexHull as ConvexHullSciPy\nfrom scipy.spatial.qhull import QhullError\n\n\nclass ConvexHull:\n \"\"\"Th... | [
[
"numpy.nanmin",
"numpy.delete",
"numpy.argmax",
"numpy.argmin",
"scipy.spatial.ConvexHull",
"numpy.array",
"numpy.column_stack"
]
] |
ShaneTsui/practical-pytorch | [
"05766973290ef637517f1a62b2bc8be129727ed8"
] | [
"char-rnn-generation/train.py"
] | [
"# https://github.com/spro/practical-pytorch\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport argparse\nimport os\n\nfrom helpers import *\nfrom model import *\nfrom generate import *\n\n# Parse command line arguments\nargparser = argparse.ArgumentParser()\nargparser.add_argument(... | [
[
"torch.nn.CrossEntropyLoss",
"torch.save"
]
] |
noasimon/RockHyraxDetection | [
"19cb20fbb43ed0c29c82a76d68388401ff10b416"
] | [
"Classification/using_vgg16_keras.py"
] | [
"from os import listdir\nfrom os.path import isfile, join, isdir\nimport pandas as pd\nfrom PIL import Image\nfrom keras.applications.vgg16 import VGG16, preprocess_input, decode_predictions\nfrom keras.preprocessing.image import img_to_array, load_img\nimport tensorflow as tf\n\n#wierd configs\nconfig = tf.ConfigP... | [
[
"tensorflow.ConfigProto",
"tensorflow.Session",
"pandas.DataFrame"
]
] |
rishawsingh/scikit-uplift | [
"c9dd56aa0277e81ef7c4be62bf2fd33432e46f36"
] | [
"sklift/datasets/datasets.py"
] | [
"import os\nimport shutil\n\nimport pandas as pd\nimport requests\nfrom sklearn.utils import Bunch\nfrom tqdm.auto import tqdm\n\n\ndef get_data_dir():\n \"\"\"Return the path of the scikit-uplift data dir.\n\n This folder is used by some large dataset loaders to avoid downloading the data several times.\n\n ... | [
[
"pandas.read_csv",
"sklearn.utils.Bunch"
]
] |
eranhirs/qasrl-gs | [
"5ba6a188c32d5d506677df9eadbf35235dfca03e"
] | [
"scripts/evaluate_inter_annotator.py"
] | [
"from argparse import ArgumentParser\nfrom typing import List, Dict\n\nimport pandas as pd\nimport numpy as np\nimport os\nfrom glob import glob\nfrom itertools import combinations, product\n\nfrom common import Role, Argument\nfrom evaluate import Metrics, joint_len, iou\nfrom evaluate_dataset import eval_datasets... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
changminL/MT-VAE | [
"0500df9e24700157a0ef81c5d627d544c06e580f"
] | [
"fairseq/models/masked_lm.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 logging\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom fairseq import utils\nfrom fairseq.mo... | [
[
"torch.FloatTensor",
"torch.nn.Linear",
"torch.nn.functional.linear",
"torch.zeros"
]
] |
Paethon/pytorch-pretrained-BERT | [
"2152bfeae82439600dc5b5deab057a3c4331c62d"
] | [
"tests/modeling_openai_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl... | [
[
"torch.tensor"
]
] |
koustuvsinha/hier-class | [
"6ee2702bc228e9c94b42a32a6a78dc27159fefb8"
] | [
"codes/experiments/hier_classifier.py"
] | [
"# Experiment on simple decoder classification\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nimport logging\nimport numpy as np\nfrom pprint import pprint, pformat\nimport os\nimport copy\nfrom codes.utils import... | [
[
"torch.optim.Adam",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.manual_seed",
"torch.cuda.empty_cache",
"torch.nn.utils.clip_grad_norm",
"torch.optim.RMSprop",
"torch.no_grad",
"numpy.mean",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"torch.FloatT... |
manesioz/modin | [
"637e148dba354825307f3f131fa2185ad5a6b54a"
] | [
"modin/pandas/test/test_groupby.py"
] | [
"import pytest\nimport pandas\nimport numpy as np\nimport modin.pandas as pd\nfrom modin.pandas.utils import from_pandas, to_pandas\n\npd.DEFAULT_NPARTITIONS = 4\n\n\ndef ray_df_equals_pandas(ray_df, pandas_df):\n assert isinstance(ray_df, pd.DataFrame)\n # Order may not match here, but pandas behavior can ch... | [
[
"pandas.MultiIndex.from_tuples",
"pandas.DataFrame",
"numpy.random.randint"
]
] |
Iximiel/dscribe | [
"1dd845cb918a244714f835023bdc82d95719eef1"
] | [
"dscribe/descriptors/matrixdescriptor.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Copyright 2019 DScribe developers\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.absolute",
"numpy.pad",
"numpy.reshape",
"numpy.linalg.eig",
"numpy.linalg.norm",
"numpy.argsort",
"numpy.random.RandomState"
]
] |
sheeptako/bi-lstm-crf | [
"5a8a4f15d085b716ef654f6ca0eba03e579c1009"
] | [
"bi_lstm_crf/model/crf.py"
] | [
"import torch\nimport torch.nn as nn\n\n\ndef log_sum_exp(x):\n \"\"\"calculate log(sum(exp(x))) = max(x) + log(sum(exp(x - max(x))))\n \"\"\"\n max_score = x.max(-1)[0]\n return max_score + (x - max_score.unsqueeze(-1)).exp().sum(-1).log()\n\n\nIMPOSSIBLE = -1e4\n\n\nclass CRF(nn.Module):\n \"\"\"Ge... | [
[
"torch.full",
"torch.zeros",
"torch.cat",
"torch.randn",
"torch.nn.Linear"
]
] |
martiansideofthemoon/mixmatch_lxmert | [
"bd2e9bee23ecdd2ba06d272e9686ddfbab9418b5"
] | [
"src/tasks/nlvr2_model.py"
] | [
"# coding=utf-8\n# Copyleft 2019 project LXRT.\n\nimport torch.nn as nn\nfrom lxrt.modeling import GeLU, BertLayerNorm\nfrom lxrt.entry import LXRTEncoder\nfrom param import args\n\n\nclass NLVR2Model(nn.Module):\n def __init__(self):\n super().__init__()\n self.lxrt_encoder = LXRTEncoder(\n ... | [
[
"torch.nn.Linear"
]
] |
DataPrajna/deep-nilmtk | [
"13d09ed92ccbc58f2924a04437e3447d18bf56ae"
] | [
"common/data_paraser.py"
] | [
"from nilmtk import DataSet\nimport matplotlib.pyplot as plt\nplt.ion()\nfrom networkx.drawing.nx_agraph import graphviz_layout\nimport networkx as nx\nfrom nilmtk.disaggregate import CombinatorialOptimisation\nfrom nilmtk import HDFDataStore, MeterGroup\nimport datetime\n\n\n\n\nclass VisualizeApplianceData:\n\n ... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.waitforbuttonpress",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.sh... |
wliuxingxiangyu/gnn | [
"d1f37473931a77595012e7308acd8c8c681a511d"
] | [
"gnn/GNN.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport datetime as time\n\n# class for the core of the architecture\nclass GNN:\n def __init__(self, net, input_dim, output_dim, state_dim, max_it=50, optimizer=tf.train.AdamOptimizer, learning_rate=0.01, threshold=0.01, graph_based=False,\n param=st... | [
[
"tensorflow.sparse_placeholder",
"tensorflow.concat",
"tensorflow.cast",
"tensorflow.sparse_tensor_dense_matmul",
"tensorflow.SparseTensorValue",
"tensorflow.summary.scalar",
"tensorflow.while_loop",
"tensorflow.greater",
"tensorflow.subtract",
"tensorflow.Session",
"nu... |
meenakshiravisankar/OCNet.pytorch | [
"3a73cf43c15b802e4877aad82f34bf2391acdbca"
] | [
"train.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n## Created by: speedinghzl02\r\n## Modified by: RainbowSecret\r\n## Microsoft Research\r\n## yuyua@microsoft.com\r\n## Copyright (c) 2018\r\n##\r\n## This source code is licensed under the MIT-style license found in the\r\n## LICENSE fi... | [
[
"torch.manual_seed",
"torch.load"
]
] |
rossmclane/demand_projection | [
"c43cf8e6b2e0d5edf92508223ad34849287924db"
] | [
"src/h3_utils.py"
] | [
"from h3 import h3\nimport json\nimport pandas as pd\nfrom geojson.feature import *\nfrom folium import Map, Marker, GeoJson\nfrom geojson.feature import *\nimport branca.colormap as cm\nimport geopandas as gpd\nfrom shapely.geometry import Polygon\n\n\ndef bin_by_hexagon(df: pd.DataFrame, groupby_items: list, agg_... | [
[
"pandas.DataFrame"
]
] |
betolink/its_live | [
"26ba7b78db260b970a75cbf1b6c5c2807797a577"
] | [
"notebooks/velocity_widget.py"
] | [
"# for leaflet global map\nimport json\n# for timing data access\nimport time\nimport traceback\n\nimport ipyleaflet\nimport ipywidgets\nimport numpy as np\nimport pandas as pd\nimport pyproj\n# to get and use geojson datacube catalog\nimport s3fs as s3\n# for datacube xarray/zarr access\nimport xarray as xr\nfrom ... | [
[
"matplotlib.pyplot.gca",
"pandas.to_datetime",
"matplotlib.pyplot.tight_layout",
"numpy.min",
"numpy.unique",
"numpy.isnan",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.cm.tab10",
"numpy.max",
"numpy.mean",
"pandas.date_range",
"numpy.array"
]
] |
AzipSauhabah/Riskfolio-Lib | [
"d02b03e665cfa8b12e41cb441c75c6fbcf1a4365"
] | [
"riskfolio/PlotFunctions.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport scipy.stats as st\nimport riskfolio.RiskFunctions as rk\n\n__all__ = [\n \"plot_series\",\n \"plot_frontier\",\n \"plot_pie\",\n \"plot_frontier_area\",\n \"plot_risk_con\",\n \"plot_hist\"... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.cumsum",
"pandas.DataFrame",
"numpy.max",
"numpy.mean",
"numpy.exp",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.gcf",
"numpy.ceil",
"numpy.std",
"numpy.diff",
"numpy.insert",
"numpy.ravel"... |
fossabot/asm2vec-pytorch | [
"3c4828d5ba80c55a36adb43e5016f4f1f3443041"
] | [
"scripts/compare.py"
] | [
"import torch\nimport torch.nn as nn\nimport click\nimport asm2vec\n\ndef cosine_similarity(v1, v2):\n return (v1 @ v2 / (v1.norm() * v2.norm())).item()\n\n@click.command()\n@click.option('-i1', '--input1', 'ipath1', help='target function 1', required=True)\n@click.option('-i2', '--input2', 'ipath2', help='targe... | [
[
"torch.cuda.is_available",
"torch.tensor"
]
] |
edornd/ProDA | [
"ffb092afbbde95e4ca29cb1ec199f9685f6601fb"
] | [
"LoveDA/uda/AdaptSegNet_train.py"
] | [
"import argparse\nimport torch\nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport os.path as osp\n# from module.CLAN_G import Deeplabv2\nfrom module.Encoder import Deeplabv2\nfrom module.Discriminator import FCDiscriminator\nfrom data.loveda import LoveDALoader\nfrom ever.core.iterator import... | [
[
"torch.autograd.Variable"
]
] |
MisterJBro/SimuRLacra | [
"525a99893aca553d3dd352b9882a294d684a6935"
] | [
"Pyrado/pyrado/algorithms/step_based/dql.py"
] | [
"# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and\n# Technical University of Darmstadt.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# 1. Redistributions... | [
[
"torch.mean",
"torch.zeros",
"torch.from_numpy",
"torch.no_grad",
"torch.nn.functional.smooth_l1_loss",
"torch.get_default_dtype"
]
] |
c2huc2hu/active-semi-supervised-clustering | [
"000a5b5d55ae186e547fc00cbdb440dfce91120a"
] | [
"active_semi_clustering/active/pairwise_constraints/random.py"
] | [
"import numpy as np\nfrom collections import namedtuple\n\nConstraints = namedtuple('Constraints', ['ml', 'cl'])\n\nclass Random:\n def __init__(self, n_clusters=3, **kwargs):\n self.n_clusters = n_clusters\n\n # 2-tuple containing ml and cl, which are each points (2-tuples)\n self.pairwise_... | [
[
"numpy.vstack",
"numpy.random.randint"
]
] |
JM-IP/DGRL | [
"e8acd43b9b68ee0be5f764774e1969fe530183d0"
] | [
"main_sub_layer_not_used.py"
] | [
"import torch\nimport sys\nimport os\nimport argparse\nimport util\nfrom data import get_dataset\nfrom preprocess import get_transform\nimport torch.nn as nn\nimport torch.optim as optim\nsys.path.insert(0, './models')\nimport nin, xnor_resnet, alexnet\nfrom torch.autograd import Variable\n\ndef save_state(model, b... | [
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.manual_seed",
"torch.cuda.set_device",
"torch.cuda.current_device",
"torch.manual_seed",
"torch.load",
"torch.utils.data.DataLoader",
"torch.optim.SGD",
"torch.nn.DataParallel",
"torch.save"
]
] |
btrzcinski/AdventOfCode | [
"46012e81ba8a56cde811ad481ab14b43ce73f09f"
] | [
"AdventOfCode/Day15.py"
] | [
"from numpy import matrix\nfrom operator import itemgetter\n\ndef moves_from_x(x):\n for i in range(len(x)):\n for j in range(len(x)):\n if i < j:\n yield x[:i] + [x[i] + 1] + x[i+1:j] + [x[j] - 1] + x[j+1:]\n elif i > j:\n yield x[:j] + [x[j] - 1] + x[j... | [
[
"numpy.matrix"
]
] |
ess-dmsc/nexus-constructor | [
"ae0026c48f8f2d4d88d3ff00e45cb6591983853b"
] | [
"nexus_constructor/pixel_options.py"
] | [
"from typing import List, Optional, Tuple\n\nimport numpy as np\nfrom PySide2.QtCore import QObject, Signal\nfrom PySide2.QtWidgets import QDoubleSpinBox, QListWidgetItem, QSpinBox\n\nfrom nexus_constructor.geometry.geometry_loader import load_geometry\nfrom nexus_constructor.geometry.pixel_data import (\n Corne... | [
[
"numpy.amin",
"numpy.where",
"numpy.abs",
"numpy.isscalar"
]
] |
nden/mirage | [
"eaa39c4c872673f8509c89597d89fa3e07853f3c"
] | [
"tests/test_niriss_imaging_modes.py"
] | [
"\"\"\"System test of mirage/NIRISS for regular and NRM imaging.\n\nAuthors\n-------\n - Kevin Volk\n\nUse\n---\n >>> pytest -s test_niriss_imaging_modes.py\n\nDescription of the test:\n------------------------\n\nThe test runs mirage for the same NIRISs imaging scene in regular imaging and\nin the NRM imagin... | [
[
"numpy.loadtxt"
]
] |
LeoYoung1996/Experiment | [
"e3e875e0fd9b0367b761c51d9862b9da5e448576"
] | [
"test.py"
] | [
"\"\"\"\n@Time : 2021/12/23 6:47 下午\n@Author : LeoYoung\n@FileName: test.py\n@Software: PyCharm\n@description: 任何程序的测试\n\"\"\"\n\nimport torch\nimport os\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = '0,1,2,3'\nprint(torch.__version__)\nprint(torch.cuda.is_available())"
] | [
[
"torch.cuda.is_available"
]
] |
rlworkgroup/metaworlds | [
"be03cfed9890a37b84283c597209b849e8a086cc"
] | [
"src/metaworlds/envs/mujoco/hopper_env.py"
] | [
"import numpy as np\n\nfrom metaworlds.core import Serializable\nfrom metaworlds.envs import Step\nfrom metaworlds.envs.mujoco import MujocoEnv\nfrom metaworlds.misc import autoargs\nfrom metaworlds.misc import logger\nfrom metaworlds.misc.overrides import overrides\n\n# states: [\n# 0: z-coord,\n# 1: x-coord (forw... | [
[
"numpy.square",
"numpy.abs",
"numpy.isfinite",
"numpy.clip",
"numpy.min",
"numpy.max",
"numpy.std",
"numpy.mean"
]
] |
on-merrit/ON-MERRIT | [
"a21324a54a6365f2f769b5952b0cf5347a97d480"
] | [
"WP3/Task3.1/notebooks/Q3_Gender_Distribution.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # This will create plots for institutions of universities in THE WUR univs only and for the period of 2007-2017. The input dataset contains info of THE WUR univs only but for any period of time.\n\n# #### This is to be compatible with other analysis questions which used ... | [
[
"matplotlib.pyplot.legend",
"pandas.concat",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.bar"
]
] |
Blind-Aid/sentiment-discovery | [
"081c7c855e00864b52e97cac0b0e097cc86d9731"
] | [
"reparameterization/weight_norm.py"
] | [
"import torch\r\nfrom torch.nn.parameter import Parameter\r\n#from ..utils import FusedNorm\r\nimport time\r\n\r\nfrom .reparameterization import Reparameterization\r\n\r\ndef _norm(p, dim):\r\n \"\"\"Computes the norm over all dimensions except dim\"\"\"\r\n if dim is None:\r\n return p.norm()\r\n ... | [
[
"torch.nn.parameter.Parameter"
]
] |
DucNguyenAnh/Web-Attack-Detection | [
"e799055efb1976d70d0c51916be97793b72b2954"
] | [
"utils/reader.py"
] | [
"from __future__ import print_function\nimport random\nimport numpy as np\n\nfrom sklearn.model_selection import train_test_split\n\nfrom vocab import Vocabulary\nfrom utils import get_requests_from_file, batch_generator, one_by_one_generator\n\n\nclass Reader(object):\n\n def __init__(self, data_path, vocab=Voc... | [
[
"sklearn.model_selection.train_test_split"
]
] |
joevin-slq/fma | [
"162b76915c3bc905203cd533a1d30d20f0b7ec05"
] | [
"features.py"
] | [
"#!/usr/bin/env python3\n\n# FMA: A Dataset For Music Analysis\n# Michaël Defferrard, Kirell Benzi, Pierre Vandergheynst, Xavier Bresson, EPFL LTS2.\n\n# All features are extracted using [librosa](https://github.com/librosa/librosa).\n# Alternatives:\n# * [MARSYAS](https://github.com/marsyas/marsyas) (C++ with Pyth... | [
[
"numpy.min",
"numpy.median",
"pandas.MultiIndex.from_tuples",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.testing.assert_allclose",
"scipy.stats.kurtosis",
"scipy.stats.skew"
]
] |
seungjaeryanlee/playing-hard-exploration-games-by-watching-youtube | [
"93eeec7647784b2c92206b6279dfe3fab8e23088"
] | [
"networks/tdc.py"
] | [
"\"\"\"TDC network for embedding video.\"\"\"\nimport torch\nimport torch.nn as nn\n\n\nclass ResidualBlock(nn.Module):\n \"\"\"\n A convolutional block with residual connections.\n\n Parameters\n ----------\n in_channels : int\n Number of channels in the input.\n out_channels : int\n ... | [
[
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
TommasoBendinelli/spatial_relations_experiments | [
"cd165437835a37c947ccf13a77531a5a42d4c925"
] | [
"learning_experiments/src/data_generator_robot_data.py"
] | [
"\"\"\"\ntitle :data_generator_robot_data.py\ndescription :Loads the spatial dataset contained in numpy arrays under train,unseen,ulabelled \n :folders under learning_experiments/data/.\nauthor :Yordan Hristov <yordan.hristov@ed.ac.uk\ndate :10/2018\npython_version ... | [
[
"numpy.swapaxes",
"numpy.take",
"numpy.random.seed",
"numpy.arange",
"numpy.linalg.norm",
"numpy.save",
"numpy.concatenate",
"numpy.max",
"numpy.transpose",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.show",
"mat... |
Mendes1302/Data_Science | [
"1d364ab2bf1f68f62bb2d9453d2897fef3f03484"
] | [
"View_data/graph_of_bar.py"
] | [
"from matplotlib import pyplot as plt\n\nmovies = [\"Annie Hall\", \"Ben-Hur\", \"casablanca\", \"Ganndhi\", \"West Side Story\"]\nnum_oscars = [5, 11, 3, 8, 10]\n\n\nxl = list()\nfor i, _ in enumerate(movies):\n xl.append(i+0.1)\n\nplt.bar(xl, num_oscars)\nplt.ylabel(\"# de Premiações\")\nplt.title(\"Meus Filme... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.title",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.ylabel"
]
] |
tmatsuzawa/tflow | [
"f47a8cad097f37d4bc7f90bd010ff91f6365ec68"
] | [
"graph.py"
] | [
"'''\nModule for plotting and saving figures\n'''\nimport os, copy\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport matplotlib.pylab as pylab\nimport matplotlib.ticker as ticker\nimport mpl_toolkits.axes_grid as axes_grid\nfrom matplotlib.lines import Line2D\... | [
[
"numpy.nanmax",
"matplotlib.pyplot.legend",
"numpy.sqrt",
"numpy.cumsum",
"numpy.arctan2",
"numpy.searchsorted",
"numpy.exp",
"matplotlib.patches.PathPatch",
"matplotlib.pylab.rcParams.update",
"numpy.sin",
"matplotlib.pyplot.Circle",
"numpy.nansum",
"numpy.diff... |
DESY-CBPF-UERJ/ANATools | [
"8e0aaca4e653ee8a0ba662c91d8fa1aa34951bfd"
] | [
"examples/efficiency_plots.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gs\nimport anatools.data as data\nimport anatools.analysis as ana\nana.start()\n\n#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n# ... | [
[
"numpy.linspace",
"matplotlib.pyplot.savefig",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
cenkcorapci/fashion-tagger | [
"059cb893ecc7ef31c6365501308e7c8229d8debe"
] | [
"experiment.py"
] | [
"import argparse\n\nimport pandas as pd\nfrom tqdm import tqdm\n\nfrom commons.config import STYLES_DATA_SET_PATH\nfrom commons.data_utils import get_target_list\nfrom experiments.fashion_tagger_experiment import FashionClassifierExperiment\nfrom models.fashion_tagger import FashionTagger\n\nusage_docs = \"\"\"\n--... | [
[
"pandas.read_csv"
]
] |
ClementPla/Retinal-Lesions-Segmentation | [
"20fa4ac8eae24814470095bb6e7f08d6751c4e11"
] | [
"tools/losses.py"
] | [
"import random\n\nimport torch\nimport torch.nn as nn\nfrom nntools.nnet import register_loss\n\n\nclass MultiLabelSoftBinaryCrossEntropy(nn.Module):\n def __init__(self, smooth_factor: float = 0, weighted: bool = True,\n mcb: bool = False, hp_lambda: int = 10,\n epsilon: float = ... | [
[
"torch.sigmoid",
"torch.nn.CrossEntropyLoss",
"torch.nn.NLLLoss",
"torch.max",
"torch.cat",
"torch.sum",
"torch.nn.BCELoss",
"torch.any",
"torch.nn.BCEWithLogitsLoss",
"torch.bmm",
"torch.topk",
"torch.clamp"
]
] |
erdeq-upenn/code_public | [
"1b4c2c79ea5f92042a94232a579b531241af672b"
] | [
"1-python/lol-champion-picker-master/lol-champion-picker-master/lol-champion-picker/tensorflow/test.py"
] | [
"import os\nimport argparse\nimport sys\n\nimport tflearn\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\n\nTRAIN_DIR = \"./new_data/cleaned_train.txt\"\nTEST_DIR = \"./new_data/cleaned_test.txt\"\n\n# with open('./new_data/dataset.txt','r') as f:\n# lines = f.read().splitlines()\n# cleaned =... | [
[
"tensorflow.reset_default_graph",
"pandas.read_csv",
"tensorflow.app.run"
]
] |
ahovhannes/label-studio | [
"22707f6b908a612ecd85039b0b10cba900fbb329"
] | [
"label_studio/blueprint.py"
] | [
"import os\nimport io\nimport attr\nimport lxml\nimport time\nimport shutil\nimport flask\nimport pathlib\nimport functools\nimport logging\nimport logging.config\nimport pandas as pd\nimport traceback as tb\nimport lxml.etree\nimport label_studio\n\ntry:\n import ujson as json\nexcept ModuleNotFoundError:\n ... | [
[
"pandas.DataFrame.from_dict"
]
] |
popcornell/tfelm | [
"ff3fa7eb3359ac67d532345c9971bcb1401c9f8f"
] | [
"tfelm/elm.py"
] | [
"import tensorflow as tf\nfrom tfelm.base_slfn import Fdnn\n\nimport time, math\nimport os\nimport numpy as np\n\n\nclass ELM(Fdnn):\n 'Single Layer ELM object'\n\n def __init__(self, input_size,\n output_size,\n type='c',\n l2norm=None,\n name=\... | [
[
"tensorflow.matmul",
"tensorflow.zeros",
"numpy.asarray",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.cast",
"tensorflow.matrix_inverse",
"tensorflow.eye",
"tensorflow.train.import_meta_graph",
"numpy.ceil",
"numpy.mean",
"tensorflow.name_scope",
"tens... |
YaoChengTang/DecNet | [
"b623ac8d0505ec68eb930ad7a21fe9d84dd07543"
] | [
"modules/loss.py"
] | [
"import os\nimport sys\nimport time\nimport math\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Function\nfrom torch.nn.modules.module import Module\n\nimport utils.utils as utils\n\n\n\nclass Loss(nn.Module):\n def __init__(self, loss_type... | [
[
"torch.mean",
"torch.abs",
"torch.ones",
"torch.zeros",
"torch.sqrt",
"torch.min",
"torch.sum",
"torch.log",
"torch.nn.functional.smooth_l1_loss",
"torch.nn.functional.unfold",
"torch.pow"
]
] |
dc-aichara/signate-jpx | [
"3d17e3fa07f091118f01638969de387664598c4a"
] | [
"competition_code/utils/utils.py"
] | [
"import yaml\nimport pandas as pd\nimport numpy as np\nfrom scipy.stats import spearmanr\nfrom PriceIndices import Indices\nfrom sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, MinMaxScaler\nfrom typing import Tuple, Optional, Union\nimport lightgbm as lgb\n\n\ndef load_data(\n data_dir: str = \"data... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.to_datetime",
"pandas.concat",
"numpy.log",
"pandas.DataFrame",
"numpy.finfo",
"numpy.iinfo",
"scipy.stats.spearmanr"
]
] |
srnthsrdhrn/VehicleTrackingGUI | [
"a18d890176de7547d557dfe7cc18dd37afa37411"
] | [
"plot.py"
] | [
"import tkinter as tk\nfrom matplotlib.figure import Figure\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nimport numpy as np\n\napp = tk.Tk()\napp.wm_title(\"Graphs\")\n\nfig = Figure(figsize=(6, 4), dpi=96)\na = np.array([1,2,3])\nax = fig.add_subplot(111)\n\nline, = ax.plot(a,np.array([0,0.5,2... | [
[
"numpy.array",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.figure.Figure"
]
] |
valerocar/geometry-blender | [
"3604f9b5b63c12b8d648ceb63719a71c3d16e055"
] | [
"demos/.ipynb_checkpoints/d2-checkpoint.py"
] | [
"import plotly.graph_objs as go\nimport numpy as np\nimport plotly\n\n\ndef triangles_xy(xs, ys, triangles_indices):\n xs_n = []\n ys_n = []\n count = int(len(triangles_indices) / 3)\n for i in range(count):\n ii = list(triangles_indices[3 * i:3 * i + 3]) + [triangles_indices[3 * i]]\n xs_... | [
[
"numpy.linspace"
]
] |
suvarchal/hecuba | [
"f52001effb0ad4f72367d632afefbe85f0e6b048"
] | [
"hecuba_py/tests/withcassandra/storagenumpy_tests.py"
] | [
"import gc\nimport unittest\n\nfrom hecuba import config, StorageNumpy\nimport uuid\nimport numpy as np\n\nfrom storage.api import getByID\n\nfrom time import time as timer\nimport random\n\nclass StorageNumpyTest(unittest.TestCase):\n @classmethod\n def setUpClass(cls):\n cls.old = config.execution_na... | [
[
"numpy.dot",
"numpy.allclose",
"numpy.array_equal",
"numpy.arange",
"numpy.array"
]
] |
edgarsmdn/TS | [
"746e6d8220e62841eeb469b9462599e8986f5cba"
] | [
"stoch_optim_utilities.py"
] | [
"import numpy as np\r\nimport random as rnd\r\n'''\r\n\r\n Utilities for Stochastic Optimization Algorithms\r\n\r\n'''\r\ndef LS_f_v3(f, p_init, max_iter, bounds, radius, reduce_iter, reduce_frac):\r\n '''\r\n ---------------------\r\n LOCAL SEARCH ALGORITHM\r\n ---------------------\r\n ... | [
[
"numpy.asarray",
"numpy.delete",
"numpy.copy",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
mjklemm/Kernels | [
"0131ab2c0451d3fdd4237ed74efc49b85f6ab475"
] | [
"PYTHON/stencil-numba.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright (c) 2015, Intel Corporation\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this l... | [
[
"numpy.reshape",
"numpy.fromfunction",
"numpy.zeros"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.