repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
zysymu/Domain-Adaptation-DeepLense | [
"64d26010d730b4e049a07b58a7234a74de0d292c"
] | [
"deeplense_domain_adaptation/data/dataset.py"
] | [
"import torch\nfrom torch.utils.data import Dataset, DataLoader\nimport numpy as np\n\nclass NumpyDataset(Dataset):\n def __init__(self, data_path, labels_path, transform, three_channels=False):\n \"\"\"\n Loads image NumPy arrays and labels NumPy arrays and applies transforms to them in a memory-e... | [
[
"numpy.load",
"numpy.tile",
"torch.from_numpy",
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
arokem/pyAFQ | [
"3aa15db49d5e50cbe9df0a5a9bc24f15f44bd758"
] | [
"AFQ/_fixes.py"
] | [
"import numpy as np\n\nfrom scipy.special import lpmv, gammaln\n\nfrom tqdm import tqdm\nfrom dipy.align import Bunch\nfrom dipy.tracking.local_tracking import (LocalTracking,\n ParticleFilteringTracking)\nimport random\n\nimport math\n\n\ndef spherical_harmonics(m, n, theta... | [
[
"numpy.square",
"numpy.concatenate",
"numpy.array",
"numpy.dot",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"scipy.special.gammaln",
"numpy.random.seed",
"numpy.sum",
"numpy.exp",
"numpy.where",
"numpy.prod",
"numpy.sqrt",
"numpy.cos",
"scipy.spe... |
roberthoenig/VQ-VAE-Speech | [
"3c537c17465bf59855f0b81d9265354f65016563"
] | [
"test/vq_vae_speech/global_conditioning_test.py"
] | [
" #####################################################################################\n # MIT License #\n # #\n # Copyright (C) 2019 Charly Lamothe ... | [
[
"torch.Size"
]
] |
jeffhernandez1995/jeffhernandez1995.github.io | [
"214c9dcaa0d37b505870e1f5d51793ab7319c1e7"
] | [
"notebooks/tracking/tracking_dat.py"
] | [
"from collections import OrderedDict\n\nimport numpy as np\nimport cv2\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nfrom dat import DAT\nimport matplotlib.pyplot as plt\nimport motmetrics as mm\nfrom copy import deepcopy\n\n\ndef compare_dataframes(gts, ts):\n accs = []\n names = []\n for k, ... | [
[
"numpy.concatenate",
"torch.cat",
"numpy.zeros",
"pandas.DataFrame",
"numpy.ones",
"numpy.load",
"torch.from_numpy",
"pandas.MultiIndex.from_arrays",
"numpy.arange"
]
] |
AtsushiSakai/pyqp | [
"f568759a9aeb0ead3481bf2daa29811c6b3d874c"
] | [
"pyqp.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\nu\"\"\"\nauthor: Atsushi Sakai\n\"\"\"\nimport numpy as np\n\n\ndef solve_qp_with_ep_const(P, q, A, b):\n \"\"\"\n solve quadratic programming with only equality constraints\n min 0.5*x*P*x + q.T*x\n s.t Ax = b\n \"\"\"\n # input check\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.matrix",
"numpy.zeros",
"numpy.linalg.solve",
"numpy.diag"
]
] |
nowhyun/METIS | [
"78e99861b076ab7c075858c48509920bb4e97796"
] | [
"modeling-component-layer/anomalydetecton-modeling-component/DeepMCDD-master/dataloader_table.py"
] | [
"import os\nimport torch\nfrom torch.utils.data import DataLoader, TensorDataset\nimport numpy as np\n\ndef get_table_data(batch_size, data_dir, dataset, oodclass_idx, fold_idx, **kwargs):\n\n data_path = os.path.join(data_dir, dataset + '_preproc.npy')\n features, labels, num_classes = np.load(data_path, all... | [
[
"numpy.array",
"numpy.random.seed",
"numpy.load",
"numpy.random.shuffle",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"torch.Tensor"
]
] |
dquail/CycleWorld | [
"2bc1833ce4b787b03cdbfaf27d0ed99af269f555"
] | [
"src/CycleWorld.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nAuthor: David Quail, September, 2017.\nDescription:\nCreates the reinformement learning environment for taking actions, receiving state and rewards.\n\n\"\"\"\n\nimport numpy\n\nfrom CycleState import *\n\nNUMBER_OF_STATES = 4\nSPECIAL_STATE_INDEX = 0\nRIGHT_REWARD = 0\nLEFT_REWARD... | [
[
"numpy.random.randint",
"numpy.zeros",
"numpy.append"
]
] |
skailasa/scikit-learn | [
"9bd6debaaebb0e64b288914b3cbcf1e2c465e7b2"
] | [
"sklearn/linear_model/_base.py"
] | [
"\"\"\"\nGeneralized Linear Models.\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Fabian Pedregosa <fabian.pedregosa@inria.fr>\n# Olivier Grisel <olivier.grisel@ensta.org>\n# Vincent Michel <vincent.michel@inria.fr>\n# Peter Prettenhofer <peter.prettenhofer@gmail.com>\n# ... | [
[
"numpy.dot",
"numpy.isclose",
"scipy.sparse.linalg.LinearOperator",
"scipy.sparse.isspmatrix",
"numpy.full",
"numpy.empty",
"scipy.linalg.lstsq",
"scipy.optimize.nnls",
"numpy.sqrt",
"scipy.sparse.csr_matrix",
"numpy.vstack",
"scipy.sparse.issparse",
"numpy.zero... |
onejgordon/active-dynamical-prospection | [
"c5623e5aa167fa7fec573cfb577a86972926f406"
] | [
"model/agent.py"
] | [
"import numpy as np\n\nfrom constants import REACH_ZONE_R, REACHABLE_BUFFER, MAP_W\n\n\nclass Agent():\n def __init__(self, runner=None, env=None, verbose=False, **kwargs):\n self.env = env\n self.runner = runner # TaskRunner (optional)\n\n # State\n self.loc = np.array([0.0, 0.0]) ... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.arctan2",
"numpy.sqrt"
]
] |
shywn-mrk/spanning-tree | [
"eb7321ba481fc61a97e1dbcaa5f97299e8f86384"
] | [
"src/spanning_tree.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib import lines\nimport sys\nfrom math import sqrt\n\ndef print_spanning_tree(points):\n x_list = []\n y_list = []\n\n for (x, y) in points:\n x_list.append(x)\n y_list.append(y)\n\n plt.plot(x_list, y_list, 'ro')\n\n reached = []\n unre... | [
[
"matplotlib.lines.Line2D",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes"
]
] |
fanld/HDRTVNet | [
"7ef7f25f55b776b4ca9fa2d7936895a42b0960af"
] | [
"codes/models/base_model.py"
] | [
"import os\r\nfrom collections import OrderedDict\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.nn.parallel import DistributedDataParallel\r\n\r\n\r\nclass BaseModel():\r\n def __init__(self, opt):\r\n self.opt = opt\r\n self.device = torch.device('cuda' if opt['gpu_ids'] is not None else ... | [
[
"torch.device",
"torch.save",
"torch.load"
]
] |
linksdl/futuretec-project-coursera_cerficates | [
"278a533501b702abd90ac3124739d3d85935e1f8",
"278a533501b702abd90ac3124739d3d85935e1f8"
] | [
"aura/AI Engineer/course2_20191117/a3_feature_engineering/6_continue_to_bin/get_column_name.py",
"aura/AI Engineer/course2_20191117/a8_titanic/2_feature.py"
] | [
"import pandas as pd\nimport numpy as np\n \n#Create a DataFrame\nd = {\n 'Name':['Alisa','Bobby','jodha','jack','raghu','Cathrine',\n 'Alisa','Bobby','kumar','Alisa','Alex','Cathrine'],\n 'Age':[26,24,23,22,23,24,26,24,22,23,24,24],\n \n 'Score':[85,63,55,74,31,77,85,63,42,62,89,77]}\n ... | [
[
"pandas.DataFrame"
],
[
"pandas.read_csv"
]
] |
maple-research-lab/CLSA | [
"37df76cf5cb032683e57b70a3a4090f0d524c8fd"
] | [
"model/CLSA.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass CLSA(nn.Module):\n\n def __init__(self, base_encoder, args, dim=128, K=65536, m=0.999, T=0.2, mlp=True):\n \"\"\"\n :param base_encoder: encoder model\n :param args: config parameters\n :param dim: feature dimension (default: 128)\n ... | [
[
"torch.zeros",
"torch.nn.functional.normalize",
"torch.cat",
"torch.nn.Linear",
"torch.distributed.get_world_size",
"torch.einsum",
"torch.arange",
"torch.no_grad",
"torch.argsort",
"torch.distributed.all_gather",
"torch.randperm",
"torch.softmax",
"torch.nn.ReL... |
Mac-AI/BNA-traffic-mapper | [
"9fcc3f516e18e19704444b6b848fc8aa356007bc"
] | [
"deep_sort.py"
] | [
"from detections import Load_Yolo_Model, yolo_predict\nimport random\nimport colorsys\nfrom deep_sort import build_tracker\nfrom config_parser import get_config\nimport torch\nimport argparse\nimport time\nfrom yolov5.utils.datasets import letterbox\nimport tensorflow as tf\nimport numpy as np\nimport cv2\nimport o... | [
[
"numpy.ascontiguousarray",
"numpy.array",
"torch.cuda.is_available"
]
] |
MingxinLiang/autovc | [
"82f0f7554375314fd911fd3a35d0a13f4c4316ad"
] | [
"vocoder.py"
] | [
"# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nimport torch\nimport librosa\nimport pickle\nimport soundfile as sf\nfrom synthesis import build_model\nfrom synthesis import wavegen\n\nspect_vc = pickle.load(open('results.pkl', 'rb'))\ndevice = torch.device(\"cuda\")\n... | [
[
"torch.device",
"torch.load"
]
] |
yuhaoooo/agns-pytorch | [
"a8a27818c3187554475c7e6615c7ffb63606db1f"
] | [
"pre_train.py"
] | [
"'''\r\n Using this script to pre-train generator and discriminator\r\n'''\r\nfrom module.discriminator import Discriminator\r\nfrom module.generator import Generator\r\nfrom module.utils.dataset import EyeGlasses, Crop\r\nfrom torchvision import transforms\r\nfrom torch.utils.data import DataLoader\r\nfrom torc... | [
[
"torch.zeros",
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.ones",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss"
]
] |
affinis-lab/core | [
"0026a471201ecbb8c3a95f0ce6497339f291ee19"
] | [
"agents/imitation_learning_agent/__init__.py"
] | [
"import json\nimport os\nfrom keras.models import load_model\nfrom keras.optimizers import SGD, Adam, RMSprop\nfrom keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard, ReduceLROnPlateau\nfrom sklearn.model_selection import train_test_split\n\nfrom .model import build\nfrom .generator import BatchGen... | [
[
"sklearn.model_selection.train_test_split"
]
] |
konstantin-ogulchansky/pfe | [
"a6983bc57dc51258d62e2104ca8820b2f2e36704"
] | [
"src/pfe/matrices/by_publication_number.py"
] | [
"from pfe.matrices.matrix import *\nfrom pfe.matrices.plot_heatmap import plot_matrix\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\n\nfrom pfe.misc.log import Log\n\nlog: Log = Pretty()\nlog.info('Starting...')\n\ndata = Path('../../../data/graph/ig')\ntest_stuff = Path('test-data'... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf"
]
] |
nidhalrahali/jax | [
"dfad5ac1ce9bba6a70b57eb20b767302318c9807"
] | [
"jax/core.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.result_type",
"numpy.dtype",
"numpy.shape",
"numpy.zeros"
]
] |
yukunchen113/DCGAN | [
"15b0202ad89223ea93ec632b63b8ba0851fa62a7"
] | [
"model.py"
] | [
"import tensorflow as tf \nimport numpy as np \nimport os\nimport util as ut\nimport matplotlib.pyplot as plt \n\nclass dcgan():\n\tdef __init__(self, images, params, test_sample=None):\n\t\tself.pm = params\n\t\timages = tf.cast(images, tf.float32)\n\t\timages = tf.image.resize_images(images, [self.pm['image_resiz... | [
[
"tensorflow.trainable_variables",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.relu",
"tensorflow.variable_scope",
"tensorflow.no_op",
"tensorflow.control_dependencies",
"tensorflow.tanh",
"tensorflow.image.resize_images",
... |
chaowentao/ntire2021_compress | [
"8ba3b9eb3e05b0b8c469380b1b7b0e33ee0cd10d"
] | [
"mmedit/models/restorers/edvr.py"
] | [
"import numbers\nimport os.path as osp\n\nimport mmcv\n\nfrom mmedit.core import tensor2img\nfrom ..registry import MODELS\nfrom .basic_restorer import BasicRestorer\nimport numpy as np\nimport torch\nimport torchvision.transforms.functional as F\n\n\n@MODELS.register_module()\nclass EDVR(BasicRestorer):\n \"\"\... | [
[
"torch.zeros",
"torch.rot90",
"torch.flip"
]
] |
Jiukaishi/PARL | [
"b162516b8ad5cde58551626b2b54dfa5e7c6c3ea"
] | [
"parl/algorithms/torch/iql.py"
] | [
"# Copyright (c) 2021 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 ... | [
[
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.min"
]
] |
jsreid13/seldon-core | [
"4197eb65bff5ac40629b717a9d533f0e92160ad2"
] | [
"components/outlier-detection/vae/CoreVAE.py"
] | [
"import logging\nimport numpy as np\nimport pickle\nimport random\n\nfrom model import model\n\nlogger = logging.getLogger(__name__)\n\n\nclass CoreVAE(object):\n \"\"\" Outlier detection using variational autoencoders (VAE).\n \n Parameters\n ----------\n threshold (float) : reconstruction erro... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.mean",
"numpy.power",
"numpy.clip"
]
] |
fortuin/tensorflow | [
"1b058574373555c8f6df056431e433f757573e81"
] | [
"tensorflow/contrib/autograph/__init__.py"
] | [
"# Copyright 2016 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.util.all_util.remove_undocumented"
]
] |
pooja-subramaniam/3DGAN_synthesis_of_3D_TOF_MRA_with_segmentation_labels | [
"c1142594b3fa0afce46436350b3f80efbb82d7b5"
] | [
"model.py"
] | [
"import torch.nn as nn\nimport config as c\n\n\n# custom weights initialization called on netG and netD\n# based on Neff et al. 2017 parameters\ndef weights_init(model):\n classname = model.__class__.__name__\n\n if classname.find('Conv') != -1:\n mean = 0.0\n std = 0.05\n nn.init.normal_... | [
[
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.init.normal_",
"torch.nn.Conv3d",
"torch.nn.InstanceNorm3d",
"torch.nn.BatchNorm3d"
]
] |
dpays/dpaygo | [
"d0473799e8e9432a618736a281146d23eb433bf4"
] | [
"examples/account_rep_over_time.py"
] | [
"#!/usr/bin/python\nimport sys\nimport datetime as dt\nfrom dpaygo.amount import Amount\nfrom dpaygo.utils import parse_time, formatTimeString, addTzInfo\nfrom dpaygo.instance import set_shared_dpay_instance\nfrom dpaygo import DPay\nfrom dpaygo.snapshot import AccountSnapshot\nimport matplotlib as mpl\n# mpl.use('... | [
[
"matplotlib.pyplot.plot_date",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel"
]
] |
Damowerko/opf | [
"342b2a5d8de7555940a7cfe829190f9b97c7a8d5"
] | [
"src/opf/power.py"
] | [
"import glob\nfrom copy import deepcopy\n\nimport networkx as nx\nimport numpy as np\nimport pandapower as pp\nimport pandapower.networks\nimport pandapower.topology\nimport pandas as pd\nfrom pandapower.converter.matpower.to_mpc import _ppc2mpc\nfrom pandapower.converter.powermodels.to_pm import convert_pp_to_pm\n... | [
[
"numpy.concatenate",
"pandas.read_pickle",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"pandas.DataFrame",
"numpy.sum",
"numpy.tile",
"pandas.RangeIndex",
"numpy.random.uniform",
"numpy.stack",
"numpy.size",
"pandas.concat",
"pandas.read_csv",
"... |
Prajwal-Prathiksh/Panel_Methods | [
"387275a2791f616e5cd53e1713c409acc47f8f0a"
] | [
"XFOIL.py"
] | [
"# FUNCTION - CALL XFOIL AND GET AIRFOIL DATA\r\n# Written by: JoshTheEngineer\r\n# YouTube : www.youtube.com/joshtheengineer\r\n# Website : www.joshtheengineer.com\r\n# Started : 02/17/20 - Transferred from MATLAB to Python\r\n# - Works as expected\r\n#\r\n# PUROSE\r\n# - Create or load ... | [
[
"numpy.loadtxt"
]
] |
Feezhen/Contrastive-learning | [
"9f7fc760c24ede2ffc485009ed787652551d0266"
] | [
"model/mobilenetv2_m.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom torch import Tensor\n# from .utils import load_state_dict_from_url\nfrom typing import Callable, Any, Optional, List\n\nimport torchvision\n\n# 导入arcface\nfrom loss.arcface import ArcMarginProduct,AddMarginProduct,SphereProduct\n# 导入center l... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.init.ones_",
"torch.nn.Conv2d",
"torch.nn.init.zeros_"
]
] |
soochan-lee/CN-DPM | [
"d592c5d794e4bddc4947f2ed61d6a9e50c6da277"
] | [
"data.py"
] | [
"from abc import ABC, abstractmethod\nfrom collections import Iterator, OrderedDict\nfrom functools import reduce\nimport os\nimport math\nimport torch\nfrom torch.utils.data import (\n Dataset,\n ConcatDataset,\n Subset,\n DataLoader,\n RandomSampler,\n)\nfrom torch.utils.data.dataloader import defa... | [
[
"torch.utils.data.ConcatDataset",
"torch.utils.data.RandomSampler",
"torch.rand_like",
"torch.utils.data.dataloader.default_collate",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.Tensor"
]
] |
sdh9446/document-classification-BERT | [
"1b5a0eb72bbd9b67693209e6735af71ab382516a"
] | [
"models/downstream.py"
] | [
"# -*- coding:utf-8 -*-\r\n\r\nimport math\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\n\r\nclass BertLM(nn.Module):\r\n def __init__(self, bert, n_hidden, vocab_size):\r\n super().__init__()\r\n self.bert = bert\r\n self.mask_lm = nn.Linear(n_hidden... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.LSTM",
"torch.nn.Dropout",
"torch.nn.ReLU"
]
] |
njmei/starfish | [
"0e879d995d5c49b6f5a842e201e3be04c91afc7e"
] | [
"starfish/core/morphology/binary_mask/binary_mask.py"
] | [
"import os\nfrom concurrent.futures import ThreadPoolExecutor\nfrom copy import deepcopy\nfrom dataclasses import dataclass\nfrom functools import partial\nfrom pathlib import Path\nfrom typing import (\n Any,\n Callable,\n Hashable,\n Iterator,\n List,\n Mapping,\n MutableMapping,\n Mutable... | [
[
"numpy.array",
"numpy.zeros",
"numpy.nonzero",
"numpy.amax",
"numpy.arange",
"numpy.amin"
]
] |
zfphil/comptic | [
"e450c94c390dd4db3e5afe04c8b6ac1763af1d2d"
] | [
"comptic/ledarray.py"
] | [
"\"\"\"\nCopyright 2018 Waller Lab\nThe University of California, Berkeley\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of condi... | [
[
"numpy.asarray",
"numpy.arctan",
"numpy.size",
"numpy.ndim",
"numpy.sqrt"
]
] |
danielsc/Recommenders | [
"8389b63e412520af0cea8e1cefbdf7b6cce727b3"
] | [
"tests/unit/test_sar_singlenode.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport pytest\nimport itertools\nimport numpy as np\nimport pandas as pd\nfrom reco_utils.common.constants import PREDICTION_COL\nfrom reco_utils.recommender.sar.sar_singlenode import SARSingleNode\nfrom reco_utils.re... | [
[
"numpy.allclose",
"numpy.array",
"pandas.concat"
]
] |
K4liber/MultiphotonClassification | [
"13c64c246879ff78d5dfcb22df2aafb9e62d650c"
] | [
"createSets.py"
] | [
"#!/usr/bin/env python3.6\n\nimport dask.dataframe as dd\nimport pandas as pd\nimport sys\nimport pickle\nfrom sklearn.model_selection import train_test_split\n\ndef dataFrameNames():\n return [\n \"x1\", # 1 gamma detected x position [cm]\n \"y1\", # 1 gamma detected y position [cm]\n ... | [
[
"sklearn.model_selection.train_test_split"
]
] |
saipavanc/scqubits | [
"a99ff75498110558c64e6a6e276834e5714793a5",
"a99ff75498110558c64e6a6e276834e5714793a5"
] | [
"scqubits/legacy/sweep_plotting.py",
"scqubits/core/oscillator.py"
] | [
"# sweep_plotting.py\n#\n# This file is part of scqubits: a Python package for superconducting qubits,\n# arXiv:2107.08552 (2021). https://arxiv.org/abs/2107.08552\n#\n# Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski\n# All rights reserved.\n#\n# This source code is licensed under the BSD-st... | [
[
"numpy.searchsorted"
],
[
"scipy.special.gamma",
"numpy.fill_diagonal",
"numpy.asarray",
"numpy.zeros",
"numpy.exp",
"numpy.sqrt",
"scipy.special.eval_hermite"
]
] |
lkrizan/ECF_deep_learning | [
"1395688d6b8a3f4a19139c40754d27a2bd6523df"
] | [
"testing/model_step_loader.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nclass VariableData:\n\n def __init__(self):\n self.name = None\n self.shape = None\n self.values = None\n\n\nclass ModelLoader:\n\n def __init__(self, folder_path):\n \"\"\"\n :param folder_path: string\n \"\"\"\n ... | [
[
"tensorflow.GraphDef"
]
] |
sreichl/atacseq_pipeline | [
"6b81b15ab48ae97c8aecd39da36b9eb75ce9c15e"
] | [
"workflow/scripts/quantify_support_sample.py"
] | [
"#!/bin/env python\n\nimport os\nimport pandas as pd\nimport pybedtools as bedtools\n\n# configuration\noutput = snakemake.output[0]\nchrom_file = snakemake.params[\"chrom_file\"]\nsample=snakemake.wildcards[\"sample\"]\n\nconsensus_peaks = bedtools.BedTool(snakemake.input[0])\nconsensus_peaks_df = bedtools.BedTool... | [
[
"pandas.DataFrame"
]
] |
baleian/python-ml-keyword_classifier | [
"06de1c768934f8382829a91fa7b14f1cb1a78ab7"
] | [
"baleian/ml/keyword_classifier/model.py"
] | [
"import tensorflow as tf\nimport tensorflow.keras.layers as layers\n\nfrom .transformer import VALID_CHARS\n\n\nclass InputLayer(layers.Layer):\n \n def __init__(self, num_class, **kwargs):\n super(InputLayer, self).__init__(**kwargs)\n self.num_class = num_class\n self.reshape_layer = la... | [
[
"tensorflow.keras.layers.GlobalMaxPool2D",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Average",
"tensorflow.keras.Model",
"tensorflow.one_hot",
"tensorflow.keras... |
r-dube/CICIDS | [
"d367fd98571ff006925456633c3ac0ed01411f79"
] | [
"scripts/ids_utils.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nData Cleaning and Utility functions for CICIDS 2017 data\n\"\"\"\n\n# Load the top modules that are used in multiple places\nimport numpy as np\nimport pandas as pd\n\n# Some global variables to drive the script\n# The indir should match the location of the data\n# The outdir shou... | [
[
"numpy.concatenate",
"sklearn.metrics.confusion_matrix",
"numpy.empty",
"pandas.set_option",
"sklearn.preprocessing.StandardScaler",
"numpy.random.seed",
"sklearn.utils.resample",
"sklearn.metrics.accuracy_score",
"pandas.concat",
"sklearn.model_selection.train_test_split",... |
vahidk/TensorflowFramework | [
"a9377d0dd8f5ac93e810876fbe8987990e3c728f"
] | [
"common/ops/image_ops.py"
] | [
"\"\"\"Image ops.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport tensorflow as tf\nfrom common.ops import shape_ops\n\n\ndef center_crop(image, landmark, size):\n \"\"\"Crop labeled image.\"\"\"\n image_size = i... | [
[
"tensorflow.reduce_min",
"tensorflow.matmul",
"tensorflow.reverse",
"tensorflow.zeros_like",
"tensorflow.contrib.image.transform",
"tensorflow.clip_by_value",
"tensorflow.stack",
"tensorflow.random_normal",
"tensorflow.cast",
"tensorflow.concat",
"tensorflow.random_unif... |
syedhamidali/wradlib | [
"25f9768ddfd69b5c339d8b22d20e45e591eaeb8d"
] | [
"wradlib/adjust.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) 2011-2020, wradlib developers.\n# Distributed under the MIT License. See LICENSE.txt for more info.\n\n\"\"\"\nGage adjustment\n^^^^^^^^^^^^^^^\n\nConcept\n-------\nThe objective of this module is the adjustment of radar-based rainfall\nestimates by rain gage observations. Ho... | [
[
"numpy.logical_not",
"scipy.spatial.cKDTree",
"numpy.array",
"numpy.setdiff1d",
"numpy.zeros",
"numpy.median",
"scipy.stats.linregress",
"numpy.mean",
"numpy.where",
"numpy.linalg.lstsq",
"numpy.abs"
]
] |
bailingnan/BRITS | [
"f315b2426b83d573f09691f7eae626211533eb8b"
] | [
"baseline_methods.py"
] | [
"# coding: utf-8\nimport json\nimport fancyimpute\nimport numpy as np\nimport pandas as pd\n\nX = []\nY = []\nZ = []\n\nfor ctx in open('json/json'):\n z = json.loads(ctx)['label']\n ctx = json.loads(ctx)['forward']\n x = np.asarray(ctx['values'])\n y = np.asarray(ctx['evals'])\n\n\n x_mask = np.asar... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.asarray",
"numpy.sum",
"numpy.save",
"numpy.abs"
]
] |
xiaoxiaoheimei/l5kit | [
"1ea2f8cecfe7ad974419bf5c8519ab3a21300119"
] | [
"l5kit/l5kit/data/zarr_utils.py"
] | [
"import os\nfrom collections import Counter\nfrom pathlib import Path\nfrom typing import List, Optional, Tuple\n\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom .filter import get_agents_slice_from_frames, get_frames_slice_from_scenes, get_tl_faces_slice_from_frames\nfrom .zarr_dataset import ChunkedDataset\n\n... | [
[
"numpy.diff"
]
] |
shaswata56/Cirq | [
"a3afa13f60160e014512a89abd85f10118047f0d"
] | [
"cirq/protocols/json_serialization_test.py"
] | [
"# Copyright 2019 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"pandas.Index",
"pandas.DataFrame",
"numpy.ones",
"pandas.MultiIndex.from_tuples",
"numpy.arange"
]
] |
subond/ww_tvol_study | [
"f29fc2fca358aa169f6b7cc790e6b6f9f8b55c6f"
] | [
"tables/table_ed3_tw_ntw.py"
] | [
"\nimport os, sys\nimport numpy as np\nimport pandas as pd\nimport pyddem.tdem_tools as tt\nfrom glob import glob\nfrom collections import OrderedDict\n\nfn_o1 = '/home/atom/ongoing/work_worldwide/vol/final/subreg_multann_O1_err.csv'\nout_csv = '/home/atom/ongoing/work_worldwide/tables/final/ED_Table_3.csv'\n\ndf_i... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.concat"
]
] |
imagejan/napari | [
"29975d805af24379671a64d2279823386be239f7"
] | [
"napari/components/tests/test_multichannel.py"
] | [
"import numpy as np\nfrom napari.components import ViewerModel\n\nbase_colormaps = ['cyan', 'yellow', 'magenta', 'red', 'green', 'blue']\n\n\ndef test_multichannel():\n \"\"\"Test adding multichannel image.\"\"\"\n viewer = ViewerModel()\n np.random.seed(0)\n data = np.random.random((15, 10, 5))\n vi... | [
[
"numpy.random.seed",
"numpy.random.random"
]
] |
PrimordialOcean/attach-gpsdata-photos | [
"33075816d6e2bac374b0b7384f963f84b8607294"
] | [
"main.py"
] | [
"import bs4\nimport csv\nimport piexif\nimport math\nimport pathlib\nimport glob\nimport pandas as pd\nfrom datetime import datetime\nfrom fractions import Fraction\nfrom dateutil import tz\n\n# sets UTC\nJST = tz.gettz('Asia/Tokyo')\nUTC = tz.gettz(\"UTC\")\n\n# sets type alias\nNumSexagesimal = tuple[int, int, fl... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
mabergerx/milvus | [
"1c48f7f4e47252f8aa2b3c09c9289a9444f5887c"
] | [
"tests/milvus_python_test/utils.py"
] | [
"import os\nimport sys\nimport random\nimport pdb\nimport string\nimport struct\nimport logging\nimport threading\nimport time\nimport copy\nimport numpy as np\nfrom sklearn import preprocessing\nfrom milvus import Milvus, DataType\n\nport = 19530\nepsilon = 0.000001\nnamespace = \"milvus\"\n\ndefault_flush_interva... | [
[
"numpy.bitwise_xor",
"numpy.array",
"numpy.count_nonzero",
"numpy.bitwise_or",
"numpy.asarray",
"numpy.packbits",
"numpy.bitwise_and",
"sklearn.preprocessing.normalize"
]
] |
DogeMajor/GDFT | [
"bd84a8cef8d68f88c3c80de9936ee65ce85fcb40"
] | [
"tests/testSequenceFinder.py"
] | [
"import sys\nsys.path.append(\"../src\")\nsys.path.append(\"src/\")\nimport unittest\nimport numpy as np\nfrom tools import *\nfrom gdft import *\nfrom correlations import *\nfrom sequencefinder import *\n\nGDFT_MAT = np.array([[1, -1], [-1, -1]], dtype=np.complex128)\n\nclass TestSequenceFinder(unittest.TestCase):... | [
[
"numpy.array"
]
] |
vlarine/wav2vec | [
"c829b871885cad35da5235c4339c10e5916a800f"
] | [
"models/fairseq_model.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\"\"\"\nBase classes for various fairseq models.\n\"\"\"\n\nimport logging\nfrom typing import Dict, List, Optional, Tuple\n\nimport t... | [
[
"torch.is_tensor",
"torch.nn.functional.softmax",
"torch.nn.functional.log_softmax",
"torch.nn.utils.remove_weight_norm"
]
] |
WardLT/active-learning | [
"289f2ef28f6376d697d435014ad03a4e1c0a8ae5"
] | [
"active_learning/query_strats/classification/active_search.py"
] | [
"from sklearn.base import BaseEstimator, clone\nfrom active_learning.problem import ActiveLearningProblem\nfrom active_learning.query_strats.base import IndividualScoreQueryStrategy, ModelBasedQueryStrategy\nfrom typing import List\nimport numpy as np\n\n\ndef _lookahead(points: np.ndarray, model: BaseEstimator,\n ... | [
[
"numpy.concatenate",
"numpy.sum",
"sklearn.base.clone",
"numpy.dot"
]
] |
oke-aditya/pytorch-lightning-bolts | [
"268df20bb442e7385b709b1488d37fd2767aba3c"
] | [
"pl_bolts/datamodules/sklearn_datamodule.py"
] | [
"import math\nfrom typing import Any\n\nimport numpy as np\nimport torch\nfrom pytorch_lightning import LightningDataModule\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom pl_bolts.utils import _SKLEARN_AVAILABLE\nfrom pl_bolts.utils.warnings import warn_missing_pkg\n\nif _SKLEARN_AVAILABLE:\n from skl... | [
[
"torch.utils.data.DataLoader",
"sklearn.utils.shuffle"
]
] |
metehancekic/adversarial-attacks-pytorch | [
"0e58364eec161867157e60e186f14cd6e2e42ca8"
] | [
"deepillusion/torchattacks/analysis/plot/_loss_landscape.py"
] | [
"from ..._fgsm import FGSM, FGM\nfrom ..._pgd import PGD\nfrom . import _plot_settings\nimport torch.nn as nn\nimport torch\nimport matplotlib.pyplot as plt\n\"\"\"\nAdversarial Evaluation functions for Pytorch neural models \n\"\"\"\n\nfrom tqdm import tqdm\nfrom mpl_toolkits import mplot3d\nimport numpy as np\ni... | [
[
"matplotlib.use",
"numpy.max",
"numpy.zeros_like",
"numpy.empty",
"torch.rand_like",
"matplotlib.pyplot.savefig",
"numpy.ones",
"numpy.min",
"matplotlib.pyplot.figure",
"torch.randn_like",
"torch.nn.functional.softmax",
"numpy.linspace",
"matplotlib.pyplot.axes"... |
Flipajs/FERDA | [
"120a9e16d7ab4877f72fadbe4484c8b91adf22c4",
"120a9e16d7ab4877f72fadbe4484c8b91adf22c4"
] | [
"scripts/gt_ctrax_ferda.py",
"gui/results/new_region_widget.py"
] | [
"from utils import video_manager\n\n__author__ = 'filip@naiser.cz'\n\nimport scipy.io as sio\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\n\n\ndef x(trx, id):\n return trx[0][id].x[0]\n\ndef y(trx, id):\n return trx[0][id].y[0]\n\ndef y_flip(trx, id, im_height):\n return im_height - tr... | [
[
"numpy.median",
"matplotlib.pyplot.show",
"scipy.io.loadmat",
"matplotlib.pyplot.plot"
],
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
simpai-net/tensorflow_windows | [
"e3ceea3f65a4091b2a13f3e9c34bf4d1cf3c27fe"
] | [
"tensorflow/contrib/deprecated/__init__.py"
] | [
"# Copyright 2016 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req... | [
[
"tensorflow.python.util.all_util.remove_undocumented"
]
] |
mrkowalski/kaggle_santander | [
"43a453a2dad9990ff9cd52984308d3065c0125ff"
] | [
"scikit/src/nosql/commons.py"
] | [
"import logging, os\nimport pandas as pd\nfrom sklearn.externals import joblib\n\npd.options.display.max_rows = 999\npd.options.display.max_columns = 999\n\nFILE_TRAIN='/home/ubuntu/santander/data/train_ver2.csv'\nFILE_TEST='/home/ubuntu/santander/data/test_ver2.csv'\nFILE_DF='dataframe.hdf5'\nFILE_DF_CLEAN='datafr... | [
[
"sklearn.externals.joblib.load",
"pandas.Timestamp"
]
] |
VHchavez/n2v | [
"029c2f4e06eee440d7586a7e784677cde614aac8"
] | [
"n2v/tests/test_methods/test_zmp/test_neon_zmp.py"
] | [
"import n2v\nimport numpy as np\nimport psi4\nimport pytest\n\npsi4.set_options({\"save_jk\" : True})\npsi4.set_memory(int(2.50e9))\n\n\n@pytest.fixture\ndef wfn():\n Ne = psi4.geometry( \n \"\"\" \n 0 1\n Ne\n noreorient\n nocom\n units bohr\n symmetry c1\n \"\"\" )\n psi4.set_options... | [
[
"numpy.array"
]
] |
tcbegley/dash-labs | [
"90295138def8c0ebe526804dc3321d3ca4fbc672"
] | [
"docs/demos/basic_decorator_manual.py"
] | [
"import dash\nimport dash_labs as dl\nimport numpy as np\nimport dash_core_components as dcc\nimport plotly.express as px\n\napp = dash.Dash(__name__, plugins=[dl.plugins.FlexibleCallbacks()])\nimport dash_bootstrap_components as dbc\n\ntpl = dl.templates.DbcRow(title=\"Manual Update\", theme=dbc.themes.SOLAR)\n\n\... | [
[
"numpy.linspace"
]
] |
Kausta/dp-fl-sc-client | [
"453c39980865b9cabbc46f938f465f4597651a4c"
] | [
"mpc/smpc_fedclient.py"
] | [
"import os\nimport random\nimport torch\nimport torchvision\n\nfrom fl_dp.models import MnistMLP\nfrom fl_dp.strategies import LaplaceDpFed\nfrom fl_dp.train import DpFedStep, LaplaceMechanismStep\nfrom pairwise_noises import PairwiseNoises\n\n\nclass FedClient:\n # Public parameters of the system. Received duri... | [
[
"torch.device",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
thomasly/rl_drug_designer | [
"66fb3c7a3a4d4d7ad3091bc4b12481109f4d93da"
] | [
"src/utils/rl_agents.py"
] | [
"from collections import deque\nimport random\n\nimport tensorflow as tf\nfrom tensorflow.keras.optimizers import Adam\nimport numpy as np\n\nfrom .models import lstm_model\n\n\nclass DQNAgent:\n def __init__(self, model_path=None, lr=1e-4, state_size=100,\n action_size=130):\n self.state_... | [
[
"tensorflow.keras.models.load_model",
"numpy.random.rand",
"numpy.sum"
]
] |
avramandrei/pyannote-audio | [
"ad7e48bac22e347c5688cb1bdc996e573024c4cf",
"ad7e48bac22e347c5688cb1bdc996e573024c4cf",
"ad7e48bac22e347c5688cb1bdc996e573024c4cf"
] | [
"pyannote/audio/interactive/utils.py",
"pyannote/audio/features/utils.py",
"pyannote/audio/models/pooling.py"
] | [
"# The MIT License (MIT)\n#\n# Copyright (c) 2020 CNRS\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 rights\n# to use, copy... | [
[
"numpy.cumsum"
],
[
"numpy.mean"
],
[
"torch.cat",
"torch.std",
"torch.mean",
"torch.max"
]
] |
mm842/lobpy | [
"059af586c47ee346302fcf637aa3b05d9872cc2b"
] | [
"lobpy/models/calibration.py"
] | [
"\"\"\"\nCopyright (c) 2018, University of Oxford, Rama Cont and ETH Zurich, Marvin S. Mueller\n\ncalibration.py\n\nContains objects and functions for calibration of the LOB models.\n\nTo calibrate dynamics to a given time series of data on bid and ask side, data_bid and data_ask, with time stamps time_stamps which... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
TuragaLab/vae | [
"90f6e2baa729a926609f246e10ab5428926aedd8"
] | [
"vae/losses.py"
] | [
"\"\"\"A set of model-agnostic losses implementing uniform API.\n\nImplemented losses:\n\n VIMCO loss\n https://arxiv.org/abs/1602.06725\n\n All three Reweighted Wake-Sleep losses: PWake, QWake, QSleep,\n https://arxiv.org/abs/1406.2751\n\n COMING SOON:\n Reparametrized ELBO for continuous latent ... | [
[
"torch.diag_embed",
"torch.logsumexp",
"torch.ones",
"torch.tensor",
"torch.eye",
"torch.nn.functional.softmax",
"torch.sum"
]
] |
dennisheitmann/um24c-python | [
"eb23c0ad897628e26b75da19cd5e59862a3ff62c"
] | [
"um24c_gui.py"
] | [
"#!/usr/bin/python3\n\nimport tkinter\nimport serial\nimport time\nimport datetime\nimport sys\nimport matplotlib\n#matplotlib.use(\"TkAgg\")\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg\nfrom matplotlib.figure import Figure\nimport matplotlib.animation as animation\nfro... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.style.use"
]
] |
antgobar/rmcalyse | [
"dee40416bfd7cf73a4ede6eb309b484397e11310",
"dee40416bfd7cf73a4ede6eb309b484397e11310"
] | [
"rmcalyse/testing_scripts/centroid.py",
"rmcalyse/general_functions/supercell_class.py"
] | [
"###=====================================================================\n### Calculate centroid for atomA orbited by atomB\n\n### ORTHONORMAL DATA TO ANALYSE\nfrom rmc6f_analyse_function_caller import orthonormal_positions\nimport numpy as np\n###===================================================================... | [
[
"numpy.array",
"numpy.subtract"
],
[
"numpy.array",
"numpy.sin",
"numpy.dot",
"numpy.float64",
"numpy.prod",
"numpy.cos",
"numpy.deg2rad",
"numpy.around"
]
] |
dbuscombe-usgs/UNetSegmentation_RGB_DEM | [
"4ea95325c00646cf65f07564171ff1587923b13d"
] | [
"monterey_make_models.py"
] | [
"\n\nfrom imports import *\n\ndef get_batched_dataset(filenames):\n\n option_no_order = tf.data.Options()\n option_no_order.experimental_deterministic = True\n\n dataset = tf.data.Dataset.list_files(filenames)\n dataset = dataset.with_options(option_no_order)\n dataset = dataset.interleave(tf.data.TF... | [
[
"matplotlib.colors.ListedColormap"
]
] |
jfuruness/lib_ddos_simulator | [
"2d860fd3f35f4c25262f5269251eed89975f95e8"
] | [
"lib_ddos_simulator/graphers/grapher.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"This module contains the class Grapher to graph ddos simulations\"\"\"\n\n__Lisence__ = \"BSD\"\n__maintainer__ = \"Justin Furuness\"\n__email__ = \"jfuruness@gmail.com, agorbenko97@gmail.com\"\n__status__ = \"Development\"\n\nimport os\n\nimport matplotlib.... | [
[
"matplotlib.pyplot.subplots"
]
] |
kkonen/gym-gazebo2 | [
"f0168847093104671346826c068598ff293c52bf",
"f0168847093104671346826c068598ff293c52bf",
"f0168847093104671346826c068598ff293c52bf"
] | [
"gym_gazebo2/envs/PHANTOMX/old/mara_orient.py",
"tests/test_mara_envs.py",
"gym_gazebo2/envs/MARA/mara_orient.py"
] | [
"import gym\ngym.logger.set_level(40) # hide warnings\nimport time\nimport numpy as np\nimport copy\nimport math\nimport os\nimport psutil\nimport signal\nimport sys\nimport transforms3d as tf3d\nfrom gym import utils, spaces\nfrom gym_gazebo2.utils import ut_generic, ut_launch, ut_mara, ut_math, ut_gazebo, tree_ur... | [
[
"numpy.asmatrix",
"numpy.array",
"numpy.asarray",
"numpy.reshape",
"numpy.ones",
"numpy.mean"
],
[
"numpy.asarray"
],
[
"numpy.asmatrix",
"numpy.array",
"numpy.asarray",
"numpy.reshape",
"numpy.ones",
"numpy.mean"
]
] |
woori2875/test | [
"79a0a597fed5a399cb5700ed39a847aca7f971c2"
] | [
"selfdrive/controls/lib/vehicle_model.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nDynamic bicycle model from \"The Science of Vehicle Dynamics (2014), M. Guiggiani\"\n\nThe state is x = [v, r]^T\nwith v lateral speed [m/s], and r rotational speed [rad/s]\n\nThe input u is the steering angle [rad]\n\nThe system is defined by\nx_dot = A*x + B*u\n\nA depends on long... | [
[
"numpy.linalg.solve",
"numpy.zeros"
]
] |
micahjsmith/tfx | [
"16a71acc465b228039e52aed5bd175303fa004b1"
] | [
"tfx/experimental/templates/taxi/e2e_tests/kubeflow_e2e_test.py"
] | [
"# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.test.main"
]
] |
robert-cochran/Calpy | [
"391d9d4b4ba3d883d7973a0663366e7c5a0573fd"
] | [
"calpy/plots/support.py"
] | [
"import numpy\n\ndef integer_to_edge_condition( k ):\n \"\"\"Given a pattern id k, return left, middle, and right conditions\n\n Args:\n k (int): pattern id\n\n Returns:\n (Lcond, Mcond, Rcond) a tuple of three functions.\n \"\"\"\n assert k < 63, \"Input k = {} must be < 63.\".format(k... | [
[
"numpy.logical_xor",
"numpy.diff"
]
] |
Gold-Sea/espnet | [
"f31fc9a832801ef725a003e97ab7a5496046dc66"
] | [
"espnet2/gan_tts/hifigan/hifigan.py"
] | [
"# Copyright 2021 Tomoki Hayashi\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"HiFi-GAN Modules.\n\nThis code is modified from https://github.com/kan-bayashi/ParallelWaveGAN.\n\n\"\"\"\n\nimport copy\nimport logging\n\nfrom typing import Any\nfrom typing import Dict\nfrom typing import List\... | [
[
"torch.nn.ConvTranspose1d",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.utils.remove_weight_norm",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.utils.weight_norm",
"torch.nn.Conv2d",
"numpy.prod",
"torch.nn.utils.spectral_norm",
"torch.flatten",
"torch.n... |
mir-group/BRAVE | [
"45a870946661d7d76fcca273036b3004f21a49bd"
] | [
"src/brave/energy.py"
] | [
"\"\"\"This module defines class Energy.\"\"\"\n\nimport numpy as np\n\nimport brave.common as common\nfrom brave.kpoint import Kpoint\n\nclass Energy(Kpoint):\n \"\"\"Class for representing the energy bands.\n\n Class Energy defines the electron or phonon energy bands. It is used for\n plotting the energy... | [
[
"numpy.copy",
"numpy.sort",
"numpy.dtype",
"numpy.zeros"
]
] |
daydreamer2023/-ICMR_2021_ROD2021_Challenge_2nd_place_solution_ustc-nelslip | [
"ff568982fcd6659e562a99811783f3645440acdc"
] | [
"prepare_data.py"
] | [
"import os\nimport sys\nimport shutil\nimport numpy as np\nimport json\nimport pickle\nimport argparse\n\nfrom cruw import CRUW\nfrom cruw.annotation.init_json import init_meta_json\nfrom cruw.mapping import ra2idx\n\nfrom rodnet.core.confidence_map import generate_confmap, normalize_confmap, add_noise_channel\nfro... | [
[
"numpy.array",
"numpy.zeros"
]
] |
elendiastarman/jaw-tracking | [
"3915ca82848c99ab277b70443058b4b96696c341",
"3915ca82848c99ab277b70443058b4b96696c341"
] | [
"jawTracking_3DpositionReconstruction.py",
"blobDetector_floodFill.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom math import sqrt, cos, sin, pi, copysign\r\nfrom time import clock\r\nfrom copy import deepcopy\r\n\r\nclass Blob:\r\n def __init__(self,x,y,r):\r\n self.x = x\r\n self.y = y\r\n self.r = r\r\n self.path = [(x,y)]\r\n\r\n ... | [
[
"matplotlib.pyplot.show",
"numpy.uint8",
"numpy.fromstring",
"matplotlib.pyplot.figure"
],
[
"numpy.uint8",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.fromstring",
"matplotlib.pyplot.imshow"
]
] |
janiapurv/swarm-reinforcement-learning | [
"118c952f96e0c6cc093996fa1c76e7cc8a544bad"
] | [
"src/models/torch_network.py"
] | [
"import torch.nn as nn\n\n\nclass Actor(nn.Module):\n \"\"\"Actor neural network.\n\n Parameters\n ----------\n nn : class\n Torch neural network class\n\n Returns\n -------\n array 1-D\n An array containing the action for a given state\n \"\"\"\n def __init__(self, n_states... | [
[
"torch.nn.Linear"
]
] |
Haiduongcable/Project-1 | [
"81929e9d025215ba62ba8d8e69e032a84e57576f"
] | [
"src/yolo_opencv.py"
] | [
"import cv2\nimport numpy as np\n\n\n\n\nclass Yolo_opencv:\n def __init__(self):\n self.pathweight = \"/home/duongnh/Documents/TPA/checkpoint/yolov3-tiny_3l_last.weights\"\n self.pathcfg = \"/home/duongnh/Documents/TPA/checkpoint/yolov3-tiny_3l.cfg\"\n self.pathnames = \"/home/duongnh/Docum... | [
[
"numpy.argmax"
]
] |
prakharg24/object_detection | [
"1e541a457056dfb8140a2f4b59afeea86327f6ca"
] | [
"scripts/join_bbox.py"
] | [
"import sys\r\nimport numpy as np\r\nfrom utils import read_json, dump_json\r\n\r\ndef join_bbox(bbox1, bbox2):\r\n\tx1_t, y1_t, x2_t, y2_t = bbox1[0], bbox1[1], bbox1[2]+bbox1[0], bbox1[3]+bbox1[1]\r\n\tx1_p, y1_p, x2_p, y2_p = bbox2[0], bbox2[1], bbox2[2]+bbox2[0], bbox2[3]+bbox2[1]\r\n\t\r\n\t# x1_n = max(x1_t, ... | [
[
"numpy.max",
"numpy.min"
]
] |
greenFantasy/Fibro-CoSANet | [
"d7b472a93ae70a7355b221a820d0254c590fdf03"
] | [
"modal_ct.py"
] | [
"# author: github/zabir-nabil\n\n# relevant imports\n\nimport os\nimport cv2\n\nimport pydicom\nimport pandas as pd\nimport numpy as np \n# import tensorflow as tf \n# import matplotlib.pyplot as plt \n\n# torch dataset\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transfo... | [
[
"torch.nn.Linear",
"torch.cat",
"numpy.random.choice",
"torch.nn.ModuleList",
"numpy.minimum",
"numpy.mean",
"torch.bmm",
"torch.squeeze",
"numpy.linalg.lstsq",
"torch.cuda.is_available",
"torch.load",
"pandas.read_csv",
"torch.nn.Softmax",
"numpy.log",
... |
dumpmemory/nlp-tutorial-1 | [
"f5aeb50fc3309f03da11c69d8736d44b2407481e"
] | [
"04_text_classification/sentiment_classification_avg.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author:XuMing(xuming624@qq.com)\n@description: sentiment classification\n\"\"\"\n\n# 本notebook参考了https://github.com/bentrevett/pytorch-sentiment-analysis\n#\n# 在这份notebook中,我们会用PyTorch模型和TorchText再来做情感分析(检测一段文字的情感是正面的还是负面的)。我们会使用[IMDb 数据集](http://ai.stanford.edu/~amaas/data/sentim... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.functional.avg_pool2d",
"torch.no_grad",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.load",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.Embedding"
]
] |
ehsangolshani/proactive-autoscaler | [
"384096a0463de41a72cc15b7ff28e02e1dcb5d48"
] | [
"workload_to_metric_mapper/DNN/model.py"
] | [
"import torch\nfrom torch import nn\n\n\nclass DNNModel(nn.Module):\n def __init__(self, dropout=0.2):\n super(DNNModel, self).__init__()\n self.fc1 = nn.Linear(4, 4)\n self.relu1 = nn.ReLU()\n self.dropout1 = nn.Dropout(p=dropout)\n\n self.fc2 = nn.Linear(4, 4)\n self.r... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.load",
"torch.nn.ReLU"
]
] |
aibhleog/simply-spectra | [
"36534061dfba2bf9214c5334dc94e6b2998c7bcc"
] | [
"modeling/plotting_offsets.py"
] | [
"'''\nPlotting the offset of CIV emission in the Cloudy models\nas a function of ionization, nebular metallicity, stellar metallicity,\nstellar population type, age, etc.\n'''\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom cloudy_func import... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.... |
AlecThomson/FRion | [
"67f710c5a5e8494c43fe0660cbcf47bdf93a5bd1"
] | [
"FRion/predict.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nFunctions for predicting time-integrated ionospheric Faraday rotation effects.\nUses RMextract package to get time-dependent ionospheric RMs for a given \nobservation, then performs the time-integration to work out the effective\nchange in polarization angle, and the effective dep... | [
[
"matplotlib.dates.ConciseDateFormatter",
"matplotlib.dates.AutoDateLocator",
"scipy.integrate.simps",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.diff",
"numpy.min",
"numpy.outer",
"numpy.arange",
"numpy.abs",
"numpy.... |
DouLiu95/dfcx_virtual_museum_guide | [
"8425ccf06b3b4d326688d2f744b4ce8affa2a9fe"
] | [
"ngrok.py"
] | [
"from pyngrok import ngrok,conf\n# Open a HTTP tunnel on the default port 80\n# <NgrokTunnel: \"http://<public_sub>.ngrok.io\" -> \"http://localhost:80\">\ndef log_event_callback(log):\n print(str(log))\n\nconf.get_default().log_event_callback = log_event_callback\n# http_tunnel = ngrok.connect(\"file:///C:/User... | [
[
"pandas.DataFrame",
"pandas.json_normalize"
]
] |
ttkingdom/automl | [
"8cfb0990febeb3a18a336be656901dfc8f62a89d"
] | [
"efficientdet/dataset/create_scut_tfrecord.py"
] | [
"# Copyright 2020 Google Research. 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... | [
[
"tensorflow.compat.v1.io.gfile.GFile",
"tensorflow.compat.v1.python_io.TFRecordWriter",
"tensorflow.compat.v1.gfile.GFile"
]
] |
lixuekai2001/OpenPNM | [
"9026f0fed427d37f4caf1a79e4a7684490d52cf6",
"61d5fc4729a0a29291cf6c53c07c4246e7a13714",
"9026f0fed427d37f4caf1a79e4a7684490d52cf6"
] | [
"tests/unit/models/physics/DiffusiveConductanceTest.py",
"openpnm/solvers/_base.py",
"openpnm/io/_mat.py"
] | [
"import numpy as np\nimport openpnm as op\nfrom numpy.testing import assert_allclose\nfrom openpnm.utils import remove_prop_deep\n\n\nclass DiffusiveConductanceTest:\n\n def setup_class(self):\n self.net = op.network.Cubic(shape=[5, 5, 5])\n self.geo = op.geometry.GenericGeometry(network=self.net,\... | [
[
"numpy.testing.assert_allclose",
"numpy.linspace",
"numpy.array"
],
[
"numpy.linalg.norm"
],
[
"scipy.io.loadmat",
"scipy.io.savemat"
]
] |
tycoer/rflib-1 | [
"5746c668f990841bd8b8385408e8ddb268d22dd4",
"5746c668f990841bd8b8385408e8ddb268d22dd4"
] | [
"rflib/image/photometric.py",
"rflib/utils/env.py"
] | [
"import cv2\nimport numpy as np\n\nfrom ..utils import is_tuple_of\nfrom .colorspace import bgr2gray, gray2bgr\n\n\ndef imnormalize(img, mean, std, to_rgb=True):\n \"\"\"Normalize an image with mean and std.\n\n Args:\n img (ndarray): Image to be normalized.\n mean (ndarray): The mean to be used... | [
[
"numpy.ones_like",
"numpy.tile",
"numpy.min",
"numpy.where",
"numpy.right_shift",
"numpy.cumsum",
"numpy.full_like",
"numpy.concatenate",
"numpy.random.normal",
"numpy.zeros_like",
"numpy.histogram",
"numpy.max",
"numpy.nonzero",
"numpy.equal",
"numpy.ar... |
jennyqsun/EEG-Decision-SincNet | [
"6612a02ff05757b7bcbf67c81f923e01d6d64fd0"
] | [
"dnn_models_pdm.py"
] | [
"# Created on 10/12/21 at 10:50 PM \n\n# Author: Jenny Sun\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport sys\nfrom torch.autograd import Variable\nimport math\n\ntorch.manual_seed(2021)\nnp.random.seed(2021)\n# random.seed(2021)\ntorch.backends.cudnn.deterministic... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.functional.elu",
"numpy.rint",
"torch.ones",
"torch.exp",
"torch.flip",
"numpy.zeros_like",
"torch.nn.AvgPool2d",
"torch.manual_seed",
"torch.abs",
"torch.nn.functional.r... |
ddziebol/Visualizing_US_Energy | [
"ce475f507e02ac5d653e4d32c21ae7e03cee9f4e"
] | [
"DateSlider and Axis Selector.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Apr 3 16:44:27 2022\r\n\r\n@author: Mark, Destiny\r\n\"\"\"\r\n\r\nimport pandas as pd\r\nfrom bokeh.io import show\r\nfrom bokeh.plotting import figure\r\nfrom bokeh.layouts import layout\r\nfrom bokeh.models import CustomJS, ColumnDataSource, CDSView, DateRang... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
eweilow/si1336-simulation-and-modeling | [
"98a8f4e8067a82584e8d6e4aa3b8c7bee6b0dc2b"
] | [
"tasks/task3/3_3.py"
] | [
"import numpy as np\n\nfrom run_3_1 import runForParticleCount\n\nrunForParticleCount(80, prefix=\"3_3\", seed=True, bins=21)\nrunForParticleCount(64, prefix=\"3_3\", seed=True, bins=17)\nrunForParticleCount(8, prefix=\"3_3\", seed=True,\n bins=np.linspace(-0.5, 8.5, 10))\n"
] | [
[
"numpy.linspace"
]
] |
AntoineRondelet/great_expectations | [
"159edd1738f8bff46dd60fa95cb4950c2e036c13",
"159edd1738f8bff46dd60fa95cb4950c2e036c13"
] | [
"great_expectations/expectations/expectation.py",
"great_expectations/dataset/sqlalchemy_dataset.py"
] | [
"import logging\nimport re\nimport traceback\nimport warnings\nfrom abc import ABC, ABCMeta, abstractmethod\nfrom collections import Counter\nfrom copy import deepcopy\nfrom inspect import isabstract\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport pandas as pd\nfrom dateutil.parser import pars... | [
[
"pandas.DataFrame"
],
[
"pandas.Index",
"pandas.read_sql",
"pandas.read_sql_table"
]
] |
lingyunwu14/STFT | [
"1af5d26c1d27388ef8b143b1de5713d5da8eb787"
] | [
"stft_core/modeling/detector/generalized_rcnn_rdn.py"
] | [
"# Copyright (c) SenseTime Research and its affiliates. All Rights Reserved.\n\"\"\"\nImplements the RDN framework\n\"\"\"\nimport time\nimport os\nfrom PIL import Image\nfrom collections import deque\n\nimport torch\nfrom torch import nn\n\nfrom stft_core.structures.image_list import to_image_list\nfrom stft_core.... | [
[
"torch.cat",
"torch.chunk"
]
] |
seanwu1105/adaptive-huffman-coding | [
"5b0bd0fa1e8ef9806fbcb6092ede0eb46fbbc80b"
] | [
"adaptive_huffman_coding/utils.py"
] | [
"import collections\nimport itertools\nimport math\n\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\n\ndef show_raw_img(original_filename, extracted_filename, size):\n with open(original_filename, 'rb') as img_file:\n original_img = np.fromfile(img_file, dtype=np.uint8)\n with open(extract... | [
[
"matplotlib.pyplot.show",
"numpy.fromfile",
"matplotlib.pyplot.subplots"
]
] |
Serpentera/Machine-Learning | [
"eb037188f415cec6d50f218dfef466dfb742a207"
] | [
"Abnormal_Url_Detection/detection_url/run_model/run_Prediction.py"
] | [
"#!/usr/bin/env python \n# -*- coding: utf-8 -*-\n# @Time : 2019/5/27 16:24\n# @FileName: run_Prediction.py\n\nimport tensorflow as tf\nimport collections\nfrom Abnormal_Url_Detection.detection_url.config.config import FLAGS\nfrom Abnormal_Url_Detection.detection_url.utils.utils import get_pred_iterator\nimport da... | [
[
"tensorflow.get_default_graph",
"tensorflow.train.import_meta_graph",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.graph_util.convert_variables_to_constants",
"tensorflow.GraphDef",
"tensorflow.gfile.GFile",
"tensorflow.gfile.FastGFile",
"tensorflow.tables_i... |
sd411/mesh-transformer-jax | [
"d6c93abf6df9a28acd299c0bb41a531e1f6e6e11"
] | [
"mesh_transformer/layers.py"
] | [
"import haiku as hk\nimport jax\nimport jax.numpy as jnp\nimport numpy as np\nfrom einops import rearrange, repeat\n\nfrom mesh_transformer.util import f_psum, g_psum\n\n\nclass ReplicatedLayerNorm(hk.Module):\n def __init__(self, offset=True):\n super().__init__()\n self.offset = offset\n\n def... | [
[
"numpy.sin",
"numpy.log",
"numpy.minimum",
"numpy.ones",
"numpy.where",
"numpy.finfo",
"numpy.arange",
"numpy.cos",
"numpy.sqrt",
"numpy.maximum"
]
] |
Jimexist/trax | [
"dd99377121d93b2a5f121afd2e39af683b922f78"
] | [
"trax/supervised/training.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Trax 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 app... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.io.gfile.rename",
"numpy.zeros",
"numpy.random.seed",
"tensorflow.random.set_seed",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.exists",
"numpy.prod"
]
] |
cltl/Guido_Ansem_Crosslingual_Aspect_Classifcation | [
"0f67f2dd8822dd2a5491d44c5e7eae6d5a930379"
] | [
"code/Label_Distribution.py"
] | [
"import glob\nimport random\nimport itertools\nimport numpy as np\nfrom collections import Counter\nimport xml.etree.ElementTree as ET\nfrom matplotlib import pyplot as plt\n\n\ndef get_path(dataset:str='Restaurant', language: str='English', mode: str='Train'):\n file_type = {'Test': 'B', \n '... | [
[
"matplotlib.pyplot.rcdefaults",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots"
]
] |
AnnLyma/gpt-2 | [
"34dfb54cc43fbb824845e54e2cacdbe96567cb99"
] | [
"train.py"
] | [
"#!/usr/bin/env python3\n# Usage:\n# PYTHONPATH=src ./train --dataset <file|directory|glob>\nimport os\nimport sys\nsys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src')]\n\nimport argparse\nimport json\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport tqdm\nfrom tensorflow.c... | [
[
"tensorflow.trainable_variables",
"tensorflow.summary.merge",
"tensorflow.train.AdamOptimizer",
"tensorflow.shape",
"tensorflow.summary.scalar",
"tensorflow.where",
"tensorflow.get_default_graph",
"tensorflow.gradients",
"numpy.mean",
"numpy.prod",
"tensorflow.placehold... |
Notargets/gofluids | [
"c14996d93ff895995f683ba65ff10c493fda682c"
] | [
"research/fenics/rt_test.py"
] | [
"import dolfin\nimport numpy\nfrom matplotlib import pyplot\n\n# define an exact stream function\n#psi_exact_str = 'x[1]<=pi ? epsilon*cos(x[0])-(1.0/(cosh((x[1]-0.5*pi)/delta)*cosh((x[1]-0.5*pi)/delta)))/delta : epsilon*cos(x[0]) + (1.0/(cosh((1.5*pi-x[1])/delta)*cosh((1.5*pi-x[1])/delta)))/delta' \npsi_exact_st... | [
[
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.semilogy",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.