repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Ignas-S/retinanet-simple | [
"81b17f65fa5278e6b9a4918e6a20b77949a7e87d"
] | [
"retinanet/val.py"
] | [
"from __future__ import print_function\n\nimport numpy as np\nimport json\nimport os\nimport matplotlib.pyplot as plt\nimport torch\n\n\n\ndef compute_overlap(a, b):\n \"\"\"\n Parameters\n ----------\n a: (N, 4) ndarray of float\n b: (K, 4) ndarray of float\n Returns\n -------\n overlaps: (... | [
[
"numpy.concatenate",
"numpy.append",
"numpy.zeros",
"numpy.sum",
"torch.no_grad",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"numpy.where",
"numpy.finfo",
"torch.cuda.is_available",
"numpy.argmax... |
Utkarsh87/Capsule-Networks | [
"a3a533d40c3ac32590067782c8a41f450ec0b28a"
] | [
"src/digitcaps.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nGPU_AVAILABLE = torch.cuda.is_available()\r\n\r\n# if(GPU_AVAILABLE):\r\n# print('Training on GPU!')\r\n# else:\r\n# print('Only CPU available')\r\n\r\ndef softmax(input_tensor, dim=1):\r\n transposed_input = input_tensor.tr... | [
[
"torch.cuda.is_available",
"torch.matmul",
"torch.randn",
"torch.sqrt"
]
] |
thivagar-manickam/data-science-notebooks | [
"afd7ecd68a140d98fafc528c983ed1f67c2c6f34"
] | [
"House Sales Prediction in King County, USA/app/model.py"
] | [
"import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom housePricePredictor import HousePricePrediction as HousePricePredictor\nimport joblib\n\nif __name__ == \"__main__\":\n url = \"house_price.csv\"\n house_df = pd.read_csv(url)\n target_column = \"price\"\n input_col = ['bed... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
sylviemonet/strawberryfields | [
"e1a90cbb73f84b17d85d993cdf878eb60d41e28e"
] | [
"tests/integration/test_ops_integration.py"
] | [
"# Copyright 2019 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applica... | [
[
"tensorflow.abs",
"numpy.array",
"tensorflow.keras.optimizers.SGD",
"numpy.linalg.norm",
"tensorflow.GradientTape",
"numpy.zeros",
"numpy.angle",
"numpy.random.seed",
"numpy.identity",
"numpy.allclose",
"numpy.random.uniform",
"scipy.stats.unitary_group.rvs",
"n... |
XiaoSanGit/wda_tracker | [
"b68ec0edb9daa6cc495815ba9ca549b36eec0369",
"b68ec0edb9daa6cc495815ba9ca549b36eec0369"
] | [
"clustering/clustering_utils.py",
"feature_extractors/ABD_Net/torchreid/datasets/viper.py"
] | [
"import pandas as pd\nfrom collections import defaultdict\nimport os\nfrom tqdm import tqdm\nfrom clustering import heapq\nimport sys\nimport numpy as np\nfrom utilities.helper import constrain_bbox_to_img_dims\n\n\ndef valid_heap_node(heap_node, old_clusters):\n pair_data = heap_node[1]\n for old_cluster in ... | [
[
"numpy.divide",
"numpy.array",
"numpy.median",
"pandas.DataFrame",
"numpy.sum",
"numpy.multiply",
"pandas.read_csv"
],
[
"numpy.arange",
"numpy.random.shuffle"
]
] |
kngwyu/rlpy | [
"329166de28d311d8f87358a62c38f40a7318fe07"
] | [
"tests/representations/test_local_bases.py"
] | [
"from rlpy.representations import NonparametricLocalBases, RandomLocalBases\nfrom rlpy.domains import infinite_track_cartpole as inf_cp\nimport numpy as np\n\ntry:\n from rlpy.representations.kernels import gaussian_kernel\nexcept ImportError:\n from rlpy.representations.slow_kernels import gaussian_kernel\n\... | [
[
"numpy.all",
"numpy.array"
]
] |
justincely/classwork | [
"2d2b1882f9141bc5776977a5c7c6a4788ea7bc4f"
] | [
"UMD/AST615/HW6_2/plot_particles.py"
] | [
"import pylab\nimport string\nimport glob\nimport numpy\nfrom mpl_toolkits.mplot3d import Axes3D\nN_particles=1000\npylab.ion()\nfig = pylab.figure()\nax=Axes3D(fig)\ntxt_list=glob.glob('t_*.txt')\ntxt_list.sort()\nfor txt in txt_list:\n infile=open(txt,'r')\n\n m=numpy.zeros(N_particles)\n r=numpy.zeros((... | [
[
"numpy.zeros"
]
] |
danieljfeller/medline-multilabel | [
"acacc6e9bd4d09776c3aa46600676eed562231ba"
] | [
"src/data/parse_ohsuMed.py"
] | [
"import os\nfrom os.path import isfile, join\nfrom os import walk\nimport re\nimport pandas as pd\n\n\"\"\"\nthis file takes the raw OHSU corpus in data/external/ and creates a pandas dataframe, \nputting it in data/processed/ohsu_med.csv\n\"\"\"\n\nbasepath=os.path.dirname(__file__)\n\nlabel_list = []\nfor (dirpat... | [
[
"pandas.DataFrame"
]
] |
hyyc116/TopicSelectionBehavior | [
"edb415f1f30a65f9f9cf06104163c38f5801d2fc"
] | [
"src/gini.py"
] | [
"import numpy as np\n'''\n source repository: https://github.com/oliviaguest/gini.git\n'''\ndef gini(array):\n \"\"\"Calculate the Gini coefficient of a numpy array.\"\"\"\n # based on bottom eq:\n # http://www.statsdirect.com/help/generatedimages/equations/equation154.svg\n # from:\n # http://www... | [
[
"numpy.array",
"numpy.sum",
"numpy.arange",
"numpy.sort",
"numpy.amin"
]
] |
louis-richard/irfu-python | [
"38960c069b3d8600fa6cb8e0fbd7f0a2d83ca967"
] | [
"pyrfu/pyrf/struct_func.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# 3rd party imports\nimport numpy as np\nimport xarray as xr\n\n__author__ = \"Louis Richard\"\n__email__ = \"louisr@irfu.se\"\n__copyright__ = \"Copyright 2020-2021\"\n__license__ = \"MIT\"\n__version__ = \"2.3.7\"\n__status__ = \"Prototype\"\n\n\ndef struct_func(... | [
[
"numpy.array",
"numpy.abs"
]
] |
lee-man/goturn-pytorch | [
"3d655eaf63b955fd211234c9a6c9246a4073ee84",
"3d655eaf63b955fd211234c9a6c9246a4073ee84"
] | [
"src/scripts/train.py",
"src/goturn/helper/image_io.py"
] | [
"\"\"\"\nFile: train.py\nAuthor: Nrupatunga\nEmail: nrupatunga.s@byjus.com\nGithub: https://github.com/nrupatunga\nDescription: Training scripts for goturn\n\"\"\"\n\nimport argparse\nimport random\nimport sys\nfrom collections import OrderedDict\nfrom multiprocessing import Manager\nimport copy\n\nimport cv2\nimpo... | [
[
"numpy.concatenate",
"torch.sigmoid",
"numpy.array",
"torch.optim.lr_scheduler.StepLR",
"torch.stack",
"numpy.random.seed",
"torch.nn.L1Loss",
"torch.manual_seed",
"numpy.stack",
"numpy.transpose",
"torch.utils.data.DataLoader",
"torch.load",
"torch.log"
],
... |
Data-Science-and-Data-Analytics-Courses/fdfff | [
"1aa85d18bdd8526b941a6936d24cfb57c687323a"
] | [
"project2_digit_recognition/mnist/part2-mnist/nnet_fc.py"
] | [
"#! /usr/bin/env python\n\nimport _pickle as cPickle, gzip\nimport numpy as np\nfrom tqdm import tqdm\nimport torch\nimport torch.autograd as autograd\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport sys\nsys.path.append(\"..\")\nimport utils\nfrom utils import *\nfrom train_utils import batchify_dat... | [
[
"torch.nn.Linear",
"numpy.random.seed",
"numpy.random.shuffle",
"torch.manual_seed",
"torch.nn.ReLU"
]
] |
rpSebastian/AutoCFR | [
"71fd4ce6e64580c11328b9fe75f79de3fae18af3"
] | [
"autocfr/program/executor.py"
] | [
"import numpy as np\n\n\nclass PostCheckError(RuntimeError):\n def __init__(self, hint):\n self.hint = hint\n\n def __str__(self):\n return self.hint\n\n\nclass ProgramExecutionError(RuntimeError):\n pass\n\n\nclass AlgorithmExecutionError(RuntimeError):\n def __init__(self, error_info):\n... | [
[
"numpy.sum",
"numpy.min"
]
] |
dabacon/Cirq | [
"54286063f679d67501ff1b905cd16b879feaae27",
"610b0d4ea3a7862169610797266734c844ddcc1f"
] | [
"cirq-core/cirq/work/observable_measurement.py",
"cirq-core/cirq/ops/mixed_unitary_channel_test.py"
] | [
"# Copyright 2020 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... | [
[
"numpy.sum",
"numpy.ones",
"numpy.zeros",
"numpy.logical_xor"
],
[
"numpy.array",
"numpy.zeros"
]
] |
JiacongXu666/lalala | [
"be513ed1dd394f2c09ce43bd377f26868ad9aa74"
] | [
"models/pidnet_large_uni128_pappm_dfm.py"
] | [
"import math\nimport torch\nimport numpy as np \nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\nfrom collections import OrderedDict\nimport time\nfrom . import model_utils\nimport logging\n\nBatchNorm2d = nn.BatchNorm2d\nbn_mom = 0.1\n \ndef conv3x3(in_planes, out_planes, stri... | [
[
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.nn.init.kaiming_normal_",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.load"
]
] |
Myyyr/transseg2d | [
"7664653dec0bf63d96ad3c76fc225d2d7f607e41"
] | [
"mmseg/models/utils/swin_unet_v2_utils_gtv5.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.checkpoint as checkpoint\nfrom einops import rearrange\nfrom timm.models.layers import DropPath, to_2tuple, trunc_normal_\nimport numpy as np\n\nfrom einops import repeat\n# MERGING STRAT : RANDOM PERMUTE\n\nclass Mlp(nn.Modul... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.Identity",
"torch.roll",
"torch.nn.Softmax",
"torch.arange",
"torch.nn.ModuleList",
"numpy.ceil",
"torch.nn.init.constant_",
"torch.randperm",
"torch.nn.Conv2d",
"torch.meshgrid",
... |
tw991/pytorch-lightning | [
"a6de1b8d75c67cdf18e3cc0a24a1f471d4069613"
] | [
"pytorch_lightning/trainer/trainer.py"
] | [
"import inspect\nimport os\nfrom argparse import ArgumentParser\nfrom typing import Union, Optional, List, Dict, Tuple, Iterable, Any\n\nimport torch\nimport torch.distributed as torch_distrib\nimport torch.multiprocessing as mp\nfrom torch.utils.data import DataLoader\n\nfrom pytorch_lightning import _logger as lo... | [
[
"torch.device",
"torch.multiprocessing.spawn",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.cuda.amp.GradScaler",
"torch.distributed.barrier"
]
] |
janfreyberg/healthy-brain-eeg | [
"3354700053bc9133901799b7a628ffa16ab77995"
] | [
"data/__init__.py"
] | [
"from pathlib import Path\nimport pandas as pd\n\n\ndatafolder = Path('/') / 'Volumes' / 'Seagate Expansion Drive' / 'cmi-hbn'\n\nif not datafolder.exists():\n datafolder = Path('/') / 'Users' / 'jan' / \\\n 'Documents' / 'eeg-data' / 'cmi-hbn'\n\nif not datafolder.exists():\n # try the windows option\... | [
[
"pandas.read_csv"
]
] |
thanhtd91/mt-dnn | [
"f9e1fc3edb4a44f0cd70e973fd93583999b517d9"
] | [
"predict.py"
] | [
"import argparse\nimport json\nimport os\nimport torch\n\nfrom data_utils.task_def import TaskType\nfrom experiments.exp_def import TaskDefs\nfrom experiments.glue.glue_utils import eval_model\nfrom mt_dnn.batcher import BatchGen\nfrom mt_dnn.model import MTDNNModel\n\ndef dump(path, data):\n with open(path, 'w'... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.load"
]
] |
johnzhang1999/Spatial-Attention | [
"9e8e90ba624e52dcccba47c7289bb305765f5da6"
] | [
"main.py"
] | [
"from __future__ import print_function, absolute_import\nimport argparse\nimport os.path as osp\nimport numpy as np\nimport sys\nimport torch\nfrom torch import nn\nfrom torch.backends import cudnn\nfrom torch.utils.data import DataLoader\n\nfrom reid import datasets\nfrom reid import models\nfrom reid.trainers_par... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.optim.SGD",
"torch.manual_seed",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel"
]
] |
leiyu1980/cavaface.pytorch | [
"522167004bb7792e063d1376c865d451f0895bd0"
] | [
"backbone/common.py"
] | [
"\"\"\"\n Common routines for models in PyTorch.\n\"\"\"\n\n__all__ = ['round_channels', 'Identity', 'Swish', 'HSigmoid', 'HSwish', 'get_activation_layer', 'InterpolationBlock',\n 'IBN', 'Flatten', 'l2_norm', 'SEModule', 'bottleneck_IR', 'bottleneck_IR_SE']\n\nimport math\nfrom inspect import isfunctio... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.modules.utils._pair",
"torch.nn.BatchNorm2d",
"torch.ones",
"torch.sigmoid",
"torch.nn.MaxPool2d",
"torch.norm",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.div",
"torch.zeros",
"torch.nn.functional.relu6",
"torch.... |
jerrypeng7773/amazon-sagemaker-examples | [
"c5ddecce1f739a345465b9a38b064983a129141d",
"c5ddecce1f739a345465b9a38b064983a129141d"
] | [
"advanced_functionality/pytorch_extending_our_containers/utils/utils_cifar.py",
"training/distributed_training/tensorflow/data_parallel/mnist/code/train_tensorflow_smdataparallel_mnist.py"
] | [
"# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th... | [
[
"numpy.transpose",
"torch.utils.data.DataLoader"
],
[
"tensorflow.GradientTape",
"tensorflow.random.set_seed",
"tensorflow.keras.layers.Flatten",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.cast",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layer... |
aaron8tang/raster-vision | [
"a1af78bafb8f19ccc40c476adb551bdc23a33611",
"a1af78bafb8f19ccc40c476adb551bdc23a33611"
] | [
"rastervision/backend/tf_deeplab.py",
"rastervision/task/semantic_segmentation.py"
] | [
"import os\nimport glob\nimport shutil\nimport tarfile\nimport uuid\nfrom typing import (Dict, List, Tuple)\nfrom os.path import join\nfrom subprocess import Popen\nimport logging\n\nimport numpy as np\nfrom google.protobuf import (json_format)\n\nimport rastervision as rv\nfrom rastervision.core.box import Box\nfr... | [
[
"numpy.array",
"numpy.random.rand",
"tensorflow.python_io.tf_record_iterator",
"numpy.vectorize",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.python_io.TFRecordWriter",
"numpy.bitwise_and",
"tensorflow.train.Example",
"tensorflow... |
gab50000/OpenAI | [
"c842631a88a72256349916548153c8b388584f17"
] | [
"cartpole/manuell.py"
] | [
"from collections import deque\nimport random\n\nimport gym\n\nimport numpy as np\nimport tensorflow as tf\nimport daiquiri\n\n\ndaiquiri.setup(level=daiquiri.logging.DEBUG)\nlogger = daiquiri.getLogger(__name__)\n\n\nRENDER = False\n\n\nclass Neuro:\n def __init__(self):\n\n n_in = 4\n n_hidden = ... | [
[
"tensorflow.trainable_variables",
"numpy.array",
"tensorflow.get_default_session",
"tensorflow.assign",
"tensorflow.contrib.layers.variance_scaling_initializer",
"numpy.sign",
"tensorflow.placeholder",
"tensorflow.layers.dense",
"tensorflow.global_variables_initializer",
"n... |
pierresegonne/ncp | [
"2decbf7dbf2125353be6f5f030c5bce12beadefd",
"2decbf7dbf2125353be6f5f030c5bce12beadefd"
] | [
"ncp/scripts/toy_regression.py",
"ncp/scripts/flights_active.py"
] | [
"import argparse\nimport itertools\nimport os\nimport warnings\n\nimport matplotlib as mpl\n\nmpl.use(\"Agg\")\nimport matplotlib.pyplot as plt\nimport ruamel.yaml as yaml\nimport tensorflow.compat.v1 as tf\n\ntf.disable_v2_behavior()\n\nfrom ncp import datasets, models, tools\n\n# NOTE\n# Possible datasets\nVARGRA... | [
[
"matplotlib.use",
"tensorflow.compat.v1.gfile.MakeDirs",
"tensorflow.compat.v1.disable_v2_behavior",
"matplotlib.pyplot.MaxNLocator",
"matplotlib.pyplot.subplots",
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.compat.v1.set_random_seed"
],
[
"matplotlib.use",
"ten... |
JFChi/Understanding-and-Mitigating-Accuracy-Disparity-in-Regression | [
"30bd1c82a5ccbcb84a23eb12da9071596796283b"
] | [
"utils.py"
] | [
"\nimport logging\nimport sys\n\nimport numpy as np\nimport torch\n\ndef get_logger(filename):\n\t# Logging configuration: set the basic configuration of the logging system\n\tlog_formatter = logging.Formatter(fmt='%(asctime)s [%(processName)s, %(process)s] [%(levelname)-5.5s] %(message)s',\n\t\t\t\t\t\t\t\t\t da... | [
[
"torch.cat",
"torch.trace",
"torch.FloatTensor",
"numpy.mean",
"torch.manual_seed",
"torch.abs",
"torch.exp",
"torch.sum"
]
] |
pongnguy/CS230_Spring-2020 | [
"e1f75075da6c25b15fcabefa1eab901e8efc5744"
] | [
"final_project/bert_pytorch.py"
] | [
"\"\"\"\nFile to do a baseline BERT model fine-tuning using PyTorch\n\nSee this article https://mccormickml.com/2019/07/22/BERT-fine-tuning/\n\n\nA. Wechselberger, 2020\n\"\"\"\n\nimport tensorflow as tf\n\n# Get the GPU device name.\ndevice_name = tf.test.gpu_device_name()\n\n# The device name should look like the... | [
[
"tensorflow.test.gpu_device_name"
]
] |
vskrachkov/master-degree | [
"be1c7f67afaf5cecb96b51bb2065eac87fd4cd4e"
] | [
"src/aco/graphs.py"
] | [
"import csv\nimport random\nimport itertools\nimport time\nimport functools\nimport copy\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport pants\n\n\nMAX_EDGE_WEIGHT = 25\nMIN_EDGE_WEIGHT = 12\n\n\ndef create_complete_graph(n=1):\n graph = nx.Graph()\n nodes = range(n)\n\n # create nodes\n ... | [
[
"matplotlib.pyplot.show"
]
] |
Rubtsowa/numba-dppy | [
"20f9825b144913ebe1f7635c785b334f3743c4cb"
] | [
"numba_dppy/examples/sum_ndarray.py"
] | [
"#! /usr/bin/env python\n# Copyright 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 requir... | [
[
"numpy.random.random",
"numpy.ones_like"
]
] |
flegac/deep-experiments | [
"e1b12e724f2c8340cbe9c51396cf3f42e3b4e934"
] | [
"mydeep-lib/tests/test_monitoring.py"
] | [
"import pandas as pd\n\nfrom mydeep_api.data import Data\nfrom mydeep_api.monitoring.confusion_viewer import ConfusionViewer\nfrom mydeep_api.monitoring.dataset_viewer import DatasetViewer\nfrom mydeep_api.monitoring.history_viewer import HistoryViewer\nfrom surili_core.workspace import Workspace\n\nws = Workspace.... | [
[
"pandas.DataFrame"
]
] |
humaohai/mars | [
"11373f64c3039d424f9276e610ae5ad108ea0eb1"
] | [
"mars/learn/neighbors/_faiss.py"
] | [
"# Copyright 1999-2020 Alibaba Group Holding Ltd.\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... | [
[
"numpy.dtype",
"numpy.sqrt"
]
] |
lj-ecjtu/Faster-RCNN-TensorFlow-Python3-master-RSDDs | [
"33371985133c93d9a7a5ef0a8a60a558ccfa1ae2"
] | [
"lib/nets/network.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __fu... | [
[
"tensorflow.constant_initializer",
"tensorflow.contrib.slim.max_pool2d",
"tensorflow.reshape",
"tensorflow.stack",
"tensorflow.to_float",
"tensorflow.nn.softmax",
"tensorflow.gather",
"tensorflow.trainable_variables",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow... |
vmarceau/jupytext | [
"72aa6c4968da714323fbd7a7c548ee4b1274c946"
] | [
"tests/notebooks/mirror/ipynb_to_script_vim_folding_markers/Notebook_with_more_R_magic_111.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# cell_markers: '{{{,}}}'\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# {{{\n# %load_ext rpy2.ipython\nimport pandas as pd\n\ndf = pd.DataFrame(\n {\n \"Letter\": [\"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"c... | [
[
"pandas.DataFrame"
]
] |
patrickcgray/florence_mapping | [
"99e2d452a0b2d32a75b42a94086c9a7272e8788e"
] | [
"rcnn/rnn_tiles.py"
] | [
"import rasterio\nimport numpy as np\nimport random\nimport math\nfrom rasterio.windows import Window\nfrom pyproj import Proj, transform\nfrom rasterio.plot import reshape_as_raster, reshape_as_image\nimport os\nimport sys\nmodule_path = os.path.abspath(os.path.join('..'))\nif module_path not in sys.path:\n sys... | [
[
"numpy.array",
"numpy.subtract",
"numpy.zeros"
]
] |
halostorm/OpenPCDet | [
"9650c9d71e7f03815e925fee6e16909fb219336a"
] | [
"pcdet/models/backbones_3d/spconv_backbone.py"
] | [
"import torch.nn as nn\nimport spconv\nfrom functools import partial\n\n\ndef post_act_block(in_channels, out_channels, kernel_size, indice_key=None, stride=1, padding=0,\n conv_type='subm', norm_fn=None):\n if conv_type == 'subm':\n conv = spconv.SubMConv3d(in_channels, out_channels, ke... | [
[
"torch.nn.ReLU"
]
] |
tinybug/zvt | [
"05c17e390f8c1c611286885ec9d0f6db2c8e0f1d"
] | [
"zvt/recorders/joinquant/meta/stock_trade_day_recorder.py"
] | [
"# -*- coding: utf-8 -*-\nimport pandas as pd\nfrom jqdatasdk import auth, get_trade_days\n\nfrom zvt.contract.api import df_to_db\nfrom zvt.contract.recorder import TimeSeriesDataRecorder\nfrom zvt.utils.time_utils import to_time_str\nfrom zvt import zvt_env\nfrom zvt.domain import StockTradeDay, Stock\n\n\nclass ... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
cjh1/hexrdgui | [
"eb8968ba763cebbffce61164f1bda1e2cc622461"
] | [
"hexrd/ui/image_tab_widget.py"
] | [
"from PySide2.QtCore import Signal, Slot, Qt\nfrom PySide2.QtWidgets import QMessageBox, QTabWidget, QHBoxLayout\n\nimport numpy as np\n\nfrom hexrd.ui.constants import ViewType, ZOOM, PAN\nfrom hexrd.ui.hexrd_config import HexrdConfig\nfrom hexrd.ui.image_canvas import ImageCanvas\nfrom hexrd.ui.image_series_toolb... | [
[
"numpy.radians",
"numpy.sin",
"numpy.vstack",
"numpy.degrees"
]
] |
willcerny/ugali | [
"00b30c5ac84e4cada338fb77d33aa31afabca7bb"
] | [
"ugali/analysis/results.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCalculate output results dictionary.\n\"\"\"\n\nfrom collections import OrderedDict as odict\n\nimport numpy as np\nimport yaml\nimport numpy.lib.recfunctions as recfuncs\n\nimport astropy.coordinates\nfrom astropy.coordinates import SkyCoord\nimport astropy.units as u\n\nimport ugal... | [
[
"numpy.log10",
"numpy.histogram",
"numpy.array",
"numpy.radians",
"numpy.arctan",
"numpy.sqrt",
"numpy.average",
"numpy.linspace"
]
] |
PearCoding/SimpleImageIO | [
"922599defcaf70cfadf453198c7f35948dc349d3"
] | [
"PyWrapper/simpleimageio/error_metrics.py"
] | [
"from ctypes import *\nimport numpy as np\nfrom . import corelib\n\n# Define the call signatures\n_compute_mse = corelib.core.ComputeMSE\n_compute_mse.argtypes = [POINTER(c_float), c_int, POINTER(c_float), c_int, c_int, c_int, c_int ]\n_compute_mse.restype = c_float\n\n_compute_rel_mse = corelib.core.ComputeRelMSE\... | [
[
"numpy.array"
]
] |
jerrykuo7727/transformers | [
"6df0d5861ab1bd845932dc24de8d7e6b836729ad"
] | [
"src/transformers/benchmark/benchmark.py"
] | [
"# coding=utf-8\n# Copyright 2018 The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"torch.randint",
"torch.jit.trace",
"torch.no_grad"
]
] |
brettkoonce/ReAgent | [
"dcaa16e0bdc5e1cecf816a6683e8909a9859855d"
] | [
"ml/rl/readers/data_streamer.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport collections\nimport dataclasses\nimport queue\nimport random\nimport sys\nimport threading\nfrom typing import NamedTuple\n\nimport torch\nimport torch.multiprocessing as multiprocessing\nimport torch.utils.da... | [
[
"torch.multiprocessing.Process",
"torch.utils.data._utils.signal_handling._set_worker_signal_handlers",
"torch.utils.data._utils.signal_handling._set_SIGCHLD_handler",
"torch.cuda.current_device",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.multiprocessing.Event",
"torch.c... |
justinchiu/NeuralDialog | [
"f272cc2e12ffdd44c94263ee373208a22c057129"
] | [
"FB/train.py"
] | [
"# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTraining script. Performs supervised training of DialogModel.\n\"\"\"\n\nimport argparse\nimport itertools\nimport l... | [
[
"torch.cuda.get_device_name",
"numpy.exp"
]
] |
Yaoming95/neurst | [
"f7e2a043f20b6724310b048035e0a6075f60032a"
] | [
"neurst/utils/converters/google_bert.py"
] | [
"# Copyright 2020 ByteDance Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agre... | [
[
"tensorflow.train.load_variable",
"tensorflow.train.list_variables",
"numpy.concatenate",
"tensorflow.io.gfile.makedirs"
]
] |
juyingnan/KaggleTest | [
"27e9114711eb0b6d6ba8c368a6079ff3feb1ca16"
] | [
"classification/ships.py"
] | [
"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import classification_report, accuracy_score\nfrom sklearn.preprocessing import MinMaxScaler\nfr... | [
[
"numpy.array",
"numpy.asarray",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Activation",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.keras.layers.Conv2D",
"tensorflow.... |
bschilder/public-resources | [
"54c129cc27f17d36ff512987659a20eebaa4f0da"
] | [
"uk_biobank/DeGAs/src/py/rivas_decomposition_py/plot_biplot.py"
] | [
"import os, logging, collections\nimport numpy as np\nimport pandas as pd\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport matplotlib.patches as mpatches\n\nfrom logging.config import dictConfig\nfrom logging import getLogger\n\ndictConfig(dict(\n version = 1,... | [
[
"numpy.max",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.linspace",
"matplotlib.gridspec.GridSpec"
]
] |
MahimaGaur31/mlModels | [
"ecab2cc83986f08b21bc85151cece85a08fcce82"
] | [
"models/googlenet.py"
] | [
"from collections import OrderedDict\nimport torch\nimport torch.nn as nn\n\n__all__ = ['googlenet']\n\nclass Inception_v1_GoogLeNet(nn.Module):\n input_side = 227\n rescale = 255.0\n rgb_mean = [122.7717, 115.9465, 102.9801]\n rgb_std = [1, 1, 1]\n\n def __init__(self, num_classes=1000):\n su... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
smonsays/equilibrium-propagation | [
"45cfee96ebecb92af1cabef4b7533c82fdb2a263"
] | [
"lib/energy.py"
] | [
"# MIT License\n\n# Copyright (c) 2020 Simon Schug, João Sacramento\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# ... | [
[
"torch.nn.Linear",
"torch.einsum",
"torch.norm",
"torch.no_grad",
"torch.nn.functional.mse_loss",
"torch.randn",
"torch.mean",
"torch.sum"
]
] |
azlkiniue/poliastro | [
"fedec503390fcb7ee375e278d1c9d7b2c570506f"
] | [
"src/poliastro/tests/tests_twobody/test_orbit.py"
] | [
"import pickle\n\nimport matplotlib\nimport numpy as np\nimport pytest\nfrom astropy import units as u\nfrom astropy.coordinates import (\n ITRS,\n CartesianDifferential,\n CartesianRepresentation,\n SkyCoord,\n)\nfrom astropy.tests.helper import assert_quantity_allclose\nfrom astropy.time import Time\n... | [
[
"numpy.testing.assert_allclose",
"numpy.testing.assert_array_equal"
]
] |
barathum000/tensorflow-upstream | [
"1ec5f5f5d8e25e9cdd55cb74ae5af370d653c618"
] | [
"tensorflow/python/keras/backend_test.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.ops.array_ops.identity",
"tensorflow.python.keras.backend.sigmoid",
"tensorflow.python.keras.backend.symbolic_learning_phase",
"tensorflow.python.ops.array_ops.ones",
"tensorflow.python.keras.backend.is_placeholder",
"tensorflow.python.keras.backend.ContextValueCache",
... |
quejebo/zippy | [
"2f7857ab2b295f188af48d434c83a9906c48de75"
] | [
"zippy/bloom_kmer_finder.py"
] | [
"import cProfile\nimport os\nimport gzip\nimport csv\nimport time\nfrom collections import defaultdict\nfrom itertools import combinations\nfrom pybloomfilter import BloomFilter\n#from pybloom import ScalableBloomFilter, BloomFilter #pybloom used cryptographic hashes in a bloom filter. This is a bad idea.\nimport ... | [
[
"numpy.max",
"numpy.argmax"
]
] |
c-rbp/panoptic_segmentation | [
"aa212d1d6e851857e0b9563bb94fe7297c987c1a"
] | [
"detectron2/evaluation/coco_evaluation.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport contextlib\nimport copy\nimport io\nimport itertools\nimport json\nimport logging\nimport numpy as np\nimport os\nimport pickle\nfrom collections import OrderedDict\nimport pycocotools.mask as mask_util\nimport torch\nfrom fvcore.common... | [
[
"torch.device",
"torch.cat",
"numpy.array",
"torch.arange",
"torch.save",
"numpy.mean",
"torch.zeros_like",
"torch.as_tensor",
"torch.sort"
]
] |
ShannonAI/GNN-LM | [
"56335cd0f30b6583260622e3dc2d7ab635ab6a12"
] | [
"fairseq_cli/convert_ckpt.py"
] | [
"# encoding: utf-8\n\"\"\"\n@author: Yuxian Meng\n@contact: yuxian_meng@shannonai.com\n@time: 2021/4/23 19:26\n@desc: convert a transformer ckpt to gnn-transformer\n\n\"\"\"\n\nimport argparse\nimport os\n\nimport faiss\nimport torch\n\nfrom fairseq import checkpoint_utils\nfrom knn.pq_wrapper import TorchPQCodec\n... | [
[
"torch.save"
]
] |
charlesjsun/rjax | [
"8b56f78b34f593f442db3cc0315a3b6f22191442"
] | [
"rjax/datasets/d4rl/sequence_dataset.py"
] | [
"import collections\nfrom typing import Callable, Optional, Tuple\n\nimport d4rl\nimport gym\nimport numpy as np\n\nfrom rjax.datasets.d4rl.utils import (get_preprocessing_fn,\n sequence_dataset_iter)\nfrom rjax.datasets.dataset import Dataset\n\nBatch = collections.namedtuple(\... | [
[
"numpy.pad",
"numpy.array",
"numpy.ones",
"numpy.stack",
"numpy.random.randint"
]
] |
lsteffenel/IntroPython | [
"5a2a6aacbb850543c264e1f87eedc3955526b8c3"
] | [
"solutions/random_number.py"
] | [
"import numpy as np\n\ny = np.random.poisson(lam=5, size=1000)\nbins = np.bincount(y)\nbins.argmax()\n"
] | [
[
"numpy.bincount",
"numpy.random.poisson"
]
] |
rohitrnath/Monocular-Depth-Estimation-and-Segmentation | [
"549aca8c581b76125349d63fb55944d7133563e3"
] | [
"utils/global_fun.py"
] | [
"from __future__ import print_function\nfrom tqdm import tqdm\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.optim.lr_scheduler import StepLR\nimport torch.optim as optim\nimport copy\nfrom torchsummary import summary\nfrom torchvision import datasets, transforms\nimport numpy as ... | [
[
"matplotlib.pyplot.xlabel",
"torch.no_grad",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.set_title",
"torch.abs",
"numpy.transpose",
"matplotlib.pyplot.ylab... |
aweers/tensorflow | [
"6aa83398ab03bfae822f36772757097bcb98b6ed"
] | [
"tensorflow/python/autograph/operators/control_flow.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.control_flow_ops.cond",
"tensorflow.python.autograph.operators.special_values.is_undefined",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.util.nest.flatten",
"tensorflow.python.framework.tensor_util.is_tensor",
"tensorflow.python.ops.control... |
kingium/PatternRecognitionForUndergrads | [
"5cd08f3a260fae4a7edaf71599433e93484863b0"
] | [
"Project/src3/pca.py"
] | [
"import numpy as np\nimport scipy\nimport sklearn.decomposition\nfrom sklearn.manifold import TSNE\nimport os\n\nprint('loading')\n\ndat = np.load('../data2/data2.npz')\nX_test = dat['X_test']\nX_train = dat['X_train']\nY_train = dat['Y_train']\ndat = []\n\nprint('normalizing')\n\nmean = np.mean(X_train, axis=0)\ns... | [
[
"numpy.load",
"numpy.mean",
"numpy.std",
"numpy.savez",
"numpy.subtract"
]
] |
itanghiu/inaFaceGender | [
"849ecd9f6d483d6e274f48288825678b3e10da7b"
] | [
"inaFaceGender/inaFaceGender.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\n# The MIT License\n\n# Copyright (c) 2019 Ina (Zohra Rezgui & David Doukhan - http://www.ina.fr/)\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 th... | [
[
"pandas.DataFrame.from_records",
"numpy.expand_dims"
]
] |
OpenSourceBrain/BlueBrainProjectShowcase | [
"2cd8aa77342576c1a871f5d500d791f927444913"
] | [
"NMC/parser/L23_PC_cADpyr229_1/run_RmpRiTau.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"Python script to run cell model\"\"\"\n\n\n\"\"\"\n/* Copyright (c) 2015 EPFL-BBP, All rights reserved.\n\nTHIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS''\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY A... | [
[
"numpy.array"
]
] |
brett-daley/fast-dqn | [
"acf21e8bb193e52d73aa8e2d4e355957095bbd36"
] | [
"run_fast_dqn.py"
] | [
"from argparse import ArgumentParser\nfrom distutils.util import strtobool\nimport itertools\nimport os\nos.environ['TF_DETERMINISTIC_OPS'] = '1'\nfrom threading import Thread\nfrom queue import Queue\n\nimport numpy as np\n\nfrom run_dqn import DQNAgent, main, make_parser\nfrom fast_dqn.worker import Worker\n\n\nc... | [
[
"numpy.empty"
]
] |
SKhan97/BigMart-Data-Analysis | [
"a0adf270ae1213ed6a53913b5e2cf7bd562d97c9"
] | [
"model.py"
] | [
"from sklearn.model_selection import cross_val_score\nfrom sklearn import metrics\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.tree import DecisionTreeRegressor\nfrom xgboost import XGBRegressor\nfrom sklearn.metrics import mean_absolute_error\nimport pandas as pd\nimport numpy as np\nimport mat... | [
[
"numpy.max",
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression",
"numpy.min",
"numpy.mean",
"numpy.std",
"sklearn.metrics.mean_absolute_error",
"numpy.abs",
"sklearn.tree.DecisionTreeRegressor",
"matplotlib.pyplot.show",
"pandas.read_csv",
... |
LuoYR/phono3py | [
"38d22f134be1cfd8891ecafe1196478668ba0490"
] | [
"test/phonon3/test_imag_self_energy.py"
] | [
"import numpy as np\n\ngammas = [\n 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000,\n 0.0005412, 0.0005412, 0.0008843, 0.0191694, 0.0206316, 0.0206316,\n 0.0019424, 0.0019424, 0.0067566, 0.0548967, 0.0506115, 0.0506115,\n 0.0062204, 0.0062204, 0.0088148, 0.0426150, 0.0417223, 0.0417223... | [
[
"numpy.testing.assert_allclose",
"numpy.swapaxes"
]
] |
ryaninhust/pyxclib | [
"6e23615742f0bb263313f2899f46bb027ea68007"
] | [
"xclib/embeddings/gen_embeddings.py"
] | [
"# Run using python gen_embeddings.py <embed> <embedding_dim> <vocabulary> <tokens> <out_file>\nimport numpy as np\nimport sys\nimport word_embedding\n\n__author__='KD'\n\ndef main():\n init = 'gaussian'\n embed = sys.argv[1]\n embedding_dim = int(sys.argv[2])\n vocab_file = sys.argv[3]\n tokens = sy... | [
[
"numpy.random.randn",
"numpy.save"
]
] |
yujialuo/Deep-reinforcement-learning | [
"689085251805b1a157e21b5d74c6a478eb8a21c8"
] | [
"hw1/dagger.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nCode to load an expert policy and generate roll-out data for behavioral cloning.\nExample usage:\n python dagger.py experts/Walker2d-v2.pkl Walker2d-v2 --render --num_rollouts 40\n\nAuthor of this script and included expert policies: Jonathan Ho (hoj@openai.com)\n\"\"\"\n\nimpor... | [
[
"numpy.array",
"tensorflow.train.AdamOptimizer",
"tensorflow.matmul",
"tensorflow.train.Saver",
"tensorflow.Session",
"numpy.mean",
"tensorflow.truncated_normal",
"numpy.std",
"tensorflow.placeholder",
"tensorflow.losses.mean_squared_error",
"numpy.append",
"sklearn... |
zhu913104/snake | [
"8fa5608db9568078fe11c9df84e58fea5c173cd9"
] | [
"champion_genetic_algorithm.py"
] | [
"import numpy as np\n\n\nclass GA(object):\n def __init__(self, DNA_size, cross_rate, mutation_rate, pop_size ,pop):\n self.DNA_size = DNA_size\n self.cross_rate = cross_rate\n self.mutate_rate = mutation_rate\n self.pop_size = pop_size\n self.max_distance=0\n if pop.any... | [
[
"numpy.max",
"numpy.random.rand",
"numpy.random.randint",
"numpy.arange",
"numpy.argmax"
]
] |
lazappi/scanpy | [
"9018e16cae6f3199f914f58841b00a00790cd494"
] | [
"scanpy/tests/test_get.py"
] | [
"from functools import partial\nfrom itertools import repeat, chain\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom anndata import AnnData\nfrom scipy import sparse\n\nimport scanpy as sc\nfrom scanpy.datasets._utils import filter_oldformatwarning\nfrom scanpy.tests._data._cached_datasets import pbm... | [
[
"pandas.testing.assert_frame_equal",
"pandas.Index",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.eye",
"numpy.arange",
"pandas.testing.assert_index_equal"
]
] |
cadoman/map-parser | [
"8568429682a14577629a8d126b6ab894b5d66da3"
] | [
"map_extractor/PolygonGroup.py"
] | [
"from shapely.geometry import Polygon\nfrom pprint import pprint\nimport numpy as np\nimport shapely.wkt\nimport matplotlib.pyplot as plt\nimport json\n\n\nclass PolygonGroup:\n def __init__(self, polygons: list, name=\"\"):\n assert isinstance(polygons, list)\n for pol in polygons:\n as... | [
[
"numpy.concatenate",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.imshow"
]
] |
nicksum107/thesiswork | [
"5d175d0e110b08b7da2926fc64287086f503e086"
] | [
"patch_attack_imagenet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\nfrom torchvision import datasets, transforms\n\nimport nets.bagnet\nimport nets.resnet\n\nimport os \nimport joblib\nimport argparse\nfrom tqdm import tqdm\nimport numpy as np \... | [
[
"numpy.concatenate",
"numpy.sum",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.utils.data.Subset",
"torch.argmax",
"torch.nn.DataParallel"
]
] |
daggertye/CS294_homework | [
"4905e2622e1c7e4d2bde343da139333b3dbecc93"
] | [
"hw2/train_pg.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport gym\nimport logz\nimport scipy.signal\nimport os\nimport time\nimport inspect\nfrom multiprocessing import Process\n\n#============================================================================================#\n# Utilities\n#===================================... | [
[
"tensorflow.exp",
"tensorflow.multinomial",
"numpy.min",
"numpy.mean",
"tensorflow.global_variables_initializer",
"tensorflow.set_random_seed",
"numpy.concatenate",
"numpy.max",
"tensorflow.shape",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"tensorflow.l... |
fnx4/Screen-Translate | [
"f4564cc21787cbc87e9f9b97c1e23a6572eaf353"
] | [
"screen_translate/Capture.py"
] | [
"# Internal\nimport os\nfrom datetime import datetime\n# External\nimport numpy as np\nimport pyautogui\nimport pytesseract\nimport cv2\n\n# Lang Code\nfrom screen_translate.LangCode import *\n# Mbox\nfrom screen_translate.Mbox import Mbox\n\n# Settings to capture all screens\nfrom PIL import ImageGrab\nfrom functo... | [
[
"numpy.array",
"numpy.mean"
]
] |
zibinpan/DL_project | [
"df48eb36dad2f45bfd439cef2d50d729dbf4cee4"
] | [
"MyProblem/ZDT3.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport geatpy as ea\n\n\nclass ZDT3(ea.Problem): # 继承Problem父类\n def __init__(self):\n name = 'ZDT3' # 初始化name(函数名称,可以随意设置)\n M = 2 # 初始化M(目标维数)\n maxormins = [1] * M # 初始化maxormins(目标最小最大化标记列表,1:最小化该目标;-1:最大化该目标)\n Dim = 30 # 初始化Dim(... | [
[
"numpy.array",
"numpy.sin",
"numpy.sum",
"numpy.where",
"numpy.abs",
"numpy.linspace"
]
] |
tensorlayer/TensorLayerX | [
"4e3e6f13687309dda7787f0b86e35a62bb3adbad"
] | [
"tensorlayerx/nn/core/common.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\nimport tensorlayerx as tlx\nfrom tensorlayerx.files import utils\nfrom tensorlayerx import logging\nimport numpy as np\nfrom queue import Queue\nfrom tensorlayerx.nn.initializers import *\n\nif tlx.BACKEND == 'mindspore':\n from mindspore.ops.operations ... | [
[
"numpy.moveaxis",
"numpy.savez",
"numpy.load"
]
] |
kencan7749/mmsegmentation | [
"e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8"
] | [
"mmseg/datasets/pipelines/multi_transforms.py"
] | [
"import mmcv\nimport numpy as np\nfrom mmcv.utils import deprecated_api_warning, is_tuple_of\nfrom numpy import random\nfrom .transforms import PhotoMetricDistortion\n\nfrom ..builder import PIPELINES\n\n\n@PIPELINES.register_module()\nclass MultiNormalize(object):\n \"\"\"Normalize the concated images.\n\n A... | [
[
"numpy.concatenate",
"numpy.array"
]
] |
JOTELLECHEA/neural_networks | [
"bced447e4f6d265fd23f5d9f0fcf0c21ce56d930"
] | [
"hyperparameterRecord.py"
] | [
"# Written By : Jonathan O. Tellechea\n# Adviser : Mike Hance, Phd\n# Research : Using a neural network to maximize the significance of tttHH production.\n# Description: This script keeps a record of trained NN; Keeps track of time , AUC , lenght of NN etc. \n# The filename for the saved weights is displayed t... | [
[
"pandas.read_csv"
]
] |
MachineLearningIsEasy/python_lesson_18 | [
"454591e27eab15a80ddfc96294a6a55f4b090765"
] | [
"postgresql_docker.py"
] | [
"import psycopg2\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\n\ndf = pd.read_csv('wine.csv')\n\n\nconn_string = \"host='localhost' dbname='postgres' user='postgres'\"\n\nconn = psycopg2.connect(conn_string)\n\ncursor = conn.cursor()\n\nengine = create_engine('postgresql://postgres@localhost:5432/po... | [
[
"pandas.read_csv",
"pandas.read_sql_query"
]
] |
ganyipeng/tr | [
"af854ffbeac79f9aa4fb66b8bd39b9e171c68c17"
] | [
"ocr_util/ImageCommonProcess.py"
] | [
"# -*- coding: utf-8 -*- \n# @Time 2021/8/26 13:10\n\nfrom PIL import Image\nimport cv2\nimport numpy\n\nMAX_SIZE = 1600 # 图片的大小最好不超过 1600\n\n\ndef resize_image_from_img_path_to_array(img_path):\n pil_img = resize_image_from_img_path_to_pil_img(img_path)\n return pil_img_to_array(pil_img)\n\n\ndef resize_imag... | [
[
"numpy.asarray"
]
] |
dou3516/xView2_baseline | [
"f1a15c36aaa8f2d5f952b45dd3eddfe98cfde1d2"
] | [
"utils/mask_polygons_class.py"
] | [
"#####################################################################################################################################################################\n# xView2 ... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros"
]
] |
terenceylchow124/Meme-MultiModal | [
"114ff75e18685476aba2c67720124a348bc00dde"
] | [
"utils/util_train.py"
] | [
"from torchvision import models as modelsummary\nfrom .util import *\nimport torch\nfrom torch import nn\nimport numpy as np\nimport time\nimport sys\nimport os\n\nos.environ[\"CUDA_DEVICE_ORDER\"]=\"PCI_BUS_ID\"\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0,1\"\n\nactivation = {}\ndef get_activation(name1, name2):\n ... | [
[
"torch.cat",
"torch.max",
"torch.no_grad",
"torch.cuda.device",
"torch.flatten",
"torch.sum"
]
] |
PedrofRodenas/anaglypher | [
"02edcb819382f8223f23224f6b590c7e1954948c"
] | [
"anagliph.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 22 22:03:31 2018\n\n@author: PedrofRodenas\n\"\"\"\n\n# imports\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport utils\nimport hough\nimport matplotlib.patches as mpatches\n\n\ndef plot_CutPoints(img, cutP, VanishP)... | [
[
"numpy.zeros",
"numpy.copy",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.patches.Patch",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
irvingzhang0512/mmpose | [
"17557522ce3e41f830973079c5b4321935c41439"
] | [
"mmpose/datasets/datasets/top_down/topdown_posetrack18_dataset.py"
] | [
"import os\nimport os.path as osp\nimport warnings\nfrom collections import OrderedDict, defaultdict\n\nimport json_tricks as json\nimport numpy as np\nfrom poseval import eval_helpers\nfrom poseval.evaluateAP import evaluateAP\nfrom xtcocotools.coco import COCO\n\nfrom ....core.post_processing import oks_nms, soft... | [
[
"numpy.array"
]
] |
lee15253/edl_bk | [
"6777f5803138e6a64dabb096fe18a495728aabe3"
] | [
"agents/maze_agents/ant_maze/off_policy_hierarchical.py"
] | [
"# Copyright (c) 2019, salesforce.com, inc.\n# All rights reserved.\n# SPDX-License-Identifier: MIT\n# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n\nimport torch\nimport numpy as np\nfrom torch.distributions import Normal\nfrom base.actors.base import BaseHie... | [
[
"numpy.random.rand",
"torch.stack",
"torch.clamp",
"torch.ones",
"numpy.random.uniform",
"torch.ones_like",
"torch.zeros_like"
]
] |
huobanlqs/faster-rcnn-win-tf2 | [
"63b5a61b3801f505a12f42b49529be8a5c337740"
] | [
"lib/config/config.py"
] | [
"import os\nimport os.path as osp\n\nimport numpy as np\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\nFLAGS = tf.app.flags.FLAGS\nFLAGS2 = {}\n\n######################\n# General Parameters #\n######################\nFLAGS2[\"pixel_means\"] = np.array([[[102.9801, 115.9465, 122.7717]]])\ntf.app.fl... | [
[
"numpy.array",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.app.flags.DEFINE_string",
"tensorflow.compat.v1.app.flags.DEFINE_float",
"tensorflow.compat.v1.app.flags.DEFINE_boolean",
"tensorflow.compat.v1.app.flags.DEFINE_integer"
]
] |
etrejo23/web-scraping-challenge | [
"c1b3833dbf33043a9b54fb9b57b29b9f7a413321"
] | [
"app/mars.py"
] | [
"from splinter import Browser\nfrom bs4 import BeautifulSoup as BS\nimport pandas as pd\nimport requests\nimport selenium\nfrom selenium import webdriver \nfrom selenium.webdriver.common.keys import Keys \nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import Web... | [
[
"pandas.read_html"
]
] |
chanind/hanzi-font-deconstructor | [
"ce41b2a5c0e66b8a83d6c734678446d1d32a18b7"
] | [
"hanzi_font_deconstructor/model/pix2pix/Generator.py"
] | [
"# from https://github.com/aladdinpersson/Machine-Learning-Collection/tree/master/ML/Pytorch/GANs/Pix2Pix\n\nimport torch\nimport torch.nn as nn\n\n\nclass Block(nn.Module):\n def __init__(\n self, in_channels, out_channels, down=True, act=\"relu\", use_dropout=False\n ):\n super(Block, self).__... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.nn.Tanh",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
Tobigs-team/EmoGET_tobigticon | [
"4b13d6a780bbe269a9c285cc603b16b09d459edf"
] | [
"sol2/models.py"
] | [
"\"\"\"\nCopyright (C) 2017 NVIDIA Corporation. All rights reserved.\nLicensed under the CC BY-NC-ND 4.0 license (https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode).\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.utils.data\nfrom torch.autograd import Variable\n\ni... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.stack",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.nn.BatchNorm3d",
"torch.nn.modules.utils._triple",
"numpy.random.normal",
"torch.autograd.Variable",
"torch.nn.ConvTranspose2d",
"numpy.ran... |
ngocson2vn/data-complexity | [
"6c7b9e3e7cdbea4d5c2f1af894dc45c59c54db3c"
] | [
"examples/creditcard_C12.py"
] | [
"import pandas as pd\nfrom dcm import dcm\nimport datasets\n\ndataset_file = 'examples/datasets/creditcard.csv'\ndatasets.download_creditcard(dataset_file)\n\nprint(\"Loading dataset ... \", end=\"\", flush=True)\ndataset = pd.read_csv(dataset_file)\nX = dataset.drop(columns=['Class']).values\ny = dataset['Class'].... | [
[
"pandas.read_csv"
]
] |
akhildraju/lambdata-akhildraju | [
"b490068460c3e379725f0e117fa323863f880c10"
] | [
"akhilutils/dsutils.py"
] | [
"import pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n\nclass DatasetUtil:\n \"\"\" This class provides untilities for splitting your dataset \n into train, test and validate sets \"\"\"\n\n dataframe = None\n\n def __init__(self, df):\n self.dataframe = df\n\n def train_test_val... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
AndreySheka/catalyst | [
"28dd7696fb4a1331c85dbeecc147bed6b46b411c"
] | [
"catalyst/contrib/models/cv/segmentation/blocks/unet.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom ..abn import ABN\nfrom .core import _get_block, _upsample, DecoderBlock, EncoderBlock\n\n\nclass EncoderDownsampleBlock(EncoderBlock):\n def __init__(\n self,\n in_channels: int,\n out_channels: int,\n i... | [
[
"torch.cat",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.nn.functional.max_pool2d",
"torch.nn.Dropout2d"
]
] |
cclauss/mindsdb | [
"d59b9273dcfaf7f137dd38ab6c6e544b3114669f"
] | [
"mindsdb/libs/phases/model_predictor/model_predictor.py"
] | [
"\"\"\"\n*******************************************************\n * Copyright (C) 2017 MindsDB Inc. <copyright@mindsdb.com>\n *\n * This file is part of MindsDB Server.\n *\n * MindsDB Server can not be copied and/or distributed without the express\n * permission of MindsDB Inc\n **********************************... | [
[
"numpy.transpose",
"numpy.format_float_positional"
]
] |
parasdahal/tinyml | [
"cf2fcc021ae65df19d420e3142e4a38d20ca87e0"
] | [
"src/MultiLayerPerceptron.py"
] | [
"import numpy as np\nimport random\nimport math\nimport datetime\n\nclass CrossEntropyCost:\n \"\"\"\n Cross Entropy class with cost function and error \n \"\"\"\n\n @staticmethod\n def fn(a,y):\n return np.sum( np.nan_to_num( -y * np.log(a) - (1-y) * np.log(1-a) ) )\n \n @staticmethod\n... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"matplotlib.ticker.MaxNLocator",
"numpy.log",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.random.randn",
"numpy.exp",
"numpy.argmax",
"matplotlib.pyplot... |
AllenCellModeling/CVAE_testbed | [
"bc9be2cd9725b9cddfca69b450dd4a2b93da6858",
"bc9be2cd9725b9cddfca69b450dd4a2b93da6858"
] | [
"CVAE_testbed/datasets/synthetic_projected.py",
"CVAE_testbed/datasets/dataloader.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader, Dataset\nfrom torch.distributions import MultivariateNormal\nimport numpy as np\nimport sklearn\nfrom sklearn import preprocessing\nfrom scipy import stats\n\n\nclass ProjectedSyntheticDataset(Dataset):\n def __init__(\n self,\n ... | [
[
"torch.zeros",
"numpy.zeros",
"numpy.random.permutation",
"numpy.eye",
"torch.from_numpy",
"torch.mm",
"numpy.random.beta",
"torch.eye",
"numpy.sqrt",
"torch.empty",
"torch.randn"
],
[
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
n3011/deepchem | [
"c316d998c462ce01032f0dae883856b400ea4765"
] | [
"deepchem/models/tensorgraph/symmetry_functions.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jul 6 20:43:23 2017\n\n@author: zqwu\n\"\"\"\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nimport numpy as np\nimport tensorflow as tf\nfrom deepchem.models.tensorgraph import activations\nfrom deepchem.models.t... | [
[
"tensorflow.square",
"numpy.array",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.eye",
"tensorflow.expand_dims",
"tensorflow.cos",
"tensorflow.reshape",
"tensorflow.add_n",
"tensorflow.constant",
"tensorflow.sign",
"tensorflow.div",
"tensorflow.stack",
... |
nmiles2718/PACMan_dist | [
"62f495f8d506919146a16750072a523aaafb3c53"
] | [
"utils/analyzer.py"
] | [
"#!/usr/bin/env python\n\nimport os\n\nfrom matplotlib.ticker import AutoMinorLocator\nimport matplotlib.pyplot as plt\nplt.style.use('ggplot')\nimport pandas as pd\n\n\nclass PACManAnalyze():\n def __init__(self):\n \"\"\" This class provides functionality for analyzing the model results\n \"\"\"\... | [
[
"matplotlib.ticker.AutoMinorLocator",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
lv-cha/zipline-chinese | [
"86904cac4b6e928271f640910aa83675ce945b8b"
] | [
"zipline/protocol.py"
] | [
"#\n# Copyright 2013 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or... | [
[
"pandas.Series"
]
] |
sgzqc/wechat | [
"6589915c46b8f51d28dba61c6da9702821f5b47c"
] | [
"20211112/20211112.py"
] | [
"import os\r\nimport sys\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib import cm\r\nimport numpy as np\r\n\r\nplt.rcParams['figure.figsize'] = (16, 8)\r\n\r\n\r\ndef test1():\r\n # left data\r\n M, N = 16, 4\r\n dadosEmp = np.random.random((N, M)) * 0.9 + 0.1\r\n empilha = 100 * dadosEmp / np.su... | [
[
"numpy.random.normal",
"numpy.round_",
"matplotlib.cm.get_cmap",
"numpy.sum",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.arange",
"numpy.random.random",
"numpy.linspace"
]
] |
aess14/Cursos-Uniandes | [
"be016b25f2f49788235fbe91ec577fd16b9ad613"
] | [
"Metodos Computacionales Uniandes/Code/ejercicio_11.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\ndef histograma_compara(n_personas):\n n_gripas_normal = np.random.poisson(3.0, size=n_personas) \n n_gripas_medicamento = np.random.poisson(2.0, size=n_personas)\n\n n_sin_resultados = int(n_personas*0.25)\n n_gripas_medicamento[:n_sin_resul... | [
[
"numpy.max",
"matplotlib.pyplot.xlabel",
"numpy.random.poisson",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel"
]
] |
wxwisgood/keras | [
"ef082c1c026e63b4705dae47a7ef463527438d1a"
] | [
"Human_Pose_Estimation.py"
] | [
"import cv2 as cv\nimport numpy as np\n\n\ndataset = 'COCO'\nprotoc = \"pose_deploy_linevec.prototxt\"\nmodel = \"pose_iter_440000.caffemodel\"\n# dataset = 'MPI'\n# protoc = \"pose_deploy_linevec_faster_4_stages.prototxt\"\n# model = \"pose_iter_160000.caffemodel\"\ncap = cv.VideoCapture('D:\\WXW\\Video_Data\\\\vi... | [
[
"numpy.int32"
]
] |
Ecoent/biosteam | [
"f1371386d089df3aa8ce041175f210c0318c1fe0"
] | [
"build/lib/biosteam/units/_fermentation.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Aug 23 22:45:47 2018\n\n@author: yoelr\n\"\"\"\nimport numpy as np\nfrom ._hx import HXutility\nfrom .. import Unit\nfrom scipy.integrate import odeint\nfrom .decorators import cost\nfrom ._tank import MixTank\nfrom .design_tools import size_batch\nfrom thermosteam.r... | [
[
"numpy.linspace",
"scipy.integrate.odeint"
]
] |
abondar24/deepLearnPython | [
"9325cd18458f66f9d90ebd044fb4c8b2c6d8abc0"
] | [
"tensorflow/tf_multivariate_linear_regression.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.learn as skflow\nimport pandas as pd\n\nfrom sklearn.utils import shuffle\n\ndf = pd.read_csv('../data/boston.csv', header=0)\nprint(df.describe())\n\nf, ax1 = plt.subplots()\nplt.figure()\ny = df['MEDV']\n\nfo... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.Session",
"sklearn.utils.shuffle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"tensorflow.placeholder",
"matplotlib.pyplot.tight_layout",
"tensorflow.name_scope",
"tensorflow.pow",
... |
toxtli/BlurbGenreCollection-HMC | [
"c9d9e7cb31889422d84180a0a90c904f619be12e"
] | [
"code/capsulelayers.py"
] | [
"\"\"\"\nAuthor: Xifeng Guo, E-mail: `guoxifeng1990@163.com`, Github: `https://github.com/XifengGuo/CapsNet-Keras`\n\"\"\"\n\nimport keras.backend as K\nimport tensorflow as tf\nfrom keras.constraints import max_norm\nfrom keras import initializers, layers\ntf_session = K.get_session()\nimport sys\n\n\nclass Length... | [
[
"tensorflow.nn.softmax",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.expand_dims"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.