repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
manuelciosici/transformers | [
"4a419d4995111c22d6842ee1bcd2d3f500150845"
] | [
"tests/models/t5/test_modeling_flax_t5.py"
] | [
"# coding=utf-8\n# Copyright 2021 Google T5 Authors and HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n... | [
[
"numpy.array",
"numpy.roll",
"numpy.abs",
"numpy.arange"
]
] |
jorisvandenbossche/mne-python | [
"0c4db6f8ef12999d119085aa7c496cadb32411bd"
] | [
"mne/preprocessing/tests/test_ica.py"
] | [
"# Author: Denis Engemann <denis.engemann@gmail.com>\n# Alexandre Gramfort <alexandre.gramfort@inria.fr>\n#\n# License: BSD (3-clause)\n\nfrom itertools import product\nimport os\nimport os.path as op\nfrom unittest import SkipTest\n\nimport pytest\nimport numpy as np\nfrom numpy.testing import (assert_arra... | [
[
"numpy.testing.assert_allclose",
"numpy.dot",
"numpy.where",
"numpy.concatenate",
"numpy.max",
"numpy.linalg.norm",
"scipy.linalg.svdvals",
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.prod",
"numpy.arange",
"numpy.append",
"numpy.int32",
"... |
maxorange/surface-to-structure | [
"b7227ea34a6ebc358d491eea70f0fa6cca400265"
] | [
"ops.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nclass Model(object):\n\n def __init__(self, vars):\n self.saver = tf.train.Saver(vars)\n\n def session(self, sess):\n if sess is not None:\n self.sess = sess\n else:\n config_proto = tf.ConfigProto()\n config... | [
[
"tensorflow.exp",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.constant_initializer",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.nn.conv3d_transpose",
"tensorflow.control_dependencies",
"tensorflo... |
gregmaya/Riyadh_modeling | [
"9ec048ccc25ad1f69ea76e963a8ada2a95f3c254"
] | [
"Syntax_functions.py"
] | [
"import geopandas as gpd\nimport pandas as pd\nfrom numpy import log\n\ndef Syntax_normalizer(df):\n \"\"\"\n This function returns normalised Choice and Integration values based on Space Syntax literature.\n \n NaCH = logCH+1/logTD+3\n NaIN = NC^1.2/TD\n \n \"\"\"\n #extracting the useful ... | [
[
"pandas.DataFrame",
"numpy.log"
]
] |
SKholkin/mmdetection | [
"52c7616efaeb7375ded8894a26d1fa729e80bed5"
] | [
"mmdet/apis/train.py"
] | [
"import warnings\nimport numpy as np\nimport random\nimport torch\nfrom copy import copy\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import (HOOKS, DistSamplerSeedHook, EpochBasedRunner, LoggerHook,\n Fp16OptimizerHook, OptimizerHook, build_optimize... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.cuda.current_device",
"torch.manual_seed",
"torch.cuda.is_available"
]
] |
daijucug/Pytorch-person-reid-imglevel-videolevel | [
"b48bc25f21fa10705b12838883f9a4aa257d4ffe"
] | [
"train_img_model_cent.py"
] | [
"from __future__ import print_function, absolute_import\nimport os\nimport sys\nimport time\nimport datetime\nimport argparse\nimport os.path as osp\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nfrom torch.utils.data import DataLoader\nfrom torch.optim import lr_s... | [
[
"torch.cat",
"torch.optim.lr_scheduler.StepLR",
"torch.cuda.manual_seed_all",
"numpy.asarray",
"torch.no_grad",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel",
"torch.pow"
]
] |
shyamalschandra/CNTK | [
"0e7a6cd4cc174eab28eaf2ffc660c6380b9e4e2d"
] | [
"Examples/Image/Detection/utils/nms_wrapper.py"
] | [
"# Copyright (c) Microsoft. All rights reserved.\n\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\nimport numpy as np\nfrom utils.cython_modules.cpu_nms import cpu_nms\ntr... | [
[
"numpy.where",
"numpy.array"
]
] |
egeersu/Multihop-GNN | [
"1638eb2408030004112b8c19d4a2f68571eb4011",
"1638eb2408030004112b8c19d4a2f68571eb4011"
] | [
"v4_pos+baseline/find_remove_sample.py",
"v3_baseline/dataset.py"
] | [
"# coding: utf-8\n\nimport scipy\nimport json\nimport re\nimport allennlp\nfrom allennlp.predictors.predictor import Predictor\nfrom allennlp.commands.elmo import ElmoEmbedder\nfrom torch.nn.utils.rnn import pad_sequence\n\n\nfrom spacy.lang.en import English\nimport numpy as np\n# import tensorflow as tf\nimport o... | [
[
"torch.tensor"
],
[
"numpy.array",
"torch.stack",
"torch.tensor"
]
] |
Naman1997/Raspberry_smartwatch | [
"fc883b53ef843dfb8e34da46a35fa88c11e5fa0a"
] | [
"step_counter_peaks.py"
] | [
"import matplotlib.pyplot as plt\nfrom scipy.misc import electrocardiogram\nfrom scipy.signal import find_peaks\nimport numpy as np\n\n#*****************************Writing to File**************************\nwith open(\"accelerometer.txt\", \"r\") as filestream:\n with open(\"answers.txt\", \"w\") as filestreamt... | [
[
"numpy.zeros_like",
"scipy.misc.electrocardiogram",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"scipy.signal.find_peaks"
]
] |
ignorama/transient_rotordynamic | [
"1aaa61f35e19311a499589361c1bb79a6b8c7781"
] | [
"run_Jeffcott_journal_bearing_floating_ring_short.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nrun-up with constant rotational acceleration \nof a Jeffcott rotor in floating ring journal bearings\n(analytical short bearing solution)\n\nCreated on Jan 25 2022\n\n@author: Gerrit Nowald\n\"\"\"\n\nimport rotordynamic as rd\n\nimport numpy as np\nimport matplotlib.pyplot as plt\... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylim",
"numpy.shape",
"matp... |
anjan4136/Histogram_equalization | [
"2986cf77d7699066b7d7219b4288de98ba04e745"
] | [
"python_code.py"
] | [
"from matplotlib import pyplot as plt #importing pyplot library from matplotlib, one use of this is it is used here for plotting the images\nimport numpy as np # It is used for numerical calculations as matrix calculations , data structures \nimport cv2 ... | [
[
"matplotlib.pyplot.show"
]
] |
dkoslicki/NCATS | [
"5d8e38d5868d830d8f8c215b8c649e3979ca03fb"
] | [
"code/reasoningtool/Q1Solution.py"
] | [
"# Solution to question 1, this assumes the neo4j network has already been populated with the relevant data\nimport numpy as np\nnp.warnings.filterwarnings('ignore')\nfrom collections import namedtuple\n#from neo4j.v1 import GraphDatabase, basic_auth\nimport os\nimport Q1Utils\nimport argparse\nimport sys\nimport j... | [
[
"numpy.warnings.filterwarnings"
]
] |
hito1280/flask_scheduler_app_open | [
"ff2644b6f6a1f9d6b1831ea683d9bd1663c27443"
] | [
"apps/scheduler/views.py"
] | [
"import os\nimport tempfile\nimport zipfile\nfrom datetime import datetime\n\nimport pandas as pd\nfrom apps.app import db\nfrom apps.crud.models import User\nfrom apps.scheduler.models import ScheduleLists, Schedules\nfrom apps.scheduler.problem_solving import KandGProblem\nfrom apps.scheduler.read_df import csvto... | [
[
"pandas.DataFrame",
"pandas.read_html"
]
] |
judajake/kwiver | [
"5e2fdba15a8f3362c811f004bd6c309df54d470d"
] | [
"vital/bindings/python/vital/util/array_wrapping.py"
] | [
"\"\"\"\nckwg +31\nCopyright 2016 by Kitware, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of co... | [
[
"numpy.ndarray.__new__",
"numpy.asarray"
]
] |
SyangZ007/deeplabv3-plus-keras | [
"ebbb1f155917807fb7fc70a9fde20593817cd4b2"
] | [
"deeplab.py"
] | [
"import colorsys\r\nimport copy\r\nimport time\r\n\r\nimport cv2\r\nimport numpy as np\r\nfrom PIL import Image\r\n\r\nfrom nets.deeplab import Deeplabv3\r\nfrom utils.utils import cvtColor, preprocess_input, resize_image\r\n\r\n\r\n#----------------------------------------------------------------------------------... | [
[
"numpy.array",
"numpy.uint8",
"numpy.reshape",
"numpy.expand_dims"
]
] |
yifan-you-37/omnihang | [
"c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2",
"c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2"
] | [
"src/utils/data_helper.py",
"src/scripts/normalize_obj.py"
] | [
"import pandas as pd\nimport numpy as np\nimport os\nimport zipfile\nimport glob\ndef rep_int(s):\n\ttry: \n\t\tint(s)\n\t\treturn True\n\texcept ValueError:\n\t\treturn False\n\ndef mkdir_if_not(folder_dir, recurse=False):\n\tif not os.path.exists(folder_dir):\n\t\tif not recurse:\n\t\t\tos.mkdir(folder_dir)\n\t\t... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.ones",
"numpy.load",
"numpy.mean",
"numpy.unravel_index",
"numpy.append",
"numpy.random.random",
"pandas.read_csv"
],
[
"scipy.spatial.transform.Rotation.from_euler"
]
] |
sbrugman/larq | [
"b080d9452847e9403b3d2fafd9425b488be71567"
] | [
"larq/constraints_test.py"
] | [
"import pytest\nimport numpy as np\nimport tensorflow as tf\nimport larq as lq\n\n\n@pytest.mark.parametrize(\"name\", [\"weight_clip\"])\ndef test_serialization(name):\n fn = tf.keras.constraints.get(name)\n ref_fn = getattr(lq.constraints, name)()\n assert fn.__class__ == ref_fn.__class__\n config = t... | [
[
"tensorflow.keras.backend.variable",
"tensorflow.keras.constraints.deserialize",
"tensorflow.keras.backend.eval",
"numpy.random.uniform",
"tensorflow.keras.constraints.get",
"numpy.clip",
"tensorflow.keras.constraints.serialize"
]
] |
iaroslav-ai/learn-to-learn | [
"3a12377d38708de2566fdc3bf2fe8dccf4a5a29a"
] | [
"mnist_example/visualize_data.py"
] | [
"import data_loader as dl\nimport matplotlib.pyplot as plt\n\na = dl.get_image(77)\n\nplt.imshow(a)\nplt.show()"
] | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
im73/MAE_INformer | [
"b585a21dd1cc3997ff9feba06d9862cc864848f8"
] | [
"models/model.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom utils.masking import TriangularCausalMask, ProbMask\r\nfrom models.encoder import Encoder, EncoderLayer, ConvLayer, EncoderStack\r\nfrom models.decoder import Decoder, DecoderLayer\r\nfrom models.attn import FullAttention, ProbAtt... | [
[
"torch.nn.Linear",
"torch.device",
"torch.nn.LayerNorm",
"torch.nn.init.constant_",
"torch.nn.init.xavier_uniform_"
]
] |
marcocannici/scs | [
"799a4f7daed4294cd98c73df71676195e6c63de4"
] | [
"tests/python-playground/least_squares_1.py"
] | [
"# This is automatically-generated code.\n\n# Uses the jinja2 library for templating.\n\n\nimport cvxpy as cp\nimport numpy as np\nimport scipy as sp\n\n# setup\n\nproblemID = \"least_squares_1\"\nprob = None\nopt_val = None\n\n\n\n\n# Variable declarations\n\nimport scipy.sparse as sps\n\nn = 20\nm = 30\nnp.random... | [
[
"numpy.random.seed",
"numpy.sum",
"numpy.random.randn"
]
] |
saedsaleh/statsmodels | [
"7df5291f04f406f127242736008f72cb4a579262"
] | [
"statsmodels/iolib/summary2.py"
] | [
"from statsmodels.compat.python import (lrange, iterkeys, iteritems, lzip,\n reduce, itervalues, zip, string_types,\n range)\nfrom statsmodels.compat.collections import OrderedDict\nimport numpy as np\nimport pandas as pd\nimport datetime\n... | [
[
"numpy.array",
"pandas.DataFrame",
"numpy.split",
"numpy.unique",
"numpy.hstack",
"numpy.vstack"
]
] |
masoudML/Spatio_Temporal_Adversarial_VSR | [
"e49fe9c4287d8e9f24c330e02ade24e479d121d3",
"e49fe9c4287d8e9f24c330e02ade24e479d121d3"
] | [
"dataset.py",
"main_deeper.py"
] | [
"import torch.utils.data as data\nimport torch\nimport numpy as np\nimport os\nfrom os import listdir\nfrom os.path import join\nfrom PIL import Image, ImageOps\nimport random\nimport pyflow\nfrom skimage import img_as_float\nfrom random import randrange\nimport os.path\n\ndef is_image_file(filename):\n return a... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.max",
"numpy.min"
],
[
"torch.cat",
"torch.cuda.manual_seed",
"torch.ones",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel",
"torch.autograd.Variable",
"torch.manual_seed",
"torch.utils.data.DataLoa... |
tengqi159/tpu | [
"4528ca48dc02ffdde564cfa55e8118d89d43a1be"
] | [
"models/official/detection/executor/tpu_executor.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 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/... | [
[
"tensorflow.compat.v1.distribute.cluster_resolver.TPUClusterResolver",
"tensorflow.compat.v1.estimator.RunConfig",
"tensorflow.compat.v1.gfile.MakeDirs",
"tensorflow.compat.v1.config.experimental.list_physical_devices",
"tensorflow.compat.v1.Session.reset",
"tensorflow.compat.v1.logging.in... |
msakai/onnx-chainer | [
"fcab3530cea7a1130aa9a43aa7de6683ee354d11"
] | [
"tests/test_export_testcase.py"
] | [
"import os\n\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\nimport numpy as np\nimport onnx\nimport pytest\n\nfrom onnx_chainer import export_testcase\n\n\n@pytest.fixture(scope='function')\ndef model():\n return chainer.Sequential(\n L.Convolution2D(None, 16, 5, 1, 2),\n ... | [
[
"numpy.zeros"
]
] |
csams/dowut | [
"cdbcb9ee78125f364ede861c83fa9c332de868ff"
] | [
"dowut/vis.py"
] | [
"import argparse\nimport json\nimport os\nimport re\nfrom glob import glob\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\n\nsns.set_style(\"dark\")\n\n\ndef parse_args():\n description = \"\"\"Measure how you spend time by tracking key presses and\n changes to window focus or ... | [
[
"pandas.concat",
"pandas.Grouper",
"pandas.date_range",
"matplotlib.pyplot.subplots",
"pandas.Series",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
zpf1452233/yolov4-keras | [
"1c895592a750d3e206c09a09d185c0f9b64282c6"
] | [
"train.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\nimport keras.backend as K\r\nfrom keras.layers import Input, Lambda\r\nfrom keras.models import Model\r\nfrom keras.optimizers import Adam\r\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping\r\nfrom nets.yolo4 import yolo_bo... | [
[
"numpy.array",
"numpy.zeros",
"numpy.minimum",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.argmax",
"numpy.floor",
"numpy.expand_dims",
"numpy.maximum"
]
] |
mdekstrand/csr | [
"03fde2d8c3cb7eb330028f34765ff2a06f849631"
] | [
"csr/constructors.py"
] | [
"\"\"\"\nNumba-accessible constructors for CSRs.\n\"\"\"\n\nfrom .csr import CSR\n\nimport numpy as np\nfrom numba import njit\n\n\n@njit\ndef create_empty(nrows, ncols):\n \"\"\"\n Create an empty CSR of the specified size.\n\n .. note:: This function can be used from Numba.\n \"\"\"\n nrows = np.in... | [
[
"numpy.int32",
"numpy.full",
"numpy.sum",
"numpy.zeros"
]
] |
xmartlabs/caffe-tensorflow | [
"4618f89c8ae60cffbc0ffd991a8cb984acc3a164"
] | [
"caffeflow/convert.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nimport numpy as np\nimport argparse\nfrom caffeflow import KaffeError, print_stderr\nfrom caffeflow.tensorflow import TensorFlowTransformer\n\n\ndef fatal_error(msg):\n print_stderr(msg)\n ... | [
[
"numpy.save"
]
] |
hello-sea/DeepLearning_Wavelet-LSTM | [
"1606c16005a5338333b4943f782f57311c6b5e49",
"1606c16005a5338333b4943f782f57311c6b5e49"
] | [
"_bak/v0.5.1/Controller/Algorithm_CWT.py",
"_bak/study_tf_lstm/StudyTensroFlow/studyTF_LSTM.2.py"
] | [
"# -*- coding: utf-8 -*-\n\n''' ***** 计算包 ***** '''\nimport numpy as np\nimport pywt #小波分析包\n\nfrom scipy import signal\nfrom sklearn import preprocessing \n\nfrom sklearn.preprocessing.data import minmax_scale # 0-1 标准化\n\nfrom wavelets import Morlet,cwt, WaveletAnalysis\n# https://github.com/aaren/wavelets\n# pip... | [
[
"numpy.array",
"numpy.exp",
"numpy.arange",
"scipy.signal.cwt",
"numpy.abs",
"numpy.transpose",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace",
"sklearn.preprocessing.data.minmax_scale"
],
[
"tensorflow.set_random_seed",
"tensorflow.nn.softmax_cross_ent... |
hsulab/DailyScripts | [
"26b03cfb721fd66f39c86df50d2ec5866e651d6e"
] | [
"vasp/enmd/inivel-new.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport argparse\n\nimport numpy as np\n\ndot = np.dot\nnorm = np.linalg.norm\n\nmass_dict = {'H': 1.0, 'C': 12.0, 'O': 16.0, \\\n 'Pt': 195.0, 'Ag': 107.9}\n\ndef read_poscar(poscar='POSCAR', format='vasp5'):\n \"\"\"read POSCAR\"\"\"\n with open(posc... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.sqrt"
]
] |
Mrityunjay2668/ObjectDetection | [
"d3582311e5cf563c4f2ba7fdd87d8f56b60cccb1"
] | [
"utils/writer.py"
] | [
"from torch.utils.tensorboard import SummaryWriter\n\n\ndef log(*args):\n iteration, loss, accuracy = args\n writer = SummaryWriter()\n writer.add_scalar(\"Loss\", loss, iteration)\n writer.add_scalar(\"Accuracy\", accuracy, iteration)\n\n"
] | [
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
CJuanvip/rl-pricing | [
"dd7092f854ac26b0a6bd760df9b5da8fda6c2d87"
] | [
"agent.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.tensorboard import SummaryWriter\nimport gym\nimport random\nfrom collections import deque, namedtuple\nimport logging\nfrom tqdm import tqdm\nimport argparse\nimport os\nimport t... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"numpy.mean",
"torch.nn.SmoothL1Loss",
"torch.load",
"torch.get_rng_state",
"torch.manual_seed",
"torch.device",
"numpy.array",
"torch.max",
"torch.save",
"torch.nn.ReLU",
"numpy.clip",
"numpy.random.set_state",
... |
ML-KULeuven/soccermix | [
"9f23c98b8e20b5cfeb569a43f8a2b110bf50dfd2"
] | [
"vis.py"
] | [
"from scipy import linalg\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport matplotsoccer as mps\nimport numpy as np\nimport math\n\n\ndef dual_axes(figsize=4):\n fig, axs = plt.subplots(1, 2)\n fig.set_size_inches((figsize * 3, figsize))\n return axs[0], axs[1]\n\n\ndef loc_angle_axes(fig... | [
[
"scipy.linalg.eigh",
"matplotlib.patches.Ellipse",
"numpy.apply_along_axis",
"matplotlib.pyplot.gcf",
"numpy.cos",
"scipy.spatial.Delaunay",
"matplotlib.colors.DivergingNorm",
"numpy.max",
"numpy.sin",
"numpy.nan_to_num",
"matplotlib.pyplot.savefig",
"matplotlib.pyp... |
egtaonline/GameAnalysis | [
"32be1a6b9f616e794362639367ad64360f3e118f"
] | [
"test/test_matgame.py"
] | [
"\"\"\"Test matrix game\"\"\"\nimport itertools\nimport json\nimport random\n\nimport numpy as np\nimport numpy.random as rand\nimport pytest\n\nfrom gameanalysis import gamegen\nfrom gameanalysis import matgame\nfrom gameanalysis import paygame\nfrom gameanalysis import rsgame\nfrom gameanalysis import utils\n\n\n... | [
[
"numpy.zeros",
"numpy.split",
"numpy.ma.masked_array",
"numpy.allclose",
"numpy.cumsum",
"numpy.all",
"numpy.random.random"
]
] |
kanav99/EzPC | [
"094e75111d00883dd90ef328bd47a7c0a1eb689f"
] | [
"Athos/tests/tf/unittests/test_convolution.py"
] | [
"\"\"\"\n\nAuthors: Pratik Bhatu.\n\nCopyright:\nCopyright (c) 2021 Microsoft Research\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the... | [
[
"tensorflow.as_dtype",
"tensorflow.Graph",
"numpy.random.randn",
"tensorflow.compat.v1.Session",
"tensorflow.constant"
]
] |
dangilman/wobbles | [
"6719bfaabbbe475e4213fd5272375e381083c0b9"
] | [
"wobbles/sampling/prior_manager.py"
] | [
"from scipy.stats import multivariate_normal\nimport numpy as np\n\n\nclass PriorBase(object):\n\n def __init__(self, param_prior):\n\n \"\"\"\n Format ['param_name', 'prior_type', [arg1, arg2], positive_definite_bool, under_hood_bool]\n\n \"\"\"\n\n self.param_prior = param_prior\n\n... | [
[
"numpy.random.normal",
"scipy.stats.multivariate_normal",
"numpy.random.uniform"
]
] |
Maltimore/garage | [
"a3f44b37eeddca37d157766a9a72e8772f104bcd",
"a3f44b37eeddca37d157766a9a72e8772f104bcd",
"a3f44b37eeddca37d157766a9a72e8772f104bcd",
"a3f44b37eeddca37d157766a9a72e8772f104bcd"
] | [
"src/garage/tf/baselines/gaussian_mlp_baseline.py",
"src/garage/np/baselines/zero_baseline.py",
"tests/fixtures/regressors/simple_mlp_regressor.py",
"src/garage/sampler/vec_env_executor.py"
] | [
"\"\"\"A value function (baseline) based on a GaussianMLP model.\"\"\"\nimport numpy as np\n\nfrom garage.np.baselines import Baseline\nfrom garage.tf.regressors import GaussianMLPRegressor\n\n\nclass GaussianMLPBaseline(Baseline):\n \"\"\"A value function using Gaussian MLP network.\"\"\"\n\n def __init__(\n... | [
[
"numpy.concatenate"
],
[
"numpy.zeros_like"
],
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.get_default_session",
"tensorflow.compat.v1.variable_scope"
],
[
"numpy.asarray"
]
] |
Suicoleiro/bokeh | [
"a212acdf091a7a4df639fa9d443be6ade0018039"
] | [
"examples/models/file/daylight.py"
] | [
"import datetime as dt\nfrom time import mktime\n\nimport numpy as np\n\nfrom bokeh.core.properties import value\nfrom bokeh.document import Document\nfrom bokeh.embed import file_html\nfrom bokeh.models import (ColumnDataSource, DatetimeAxis, DatetimeTickFormatter,\n FixedTicker, Legend, L... | [
[
"numpy.concatenate"
]
] |
rushkock/insta | [
"6465b6164d5bce1f6cab5b4b44ac3f612e2f70d2"
] | [
"400_logreg_perma_user_images.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 10 19:51:52 2019\n\n@author: hduser\n\"\"\"\n\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom ma... | [
[
"pandas.read_pickle",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"pandas.get_dummies"
]
] |
CircuitLaunch/colab-reachy-ros | [
"f54414ae181beb60a0435611227d77b3a549339e"
] | [
"src/mask_detection/detect_mask.py"
] | [
"# Adapted from\n# https://www.pyimagesearch.com/2020/05/04/covid-19-face-mask-detector-with-opencv-keras-tensorflow-and-deep-learning/\n\n# Copyright (c) 2020 PyImageSearch.com\n#\n# SIMPLE VERSION\n# Feel free to use this code for your own projects, whether they are\n# purely educational, for fun, or for profit. ... | [
[
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input"
]
] |
wzqwwq/IsaacGymEnvs | [
"0b94bb249a079e7c02a77188faea97e5fc30191d"
] | [
"isaacgymenvs/tasks/dual_franka.py"
] | [
"import math\nimport numpy as np\nimport os\nimport torch\nfrom torch import Tensor\nimport random\nfrom isaacgym import gymutil, gymtorch, gymapi\nfrom isaacgym.torch_utils import *\nfrom tasks.base.vec_task import VecTask\nfrom typing import Dict, List, Tuple, Union\n\nshelf_as_box = False\nspoon_as_box = False\n... | [
[
"torch.zeros",
"torch.cat",
"numpy.array",
"torch.acos",
"torch.arange",
"torch.norm",
"torch.sign",
"torch.abs",
"torch.tensor",
"torch.ones_like",
"numpy.sqrt",
"torch.zeros_like",
"torch.where",
"torch.sum"
]
] |
furkankurtoglu/whole-well | [
"cbafce776256f1a78ca52141a365f4690601c339",
"cbafce776256f1a78ca52141a365f4690601c339"
] | [
"Transfer_Region/py_analysis/analysis/anim_svg_edges.py",
"Transfer_Region/py_analysis/analysis/cell_tracker_movie.py"
] | [
"#\n# anim_svg.py: render/animate PhysiCell .svg files, using left/right arrows on keyboard\n#\n# Usage:\n# python anim_svg.py <show_nucleus start_index axes_min axes_max>\n# i.e., the arguments <...> are optional and have defaults.\n# \n# Keyboard arrows: right/left arrows will single step forward/backward; u... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.xlim",
"numpy.broadcast",
"matplotlib.colors.to_rgb",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.draw_if_interactive",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.f... |
zyxue/berkeley-cs294-hw | [
"30d50c7c46c106dbfd12d78e561eb2410be1e6d1"
] | [
"hw2/train_pg.deprecated.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport gym, roboschool\nimport logz\nimport os\nimport time\nimport inspect\nfrom multiprocessing import Process\n\nimport utils as U\n\n\n##################################################\n# Utilities\n##################################################\ndef build_mlp(... | [
[
"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... |
tsteternlieb/CV | [
"e149767a5c131b0f78f7390f42eff204ff649815"
] | [
"transformer_model.py"
] | [
"\"\"\"\nMy Transformer implementations\n\"\"\"\n\n\nimport torch\nfrom torch import nn\nimport math\n\n\nclass DotProdAttention(nn.Module):\n \"\"\"calculating dot product self attention\"\"\"\n\n def __init__(self, in_dim, out_dim):\n super(DotProdAttention, self).__init__()\n self.key = nn.Li... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.sqrt",
"torch.square",
"torch.softmax",
"torch.ones",
"torch.nn.ReLU",
"torch.concat",
"torch.matmul",
"torch.mean"
]
] |
WhenTheyCry96/chainerrl | [
"0f32aae2855dbb6288ae628be6271739ced6c42c"
] | [
"examples/ale/train_dqn_ale.py"
] | [
"from __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import\nfrom builtins import * # NOQA\nfrom future import standard_library\nstandard_library.install_aliases() # NOQA\nimport argparse\nimport os\n\nimport chainer\nfro... | [
[
"numpy.random.randint",
"numpy.asarray",
"numpy.zeros"
]
] |
alopezrivera/torque_limited_simple_pendulum | [
"2164a41d65c16743ba260a79a04a04cdd72c3903"
] | [
"software/python/simple_pendulum/model/pendulum_plant.py"
] | [
"\"\"\"\nPendulum Plant\n==============\n\"\"\"\n\n\nimport numpy as np\nimport yaml\n\n\nclass PendulumPlant:\n def __init__(self, mass=1.0, length=0.5, damping=0.1, gravity=9.81,\n coulomb_fric=0.0, inertia=None, torque_limit=np.inf):\n\n \"\"\"\n The PendulumPlant class contains ... | [
[
"numpy.sin",
"numpy.asarray",
"numpy.zeros",
"numpy.sign",
"numpy.arctan2",
"numpy.cos"
]
] |
xiangruhuang/mmcv | [
"30aa22c6dd9d53822c5a72231021f33b1ab4b633"
] | [
"mmcv/runner/epoch_based_runner.py"
] | [
"# Copyright (c) Open-MMLab. All rights reserved.\nimport os.path as osp\nimport platform\nimport shutil\nimport time\nimport warnings\n\nimport torch\n\nimport mmcv\nfrom .base_runner import BaseRunner\nfrom .builder import RUNNERS\nfrom .checkpoint import save_checkpoint\nfrom .utils import get_host_info\n\n@RUNN... | [
[
"torch.no_grad"
]
] |
realdealneil/realdealrobotics_vision | [
"e4ef37452ac377c2d56366bf2525ee8549399108"
] | [
"submission/generate_results.py"
] | [
"# This script is to be filled by the team members. \n# Import necessary libraries\n# Load libraries\nimport json\nimport cv2\nimport numpy as np\n\n# Implement a function that takes an image as an input, performs any \n# preprocessing steps and outputs a list of bounding box detections and \n# associated confidenc... | [
[
"numpy.array",
"numpy.argmax"
]
] |
MisterZhouZhou/python3demo | [
"da0b6771cc12e8e1066a115c3f72a90c100108ac"
] | [
"drawline/drawling1.py"
] | [
"'''\n 利用matplotlib绘制简单的坐标图\n'''\nimport matplotlib.pyplot as plt\n\n# 绘制折线图\ninput_values = [1,2,3,4,5]\nsquares = [1,4,9,16,25]\n# 给plot同时提供输入值和输出值\nplt.plot(input_values, squares, linewidth=5)\n\n# 设置图标标题,并给坐标轴加上标签\nplt.title(\"Square Numbers\",fontsize=24)\nplt.xlabel(\"Value\", fontsize=14)\nplt.ylabel(\"Squa... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
BenoitCorsini/music-patterns | [
"372b8ddf53f8e0100e79e1dcb6f8f6d783c424cb"
] | [
"statistics.py"
] | [
"import argparse\nimport os\nimport os.path as osp\nimport json\nimport sys\nimport random\nfrom time import time\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom collections import Counter\n\nfrom utils import time_to_string, basic_stats\n\n\nMEAN_COLOUR = 'navy'\nSTD_COLOUR = 'royalblue'\nCENTER_COLOU... | [
[
"numpy.max",
"numpy.array",
"matplotlib.pyplot.errorbar",
"numpy.sum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.close",
"numpy.std",
"numpy.min",
"matplotlib.pyp... |
apatlpo/panel | [
"560545f5f8e62ce82b24e7aa39a8f09101c9a65f"
] | [
"panel/pane/vtk/synchronizable_deserializer.py"
] | [
"import json\nimport zipfile\nimport vtk\nimport re\nimport struct\n\nfrom .synchronizable_serializer import arrayTypesMapping\n\n\nMETHODS_RENAME = {\n \"AddTexture\": \"SetTexture\",\n \"SetUseGradientOpacity\": None,\n \"SetRGBTransferFunction\": \"SetColor\",\n}\nWRAP_ID_RE = re.compile(r\"instance:\\$... | [
[
"numpy.frombuffer"
]
] |
ashawkey/NotVeryFastNeRF | [
"65129c225d1d26b21843eb3d05d7b0f56c6e221b"
] | [
"fastnerf/datasets/llff.py"
] | [
"import torch\nfrom torch.utils.data import Dataset\nimport glob\nimport numpy as np\nimport os\nfrom PIL import Image\nfrom torchvision import transforms as T\n\nfrom .ray_utils import *\n\n\ndef normalize(v):\n \"\"\"Normalize a vector.\"\"\"\n return v/np.linalg.norm(v)\n\n\ndef average_poses(poses):\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"torch.cat",
"numpy.sin",
"numpy.argmin",
"numpy.linalg.inv",
"torch.FloatTensor",
"numpy.eye",
"numpy.stack",
"numpy.cos",
"torch.ones_like",
"numpy.abs",
"numpy.linspace",
"numpy.cross"
]
] |
NorianGuernine/AES-python | [
"0dd2327289cab0487f8bdb459b61f173b8164c67"
] | [
"src/Dechiffrement_AES.py"
] | [
"import numpy as np\nfrom CF_Multi import CF_Mult9, CF_Mult11, CF_Mult13, CF_Mult14\nfrom Operation_cle import AddRoundKey, KeyExpansion\nfrom MiseEnForme import *\nfrom Matrices import InvSbox, Sbox, Rcon\n\n\ndef InvSubBytes(state,InvSbox): #Inversion du Subbytes pour déchiffrement AES\n for i in range(0,state... | [
[
"numpy.roll"
]
] |
smlindauer/python-sasctl | [
"e059647e1e35684591505be3838e8dbcfcc06ca9"
] | [
"tests/unit/test_tasks.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n#\n# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n\nimport pytest\nfrom six.moves import mock\n\nfrom sasctl.core import RestObj\nfrom sasctl._services.model_repository import ModelRepository\n\ndef test... | [
[
"sklearn.linear_model.LinearRegression",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.svm.SVC",
"sklearn.linear_model.LogisticRegression",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.ensemble.GradientBoostingClassifier"
]
] |
aarpit1010/greyatom-python-for-data-science | [
"e5d5a087f4237c5d234db849ada672f2d71d8425"
] | [
"data_wrangling_pandas/code.py"
] | [
"# --------------\nimport numpy as np\r\nimport pandas as pd\r\nfrom scipy.stats import mode \r\n\r\nbank = pd.read_csv(path)\r\n \r\ncategorical_var=bank.select_dtypes(include='object')\r\nprint(\"Categorical variables : \",categorical_var)\r\n\r\nnumerical_var=bank.select_dtypes(include='number')\r\nprint(\"Nu... | [
[
"pandas.read_csv"
]
] |
ConorHogan/Programming_Scripting_Projects | [
"fd45c7920c74b93b10615ae70f2e9e4ddbee0af5"
] | [
"Old_Attempts/Import_data.py"
] | [
"#import dataset from git file using pandas\n#reference: https://stackoverflow.com/questions/23464138/downloading-and-accessing-data-from-github-python\n\nimport pandas as pd\nimport numpy as np\nurl = 'https://raw.githubusercontent.com/ConorHogan/Programming_Scripting_Projects/master/Iris_Data.csv'\ndf = pd.read_c... | [
[
"pandas.read_csv"
]
] |
JoHof/MONAI | [
"70483b648fba92f0a8346e53dc14d686e56120a3",
"70483b648fba92f0a8346e53dc14d686e56120a3"
] | [
"monai/networks/nets/segresnet.py",
"monai/networks/blocks/dynunet_block.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"torch.nn.Linear",
"torch.nn.Identity",
"torch.nn.functional.softplus",
"torch.nn.ModuleList",
"torch.nn.functional.mse_loss",
"torch.randn_like",
"numpy.prod",
"torch.log",
"torch.mean"
],
[
"numpy.all",
"torch.cat",
"numpy.atleast_1d",
"numpy.min"
]
] |
wooks527/mobilenetv2-pytorch | [
"c6505b01a0374cf77504fee4ac34a71a5f8c13e0"
] | [
"eval.py"
] | [
"import argparse\nimport time\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\n\nfrom models.mobilenetv2 import MobileNetV2\n\ndef load_data(data_dir):\n '''Load dataset.\n \n Args:\n data_dir (str): dataset path to load dataset\n ... | [
[
"torch.max",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"torch.sum"
]
] |
Teva/scikits.image | [
"12669d62e699313ca0f73de1b211bf438f4efb0c",
"12669d62e699313ca0f73de1b211bf438f4efb0c"
] | [
"skimage/io/tests/test_fits.py",
"skimage/transform/finite_radon_transform.py"
] | [
"import os.path\nimport numpy as np\nfrom numpy.testing import run_module_suite\nfrom numpy.testing.decorators import skipif\nimport skimage.io as io\nfrom skimage import data_dir\n\n\npyfits_available = True\n\ntry:\n import pyfits\nexcept ImportError:\n pyfits_available = False\nelse:\n import skimage.io... | [
[
"numpy.all",
"numpy.testing.decorators.skipif",
"numpy.testing.run_module_suite"
],
[
"numpy.empty",
"numpy.roll"
]
] |
mikegpl/benchmike | [
"7663462f8abcaf2c4f3ef73c96c8a2cf23ffc122"
] | [
"benchmike/bigoestimator.py"
] | [
"\"\"\"Module for estimating code time complexity based on TOE measurements and\npresenting them in RiGCzd form\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom inspect import getsourcelines\n\nfrom benchmike import complexities as cp\nfrom benchmike.customlogger import CustomLogger, LOGGER_NAME\n\n... | [
[
"matplotlib.pyplot.show",
"numpy.linalg.lstsq",
"matplotlib.pyplot.legend"
]
] |
THINK2TRY/cogdl | [
"e5d163ec964144ded595565e829a16011295d10e"
] | [
"tests/tasks/test_node_classification.py"
] | [
"import torch\nimport torch.nn.functional as F\n\nfrom cogdl.options import get_default_args\nfrom cogdl.experiments import train\n\n\ncuda_available = torch.cuda.is_available()\ndefault_dict = {\n \"hidden_size\": 16,\n \"dropout\": 0.5,\n \"patience\": 2,\n \"epochs\": 3,\n \"sampler\": \"none\",\n... | [
[
"torch.cuda.is_available"
]
] |
zijian-hu/pytorchvideo | [
"51589b100437af2285c56ce2ccc7ccecb7f9b18b"
] | [
"tests/test_models_vision_transformers.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport unittest\n\nimport torch\nfrom pytorchvideo.models.vision_transformers import (\n create_multiscale_vision_transformers,\n)\n\n\nclass TestVisionTransformers(unittest.TestCase):\n def setUp(self):\n super().setUp()\n ... | [
[
"torch.manual_seed",
"torch.rand"
]
] |
Existever/Pysot | [
"41f009904c81422ae71e83aab5655631d5c4b0d8",
"41f009904c81422ae71e83aab5655631d5c4b0d8"
] | [
"tools/test_gru.py",
"pysot/datasets/dataset.py"
] | [
"# Copyright (c) SenseTime. All Rights Reserved.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport os\n\nimport cv2\nimport torch\nimport numpy as np\n\nfrom pysot.core.config import c... | [
[
"numpy.array",
"torch.save",
"torch.set_num_threads"
],
[
"numpy.array",
"numpy.random.choice",
"numpy.random.shuffle",
"numpy.random.randint",
"numpy.sqrt",
"numpy.random.random",
"numpy.linspace"
]
] |
kylepeterson777/CancerDetection | [
"2cc60de1b98cc8e84182549cdd3e5696c1c5fa04"
] | [
"DenseNet201.py"
] | [
"# Histopathology Cancer Detection \n# DenseNet201 CNN classification\n\nimport numpy as np\nimport pandas as pd \nimport os\nfrom glob import glob\nfrom random import shuffle\nimport cv2\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom keras.preprocessing.image import Im... | [
[
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"pandas.read_csv",
"numpy.array"
]
] |
FBlandfort/Subset-Simulation-Interpolation | [
"e0c1433d6769c8a8c41943ed824007c2511a0c2e"
] | [
"susi/tests/tests_seed_susi.py"
] | [
"\n\n\nimport unittest\n\nimport numpy as np\nimport random\nimport math\n\nimport susi\n\n\nclass main_test_attr(unittest.TestCase):\n\n #####################################################################\n ###### col1 \t\t\t\t\t\t#################################\n\n ### susi ####\n\n def test_examp... | [
[
"numpy.random.seed"
]
] |
xian1234/SRBuildSeg | [
"db16ae2aba6aaa336a0b612446c80b4546b96a1f"
] | [
"superresolution_stage/models/archs/arch_util.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\n\n\ndef initialize_weights(net_l, scale=1):\n if not isinstance(net_l, list):\n net_l = [net_l]\n for net in net_l:\n for m in net.modules():\n if isinstance(m, nn.Conv2d):\n ... | [
[
"torch.stack",
"torch.arange",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d",
"torch.nn.functional.grid_sample"
]
] |
tz3/dlcourse_ai | [
"e1405bc45de9c084672ac3206215177c21f2e4b7"
] | [
"assignments/assignment2/metrics.py"
] | [
"import numpy as np\n\n\ndef multiclass_accuracy(prediction, ground_truth):\n '''\n Computes metrics for multiclass classification\n\n Arguments:\n prediction, np array of int (num_samples) - model predictions\n ground_truth, np array of int (num_samples) - true labels\n\n Returns:\n accuracy -... | [
[
"numpy.sum"
]
] |
liuchang0520/AttnGAN | [
"0d000e652b407e976cb88fab299e8566f3de8a37"
] | [
"code/miscc/config.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport os.path as osp\nimport numpy as np\nfrom easydict import EasyDict as edict\n\n\n__C = edict()\ncfg = __C\n\n# Dataset name: flowers, birds\n__C.DATASET_NAME = 'birds'\n__C.CONFIG_NAME = ''\n__C.DATA_DIR = ''\n__C.GPU_ID = 0\n__C.CUDA ... | [
[
"numpy.array"
]
] |
cw-somil/Medical-Image-Synthesis | [
"6fb85f4e432b37c40d0fae3bbca50b114fd71f6f"
] | [
"predict.py"
] | [
"from keras.layers import Layer, Input, Dropout, Conv2D, Activation, add, UpSampling2D, Conv2DTranspose, Flatten, Reshape\nfrom keras_contrib.layers.normalization.instancenormalization import InstanceNormalization, InputSpec\nfrom keras.layers.advanced_activations import LeakyReLU\nfrom keras.models import Mode... | [
[
"tensorflow.abs",
"numpy.reshape",
"matplotlib.image.imread",
"tensorflow.Session",
"tensorflow.ConfigProto",
"matplotlib.image.imsave",
"tensorflow.squared_difference"
]
] |
christian-rauch/hand_eye_calibration | [
"5d5077572d650a5491040a4a90d98850df4cf068"
] | [
"hand_eye_calibration/python/hand_eye_calibration/time_alignment.py"
] | [
"# Expect time stamped transformations\n# Output aligned and resampled poses\n\nfrom quaternion import (angular_velocity_between_quaternions,\n quaternions_interpolate, Quaternion)\nfrom time_alignment_plotting_tools import (plot_results, plot_input_data,\n ... | [
[
"numpy.array",
"numpy.isclose",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"numpy.percentile",
"numpy.ones",
"scipy.signal.correlate",
"numpy.diff",
"numpy.allclose",
"numpy.argmax",
"numpy.clip",
"numpy.linspace"
]
] |
jiahuanluo/Federated-Benchmark | [
"50df36142fd0f17c5a04bbb739e571dc940ff2b8"
] | [
"experiments/plot.py"
] | [
"# -*- coding:utf-8 -*-\r\n# @Author : LuoJiahuan\r\n# @File : plot.py \r\n# @Time : 2019/7/23 16:27\r\n\r\nimport csv\r\nfrom matplotlib import pyplot as plt\r\nfrom scipy.interpolate import interp1d, InterpolatedUnivariateSpline, make_interp_spline, BSpline\r\nimport numpy as np\r\nfrom scipy.ndimage.fi... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_params",
"scipy.ndimage.filters.gaussian_filter1d",
"matpl... |
SunnyMarkLiu/Deep_Learning_In_Action | [
"50a90a2af0b7b8887ff3ca4699fa991f532aebc4"
] | [
"Alexnet/image_net_demo.py"
] | [
"#!/home/sunnymarkliu/software/miniconda2/bin/python\n# _*_ coding: utf-8 _*_\n\n\"\"\"\nAlexnet predict ImageNet demo.\n\n@author: MarkLiu\n@time : 17-3-6 上午11:23\n\"\"\"\nfrom alex_net import Alexnet\nfrom caffe_classes import class_names\nimport tensorflow as tf\nimport utils\nimport numpy as np\nimport os\nimp... | [
[
"numpy.array"
]
] |
GavinHU66/DebugEntity | [
"21f38f01bdfbbc363a73f640331c6f04a121cf82"
] | [
"NN_skin_cancer/cfgs/2020/ham_effb1_rand_25.py"
] | [
"import numpy as np\r\n\r\n\r\ndef init(mdlParams_):\r\n mdlParams = {}\r\n # Save summaries and model here\r\n mdlParams['saveDir'] = './models/model_ham_effb1_rand_25'\r\n mdlParams['model_load_path'] = ''\r\n # Data is loaded from here\r\n mdlParams['dataDir'] = './Data'\r\n mdlParams['with_... | [
[
"numpy.array"
]
] |
sunzhaoc/TrackPrediction | [
"bcf5e5f71d5d893f562d141915198f5f2578d48c"
] | [
"traffic/data/adsb/opensky_impala.py"
] | [
"# fmt: off\n\nimport hashlib\nimport logging\nimport re\nimport string\nimport time\nfrom datetime import timedelta\nfrom io import StringIO\nfrom pathlib import Path\nfrom tempfile import gettempdir\nfrom typing import Callable, Dict, Iterable, List, Optional, Tuple, Union, cast\n\nimport pandas as pd\nimport par... | [
[
"pandas.to_datetime",
"pandas.read_csv",
"pandas.concat"
]
] |
1over/autokeras | [
"1562b1485d4d171ef0698d657723fc63a748175d"
] | [
"docs/py/load.py"
] | [
"\"\"\"shell\npip install autokeras\npip install git+https://github.com/keras-team/keras-tuner.git@1.0.2rc2\n\"\"\"\n\n\"\"\"\nIf the data is too large to put in memory all at once, we can load it batch by batch into memory from disk with tf.data.Dataset.\nThis [function](https://www.tensorflow.org/api_docs/python/... | [
[
"tensorflow.keras.utils.get_file"
]
] |
smoh/gapipes | [
"586fd7beef5e9b834eea2eaf66bee9b892f50ffb"
] | [
"gapipes/gaia/utils.py"
] | [
"\"\"\"\nUtilities for parsing Tap and Gaia TapPlus HTML and XML responses\n\"\"\"\nimport io\nimport logging\nimport re\nimport time\nimport requests\nfrom requests.exceptions import HTTPError\nfrom bs4 import BeautifulSoup\nimport xml.etree.ElementTree as ET\nfrom astropy.table import Table\nimport pandas as pd\n... | [
[
"pandas.DataFrame"
]
] |
MetaMain/BewareAdvML | [
"52d489b565b0df36cb588b5709c29c2e8e4d3f49"
] | [
"AdversarialSampleGeneratorV11/AdversarialSampleGeneratorV11/DefaultMethodsBuzz.py"
] | [
"#From the Buzz paper \r\nimport DataManager\r\nimport AttackWrappersBlackBox\r\nimport NetworkConstructors\r\nimport numpy\r\nimport tensorflow \r\nimport DefenseMultiModel\r\nfrom tensorflow import keras\r\n\r\n#Run every attack on the BUZZ model \r\ndef RunAllCIFAR10BUZZEightAttacks():\r\n for i in range(0,5)... | [
[
"numpy.array",
"numpy.round",
"tensorflow.Session",
"tensorflow.keras.backend.set_session",
"tensorflow.ConfigProto",
"tensorflow.keras.backend.clear_session"
]
] |
DerAndere1/mecode | [
"a8acb646be635be77961ad1e29c995351f2e221e"
] | [
"mecode/main.py"
] | [
"\"\"\"\r\nMecode\r\n======\r\n### GCode for all\r\nMecode is designed to simplify GCode generation. It is not a slicer, thus it\r\ncan not convert CAD models to 3D printer ready code. It simply provides a\r\nconvenient, human-readable layer just above GCode. If you often find\r\nyourself manually writing your own ... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
karkirowle/gantts | [
"f61d2b1ecb9493980338c9f598d74fc46120afe2"
] | [
"gantts/models.py"
] | [
"# coding: utf-8\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\n\nimport numpy as np\n\nfrom nnmnkwii.autograd import unit_variance_mlpg\n\n\nclass AbstractModel(object):\n \"\"\"Interface for VC and TTS models\n \"\"\"\n\n def include_parameter_generation(self):\n \"\"\"W... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.Sigmoid",
"torch.nn.LeakyReLU",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence"
]
] |
StanfordASL/soft-robot-control | [
"29ade9b7b952e25e639b42767a4f09c87a0e824a"
] | [
"sofacontrol/scp/models/tpwl.py"
] | [
"import numpy as np\n\nimport sofacontrol.utils as scutils\nfrom .template import TemplateModel\n\n\nclass TPWLGuSTO(TemplateModel):\n \"\"\"\n Provides an interface between GuSTO's template model and the TPWL model class\n defined in sofacontrol/tpwl/tpwl.py\n\n :dyn_sys: TPWL object as defined in sofa... | [
[
"numpy.abs",
"numpy.zeros"
]
] |
arennax/contemporary2020 | [
"1da86d384a5b7e1afea0d3e309799728a0734e9f"
] | [
"experiments/main.py"
] | [
"import sys\nsys.path.append(r'../')\n\nimport numpy as np\nimport time\nfrom experiments.learners import *\nfrom experiments.tuned_learners import *\nfrom data_experiment.data_touse_new import *\nfrom data_experiment.data_touse_old import *\n\n\ndef prediction_contemporary(Repo, Directory, metrics, repeats, tocsv=... | [
[
"numpy.median",
"numpy.array"
]
] |
odtoolkit/COBS | [
"b7a372e339769bdb033faec05341091394b0feec"
] | [
"cobs/plot/state_plotter.py"
] | [
"import matplotlib.pyplot as plt\n\n\ndef plot_state_history(model, variable, zone=None):\n temp = model.historical_values[-1]\n if isinstance(temp[variable], dict):\n if zone is None:\n for name in temp[variable]:\n data = [timestep[variable][name] for timestep in model.histo... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend"
]
] |
LOTEAT/CS231n | [
"b840b37848b262dc14d8f200b4656e859bb2c81e"
] | [
"assignment3/cs231n/classifiers/rnn.py"
] | [
"from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom ..layers import *\nfrom ..rnn_layers import *\n\n\nclass CaptioningRNN(object):\n \"\"\"\n A CaptioningRNN produces captions from image features using a recurrent\n neural network.\n\n The RNN receives input vectors of ... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.ones",
"numpy.random.randn",
"numpy.sqrt"
]
] |
ShangxuanWu/MT_python | [
"b64bea6e773d9f0df3f8f850252a909e6e4afff5"
] | [
"main/python/utils/FileUtils.py"
] | [
"# CopyRight Shangxuan Wu @ Myriad of Things\n# Created in Jan 2018\n\n# add path for root ('tf_code/') directory if not in sys.path\nimport sys, os\nroot_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))\nif root_path not in sys.path:\n sys.path.append(root_pat... | [
[
"numpy.genfromtxt"
]
] |
hpcn-uam/ccore | [
"d3b1cd709d9c72eb0d89d8b3fabf54c8e47603d1"
] | [
"tests/conftest.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport pytest\nimport pandas as pd\nimport py\nimport random\n\n@pytest.fixture(scope='session')\ndef sessiondir(request):\n\t\"\"\"Temporal session directory\"\"\"\n\td = py.path.local.mkdtemp()\n\trequest.addfinalizer(lambda: d.remove(rec=1))\n\n\treturn d\n\n@pytest.fixture(scope = 's... | [
[
"pandas.Timestamp"
]
] |
bytedance/Hammer | [
"388ed20b3d9b34f33f5357d75f8fe5d726782ec8"
] | [
"third_party/stylegan2_official_ops/misc.py"
] | [
"# python3.7\n\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution... | [
[
"torch.get_default_dtype",
"torch.device",
"numpy.asarray",
"numpy.random.RandomState",
"torch.finfo",
"numpy.rint",
"torch.as_tensor",
"torch.autograd.profiler.record_function",
"torch.empty",
"torch.distributed.broadcast"
]
] |
GPuleri/contiki-ng | [
"5b82fe293b8241e0c4aea9b6387c7e7e1c1098fc"
] | [
"assignment1/assignment1_4/scripts/plot_throughput.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sys,os\n\ntry:\n test,inFilename1,inFilename2,inFilename3,outFilename=sys.argv\n\nexcept:\n print(\"Please specify all the filenames(with extension)!\")\n exit(1)\n\n#create a new figure\nfig=plt.gcf()\n#Read files csv\ndata1... | [
[
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.ylabel",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
tobeannouncd/AdventOfCode | [
"b4fe6e9b10a0dc191429a90ab351806df03bca10"
] | [
"2021/day11.py"
] | [
"from itertools import product\n\nimport numpy as np\n\nfrom advent import getData\n\ndata = getData(11)\nd_array = np.array([[int(a) for a in line.strip()] for line in data])\n\n\ndef step(ar: np.ndarray) -> np.ndarray:\n q = []\n with np.nditer(ar, flags=['multi_index'], op_flags=['readwrite']) as it:\n ... | [
[
"numpy.count_nonzero",
"numpy.nditer"
]
] |
students-using-ai-for-good/people-matcher | [
"5d247f9cf32d59c8d629a5be4bf998fa3a96c9aa"
] | [
"lib/data_utils.py"
] | [
"import base64\nimport io\nimport numpy as np\nimport pandas as pd\nimport re\n\nfrom lib import tasks\n\n\ndef find_name_column(df):\n for c in df.columns:\n if re.search(r\"name\", c, re.I):\n return c\n\n\ndef find_firstname_column(df):\n for c in df.columns:\n if re.search(r\"name... | [
[
"pandas.DataFrame"
]
] |
Wave-View-Imaging/citi | [
"82e99760489f02a9ad311b9bf178d0995e7926ea"
] | [
"ffi/python/tests/test_read_data_record.py"
] | [
"import unittest\nimport os\nfrom pathlib import Path\nfrom citi import Record\nimport numpy.testing as npt\nimport numpy as np\n\n\nclass TestReadDataRecord(unittest.TestCase):\n\n @staticmethod\n def __get_display_memory_filename() -> str:\n relative_path = os.path.join('.', '..', '..', '..')\n ... | [
[
"numpy.linspace"
]
] |
glistening/ONE-1 | [
"cadf3a4da4f4340081862abbd3900af7c4b0e22d",
"cadf3a4da4f4340081862abbd3900af7c4b0e22d"
] | [
"res/TensorFlowPythonExamples/examples/ceil/__init__.py",
"res/TensorFlowPythonExamples/examples/floor/__init__.py"
] | [
"import tensorflow as tf\n\ntf.compat.v1.disable_eager_execution()\n\nin_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(1, 1), name=\"Hole\")\nop_ = tf.compat.v1.ceil(in_)\n",
"import tensorflow as tf\n\ntf.compat.v1.disable_eager_execution()\n\nin_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(1, 1),... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.ceil",
"tensorflow.compat.v1.disable_eager_execution"
],
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.floor",
"tensorflow.compat.v1.disable_eager_execution"
]
] |
bayonet222/gridlod | [
"0a5390cee139a1664a5437b635c8e0ccf576da77"
] | [
"gridlod/pglod.py"
] | [
"import numpy as np\nimport scipy.sparse as sparse\nfrom copy import deepcopy\n\nfrom . import util\nfrom . import fem\n\ndef assembleBasisCorrectors(world, patchT, basisCorrectorsListT):\n '''Compute the basis correctors given the elementwise basis\n correctors for each coarse element.\n\n '''\n NWorld... | [
[
"scipy.sparse.linalg.spsolve",
"numpy.ones_like",
"numpy.zeros",
"scipy.sparse.csc_matrix",
"numpy.prod",
"numpy.arange",
"numpy.size",
"numpy.hstack"
]
] |
yeshas1994/carla-dataset-runner | [
"c781b9d2b5cd748d062f775b65a86b5d569c8e64"
] | [
"client_bounding_boxes.py"
] | [
"import os\nimport sys\nimport settings\nsys.path.append(settings.CARLA_EGG_PATH)\nimport carla\nimport numpy as np\n\n# ==============================================================================\n# -- ClientSideBoundingBoxes ---------------------------------------------------\n# ===============================... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.identity",
"numpy.radians",
"numpy.transpose",
"numpy.linalg.inv"
]
] |
gokseltokur/kerasfrcnn-objectdetection | [
"6d53a2bab68dedf26e118c9f2f57de8fbea74309"
] | [
"train_frcnn.py"
] | [
"from __future__ import division\nimport random\nimport pprint\nimport sys\nimport time\nimport numpy as np\nfrom optparse import OptionParser\nimport pickle\n\nfrom keras import backend as K\nfrom keras.optimizers import Adam, SGD, RMSprop\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras... | [
[
"numpy.random.choice",
"numpy.zeros",
"numpy.mean",
"numpy.where",
"numpy.random.randint"
]
] |
zw-shen/incubator-mxnet | [
"ce1330690124630a8b095336ce3b1fb675d9547a"
] | [
"python/mxnet/gluon/nn/basic_layers.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.dtype"
]
] |
m1ndgames/SerpentAI | [
"614bafd3c2df3ee6736309d46a7b92325f9a2d15"
] | [
"serpent/machine_learning/reinforcement_learning/ddqn.py"
] | [
"from serpent.machine_learning.reinforcement_learning.dqn import DQN\n\nimport numpy as np\n\nfrom keras.optimizers import Adam\n\nimport random\n\n\nclass DDQN(DQN):\n\n def __init__(\n self,\n input_shape=None,\n input_mapping=None,\n replay_memory_size=10000,\n batch_size=32... | [
[
"numpy.squeeze",
"numpy.argmax",
"numpy.abs"
]
] |
aaman123/faceswap | [
"a5825c3457b062c1824ef3f8b02e4f3fa4c2217f"
] | [
"plugins/extract/align/fan.py"
] | [
"#!/usr/bin/env python3\n\"\"\" Facial landmarks extractor for faceswap.py\n Code adapted and modified from:\n https://github.com/1adrianb/face-alignment\n\"\"\"\nimport cv2\nimport numpy as np\n\nfrom lib.model.session import KSession\nfrom ._base import Aligner, logger\n\n\nclass Align(Aligner):\n \"\"\"... | [
[
"numpy.full",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.minimum",
"numpy.ones",
"numpy.eye",
"numpy.unravel_index",
"numpy.sign",
"numpy.einsum",
"numpy.arange",
"numpy.repeat",
"numpy.maximum"
]
] |
nestauk/heat_pump_adoption_modelling | [
"ab30b045e09597c22aeb565ca7caa23ba6e48ffb",
"ab30b045e09597c22aeb565ca7caa23ba6e48ffb"
] | [
"heat_pump_adoption_modelling/getters/location_data.py",
"heat_pump_adoption_modelling/getters/epc_data.py"
] | [
"# File: getters/location_data.py\n\"\"\"Loading location data, e.g. postcodes with coordinates.\"\"\"\n\n# ---------------------------------------------------------------------------------\n\nimport pandas as pd\nfrom heat_pump_adoption_modelling import get_yaml_config, Path, PROJECT_DIR\n\n# ---------------------... | [
[
"pandas.read_csv"
],
[
"pandas.read_csv",
"pandas.concat"
]
] |
denysvitali/tsp-cup-2019 | [
"7ba5eac927067d385a5ac18c117a603ab76c5249"
] | [
"src/main/resources/scripts/plot.py"
] | [
"import sys\nimport numpy as np\nimport pylab as pl\nfrom matplotlib import collections as mc\nfrom matplotlib.pyplot import cm\n\ndef plotFile(path):\n file = open(path, 'r').read()\n\n blocks = file.split('\\n\\n')\n\n lines = list()\n for block in blocks:\n sub = block.split('\\n')\n\n ... | [
[
"matplotlib.collections.LineCollection"
]
] |
macul99/Informer2020 | [
"7e1e3979ea912879e16194e3bf93062458f2cb9e"
] | [
"models/embed.py"
] | [
"import torch\nimport torch.nn as nn\n#import torch.nn.functional as F\n\nimport math\n\nclass PositionalEmbedding(nn.Module):\n '''\n Encode position index to d_model dimension feature\n '''\n def __init__(self, d_model, max_len=5000):\n super(PositionalEmbedding, self).__init__()\n\n # b... | [
[
"torch.nn.Linear",
"torch.cos",
"torch.nn.Dropout",
"torch.__version__.split",
"torch.zeros",
"torch.sin",
"torch.nn.Conv1d",
"torch.arange",
"torch.nn.init.kaiming_normal_",
"torch.nn.Parameter",
"torch.nn.Embedding"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.