repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jiwidi/MIARFID | [
"979eda45fc18a4816ef65d33b1423a6d63176c04"
] | [
"HAIA/dqn/cartpole/train_cartpole-v1.py"
] | [
"import gym\nimport random\nimport torch\nimport numpy as np\nfrom collections import namedtuple, deque\nimport matplotlib.pyplot as plt\n# pytorch imports\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport pandas as pd\n\nenv = gym.make(\"CartPole-v1\")\nenv.... | [
[
"torch.nn.Linear",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"torch.no_grad",
"numpy.mean",
"matplotlib.pyplot.figure",
"torch.manual_seed",
"torch.nn.functional.mse_loss",
"torch.from_numpy",
"tor... |
HatsuneMiku4/distiller | [
"8fbacb01ebcb7d70c5d3ecb6a88093e6c4d42137"
] | [
"distiller/quantization/quantizer.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 ... | [
[
"torch.zeros_like",
"torch.nn.Parameter"
]
] |
SSYoung/Gender-Census-ANN | [
"6d52949b6f5cf1dd731894afa07bc09d67136339"
] | [
"nn.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom CrossValidate import split_training_data\n\n# datax = 10000\n# testx = 5000\n# data = np.random.randint(0,2,(datax, 100))\n# labels = np.zeros((datax,2))\n# test_data = np.random.randint(0,2,(testx, 100))\n# test_labels = np.zeros((testx,2))\n# for i in range(datax... | [
[
"tensorflow.train.AdamOptimizer",
"numpy.zeros",
"tensorflow.sigmoid",
"tensorflow.argmax",
"tensorflow.Session",
"numpy.load",
"tensorflow.matmul",
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"... |
tcfuji/capi | [
"4c0f648216ae22d29c537318fb9a646d430cf310"
] | [
"capi/type_checking.py"
] | [
"\"\"\"Functions for runtime type checking. More strict but slower than availabe\nstatic type checking. Off by default.\n\"\"\"\nimport os\nfrom typing import Any, Optional, Tuple\n\nimport torch\n\n\ndef assert_joint_probability(\n x: torch.Tensor, shape: Tuple[int, ...], allow_improper: bool = False\n) -> None... | [
[
"torch.Tensor"
]
] |
Ludecan/shap | [
"575e791cce2f755b5bcebfb33d0fc9a57ff6e77c"
] | [
"shap/plots/summary.py"
] | [
"\"\"\" Summary plots of SHAP values across a whole dataset.\n\"\"\"\n\nfrom __future__ import division\n\nimport warnings\nimport numpy as np\nfrom scipy.stats import gaussian_kde\ntry:\n import matplotlib.pyplot as pl\nexcept ImportError:\n warnings.warn(\"matplotlib could not be loaded!\")\n pass\nfrom ... | [
[
"matplotlib.pyplot.xlim",
"numpy.tile",
"numpy.min",
"numpy.invert",
"matplotlib.pyplot.gcf",
"numpy.cumsum",
"numpy.max",
"numpy.random.normal",
"matplotlib.pyplot.colorbar",
"numpy.nanpercentile",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.fill_between",
... |
luckmoon/examples | [
"e128edac1d9ed96f58502d319737324c05640041"
] | [
"reinforcement_learning/reinforce.py"
] | [
"import argparse\nimport gym\nimport numpy as np\nfrom itertools import count\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.distributions import Categorical\n\n\nparser = argparse.ArgumentParser(description='PyTorch REINFORCE example')\nparser.add_a... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.distributions.Categorical",
"torch.from_numpy",
"torch.manual_seed",
"numpy.finfo",
"torch.tensor",
"torch.nn.functional.softmax"
]
] |
ArasAzimi/mne-python | [
"65e510049d81ae3517f63c27244eacbc5cc8d320"
] | [
"mne/beamformer/_lcmv.py"
] | [
"\"\"\"Compute Linearly constrained minimum variance (LCMV) beamformer.\"\"\"\n\n# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Roman Goj <roman.goj@gmail.com>\n# Britta Westner <britta.wstnr@gmail.com>\n#\n# License: BSD (3-clause)\nimport numpy as np\nfrom scipy impor... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.mean",
"scipy.linalg.pinv",
"numpy.abs"
]
] |
qthequartermasterman/muzero-general | [
"757b9be796c1f7510993d078e4d897cd7f73dda2"
] | [
"games/tensortrade_ohrnstein.py"
] | [
"from .abstract_game import AbstractGame\n\nimport numpy as np\nimport torch\nimport os\nimport datetime\n\nfrom .trading_envs import create_fourier_gbm_env, create_ornstein_uhlenbeck_env\n\n\nclass MuZeroConfig:\n def __init__(self):\n # More information is available here: https://github.com/werner-duvau... | [
[
"numpy.array",
"torch.cuda.is_available"
]
] |
Asharits/CIL | [
"66848b021fb2c6daca71e276890152f34a87ba36"
] | [
"Wrappers/Python/test/test_functions.py"
] | [
"# -*- coding: utf-8 -*-\n# This work is part of the Core Imaging Library (CIL) developed by CCPi \n# (Collaborative Computational Project in Tomographic Imaging), with \n# substantial contributions by UKRI-STFC and University of Manchester.\n\n# Licensed under the Apache License, Version 2.0 (the \"License... | [
[
"numpy.random.normal",
"numpy.asarray",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.random.seed",
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_array_equal",
"numpy.sum",
"numpy.random.randn",
"numpy.testing.assert_array_almost_equal",
"numpy.float6... |
thexa4/artificial-data-research-models | [
"aa622469758a35ddaa8cf8af0cf14925a08293a2",
"aa622469758a35ddaa8cf8af0cf14925a08293a2",
"aa622469758a35ddaa8cf8af0cf14925a08293a2"
] | [
"research/slim/nets/cifarnet.py",
"research/domain_adaptation/pixel_domain_adaptation/mnist.py",
"research/slim/nets/resnet_v2.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.zeros_initializer",
"tensorflow.constant_initializer",
"tensorflow.nn.lrn",
"tensorflow.variable_scope",
"tensorflow.truncated_normal_initializer"
],
[
"tensorflow.logging.set_verbosity",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow... |
caiyongji/py36-tf2.0rc | [
"c5b4b364ba14214534228570e58ef96b1a8bb6dc"
] | [
"Lib/site-packages/tensorflow_core/_api/v2/compat/v2/lookup/__init__.py"
] | [
"# This file is MACHINE GENERATED! Do not edit.\n# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.\n\"\"\"Public API for tf.lookup namespace.\n\"\"\"\n\nfrom __future__ import print_function as _print_function\n\nimport sys as _sys\n\nfrom tensorflow._api.v2.compat.v2.lookup import ... | [
[
"tensorflow.python.util.module_wrapper.TFModuleWrapper"
]
] |
stnk20/Differentiable_Ascii_Art_Renderer | [
"c1e9c97da3a31ccc189cfff1ada92d44fd14ce0a"
] | [
"layers.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras import backend as K\n\n\ndef combine_value_gradient(xv, xg):\n # 値とgradientで別のフローを適用する\n return tf.stop_gradient(xv)+tf.custom_gradient(lambda x: [K.zeros_like(x), lambda dy: dy])(xg)\n\n\ndef step(x):\n return K.cast_to_floatx(K.greater(x, 0.0))\n\n\ndef gum... | [
[
"tensorflow.keras.backend.sigmoid",
"tensorflow.keras.backend.argmax",
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.backend.dot",
"tensorflow.keras.backend.transpose",
"tensorflow.keras.backend.zeros_like",
"tensorflow.keras.backend.softmax",
"tensorflow.transpose",
... |
isuruf/pytato | [
"f9b17200a93d36578c3f36ef0571dd8070109c90"
] | [
"pytato/utils.py"
] | [
"from __future__ import annotations\n\n__copyright__ = \"Copyright (C) 2021 Kaushik Kulkarni\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, ... | [
[
"numpy.isscalar"
]
] |
XDUxyLi/SCEN-master | [
"43c3cc60fb20054bb55c0d9d9eb4e1f6082a1377"
] | [
"models/image_extractor.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models\nfrom torchvision.models.resnet import ResNet, BasicBlock\n\nclass ResNet18_conv(ResNet):\n def __init__(self):\n super(ResNet18_conv, self).__init__(BasicBlock, [2, 2, 2, 2])\n \n def forward(s... | [
[
"torch.nn.Sequential",
"torch.nn.Linear",
"torch.load"
]
] |
itamaro/CADL | [
"b5de17485962577fc51156cd12da1b16d66dbb26"
] | [
"session-1/tests/test_1.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nfrom libs import utils\nimport numpy as np\n\n\ndef test_celeb():\n files = utils.get_celeb_files()\n assert(len(files) == 100)\n\ndef test_crop():\n assert(utils.imcrop_tosquare(np.zeros((64, 23))).shape == (23, 23))\n assert(utils.imcrop_tosquare(np.zeros((23... | [
[
"matplotlib.use",
"numpy.zeros"
]
] |
ed741/PathBench | [
"101e67674efdfa8e27e1cf7787dac9fdf99552fe"
] | [
"src/structures/point.py"
] | [
"from typing import Union, Tuple, Callable, Any\n\nimport torch\nimport copy\nimport numpy as np\n\nclass Point(torch.Tensor):\n \"\"\"\n A point has a variable number of coordinates specified in the constructor.\n Each point is immutable.\n \"\"\"\n __values: Union[Tuple[float, ...], Tuple[int, ...]... | [
[
"torch.round",
"torch.FloatTensor"
]
] |
jihyungSong/spacectl | [
"29bfcb9a1c2b30de696b9ef21b0a4abe7e575e83"
] | [
"src/spacectl/modules/export_google_sheets/export_google_sheets_task.py"
] | [
"import gspread\nimport json\nimport re\nimport string\nimport pandas as pd\nimport datetime\n\nfrom spacectl.command.execute import _check_api_permissions, _get_service_and_resource, _get_client,_call_api, \\\n _parse_parameter\nfrom spacectl.conf.my_conf import get_config, get_endpoint, get_template\nfrom spac... | [
[
"pandas.DataFrame"
]
] |
vietnhatthai/segmentation_models.pytorch | [
"9052aa2a4f09a600f687120e69ad2b57c04cc0dd"
] | [
"segmentation_models_pytorch/losses/_functional.py"
] | [
"import math\nimport numpy as np\n\nfrom typing import Optional\n\nimport torch\nimport torch.nn.functional as F\n\n__all__ = [\n \"focal_loss_with_logits\",\n \"softmax_focal_loss_with_logits\",\n \"soft_jaccard_score\",\n \"soft_dice_score\",\n \"wing_loss\",\n]\n\n\ndef to_tensor(x, dtype=None) ->... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"numpy.array",
"torch.from_numpy",
"torch.nn.functional.log_softmax",
"torch.nn.functional.nll_loss",
"torch.log",
"torch.exp",
"torch.sum"
]
] |
mayank171986/Amazon-Employee-Access | [
"84a65d4e2f8eb196c1f83b1e03faf452e760f972"
] | [
"Amazon-Employee-Access-Challenge-EDA.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\n# import libraries\nimport pandas as pd\nimport numpy as np\nimport seaborn as sb\nimport matplotlib.pyplot as plt\nget_ipython().run_line_magic('matplotlib', 'inline')\n\nimport warnings\nwarnings.filterwarnings('ignore')\n\n\n# # Amazon Employee Access Chal... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"pandas.read_csv"
]
] |
stephenwilley/OctoPrint-PrusaMeshMap | [
"8e5b261e31633be926809c02a7297858b3970a76"
] | [
"octoprint_PrusaMeshMap/__init__.py"
] | [
"# coding=utf-8\nfrom __future__ import absolute_import\n\n### (Don't forget to remove me)\n# This is a basic skeleton for your plugin's __init__.py. You probably want to adjust the class name of your plugin\n# as well as the plugin mixins it's subclassing from. This is really just a basic skeleton to get you start... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gcf"... |
redhotk1m/brain-tokyo-workshop | [
"442e55034bcc9cff60269bcfe045479b13f9a0c6"
] | [
"WANNRelease/prettyNeatWann/domain/cartpole_swingup.py"
] | [
"\"\"\"\nCart pole swing-up: Original version from:\nhttps://github.com/zuoxingdong/DeepPILCO/blob/master/cartpole_swingup.py\n\nModified so that done=True when x is outside of -2.4 to 2.4\nReward is also reshaped to be similar to PyBullet/roboschool version\n\nMore difficult, since dt is 0.05 (not 0.01), and only ... | [
[
"numpy.array",
"numpy.sin",
"numpy.random.randn",
"numpy.finfo",
"numpy.cos",
"numpy.clip"
]
] |
Lakerszjb/CentereNet-C | [
"a628ccc64b704333c320f1ce6fd67c1433855afc"
] | [
"src/lib/utils/image_draw.py"
] | [
"from random import random as rand\nimport cv2\nimport numpy as np\nimport math\nimport copy\n\n\ndef draw_points(im, points, point_color=None):\n color = (rand() * 255, rand() * 255, rand() * 255) if point_color is None else point_color\n for i in range(points.shape[0]):\n cv2.circle(im, (int(points[i... | [
[
"numpy.array",
"numpy.uint8",
"numpy.zeros_like",
"numpy.zeros",
"numpy.round",
"numpy.sum",
"numpy.transpose",
"numpy.vstack"
]
] |
flanggut/advent-of-code | [
"d0c3a62596564d2886bcf31e107b38df122c0d20"
] | [
"aoc-2021/day4.py"
] | [
"import aoc\nimport numpy as np\n\n\ndef didwin(board):\n for i in range(0, board.shape[0]):\n if np.sum(board[i, :]) == -board.shape[0]:\n return True\n\n for i in range(0, board.shape[1]):\n if np.sum(board[:, i]) == -board.shape[1]:\n return True\n\n return False\n\n\... | [
[
"numpy.sum",
"numpy.array",
"numpy.char.split"
]
] |
Jiangtong-Li/ZHSIR | [
"fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7"
] | [
"src/package/dataset/data_cmt.py"
] | [
"import os\nimport csv\nimport time\nimport random\nimport pickle\nimport torchvision\nfrom torchvision import transforms\n\nimport cv2\nimport random\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset as torchDataset\nfrom torchvision.transforms import Normalize\nfrom package.dataset.utils imp... | [
[
"numpy.delete",
"torch.stack",
"numpy.asarray",
"numpy.transpose",
"torch.tensor"
]
] |
jaeyeun97/audio | [
"8a347b62cf5c907d2676bdc983354834e500a282"
] | [
"torchaudio/functional/functional.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom collections.abc import Sequence\nimport io\nimport math\nimport warnings\nfrom typing import Optional, Tuple\n\nimport torch\nfrom torch import Tensor\nfrom torchaudio._internal import module_utils as _mod_utils\nimport torchaudio\n\n__all__ = [\n \"spectrogram\",\n \"griffinl... | [
[
"torch.round",
"torch.cat",
"torch.view_as_real",
"torch.stack",
"torch.istft",
"torch.nn.functional.pad",
"torch.exp",
"torch.stft",
"torch.sum",
"torch.sqrt",
"torch.log1p",
"torch.norm",
"torch.view_as_complex",
"torch.i0",
"torch.abs",
"torch.ten... |
COAOX/Cifar-Prototypical | [
"801c3c1074f8e767c6a3654a0476d07f52bb718e"
] | [
"src/prototypical_batch_sampler.py"
] | [
"# coding=utf-8\r\nimport numpy as np\r\nimport torch\r\n\r\n\r\nclass PrototypicalBatchSampler(object):\r\n '''\r\n PrototypicalBatchSampler: yield a batch of indexes at each iteration.\r\n Indexes are calculated by keeping in account 'classes_per_it' and 'num_samples',\r\n In fact at every iteration t... | [
[
"numpy.isnan",
"torch.randperm",
"torch.LongTensor",
"numpy.argwhere",
"torch.zeros_like",
"torch.Tensor",
"numpy.unique"
]
] |
richardseifert/COCKAMCMC | [
"ba97bcb1520b7c9adb68bf2b03226ce01e5aa53a"
] | [
"pyfam/walker.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nclass walker:\n def __init__(self, x, y, model, p0, psig=None, cost=None):\n self.x = np.array(x)\n self.y = np.array(y)\n self.model = model\n\n #Define a cost function.\n if cost == None:\n self.cost = lambda ... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.ones_like",
"numpy.sum",
"numpy.exp",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.random.uniform",
"numpy.insert"
]
] |
PhilipeRLeal/bootstrap_analyses | [
"377103706aa56b2ab6f16123d703550abc6ce18c"
] | [
"tests/example_1.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 26 17:23:54 2020\n\n@author: Philipe_Leal\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os \n\npath = os.path.join(os.getcwd(), 'Data_example.csv')\ndf = pd.read_csv(path, sep=',', decimal='.', encoding='latin')\n\nprin... | [
[
"numpy.concatenate",
"matplotlib.pyplot.xlabel",
"numpy.percentile",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"pandas.concat",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
colspan/lithophane-generator | [
"db84d265b1471585d892137beec99e9e0b30b0ed"
] | [
"lithophane.py"
] | [
"import cv2\nimport numpy as np\nfrom stl import mesh\n\n# MEMO: axis mappings\n# width, height, depth == x, y, z\n# img.shape == (y, x)\n# pcd.shape == (x, y, z)\n\n\ndef img_to_planepcd(img, target_depth=1.0, target_width=None):\n if target_width is None:\n target_width = img.shape[1]\n target_height... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.sin",
"numpy.vectorize",
"numpy.arcsin",
"numpy.cos",
"numpy.linspace"
]
] |
einthomas/CVSP2019-Project-01a-Shot-Type-Classification-dl-based | [
"5fb005e3186127e8d4d5ad2d22e7c13107ae8e21"
] | [
"Develop/trainNetwork.py"
] | [
"import yaml\nfrom argparse import ArgumentParser\nimport datetime\nimport tensorflow as tf\nfrom keras.utils import to_categorical\nfrom keras.preprocessing.image import ImageDataGenerator\n\nfrom shotTypeML_pkg.imageUtil import *\nfrom Develop.lr_finder import LRFinder\nfrom shotTypeML_pkg.loadModel import *\n\n#... | [
[
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.compat.v1.ConfigProto"
]
] |
Duchanoy/ASAMS | [
"829e9c8c32a4d26b3acdc25de95804aa956e44f3"
] | [
"Magnetic circuit/AutoML_SM.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\ndef TestData(data):\n print(type(data))\n print(data)\n castdata=list(data)\n print(type(castdata))\n print(castdata)\n return False\n \n\n\n# In[ ]:\n\n\ndef AutoSBTest( inputs_train,outputs_train):\n # firstmodel\n from sklearn.ne... | [
[
"numpy.array",
"scipy.spatial.Voronoi",
"numpy.mean",
"sklearn.linear_model.BayesianRidge",
"sklearn.svm.SVR",
"sklearn.ensemble.RandomForestRegressor",
"numpy.argsort",
"sklearn.model_selection.GridSearchCV",
"sklearn.model_selection.cross_val_score"
]
] |
haoyuan80s/Free_trail | [
"c86ae317e6d1df567fbac6606dee3fdbd864ea82"
] | [
"chapter09/RandomWalk.py"
] | [
"#######################################################################\n# Copyright (C) 2016 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################... | [
[
"numpy.random.binomial",
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.copy",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"num... |
HesseSummer/vq-vae-2-pytorch | [
"12281d82b86fd91e56bf5d44802b533429fc7308"
] | [
"o-gan.py"
] | [
"#! -*- coding: utf-8 -*-\n\nimport numpy as np\nimport scipy as sp\nfrom scipy import misc\nimport glob\nimport imageio\nfrom keras.models import Model\nfrom keras.layers import *\nfrom keras import backend as K\nfrom keras.optimizers import RMSprop\nfrom keras.callbacks import Callback\nfrom keras.initializers im... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.round",
"numpy.random.randn",
"numpy.random.shuffle",
"scipy.misc.imresize",
"scipy.misc.imread",
"numpy.log2"
]
] |
amitkml/EPAI3-AdvancedPython | [
"fbfee70e5a549aea5a146f1884901d47ac0d43d7"
] | [
"session9.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 6 11:53:11 2021 for Assignment 9 on namedtuple\n\n@author: AKayal\n\"\"\"\nfrom decimal import *\n\ndef calculate_random_profile_info(no=10000,\n convert_nmd_tuple = True):\n \"\"\"\n this function will call the Faker libra... | [
[
"pandas.DataFrame.from_dict"
]
] |
je-santos/lettuce | [
"9455449b997eb245cd714c5759d7a7cd4c33b1dc",
"9455449b997eb245cd714c5759d7a7cd4c33b1dc"
] | [
"tests/conftest.py",
"lettuce/collision.py"
] | [
"\"\"\"\nFixtures for unit tests.\n\"\"\"\nimport pytest\n\nimport numpy as np\nimport torch\n\nfrom lettuce import (\n stencils, Stencil, get_subclasses, Transform, Lattice, moments\n)\n\nSTENCILS = list(get_subclasses(Stencil, stencils))\nTRANSFORMS = list(get_subclasses(Transform, moments))\n\n\n@pytest.fixtu... | [
[
"numpy.random.seed",
"numpy.random.random",
"torch.cuda.is_available"
],
[
"torch.zeros",
"torch.zeros_like",
"torch.isnan",
"torch.einsum"
]
] |
yongfeng0616/CS230_fall_2019_Fruit_Detection | [
"84910e949fcc38df3029bdd1a774504fe94967d1"
] | [
"mvtectrain.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Nov 17 11:16:13 2019\r\n\r\n@author: Anna\r\n\"\"\"\r\n\r\n# Load the Drive helper and mount\r\n#======================\r\n#from google.colab import drive\r\n#drive.mount('/content/drive')\r\n\r\nimport os\r\nimport sys\r\nimport random\r\nimport math\r\nimport n... | [
[
"numpy.around",
"numpy.array",
"numpy.stack",
"numpy.asfortranarray"
]
] |
atomicateam/atomica | [
"de05daf15088e315b89fd62319fa11529d43f8cf"
] | [
"atomica/optimization.py"
] | [
"\"\"\"\nImplements various Optimizations in Atomica\n\nThis module implements the :class:`Optimization` class, which contains the\ninformation required to perform an optimization in Atomica. An Optimization\neffectively serves as a mapping from one set of program instructions to another.\n\n\"\"\"\n\nimport loggin... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.exp",
"numpy.where",
"numpy.isfinite"
]
] |
viv-codes/ebnn | [
"c9807f60a9cff7b90319a576a27e77ca163cc2e1"
] | [
"ebnn/functions/function_binary_convolution_2d.py"
] | [
"import numpy\nfrom six import moves\n\nfrom chainer import cuda\nfrom chainer import function\nfrom chainer.utils import conv\nfrom chainer.utils import type_check\n\nif cuda.cudnn_enabled:\n cudnn = cuda.cudnn\n libcudnn = cuda.cudnn.cudnn\n _cudnn_version = libcudnn.getVersion()\n _fwd_pref = libcudn... | [
[
"numpy.tensordot",
"numpy.rollaxis",
"numpy.array",
"numpy.where"
]
] |
kohilin/lgat | [
"ba9fe6b4edd22c33c1c96f3139833cca9d149022"
] | [
"lgat/generator.py"
] | [
"from collections import OrderedDict\n\nimport torch\nimport numpy as np\n\nfrom .q import QLayer, QAction, merge_q_layer_outputs\nfrom .vocab import VocabDict\n\n\ndef build_q_layers_for_template_action(state_size, template_collection, **kwargs):\n q_layers = OrderedDict()\n q_layer_type = kwargs.pop('q_laye... | [
[
"numpy.array"
]
] |
Leechanggun/Flow_DeepLearning | [
"1440128cb4076f7511d56c347eaac2532598d59c"
] | [
"utils/createTFRecords.py"
] | [
"\nimport numpy as np \nimport tensorflow as tf \nfrom glob import glob as glb\nimport re\nfrom tqdm import *\nfrom flow_reader import load_flow, load_boundary\n\nFLAGS = tf.app.flags.FLAGS\n\n\ntf.app.flags.DEFINE_bool('debug', False,\n \"\"\" this will show the images while generating r... | [
[
"numpy.uint8",
"tensorflow.train.BytesList",
"numpy.zeros",
"tensorflow.python_io.TFRecordWriter",
"numpy.float32",
"tensorflow.app.flags.DEFINE_bool"
]
] |
haryobagus/haryo_ig | [
"1ad160b422d2c6d5b9b3016e312eb77a576ff9b1"
] | [
"app/controllers/algoritma.py"
] | [
"import math\nimport numpy as np\nimport pandas as pd\nimport scipy.sparse as sp\n\nimport copy\n\nfrom flask import render_template, jsonify, url_for\nfrom app.models import Dataset, Klasifikasi, Username\n\nfrom sklearn.metrics import classification_report\nfrom sklearn.svm import SVC\nfrom sklearn.neural_network... | [
[
"matplotlib.use",
"sklearn.metrics.confusion_matrix",
"numpy.count_nonzero",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"matplotlib.pyplot.pie",
"sklearn.neural_network.MLPClassifier",
"scipy.sparse.vstack",
"sklearn.metrics.accuracy_score",
"sklearn.svm.SVC",
"s... |
egdinger/QuadCopterSim | [
"e87113f1566c7039c6fa146b196fb32f9d410754"
] | [
"sim_proto.py"
] | [
"from random import *\r\nimport numpy, math\r\nimport matplotlib as mpl\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nimport matplotlib.pyplot as plt1\r\nimport pdb\r\n#These are constants that need to be set for each quadcopter\r\nmass = 1.2\r\nCodX = 1.04 #Coefficient of Drag on the x axis\r\nCodY = 1.04 #Coeffic... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
Kur1su0/ML-proj | [
"78d6b56674b83c6c876e6397d778c5bee031885a"
] | [
"utils/mnist_loader.py"
] | [
"import pickle\r\nimport gzip\r\nimport numpy as np\r\n\r\ndef load_data():\r\n \"\"\"Return the MNIST data as a tuple containing the training data,\r\n the validation data, and the test data.\r\n The ``training_data`` is returned as a tuple with two entries.\r\n The first entry contains the actual trai... | [
[
"numpy.reshape",
"numpy.zeros"
]
] |
PabloIbannez/UAMMD-structured | [
"897d7211c3d37123976a03bc5ffa545495d673cd"
] | [
"structured/Tools/MADna/CreateMolecule/CreateBonds.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nimport math\nimport numpy as np\nimport glob\nimport scipy.optimize as optimization\nimport os\nfrom itertools import islice\nimport re\n\n#Bond Types\n# 1-16 -> SP\n# 17-32 -> PS\n# 33-36 -> SB\n# 37-38 -> BB-inter\n# 39-54 -> BB-intra\n\nWC = {\n 'A': 'T',\n 'C': 'G',\... | [
[
"numpy.zeros"
]
] |
cmarmo/dask-ml | [
"a5b96edf863e3540be83c8321a9e2aa37dc91b4a"
] | [
"dask_ml/model_selection/_search.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport logging\nimport numbers\nfrom collections import defaultdict\nfrom itertools import repeat\nfrom multiprocessing import cpu_count\nfrom operator import getitem\n\nimport dask\nimport numpy as np\nimport packaging.version\nfrom dask.base imp... | [
[
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils._tags._safe_tags",
"sklearn.model_selection._search._check_param_grid",
"sklearn.model_selection._split.KFold",
"sklearn.utils.metaestimators.if_delegate_has_method",
"sklearn.exceptions.NotFittedError",
"sklearn.model_selectio... |
aeisenbarth/dask | [
"3c46e89aea2af010e69049cd638094fea2ddd576"
] | [
"dask/dataframe/io/demo.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom ...highlevelgraph import HighLevelGraph\nfrom ...layers import DataFrameIOLayer\nfrom ...utils import random_state_data\nfrom ..core import DataFrame, tokenize\n\n__all__ = [\"make_timeseries\"]\n\n\ndef make_float(n, rstate):\n return rstate.rand(n) * 2 - 1\n\n\n... | [
[
"pandas.date_range",
"numpy.random.randint",
"numpy.random.RandomState"
]
] |
danielballan/napari | [
"9963d6bf52971f8f240b507be206ec682487fb4a"
] | [
"napari/layers/shapes/_tests/test_shapes.py"
] | [
"from copy import copy\nfrom itertools import cycle, islice\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom vispy.color import get_colormap\n\nfrom napari.layers import Shapes\nfrom napari.utils.colormaps.standardize_color import transform_color\n\n\ndef _make_cycled_properties(values, length):\n ... | [
[
"numpy.concatenate",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.repeat",
"numpy.empty",
"numpy.testing.assert_equal",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.arange",
"numpy.unique",
"numpy.all"... |
bartvbw/MILO | [
"334e9bdec954b0cb82da0576b339729e3f39afd0"
] | [
"scripts/profile.py"
] | [
"#!/usr/bin/python\n\n# This reads in the profile file (MILO.profile) as YAML and creates graphics\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport sys\n\nprof = open(\"MILO.profile\", \"r\")\n\nlines = prof.readlines()\nnumlines = len(lines)\n\n\n# Important settings/optio... | [
[
"matplotlib.pyplot.setp",
"numpy.sum",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.margins",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.su... |
finn-dodgson/DeepHalos | [
"86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c",
"86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c",
"86e0ac6c24ac97a0a2a0a60a7ea3721a04bd050c"
] | [
"scratch/regression/mass_range_13.4/train_9sims_random_alpha-2.py",
"nose/test_generate_subboxes_inputs.py",
"scratch/regression/full_mass_range/regression_mixed_sims_training.py"
] | [
"from dlhalos_code import CNN\nfrom dlhalos_code import custom_regularizers as reg\nimport dlhalos_code.data_processing as tn\nfrom pickle import load\nimport numpy as np\nimport tensorflow as tf\nimport random as python_random\nimport tensorflow.keras as keras\nimport tensorflow.keras.callbacks as callbacks\n\n\ni... | [
[
"numpy.random.seed",
"tensorflow.compat.v1.set_random_seed"
],
[
"numpy.testing.assert_allclose",
"numpy.random.choice",
"numpy.zeros",
"numpy.load",
"numpy.where"
],
[
"tensorflow.keras.callbacks.CSVLogger",
"numpy.save",
"tensorflow.keras.callbacks.ModelCheckpoint... |
Nabizeus/merkmalskonstruktion | [
"e6553a290d36b3bb4079e0ba21989e192d70eb6b"
] | [
"bsp2_9.py"
] | [
"import pandas as pd\nimport json\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import linear_model\nfrom sklearn.model_selection import cross_val_score\n\n\n# Beispiel 2.9 - Online News\n\n# Datensatz\n\ndf = pd.read_csv('data/OnlineNewsPopularity.csv', delimiter=',')\n\ndf.head()\n\n\n# Bilde... | [
[
"pandas.read_csv"
]
] |
uBhappy2/ventivader-rpi | [
"fb0354ca9b08e359c7c281c97922b7577690516d"
] | [
"ventilator_gui.py"
] | [
"#import important packages\n\nfrom tkinter import *\nimport time\nfrom tkinter import font\nimport tkinter.messagebox as messagebox\nimport serial\nfrom time import sleep \nimport RPi.GPIO as GPIO\nimport board\nimport busio\nimport adafruit_bmp280\nimport ventilator_functionsd as mm\nimport board\nimport busio\ni... | [
[
"matplotlib.pyplot.ion",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.xticks"
]
] |
AstraliteHeart/cookietts | [
"c871f5f7b5790656d5b57bcd9e63946a2da52f0f"
] | [
"CookieTTS/utils/torchmoji/create_vocab.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division\n\nimport glob\nimport json\nimport uuid\nfrom copy import deepcopy\nfrom collections import defaultdict, OrderedDict\nimport numpy as np\n\nfrom CookieTTS.utils.torchmoji.filter_utils import is_special_token\nfrom CookieTTS.utils.torchmoji.w... | [
[
"numpy.savez_compressed",
"numpy.load"
]
] |
MaoXianXin/oneflow | [
"6caa52f3c5ba11a1d67f183bac4c1559b2a58ef5"
] | [
"oneflow/python/test/ops/test_softmax.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap... | [
[
"tensorflow.nn.softmax",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.GradientTape"
]
] |
seaveredge/deepSI | [
"429dfcc3dba5cebd4ece01ad734c7f543f17f206",
"429dfcc3dba5cebd4ece01ad734c7f543f17f206"
] | [
"deepSI/fit_systems/ss_linear.py",
"examples/linear-SI.py"
] | [
"from deepSI.systems.system import System, System_ss, System_data\nfrom deepSI.fit_systems import System_fittable\nimport deepSI\nimport numpy as np\nfrom tqdm import tqdm as tqdm\nfrom warnings import warn\nimport math\nimport scipy as sc\nfrom numpy.linalg import pinv\nfrom scipy import linalg\n\n\n#adapted from ... | [
[
"numpy.dot",
"numpy.block",
"numpy.random.normal",
"scipy.linalg.logm",
"numpy.linalg.inv",
"numpy.linalg.matrix_power",
"numpy.linalg.eigvals",
"numpy.atleast_2d",
"numpy.array",
"numpy.zeros",
"numpy.linalg.pinv",
"numpy.identity",
"numpy.std",
"scipy.lina... |
VFRAMEio/vframe | [
"0dbc991697a6de47ccf3b65ced5b1201a45156b6"
] | [
"src/vframe/image/processors/utils/pose_utils.py"
] | [
"import numpy as np\nimport cv2 as cv\n\nfrom vframe.settings.app_cfg import LOG\nfrom vframe.models.geometry import BBox\n\nN_POINTS = 18\n\n# COCO Output Format\nKEYPOINTS_MAPPING = ['nose', 'neck', 'shoulder_right', 'elbow_right', 'wrist_right', 'shoulder_left', \n 'elbow_left', 'wrist_left', 'hip_right', 'knee... | [
[
"numpy.array",
"numpy.uint8",
"numpy.linalg.norm",
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.where",
"numpy.subtract",
"numpy.append",
"numpy.linspace",
"numpy.vstack"
]
] |
TingWeiKe/ChatBox | [
"0425ab16b12dff30379a643b1a5debe2540a5014"
] | [
"dialogue/bot.py"
] | [
"import random\nimport os\nfrom sklearn.metrics.pairwise import pairwise_distances_argmin\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.optim import Adam\n\nfrom .moviebot_model import NewSeq2seq\nfrom .moviebot_data import TrainData\nfrom .utils import *\n\n# Stackoverflow R... | [
[
"torch.device",
"torch.cuda.is_available",
"torch.load"
]
] |
vishalbelsare/PyAutoFit | [
"04b927419fa95c302e0eebab632fc7ebcdc3f06b"
] | [
"autofit/graphical/factor_graphs/transform.py"
] | [
"\nfrom abc import ABC, abstractmethod\nfrom functools import wraps, lru_cache\nfrom typing import Dict, Tuple, Optional, List\n\nimport numpy as np\nfrom scipy.linalg import cho_factor\nfrom scipy._lib._util import _asarray_validated\nfrom scipy.special import ndtr, ndtri\nfrom scipy.stats._continuous_distns impor... | [
[
"numpy.ndim",
"scipy.linalg.cho_factor"
]
] |
ossadtchi/cognigraph | [
"e616e9fa021720cc62dded649f508500af01853b"
] | [
"cognigraph/utils/inverse_model.py"
] | [
"import os\n\nimport numpy as np\nimport mne\nfrom mne.datasets import sample\n\nfrom ..utils.misc import all_upper\nfrom ..utils.channels import capitalize_chnames_fwd\nimport logging\n\ndata_path = sample.data_path(verbose=\"ERROR\")\nsample_dir = os.path.join(data_path, \"MEG\", \"sample\")\nneuromag_forward_fil... | [
[
"numpy.identity"
]
] |
jkim117/IWSpring2020 | [
"3ca93768cd94487223168a76381cfd779bbc3b80"
] | [
"DNS_Netassay/PaperResults/timeout/p4_graphs.py"
] | [
"import operator\nfrom sys import argv\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport csv\n\ndns_60_total = 0\npackets_60_total = 0\nbytes_60_total = 0\n\nwith open('parse_limit60_3hr.csv') as csvfile:\n#with open('unlimited0000.csv') as csvfile:\n reader = csv.reader(csvfile)\n ... | [
[
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
wuaalb/project-NN-Pytorch-scripts | [
"3434179a919fe67a614d80761104010255eff752"
] | [
"sandbox/block_nsf.py"
] | [
"##!/usr/bin/env python\n\"\"\"\nMajor blocks defined for NSF\nThese blocks are originall defined in ../project/01_nsf/*/.model.py\n\nDefinition are gathered here for convience.\n\nCondModule, SourceModule, and FilterModule are not copied here since \nthey may change according to the model for certain application\n... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.roll",
"torch.cos",
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"torch.no_grad",
"torch.randn_like",
"numpy.arange",
"numpy.power",
"torch.ones_like",
"torch.tensor",
"torch.zeros_like",
"torch.cumsum"
... |
diptorupd/numba-dppy | [
"0b39be7af6d188a31578b87ce8ca94fc76ca3fa1",
"0b39be7af6d188a31578b87ce8ca94fc76ca3fa1"
] | [
"numba_dppy/examples/blacksholes_kernel.py",
"numba_dppy/examples/matmul.py"
] | [
"# Copyright 2020, 2021 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 l... | [
[
"numpy.random.random",
"numpy.ones",
"numpy.zeros"
],
[
"numpy.matrix",
"numpy.ones_like",
"numpy.allclose",
"numpy.arange",
"numpy.random.random"
]
] |
dimithras/pandas | [
"efb068f25b911ff3009d5692eb831df35bb042e5"
] | [
"pandas/tests/indexing/test_indexing.py"
] | [
"\"\"\" test fancy indexing & misc \"\"\"\n\nfrom datetime import datetime\nimport re\nimport weakref\n\nimport numpy as np\nimport pytest\n\nfrom pandas.core.dtypes.common import is_float_dtype, is_integer_dtype\n\nimport pandas as pd\nfrom pandas import DataFrame, Index, NaT, Series\nimport pandas._testing as tm\... | [
[
"numpy.random.rand",
"pandas.core.indexing.maybe_numeric_slice",
"pandas.core.indexing.non_reducing_slice",
"pandas.Timestamp",
"pandas.core.dtypes.common.is_float_dtype",
"pandas._testing.assert_series_equal",
"pandas.core.arrays.integer_array",
"numpy.random.random",
"pandas.... |
jeffwhite530/d2yabt | [
"ff70bc9e46f6d7238fdcc48bb2eff106b198270a"
] | [
"lib/d2yabt/dcos/check.py"
] | [
"#!/usr/bin/env python3\n\"\"\"This file contains the health check functions used on a DC/OS bundle.\n\"\"\"\n\n\n\nimport sys\nimport os\nimport json\nimport re\nimport datetime\nimport glob\nimport pandas\n\n\n\npandas.options.display.max_colwidth = 200\nANSI_RED_FG = \"\\033[31m\"\nANSI_END_FORMAT = \"\\033[0m\"... | [
[
"pandas.DataFrame"
]
] |
castorfou/drl_handson | [
"4f5a07611c483ad20022afd37961559131c5bf31"
] | [
"Chapter04/01_cartpole.py"
] | [
"#!/usr/bin/env python3\nimport gym\nfrom collections import namedtuple\nimport numpy as np\nfrom tensorboardX import SummaryWriter\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\n\nHIDDEN_SIZE = 128\nBATCH_SIZE = 16\nPERCENTILE = 70\n\n\nclass Net(nn.Module):\n def __init__(self, obs_size... | [
[
"torch.nn.Linear",
"torch.nn.Softmax",
"numpy.percentile",
"torch.FloatTensor",
"numpy.mean",
"torch.nn.ReLU",
"torch.LongTensor",
"torch.nn.CrossEntropyLoss"
]
] |
pakpoomton/CellmodellerShadow | [
"c3fdc0aa41ca2cbd56a3eae168e27312a5c0c185"
] | [
"Models/BiofilmLineage.py"
] | [
"import random\nfrom CellModeller.Regulation.ModuleRegulator import ModuleRegulator\nfrom CellModeller.Biophysics.BacterialModels.CLBacterium import CLBacterium\nfrom CellModeller.GUI import Renderers\nimport numpy\nimport math\n\nrodlen = 3.5 \n\nmax_cells = 400000\n\n#cell_colors = {0:[0.0, 1.0, 0.0],\n# ... | [
[
"numpy.random.uniform"
]
] |
sebsm/Python_PySimpleGUI | [
"d6e8902497cd2986f8d9bce8d285763954fcd01c"
] | [
"charts.py"
] | [
"from tkinter.constants import Y\nimport PySimpleGUI as sg\nimport numpy as np\n\"\"\"\n Embedding the Matplotlib toolbar into your application\n\"\"\"\n\n# ------------------------------- This is to include a matplotlib figure in a Tkinter canvas\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as tck... | [
[
"numpy.sin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.... |
ivanLM2310/CoronavirusML_ant | [
"e7da9a9ea0417ef3dbe42609958216b4d9eb82c5"
] | [
"2020-11/src/201313898.py"
] | [
"\"\"\"\nCopyright 2020 Eduardo Javier Hevia Calderon\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 applicable law... | [
[
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"sklearn.preprocessing.PolynomialFeatures",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
h4ste/oscar | [
"772aa5dba86f1987eb6992a3349b9a16cab92dd4"
] | [
"run_classifier.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... | [
[
"tensorflow.contrib.tpu.TPUEstimatorSpec",
"tensorflow.data.TFRecordDataset",
"tensorflow.train.Features",
"tensorflow.metrics.auc",
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.python.debug.LocalCLIDebugHook",
"tensorflow.matmul",
"tensorflow.metrics.precision",
"tensorf... |
VibroSim/VibroSim_Simulator | [
"a12dacd7d8fe47074a17d3ae74420786faaf3016"
] | [
"VibroSim_Simulator/read_comsol_probe_txt.py"
] | [
"import collections\nimport numpy as np\n\n\ndef read(filename):\n fh=open(filename,\"r\")\n\n metadata=collections.OrderedDict()\n fieldheaderdata = collections.OrderedDict()\n fieldrowdata = []\n rownum=0\n\n lines=[]\n line=fh.readline()\n while line != \"\":\n lines.append(line)\n... | [
[
"matplotlib.pyplot.show"
]
] |
prisae/tmp-share | [
"c09713f6860106cdf203b0644077ed276a9412ca"
] | [
"interp_cubic_spline_3d.py"
] | [
"import numpy as np\nfrom scipy import interpolate, ndimage\n\ndef interp_cubic_spline_3d(points, values, xi):\n \"\"\"3D cubic spline interpolation.\n\n Zeroes are returned for interpolated values requested outside of the domain\n of the input data.\n \"\"\"\n\n # Replicate the same expansion of xi ... | [
[
"scipy.ndimage.map_coordinates",
"scipy.interpolate.interpnd._ndim_coords_from_arrays",
"numpy.vstack"
]
] |
SmaleZ/vcl_diayn | [
"b2c47a681675b405d2011bc4a43c3914f3af4ecc"
] | [
"url_benchmark-main/agent/diayn_vcl.py"
] | [
"import math\nfrom collections import OrderedDict\n\nimport hydra\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dm_env import specs\n\nimport utils\nfrom agent.ddpg import DDPGAgent\n\nfrom discriminator.vcl_nn import DiscriminativeVCL\nfrom discriminator.discrimina... | [
[
"torch.cat",
"numpy.random.choice",
"numpy.zeros",
"torch.max",
"torch.arange",
"torch.no_grad",
"torch.nn.functional.log_softmax",
"torch.argmax"
]
] |
KonstantinKlepikov/probability | [
"0cc6c5febf3b10ece5bb2b9877bd695137a420ea",
"0cc6c5febf3b10ece5bb2b9877bd695137a420ea"
] | [
"spinoffs/inference_gym/backends/tensorflow_integration_test.py",
"spinoffs/inference_gym/targets/bayesian_model_test.py"
] | [
"# Lint as: python3\n# Copyright 2020 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# ... | [
[
"tensorflow.compat.v2.enable_v2_behavior"
],
[
"tensorflow.compat.v2.test.main"
]
] |
vyraun/long-tailed | [
"e6c94a77e5dbf0036de82560f4661e7a9f612ac1",
"e6c94a77e5dbf0036de82560f4661e7a9f612ac1"
] | [
"fairseq/criterions/trigram_anti_focal_loss.py",
"fairseq/models/transformer_mos.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 math\nimport numpy as np\nfrom pdb import set_trace as bp\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.... | [
[
"torch.nn.functional.nll_loss",
"torch.repeat_interleave",
"torch.sum"
],
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.Tanh",
"torch.nn.functional.dropout",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_",
... |
cclauss/hyperparameter_hunter | [
"12fcbbd4ed71447f80e41f3538be824126b3e209"
] | [
"hyperparameter_hunter/utils/optimization_utils.py"
] | [
"\"\"\"This module defines utility functions used to organize hyperparameter optimization, specifically the gathering of saved\nExperiment files in order to identify similar Experiments that can be used as learning material for the current\nOptimizationProtocol. Additionally, :class:`AskingOptimizer` is defined her... | [
[
"numpy.zeros",
"sklearn.base.is_regressor",
"sklearn.utils.check_random_state",
"sklearn.multioutput.MultiOutputRegressor",
"pandas.read_csv",
"numpy.iinfo"
]
] |
anon-coil/coil_gecco | [
"6b8aa410a944e1db26c3acdc77af71b3b5d4fe74"
] | [
"coil/optimise.py"
] | [
"# Loads VAE and optimise the objective function with constraints\n# Uses DEAP https://deap.readthedocs.io/en/master/index.html\n\nimport importlib\nimport random\nimport numpy as np\nimport pickle\nimport argparse\nimport os, time\n\n# for GA\nfrom deap import base\nfrom deap import creator\nfrom deap import... | [
[
"numpy.array",
"numpy.asarray",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tick_params",
"numpy.abs",
"torch.load",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"matplotlib.... |
belteki/ventiliser | [
"5d7afa953e0314289806ebb627fddf9f4de01699"
] | [
"ventiliser/GUI.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun May 3 12:31:52 2020\n\n@author: David Chong Tian Wei\n\"\"\"\nfrom PyQt5.QtWidgets import QMainWindow, QApplication, QVBoxLayout, QDialog, QDialogButtonBox, QAction, QTableView, QFileDialog, QLabel, QLineEdit, QHBoxLayout, QComboBox, QWidget\... | [
[
"numpy.array",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
liucsny/Processing-Data | [
"41eb12ecb53869771d266e1d9afccd39d4ca8234"
] | [
"geo/data/f_add_geo.py"
] | [
"import pandas as pd\nimport pprint as pp\n\ndf=pd.read_csv(\"f_cleaned.csv\");\ndf_geo=pd.read_csv(\"f_geo.csv\");\n\nprint(df)\nprint(df_geo)\n\ndf[\"谷歌地图经度\"]=0.0\ndf[\"谷歌地图纬度\"]=0.0\n\nkeyWord=list(df_geo[\"关键词\"])\n\n# count=0\n\nfor index,rows in df.iterrows():\n\tprint(rows.MOBILEAREA)\n\tif rows.MOBILEAREA ... | [
[
"pandas.read_csv"
]
] |
houweidong2020/face_detect_by_camera | [
"75110c6715e5bd0c254b08440021712d587d0bd0"
] | [
"step_2_training.py"
] | [
"#\r\n# 人脸数据训练\r\n\r\n\"\"\" \r\n注:1.运行该程序前,请在人脸识别文件夹下创建face_trainer文件夹。\r\n注:2.训练后的文件会保存在目录中。 \r\n\"\"\"\r\n\r\nimport numpy as np\r\nfrom PIL import Image\r\nimport os\r\nimport cv2\r\n\r\n# 人脸数据路径\r\n__path__ = 'facedata'\r\n__cascadefile__ = r'D:\\works\\python\\opencv-450\\data\\haarcascades\\ha... | [
[
"numpy.array",
"numpy.unique"
]
] |
s-mizuki-nlp/semantic_specialization | [
"4d00a461f18828ee8ebaccf7c737a32ccc11809f"
] | [
"dataset/transform.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom typing import Dict, Callable, Optional, List, Tuple, Union\nfrom collections import defaultdict, Counter\nim... | [
[
"numpy.random.seed",
"numpy.random.uniform"
]
] |
lapic-ufjf/evolutionary-ACS-benchmark | [
"5baf0f9a42e252f549a44d82c7aa2e46ab904238"
] | [
"irace/test.py"
] | [
"import argparse\nimport random\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom acs.objective import fitness\nfrom acs.instance import Instance\n\nfrom utils.misc import evaluate_population_fixed, evaluate_population_random\nfrom utils.runner import run_method\n\nfrom ppa_d.main import prey_predator_... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
wjt/pandas | [
"0813a3359a7a946ee5f9246a5d49a933ff130f8e"
] | [
"pandas/tests/test_generic.py"
] | [
"# -*- coding: utf-8 -*-\n# pylint: disable-msg=E1101,W0612\n\nfrom operator import methodcaller\nimport nose\nimport numpy as np\nfrom numpy import nan\nimport pandas as pd\n\nfrom distutils.version import LooseVersion\nfrom pandas import (Index, Series, DataFrame, Panel, isnull,\n date_range, p... | [
[
"numpy.repeat",
"numpy.random.rand",
"pandas.Timestamp",
"pandas.util.testing._skip_if_no_scipy",
"pandas.core.common.pprint_thing",
"pandas.core.index.MultiIndex.from_tuples",
"pandas.concat",
"pandas.compat.range",
"numpy.random.random",
"pandas.period_range",
"numpy.... |
XUE-Hao/NLPLibrary | [
"e685f908d45ee4c534018dbe7ae202a85bc8977a"
] | [
"TransfomerTranslation/src/args.py"
] | [
"import torch\n\nnum_epochs = 10\nbatch_size = 32\nnum_layers = 2\nmax_sentence_length = 100\nwarm_up_epoches = 5\nlog_batch_interval = 100 # 多少个batch记录一次\nckpt_dir = '../model/'\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nvocab_size = 5000\nnum_batchs = 400\n"
] | [
[
"torch.cuda.is_available"
]
] |
ramadhanqa/tugas3_datmining | [
"4976ddd1740ad94d856f190ce511bf1454a5d313"
] | [
"analisa-kmodes.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nfrom kmodes.kmodes import KModes\n\n# reproduce results on small soybean data set\nx = np.genfromtxt('data-categorical.csv', dtype=int, delimiter=',')[:, :-1]\ny = np.genfromtxt('data-categorical.csv', dtype=str, delimiter=',', usecols=(35, ))\n\nkmodes_huang = KModes(n... | [
[
"numpy.genfromtxt",
"numpy.zeros"
]
] |
scrose/pylc | [
"9c4c4e84a14cb3adc0b4226199e4cd5841384b0b"
] | [
"utils/evaluate.py"
] | [
"\"\"\"\n(c) 2020 Spencer Rose, MIT Licence\nPython Landscape Classification Tool (PyLC)\n Reference: An evaluation of deep learning semantic segmentation\n for land cover classification of oblique ground-based photography,\n MSc. Thesis 2020.\n <http://hdl.handle.net/1828/12156>\nSpencer Rose <spencerrose@uvic.ca>... | [
[
"numpy.concatenate",
"torch.save",
"numpy.save",
"torch.tensor",
"torch.as_tensor"
]
] |
mahshidaln/fairseq | [
"feed52e0a028adddca565447852e5e0dfeeabb7a"
] | [
"examples/wav2vec/unsupervised/scripts/wav2vec_cluster_faiss.py"
] | [
"#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport gc\nimport os\nimport os.path as osp\nimport random\nimport numpy as np\nimport t... | [
[
"numpy.concatenate",
"torch.no_grad",
"numpy.load",
"torch.from_numpy",
"torch.cuda.empty_cache",
"torch.cuda.is_available"
]
] |
quanta413/Population-Evolution-Project-Source-Code | [
"d2512f1fa6672e229cb3b2767c6837ca83865e8b"
] | [
"populationevolution/wrightfisher.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 8 12:05:22 2018\n\n@author: nashere2\n\"\"\"\n\nimport numpy as np\nfrom . import arraymultinomial as am\n\n\ndef mean_exp_fitness(pop_dist, fitnesses):\n return np.sum(pop_dist*np.exp(fitnesses))/np.sum(pop_dist)\n\n\ndef var_exp_fitness(pop_dist, fitnesses)... | [
[
"numpy.sum",
"numpy.min",
"numpy.exp"
]
] |
clw5180/remote_sensing_object_detection_2019 | [
"3810ab924d1899cf43e50c42a790674d738263d3"
] | [
"demo/polygon_wrapper.py"
] | [
"import numpy as np\r\nfrom skimage.draw import polygon\r\n\r\n\"\"\"\r\n:param det_x: [1, N] Xs of detection's vertices \r\n:param det_y: [1, N] Ys of detection's vertices\r\n:param gt_x: [1, N] Xs of groundtruth's vertices\r\n:param gt_y: [1, N] Ys of groundtruth's vertices\r\n\r\n##############\r\nAll the calcul... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
"numpy.min",
"numpy.where",
"numpy.maximum"
]
] |
potter-potter/pybrain-to-python3 | [
"2787d13fcaa762d0feb2977da85b48d82beb5015"
] | [
"pybrain/optimization/populationbased/coevolution/coevolution.py"
] | [
"\n\n__author__ = 'Tom Schaul, tom@idsia.ch'\n\nfrom scipy import argmax, array\nfrom random import sample, choice, shuffle\n\nfrom pybrain.utilities import fListToString, Named\n\n\nclass Coevolution(Named):\n \"\"\" Population-based generational evolutionary algorithm\n with fitness being based (paritally) ... | [
[
"scipy.array"
]
] |
dhimanray/MWEM | [
"a105b2cd0d39a76ef6058cd16cf0959c650a8cc6"
] | [
"scripts/analysis/Trypsin-Benzamidine/mean_krev_200.py"
] | [
"import numpy as np\n\nl = np.loadtxt('K_i_i-1.dat')\na = l.T[1]\n\n\n\nalpha = 0.01373 #obtained from fraction coverage\n\n#D = 1E-5 #approximate value for small molecule in water (in cm^2/s)\n\nr = 12 #radius of the outermost milestone in Angstrom\n\na = 7.569 * 1E+8 * r * alpha * a\n\nmean_krev = np.mean(a[-10:-... | [
[
"numpy.std",
"numpy.loadtxt",
"numpy.sqrt",
"numpy.mean"
]
] |
ankanbansal/semi-supervised-learning | [
"1aa16e2a7ae10908f70bf9657d26a49bacc50be9"
] | [
"models.py"
] | [
"import numpy as np\nimport ipdb\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\nimport torchvision\nimport torchvision.models as tv_models\nfrom torchvision import transforms\n\n# Mode... | [
[
"torch.nn.Linear",
"torch.nn.functional.avg_pool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.functional.softmax",
"torch.nn.functional.relu"
]
] |
quantopian/cvxpy | [
"7deee4d172470aa8f629dab7fead50467afa75ff",
"7deee4d172470aa8f629dab7fead50467afa75ff"
] | [
"cvxpy/performance_tests/test_warmstart.py",
"cvxpy/atoms/elementwise/log1p.py"
] | [
"\"\"\"\nCopyright 2017 Steven Diamond\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 applicable law or agreed to i... | [
[
"numpy.random.seed",
"numpy.random.randn",
"numpy.logspace"
],
[
"numpy.min",
"numpy.ones",
"scipy.special.log1p"
]
] |
ajd12342/PDVC | [
"0a8728c273102c0ba5849255b941c409d599322e"
] | [
"pdvc/ops/modules/ms_deform_attn.py"
] | [
"# ------------------------------------------------------------------------------------------------\n# Deformable DETR\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\n# ----------------------------------------------------------------... | [
[
"torch.nn.Linear",
"torch.arange",
"torch.nn.init.constant_",
"torch.no_grad",
"torch.nn.init.xavier_uniform_",
"torch.nn.functional.softmax"
]
] |
chibbargroup/CentralRepository | [
"0f152cdc207565656e8f6f10622517c5422f18f6"
] | [
"Phylogeny Scripts/sequence_combiner.py"
] | [
"'''\nCombines fasta files based on a list of accession numbers with formated headers\n\nUsage:\npython sequence_combiner.py file_info.csv fasta_directory out_directory\n\n'''\n\nfrom os import listdir, remove\nfrom os.path import join, isfile\nimport pandas as pd \nimport sys\n\ndef File_Reader(file_info):\n\tdata... | [
[
"pandas.read_csv"
]
] |
AbelHeinsbroek/epynet | [
"992ce792c6b6427ee0d35325645c8185bc888928"
] | [
"epynet/.ipynb_checkpoints/objectcollection-checkpoint.py"
] | [
"import collections\r\nimport pandas as pd\r\n\r\nclass ObjectCollection(dict):\r\n\r\n # magic methods to transform collection attributes to Pandas Series or, if we return classes, another list\r\n def __getattr__(self,name):\r\n values = {}\r\n\r\n for key, item in self.items():\r\n ... | [
[
"pandas.concat",
"pandas.Series"
]
] |
ismailuddin/tfserving_manager | [
"cbddbe050567ad6d89c61cfd0d25f7dcc48419ed"
] | [
"tfserving_manager/prediction/grpc.py"
] | [
"\"\"\"Class for getting predictions from the TensorFlow Serving server\nusing the gRPC API\"\"\"\n\n\nimport numpy as np\nimport grpc\nfrom typing import List, Tuple\nfrom tensorflow_serving.apis.predict_pb2 import PredictRequest\nfrom tensorflow_serving.apis.prediction_service_pb2_grpc import (\n PredictionSer... | [
[
"numpy.array"
]
] |
mattdon/raven | [
"b5b4a9fc96cec37ca5fb3757c45653eec66522f1"
] | [
"framework/SupervisedLearning/SupervisedLearning.py"
] | [
"# Copyright 2017 Battelle Energy Alliance, 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"numpy.__version__.split",
"numpy.stack",
"numpy.asarray"
]
] |
DR08/pytorch_RFCN | [
"3baed2001fe2ed47cb80ea4193ec945bbc162c06"
] | [
"demo.py"
] | [
"import cv2\nimport numpy as np\nimport torch\nfrom faster_rcnn import network\nfrom faster_rcnn.faster_rcnn import FasterRCNN\nfrom faster_rcnn.utils.timer import Timer\n\n\ndef test():\n import os\n im_file = 'demo/004545.jpg'\n # im_file = 'data/VOCdevkit2007/VOC2007/JPEGImages/009036.jpg'\n # im_fil... | [
[
"numpy.copy",
"torch.load"
]
] |
petersackettferguson/xCurling | [
"b7b59263bfbdf70811870c522caacff46a5b55df"
] | [
"imgproc.py"
] | [
"import constants\nimport gen\nimport vis\n\nimport math\nimport cv2\nfrom cv2 import xphoto\nimport numpy as np\nfrom glob import glob\n\n# makes output match image, but internal processing is mirrored\nFLIP = True\nRES = 1080\n\n# Options: None, ROTATE_TEE, ROTATE_BASE, TEE, BASE\n# Warping beyond rotation (TEE, ... | [
[
"numpy.array",
"numpy.subtract",
"numpy.float32",
"numpy.mean"
]
] |
calekochenour/awhere-fire-risk | [
"04cc426dfc49337bbbefd97f11af82b171f995ef"
] | [
"examples/work_with_agronomics.py"
] | [
"\"\"\"\nWork with Agronomics in aWherePy\n================================\n\nLearn how to get agronomic norms and observed values with aWherePy.\n\n\"\"\"\n\n###############################################################################\n# Get Agronomic Norms and Observed Agronomic Data with aWherePy\n# --------... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.context",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
]
] |
acivgin1/M1-DS-internship | [
"093e64632f61a3b9b980d6258edd3c248141b19c"
] | [
"Task3/ds_movie_recommender/play_file.py"
] | [
"import os\n\nimport numpy as np\nfrom ratings import load_train_validation_test\nimport pyximport; pyximport.install()\nfrom svd_clustering import SvdCluster\n\nfrom movie_recommender import SmartQi\n\nGAMMA_LIST = [0.006, 0.005]\nBETA_LIST = [0.06, 0.05, 0.04]\n\n\ndef cross_validation(sA_train, sA_validation, sA... | [
[
"numpy.unique",
"numpy.diff"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.