repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
binhna/ESIM | [
"135894d13a14894111e826114596e2317008ccda"
] | [
"torch_util.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\n\n\"\"\"\nthis code from https://github.com/easonnie/ResEncoder\n\"\"\"\ndef pad_1d(t, pad_l):\n l = t.size(0)\n if l >= pad_l:\n return t\n else:\n pad_seq = Variab... | [
[
"torch.zeros",
"torch.nn.functional.sigmoid",
"torch.cat",
"torch.stack",
"torch.gather",
"torch.max",
"torch.sum",
"torch.abs",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.cuda.is_available",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.functional.soft... |
ethanlighter/crnn_ctc_tf2 | [
"2995dfb9fd07e2e3a9a0cb8563b3159323a2e757"
] | [
"tools/demo.py"
] | [
"\nfrom dataset.tf_data_handler import tf_data_handler\nimport tensorflow as tf\nfrom config import Config\nimport time\nimport os\nfrom model.model import vgg_crnn\nfrom tools.utils import ctc_decode\nfrom tools.utils import map_to_text\nimport cv2\n# tf_config = tf.ConfigProto()\n# tf_config.gpu_options.per_proce... | [
[
"tensorflow.io.decode_jpeg",
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.io.read_file",
"tensorflow.image.resize",
"tensorflow.cast"
]
] |
dv-123/Smart-Road-Assistant | [
"9b6222f23f030dd89e03e1c38030cd9e90eaffd4"
] | [
"YOLO_with_image.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Aug 20 23:45:13 2019\r\n\r\n@author: bhaik\r\n\"\"\"\r\n\r\n#%%\r\n# importing required libraries\r\n\r\nimport argparse\r\nimport os\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.pyplot import imshow\r\nimport scipy.io\r\nimport scipy.misc\r\nimport nump... | [
[
"numpy.multiply",
"tensorflow.variables_initializer",
"tensorflow.boolean_mask",
"tensorflow.image.non_max_suppression"
]
] |
Salompas/pandas | [
"2ebab98cf1f36a678256436e7a4f5149536436c9"
] | [
"pandas/core/arrays/datetimelike.py"
] | [
"from datetime import datetime, timedelta\nimport operator\nfrom typing import Any, Sequence, Type, Union, cast\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import NaT, NaTType, Timestamp, algos, iNaT, lib\nfrom pandas._libs.tslibs.c_timestamp import maybe_integer_op_deprecated\nfrom pandas._libs.tsl... | [
[
"pandas.core.dtypes.common.is_string_dtype",
"numpy.array_equal",
"pandas.core.dtypes.common.is_unsigned_integer_dtype",
"pandas._libs.tslibs.c_timestamp.maybe_integer_op_deprecated",
"pandas.core.algorithms.value_counts",
"pandas._libs.tslibs.timedeltas.delta_to_nanoseconds",
"pandas.... |
ZJU-ZhangY/OpenAttack | [
"c1d095b595257caa226e902b2c89b36845164f6a"
] | [
"OpenAttack/utils/albert_model.py"
] | [
"import numpy as np \nimport pickle, os\nfrom ..classifier import Classifier\n\nclass AlbertModel():\n def __init__(self, model_path, num_labels, max_len = 100, device=\"cpu\"):\n import transformers\n self.tokenizer = transformers.AlbertTokenizer.from_pretrained(model_path)\n self.device = ... | [
[
"numpy.array",
"torch.LongTensor",
"torch.stack",
"torch.nn.functional.softmax"
]
] |
Timo1997/Simplex | [
"239e79f60faa6a6cf46b6cce4d5798118c4630ed"
] | [
"simplex_algorithm.py"
] | [
"\nimport pandas as pd\nimport numpy as np\nimport copy\nimport sympy as sp\nfrom sympy import sympify\n\n\ndef get_pivotzeile(copy_tableau, pivot_spalte, anzahl_zeilen):\n # soll original Tableau nicht ändern\n copy_tableau = copy.deepcopy(copy_tableau)\n # wähle Ressourcenverbrauchskoeffizienten der Pivo... | [
[
"numpy.isnan"
]
] |
mgwillia/vissl | [
"513fc1f4bb8f99161f1cd1d7c23e65ac8016e77f"
] | [
"vissl/trainer/train_steps/standard_train_step.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nThis is the train step that\"s most commonly used in most of the model trainings.\n\"\"\"\nimport logging\n\nimport contextli... | [
[
"torch.enable_grad",
"torch.cuda.amp.autocast",
"torch.no_grad"
]
] |
jvishnuvardhan/agents | [
"b1c50a955876c16eac03ad1274c455a2d0c9cc7d"
] | [
"tf_agents/policies/py_tf_eager_policy.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ... | [
[
"tensorflow.compat.v2.saved_model.load",
"tensorflow.train.Checkpoint",
"tensorflow.nest.map_structure"
]
] |
USDepartmentofLabor/Binary-Context-Transformer | [
"b80c26b82ab67e0d0bd728a7940685d160ae742d"
] | [
"binarycontexttransformer.py"
] | [
"import numpy as np\r\nimport scipy as sp\r\nfrom sklearn.base import TransformerMixin\r\nfrom scipy.sparse import csc_matrix, csr_matrix\r\n\r\n\r\nclass BinaryContextTransformer(TransformerMixin):\r\n \"\"\"\r\n Expands base features into interaction terms when they appear with\r\n different context feat... | [
[
"scipy.sparse.csc_matrix",
"scipy.sparse.vstack",
"scipy.sparse.csr_matrix"
]
] |
stoplime/OpenAudioAI | [
"4ed6fb78b976fd7c4d2b4661849562b28003a2ed"
] | [
"dialoguePytorch/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models\n\nclass ABHUE(nn.Module):\n ''' Attention-Based Heirarchical Utterance Embedding\n '''\n def __init__(self, recurrent_model=\"lstm\", dropout=0, stack_size=1, dev=torch.device(\"cpu\")):\n super(AB... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.GRU",
"torch.randn"
]
] |
Doswind/pytorch | [
"ba14f9d9b00e608d4857c5101ed4465500fba79e"
] | [
"torch/testing/_internal/common_methods_invocations.py"
] | [
"from functools import wraps, partial\nfrom itertools import product, chain\nimport itertools\nimport collections\nimport copy\nfrom enum import Enum\nimport operator\nimport random\nimport unittest\nimport math\n\nimport torch\nimport numpy as np\nfrom torch._six import inf\nimport collections.abc\n\nfrom typing i... | [
[
"numpy.product",
"numpy.random.choice",
"torch.triu_indices",
"numpy.sign",
"torch.linalg.cholesky",
"torch.testing._internal.common_utils.is_iterable_of_tensors",
"torch.lu_unpack",
"numpy.prod",
"torch.tensor",
"torch.testing._internal.common_utils.make_fullrank_matrices_... |
TruthK/Informer2020 | [
"085debb00c12418f6f51bae5609e24ee5ed5b882"
] | [
"utils/imputer.py"
] | [
"## 图像显示中文的问题\nimport matplotlib\nfrom sklearn.linear_model import BayesianRidge\nfrom sklearn.preprocessing import StandardScaler\n\nmatplotlib.rcParams['axes.unicode_minus'] = False\nimport seaborn as sns\n\nsns.set(font=\"Kaiti\", style=\"ticks\", font_scale=1.4)\n\n## 导入本小节会使用到的包\nimport numpy as np\nimport pan... | [
[
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"sklearn.ensemble.ExtraTreesRegressor",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
BerryAI/Acai | [
"a3dc7d29c3ca4df00817e7ee94440c9e947ebcb4"
] | [
"OpenMRS/cf/cf_hidden_feature.py"
] | [
"\"\"\"\r\n cf_hidden_feature.py\r\n ~~~\r\n This module contains collaborative filtering algorithm, based on matrix\r\n factorization to find hidden features in user rating. It includes SVD and\r\n Gradient Descent methods.\r\n\r\n :auther: Alexander Z Wang\r\n\"\"\"\r\n\r\nimport numpy\r\nimport... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.dot",
"numpy.sum",
"numpy.copy",
"numpy.linalg.svd",
"numpy.diag"
]
] |
ParikhKadam/fairseq | [
"f862ff5137cf03ec8769b6e8f19c9dcdfe08ff91"
] | [
"fairseq/data/data_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\ntry:\n from collections.abc import Iterable\nexcept ImportError:\n from collections import Iterable\nimport contextlib\nimport... | [
[
"numpy.random.rand",
"numpy.random.choice",
"numpy.copy",
"numpy.min",
"numpy.full",
"numpy.random.normal",
"numpy.random.poisson",
"numpy.random.get_state",
"numpy.random.randint",
"numpy.array",
"torch.max",
"numpy.random.set_state",
"numpy.asarray",
"torc... |
titikid/tvm | [
"0cf3765b28d457d2503ec20b551e9a8eadb1491d"
] | [
"nnvm/python/nnvm/testing/tf.py"
] | [
"# pylint: disable=invalid-name, unused-variable, unused-argument, no-init\n\"\"\"\nTensorflow Model Helpers\n========================\nSome helper definitions for tensorflow models.\n\"\"\"\nimport re\nimport os.path\nimport collections\nimport numpy as np\n\n# Tensorflow imports\nimport tensorflow as tf\nfrom ten... | [
[
"numpy.sum",
"tensorflow.GraphDef",
"tensorflow.gfile.Exists",
"tensorflow.import_graph_def",
"tensorflow.core.framework.graph_pb2.GraphDef",
"tensorflow.gfile.GFile",
"numpy.cumsum",
"tensorflow.logging.fatal",
"numpy.searchsorted"
]
] |
suhuating/ML_CIA | [
"37838eb655d3e432393cee7dda11ea693217eb42"
] | [
"TensorLayer/example1.py"
] | [
"import tensorlayer as tl\nimport tensorflow as tf\n\nsess = tf.InteractiveSession()\n\n# 准备数据\nX_train, y_train, X_val, y_val, X_test, y_test = tl.files.load_mnist_dataset(shape=(-1,784))\n\n# 定义placeholder None表示任意维度数据\nx = tf.placeholder(tf.float32, shape=[None, 784], name='x')\ny_ = tf.placeholder(tf.int64, sha... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.argmax",
"tensorflow.placeholder",
"tensorflow.nn.softmax",
"tensorflow.cast",
"tensorflow.InteractiveSession"
]
] |
YoungXueya/DeepCTR | [
"51835e7de83049bfeaa92cd53ee394446f797822"
] | [
"deepctr/models/wdl.py"
] | [
"# -*- coding:utf-8 -*-\n\"\"\"\nAuthor:\n Weichen Shen,wcshen1994@163.com\n\nReference:\n [1] Cheng H T, Koc L, Harmsen J, et al. Wide & deep learning for recommender systems[C]//Proceedings of the 1st Workshop on Deep Learning for Recommender Systems. ACM, 2016: 7-10.(https://arxiv.org/pdf/1606.07792.pdf)\n... | [
[
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.keras.models.Model"
]
] |
miles-weatherseed/reac-diff-solver | [
"1ea32b352f9eace2a51d2196e3b2b111c080ad7b"
] | [
"tst/test_conjgrad.py"
] | [
"import unittest\nimport numpy as np\nfrom scipy.sparse import lil_matrix, csc_matrix\nfrom reac_diff_solver.conjgrad import conjugate_gradients\n\nclass ConjugateGradientsTest(unittest.TestCase):\n def test_non_square(self):\n A = np.arange(0,6,1).reshape(3,2)\n b = np.zeros(3) # Don't care about... | [
[
"numpy.array",
"numpy.zeros",
"scipy.sparse.csc_matrix",
"numpy.ones",
"numpy.eye",
"numpy.allclose",
"numpy.arange",
"scipy.sparse.lil_matrix"
]
] |
elephantmipt/catalyst | [
"6c706e4859ed7c58e5e6a5b7634176bffd0e2465"
] | [
"catalyst/utils/torch.py"
] | [
"from typing import Dict, Iterable, List, Union\nimport collections\nimport os\nimport re\n\nimport numpy as np\n\nimport torch\nfrom torch import nn, Tensor\nimport torch.backends\nfrom torch.backends import cudnn\n\nfrom catalyst.settings import IS_XLA_AVAILABLE\nfrom catalyst.typing import Device, Model, Optimiz... | [
[
"torch.device",
"torch.is_tensor",
"torch.norm",
"torch.finfo",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.Tensor",
"torch.randn",
"torch.sum"
]
] |
cnmy-ro/direct-custom | [
"a354e82d4f4b7598037e7b9dc73456fc361820ac"
] | [
"direct/nn/multidomainnet/multidomainnet_engine.py"
] | [
"# coding=utf-8\n# Copyright (c) DIRECT Contributors\n\nfrom typing import Callable, Dict, Optional\n\nimport torch\nfrom torch import nn\nfrom torch.cuda.amp import autocast\n\nimport direct.data.transforms as T\nfrom direct.config import BaseConfig\nfrom direct.engine import DoIterationOutput\nfrom direct.nn.mri_... | [
[
"torch.cuda.amp.autocast",
"torch.tensor"
]
] |
ETCBC/ssi_morphology | [
"2f784b6a440b990968f504da02c0bd8881b7bf1b"
] | [
"evaluation.py"
] | [
"# This module provides a method for calculating the incorrectness\n# of a morphological encoding or the distance between two encodings.\n# It exports three functions: mc_badness(), mc_distance(code1, code2)\n# and mc_load_morphemes(language).\n\n# mc_load_morphemes() needs to be called before the first call to\n# ... | [
[
"numpy.zeros"
]
] |
rohts-patil/keras | [
"a8bbcf611f64c1b36fda671534f25a0366c076b7"
] | [
"tests/keras/layers/test_normalization.py"
] | [
"import pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom keras.layers.core import Dense, Activation\nfrom keras.utils.test_utils import layer_test, keras_test\nfrom keras.layers import normalization\nfrom keras.models import Sequential\nfrom keras import backend as K\n\ninput_1 = np.ara... | [
[
"numpy.random.normal",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.std",
"numpy.arange"
]
] |
liujie40/msticpy | [
"421a8044253f8092e71a1f1b0531fbb4b1bf7483"
] | [
"msticpy/nbtools/nbinit.py"
] | [
"# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n... | [
[
"pandas.set_option"
]
] |
aghezz1/hpipm | [
"937c9d7264ac1624ef5539bb4208a8b7c8d3e140"
] | [
"examples/python/example_qcqp_getting_started.py"
] | [
"###################################################################################################\n# #\n# This file is part of HPIPM. #\n# ... | [
[
"numpy.array",
"numpy.dot",
"numpy.eye"
]
] |
AitorBengoechea/sandy | [
"c55e4ee7b593389947a52e1adb85282dcb73dda3"
] | [
"sandy/core/xs.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nThis module contains all classes and functions specific for the cross section\nclass `Xs` that acts as a container for energy-dependent tabulated cross\nsection values.\n\"\"\"\nimport os\nimport logging\nimport functools\n\nimport numpy as np\nimport pandas as pd\n\nimport sandy\n... | [
[
"numpy.union1d",
"pandas.merge",
"pandas.DataFrame",
"pandas.MultiIndex.from_product",
"pandas.concat",
"pandas.Series"
]
] |
tbennun/dace | [
"484f959c847feee048cd43ae5580f57e67d51671"
] | [
"tests/numpy/math_test.py"
] | [
"import numpy as np\nimport dace\n\nM, N = 24, 24\n\n\n@dace.program\ndef exponent(A: dace.complex64[M, N], B: dace.complex64[M, N]):\n B[:] = exp(A)\n\n@dace.program\ndef sine(A: dace.complex64[M, N], B: dace.complex64[M, N]):\n B[:] = sin(A)\n\n@dace.program\ndef cosine(A: dace.complex64[M, N], B: dace.comp... | [
[
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.zeros"
]
] |
HaydenAI/motpy | [
"da0a21c6a47d520d1f1edffce52e842121f20eb6"
] | [
"examples/mot16_challange.py"
] | [
"import os\nimport random\nimport time\n\nimport cv2\nimport fire\nimport pandas as pd\nfrom motpy import Detection, MultiObjectTracker\nfrom motpy.core import setup_logger\nfrom motpy.testing_viz import draw_detection, draw_track\nfrom motpy.utils import ensure_packages_installed\n\nensure_packages_installed(['cv2... | [
[
"pandas.read_csv"
]
] |
Shetty073/tv-shows-ratings-visualization | [
"eb1a633f3e071b79e6482e177e0dfc76c25d3366"
] | [
"plot.py"
] | [
"import matplotlib.pyplot as plt\n\n# set the size of the graph image\nplt.rcParams[\"figure.figsize\"] = (19, 11)\n\n\ndef plot(p_type: str, x_axis: list, points: list, title: str, x_label: str, y_label: str, y_min_lim=0, y_max_lim=0,\n color='blue', marker='D',\n width=0.30):\n # if y_min_lim a... | [
[
"matplotlib.pyplot.stem",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
abeermohamed1/ArabicNER | [
"d38225e2543632924171dfe996ff2c6d8930dca2"
] | [
"abnlp/encoder/LM.py"
] | [
"\"\"\"\n.. module:: LM\n :synopsis: language modeling\n \n.. moduleauthor:: Liyuan Liu\n\"\"\"\nimport torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nimport torch_scope\n\nclass LM(nn.Module):\n \"\"\"\n The language model model.\n \n Parame... | [
[
"torch.nn.Dropout",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.Embedding",
"torch.nn.utils.rnn.pack_padded_sequence"
]
] |
AayushGrover/text_style_transfer | [
"3b8f3fe3080f60be4c190c8e1d8140b71aa4c492"
] | [
"src/losses.py"
] | [
"import torch\nimport torch.nn as nn\n\ndef loss_semantic_meaning(cls_input, cls_generated):\n # Could also use cross entropy, WMD, cosine distance (recommended) or any other distance function\n cos = nn.CosineSimilarity()\n return cos(cls_input, cls_generated)\n\ndef loss_sentiment(sentiment_target, senti... | [
[
"torch.nn.MSELoss",
"torch.nn.CosineSimilarity",
"torch.nn.CrossEntropyLoss"
]
] |
lzharthur/MSML_loss_facenet | [
"d480eec44774c2f5591144e8f32e1ce4ca7ebdc4"
] | [
"aug_img.py"
] | [
"#!/usr/bin/env python\n# -*- coding_utf-8 -*-\n\"\"\"\n Author: Zhenghan Lee\n Date:\n\"\"\"\nimport cv2\nimport os\nimport numpy as np\n\ndef flip_img(img):\n return cv2.flip(img, 1) # 1 represent flip horizontal\n\ndef img_adjust_brightness(img,brightness):\n\n return np.uint8(np.clip((1.5 * img + br... | [
[
"numpy.clip"
]
] |
liangzongchang/bert_seq2seq | [
"e45b63dc2d9611de5b5f89754591473e33b52a9c"
] | [
"test/test.py"
] | [
"import torch \nimport torch.nn as nn \nimport sys\nsys.path.append(\"/Users/xingzhaohu/Downloads/code/python/ml/ml_code/bert/bert_seq2seq\")\nfrom torch.optim import Adam\nimport pandas as pd\nimport numpy as np\nimport os\nimport json\nimport time\nimport bert_seq2seq\nfrom bert_seq2seq.tokenizer import Tokenizer... | [
[
"torch.load"
]
] |
jacob720/Savu | [
"7afc9e10ea4944ceb39a83574f3142f025cf81e1"
] | [
"savu/plugins/utils.py"
] | [
"# Copyright 2014 Diamond Light Source 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 applicable ... | [
[
"numpy.arange"
]
] |
Cabletutu/analytics-zoo | [
"ee6487f6c126e34647914d5a78ca9bf531695f8d"
] | [
"pyzoo/zoo/orca/learn/mxnet/mxnet_runner.py"
] | [
"#\n# Copyright 2018 Analytics Zoo Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"numpy.concatenate"
]
] |
jucaleb4/msppy | [
"7e053cc99e805f2fa60675a28481109dfae3eb0b"
] | [
"msppy/utils/measure.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: lingquan\n\"\"\"\nimport numpy\n\ndef Expectation(obj, grad, p, sense):\n if p is not None:\n return (numpy.dot(p, obj),numpy.dot(p, grad))\n else:\n return (numpy.mean(obj),numpy.mean(grad, axis=0))\n\ndef Expectation_AVaR(obj, ... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.argsort"
]
] |
charlesblakemore/sem_processing | [
"1ec8ac4b3eff4886f7a86529c590eed7cc15cbba"
] | [
"scripts/calibration.py"
] | [
"import numpy as np\nimport argparse\nimport cv2\n\nimport scipy.optimize as opti\n\nimport matplotlib.pyplot as plt\n\nfrom bead_util import find_all_fnames\nimport sem_util as su\n\n\ngauss_kernel = 10\n\n\nimg_dir = '/Users/manifestation/Stanford/beads/photos/sem/20200624_gbeads-7_5um/'\nsubstr = '7_5um_calibrat... | [
[
"numpy.copy",
"numpy.exp",
"numpy.mean",
"numpy.max",
"numpy.save",
"numpy.sqrt",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.hist",
"numpy.arctan2",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axvline",
"sc... |
siavash9000/famousfaces | [
"672c2fe6c6c8406622614a34f1def2c6b08e7a3c"
] | [
"facecruncher/src/embedd_face.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport time\nfrom scipy import misc\nimport io\nimport tensorflow as tf\nimport numpy as np\nimport sys\nimport os\nimport argparse\nimport facenet\nimport align.detect_face\nimport glob\nfrom six.move... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.minimum",
"tensorflow.get_default_graph",
"tensorflow.Graph",
"tensorflow.Session",
"scipy.misc.imresize",
"tensorflow.ConfigProto",
"numpy.stack",
"numpy.squeeze",
"tensorflow.GPUOptions",
"numpy.maximum"
]
] |
togoon/akshare | [
"edbf8fc3ff1f029d22990dfb33d5d610458200b7"
] | [
"akshare/index/zh_stock_index_csindex.py"
] | [
"# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nDate: 2020/07/22 15:00\nDesc: 中证指数-所有指数-历史行情数据\nhttp://www.csindex.com.cn/zh-CN/indices/index-detail/H30374\n\"\"\"\nimport pandas as pd\nimport requests\n\n\ndef stock_zh_index_hist_csindex(symbol: str = \"H30374\") -> pd.DataFrame:\n \"\"\"\n 中证指数获取某个指... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.to_numeric"
]
] |
enomotom/nnabla | [
"1947fe16a0a41d19d76cd916f151aa1991ea1b44",
"1947fe16a0a41d19d76cd916f151aa1991ea1b44"
] | [
"python/src/nnabla/utils/cli/create_image_classification_dataset.py",
"examples/vision/cifar10/cifar10_data.py"
] | [
"# Copyright (c) 2017 Sony 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"numpy.array",
"numpy.pad",
"numpy.dot"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.random.RandomState",
"numpy.load",
"numpy.arange"
]
] |
Anikbh11/trident | [
"4edad87889997dbafcef68c6a564cf67d921c938"
] | [
"tests/test_light_ray.py"
] | [
"\"\"\"\nUnit test for the light_ray analysis module\n\"\"\"\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2016-2017, yt Development Team.\n# Copyright (c) 2017, Trident Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The fu... | [
[
"numpy.ones",
"numpy.diff"
]
] |
mjsiers/practice-data-cpcapaper | [
"5f5c004c3c478195510cfd0d90e5470f85525b74"
] | [
"notebooks/generators/workbooks/01-signal-workbook.py"
] | [
"#%% [markdown]\n# ## Simulated Signal Data Generation\n# The simulated signal for this example will be constructed by the combination of two Gaussian peaks with some\n# overlap. The height of each peak will be dependent on a concentration value. The target value for each generated\n# signal will be the concentra... | [
[
"numpy.max",
"matplotlib.cm.ScalarMappable",
"numpy.array",
"matplotlib.style.use",
"numpy.dot",
"numpy.random.rand",
"matplotlib.pyplot.colorbar",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.legend",
"numpy.min"... |
Kuro96/vedasal | [
"3c5588bf12059af5bd7bc779fd5f9dc0b2901cb2"
] | [
"tests/test_convlstm.py"
] | [
"import torch\n\nfrom kurosal.models.sequencer import ConvLSTMCell\n\n\nif __name__ == '__main__':\n import os\n os.environ['CUDA_VISIBLE_DEVICES'] = '7'\n cell = ConvLSTMCell(3, 3, 3, 0.1).cuda()\n x = torch.Tensor(4, 3, 5, 5).cuda()\n\n out, state = cell(x, None)\n print(out, out.size())\n ou... | [
[
"torch.Tensor"
]
] |
jaschau/21datalab | [
"5f9ad831273197f4fffc35b3d55a311d24a54307"
] | [
"model.py"
] | [
"import glob\nimport json\nimport copy\nimport importlib\nimport threading\nimport logging\nimport pytz\n\n#for tables\nimport numpy\nimport numpy as np\nimport datetime\nimport dateutil.parser\nimport sys\nimport os\nimport time\nimport uuid\nimport hashlib\nimport random\nimport traceback\nfrom dates import *\n\n... | [
[
"numpy.full",
"numpy.asarray",
"numpy.round",
"numpy.where",
"numpy.arange",
"numpy.isscalar",
"numpy.cos",
"numpy.append",
"numpy.linspace",
"numpy.insert"
]
] |
ingako/pgmpy | [
"a695e3fc97a467855803f18c0ede7600c98e13ab"
] | [
"pgmpy/tests/test_models/test_BayesianModel.py"
] | [
"import unittest\n\nimport networkx as nx\nimport pandas as pd\nimport numpy as np\nimport numpy.testing as np_test\n\nfrom pgmpy.models import BayesianModel, MarkovModel\nfrom pgmpy.base import DAG\nimport pgmpy.tests.help_functions as hf\nfrom pgmpy.factors.discrete import (\n TabularCPD,\n JointProbability... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"numpy.random.randint",
"pandas.read_csv"
]
] |
alptezbasaran/raven | [
"fd6fe8fe90b59d6dd3615cfea929722f3e04b2ca"
] | [
"framework/PostProcessors/LimitSurface.py"
] | [
"# Copyright 2017 Battelle Energy Alliance, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.rollaxis",
"numpy.ones",
"numpy.gradient",
"numpy.atleast_2d"
]
] |
kourouklides-ImpacTech/artificial_neural_networks | [
"83c37f7669fe1aa2bac92cce4bb7549e1e67d32f"
] | [
"code/architectures/feedforward_neural_networks/standard_neural_networks/snn_dense_mnist.py"
] | [
"\"\"\"\r\n\r\nModel: Standard Neural Network (SNN) with dense (i.e. fully connected) layers\r\nMethod: Backpropagation\r\nArchitecture: Feedforward Neural Network\r\n\r\nDataset: MNIST\r\nTask: Handwritten Digit Recognition (Multi-class Classification)\r\n\r\n Author: Ioannis Kourouklides, www.kourouklides.com\... | [
[
"tensorflow.set_random_seed",
"matplotlib.pyplot.colorbar",
"sklearn.metrics.confusion_matrix",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout"... |
sgeorgiev255/glow | [
"d0d5c45d5487b77027875930acc56a32f867d8bb"
] | [
"torch_glow/tests/nodes/quantized_batchnorm3d_relu_test.py"
] | [
"from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport unittest\n\nimport torch\nimport torch.nn as nn\nfrom tests import utils\nfrom torch.quantization import (\n DeQuantStub,\n QConfig,\n QuantStub,\n convert,\n fuse_modules,\n observer,\n prepare,\n)\n\... | [
[
"torch.zeros",
"torch.rand",
"torch.quantization.convert",
"torch.quantization.fuse_modules",
"torch.quantization.observer.HistogramObserver.with_args",
"torch.quantization.QuantStub",
"torch.quantization.prepare",
"torch.quantization.DeQuantStub",
"torch.ones",
"torch.nn.R... |
nie-lang/Multi-Grid-Deep-Homography | [
"ba3b3820ba639829797be6cc81ddde4a19e5cd82"
] | [
"Codes/tf_spatial_transform_local.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.ones_like",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.clip_by_value",
"tensorflow.stack",
"tensorflow.tile",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.add_n",
"tensorflow.constant",
"tensorflow.variable_scope",
... |
shruti1421/scona | [
"c07512dc80303b312ae73ae271ce91a832fbb258"
] | [
"scona/visualisations.py"
] | [
"import warnings\n\nimport numpy as np\nimport networkx as nx\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom nilearn import plotting\n\nfrom scona.visualisations_helpers import save_fig\nfrom scona.visualisations_helpers import create_df_sns_barplot\nfrom scona.visualisations_hel... | [
[
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"numpy.append",
"matplotlib.pyplot.show"
]
] |
And1210/AutoencoderTransformer | [
"9c6142421d311d34f6a00cb90dd49388e5f1cdff"
] | [
"models/AutoEncoderTransformer_model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom models.base_model import BaseModel\n\nclass Encoder(nn.Module):\n def __init__(self, hidden_dims, in_channels=3, encoded_dim=256):\n super().__init__()\n\n modules = []\n for h_dim in hidden_dims:\n module... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.MSELoss",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.nn.LeakyReLU",
"torch.no_grad",
"torch.unsqueeze",
"torch.nn.ReLU",
"torch.squeeze",
"torch.cuda.empty_cache... |
ilBarbara/BioRL | [
"82d2964e19e292fde84ff7cbaaf78c185511d75d"
] | [
"src/agents/dqn/dqn.py"
] | [
"\"\"\"\nImplements a DQN learning agent.\n\"\"\"\n\nimport os\nimport pickle\nimport random\nimport time\nfrom copy import deepcopy\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom src.agents.dqn.utils import ReplayBuffer, Logger, TestMetric, set_global_seed... | [
[
"numpy.array",
"numpy.round",
"torch.no_grad",
"torch.FloatTensor",
"numpy.mean",
"numpy.nanmean",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.load",
"torch.as_tensor"
]
] |
xianba/datadrawer | [
"864e0cd72f169a3cf107b827a5aa1b3a0717dd09"
] | [
"datadrawer/src/draw.py"
] | [
"#!/usr/bin/env python\r\n# -*- encoding: utf-8 -*-\r\n\"\"\"\r\n@File : draw.py\r\n@Version : 1.0.0\r\n@Author : xiaxianba\r\n@License : (C) Copyright 2006-2019\r\n@Contact : xiaxianba@qq.com\r\n@Software: PyCharm\r\n@Time : 2019/5/6 15:14\r\n@Desc :\r\n\"\"\"\r\n\r\nfrom matplotlib import ... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar"
]
] |
Kundusoumik123/ML-OpenCV-Projects | [
"38807a9fbc436624ee5808c393e89d8a22502e73"
] | [
"New Projects/face_recognize.py"
] | [
"import cv2, sys, numpy, os \r\nsize = 4\r\nhaar_file = 'haarcascade_frontalface_default.xml'\r\ndatasets = 'datasets'\r\nprint('Recognizing Face Please Be in sufficient Lights...') \r\n(images, lables, names, id) = ([], [], {}, 0) \r\nfor (subdirs, dirs, files) in os.walk(datasets): \r\n for subdir in dirs: \r\... | [
[
"numpy.array"
]
] |
meyer9/nionui | [
"ca2f9d773bb956e064f40c0cac2465f664447953"
] | [
"examples/basic/Buttons.py"
] | [
"# standard libraries\n# None\n\n# third party libraries\nimport numpy\n\n# local libraries\nfrom nion.ui import Application\nfrom nion.ui import Window\nfrom nion.utils import Binding\nfrom nion.utils import Converter\nfrom nion.utils import Model\n\n\n# user program below\n\nclass ButtonsApplication(Application.A... | [
[
"numpy.random.randn",
"numpy.zeros"
]
] |
rob-luke/autoreject | [
"b73847949db64740680e3d325b824ed9aa05a8cc"
] | [
"autoreject/tests/test_utils.py"
] | [
"# Author: Mainak Jas <mainak.jas@telecom-paristech.fr>\n# License: BSD (3-clause)\n\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\nimport pytest\n\nimport mne\nfrom mne.datasets import sample\nfrom mne.bem import _check_origin\nfrom mne import io\n\nfrom autoreject.utils import clean_by_... | [
[
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_array_equal"
]
] |
gyanz/pyclaw | [
"15bbd970dd84ba69337e2cee2b0b1522811b0af5"
] | [
"examples/advection_2d_annulus/mapc2p.py"
] | [
"\n\nfrom __future__ import absolute_import\ndef mapc2p(xc,yc):\n \"\"\"\n Specifies the mapping to curvilinear coordinates \n \"\"\"\n import numpy as np\n\n # Polar coordinates (x coordinate = radius, y coordinate = theta)\n xp = xc * np.cos(yc)\n yp = xc * np.sin(yc)\n return xp,yp\n"... | [
[
"numpy.sin",
"numpy.cos"
]
] |
janthiemen/data_scout | [
"6366eedfb20ed429bc96100de4dd2c7409e5dd88"
] | [
"data_scout/connectors/csv.py"
] | [
"import csv\nimport random\nimport sys\nfrom typing import List\n\nimport pandas as pd\n\nfrom .connector import Connector\n\n\nclass CSV(Connector):\n \"\"\"\n Read data from a CSV file.\n \"\"\"\n TMP_SINK = False\n MAX_SIZE = 2000000\n MAX_ROWS = 200\n fields = {\n \"filename\": {\"na... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
Akado2009/katib | [
"cf15cd4dbb3e61814e8054678eeee8c37411fbd1"
] | [
"pkg/suggestion/nasrl_service.py"
] | [
"from pkg.suggestion.NAS_Reinforcement_Learning.Controller import Controller\nfrom pkg.suggestion.NAS_Reinforcement_Learning.Operation import SearchSpace\nfrom pkg.suggestion.NAS_Reinforcement_Learning.SuggestionParam import parseSuggestionParam\nimport tensorflow as tf\nimport grpc\nfrom pkg.api.python import api_... | [
[
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer"
]
] |
wanghuancoder/Paddle | [
"8f2b0860ebe4bd5998c97dfaf2a29702ffd2b52a"
] | [
"python/paddle/fluid/dygraph/layers.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.prod"
]
] |
icoolworld/gpt2 | [
"cdd8d28362bab738fc3a47145335bf79679bead3"
] | [
"train.py"
] | [
"# -*- coding: UTF-8 -*-\nimport transformers\nimport torch\nimport os\nimport json\nimport random\nimport numpy as np\nimport argparse\nfrom torch.utils.tensorboard import SummaryWriter\nfrom datetime import datetime\nfrom tqdm import tqdm\nfrom torch.nn import DataParallel\nfrom tokenizations.bpe_tokenizer import... | [
[
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.tensor",
"numpy.linspace",
"torch.utils.tensorboard.SummaryWriter"
]
] |
hidden-ar/OpenSfM | [
"3ea1216d4dedc94b93ea9f7aa51cd8efd7377922"
] | [
"opensfm/reconstruction_helpers.py"
] | [
"import logging\nimport math\nfrom typing import Optional, List, Dict, Any, Iterable\n\nimport numpy as np\nfrom opensfm import (\n geo,\n multiview,\n pygeometry,\n pymap,\n geometry,\n types,\n exif as oexif,\n rig,\n)\nfrom opensfm.dataset_base import DataSetBase\n\n\nlogger: logging.Logg... | [
[
"numpy.array",
"numpy.fabs",
"numpy.sqrt"
]
] |
acul3/transformers | [
"b38a9251c7c3105734dd61edea84d70fe98943b1"
] | [
"src/transformers/models/blenderbot/modeling_blenderbot.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Facebook, Inc. and The HuggingFace Inc. team. 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.... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.LayerNorm",
"torch.arange",
"torch.isnan",
"torch.finfo",
"torch.nn.functional.dropout",
"torch.nn.CrossEntropyLoss",
"torch.bmm",
"torch.clamp",
"torch.tensor",
"torch.isinf",
"torch.nn.functional.sof... |
smiton/IllegalWebsiteClassifier | [
"830f755fe29708de4fff815cb2600413831fcaf5"
] | [
"models/bert_MCNN.py"
] | [
"# coding: UTF-8\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pytorch_pretrained import BertModel, BertTokenizer\n\n\nclass Config(object):\n\n \"\"\"配置参数\"\"\"\n def __init__(self, dataset):\n self.model_name = 'bert'\n self.train_path = dataset + '/data/train.txt... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.cuda.is_available",
"torch.nn.Conv2d"
]
] |
tcapelle/pvfactors | [
"1aaf6cdd3066a3a68d93db4ad7abcf10e97b5620"
] | [
"pvfactors/tests/test_geometry/test_pvarray.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nfrom pvfactors.geometry import OrderedPVArray, PVGround, PVSurface\nfrom pvfactors.geometry.utils import contains\nfrom pvfactors.config import MAX_X_GROUND, MIN_X_GROUND\nfrom pvfactors.tests.test_geometry.test_data import \\\n vm_flat_orderedpvarray, vm_righ... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.where",
"numpy.abs",
"matplotlib.pyplot.show"
... |
md12g12/pymeasure | [
"f5b693543c4c4a4fdc2350e9fda00140a74bc50d"
] | [
"pymeasure/instruments/keithley/keithley2600.py"
] | [
"# This file is part of the PyMeasure package.\n#\n# Copyright (c) 2013-2020 PyMeasure Developers\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 wi... | [
[
"numpy.linspace"
]
] |
moiexpositoalonsolab/deepbiosphere | [
"a12e59c40d2c29b5428e4969ef8c3a0cb457e387"
] | [
"deepbiosphere/scripts/GEOCLEF_Run.py"
] | [
"import copy\nimport pickle\nimport pandas as pd\nimport argparse\nimport time\nimport numpy as np\nimport socket\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.tensorboard import SummaryWriter\nimport itertools\nimport gc\nimport csv\nfrom torch.utils.data import DataLoader\nfr... | [
[
"torch.zeros",
"torch.cuda.current_device",
"torch.stack",
"torch.is_tensor",
"torch.no_grad",
"torch.cuda.device_count",
"numpy.testing.suppress_warnings",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"numpy.stack",
"torch.tensor",
"torch.utils.data.DataLoade... |
yunai2384/ADIOS2 | [
"c88fd748720dfdfb0d7f8a529d7838ea86ecfa65"
] | [
"examples/experimental/runtimeconfig/hello/helloBPWriterXML_nompi.py"
] | [
"#\n# Distributed under the OSI-approved Apache License, Version 2.0. See\n# accompanying file Copyright.txt for details.\n#\n# helloBPWriterXML_nompi.py serial non-MPI version of helloBPWriter.py\n# Created on: Feb 2, 2017\n# Author: William F Godoy godoywf@ornl.gov\n\nimport numpy\nimport adios2\n\n\n# Use... | [
[
"numpy.array"
]
] |
fito-jaeuklee/Python-NMEA-data-analysis | [
"3aaa2637fefb8284833ce351c722ba3228138425"
] | [
"testboard.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfig = plt.figure()\nax = fig.add_subplot(1, 1, 1)\n\n# Major ticks every 20, minor ticks every 5\nmajor_ticks = np.arange(0, 101, 20)\nminor_ticks = np.arange(0, 101, 5)\n\nax.set_xticks(major_ticks)\nax.set_xticks(minor_ticks, minor=True)\nax.set_yticks(major... | [
[
"matplotlib.pyplot.show",
"numpy.arange",
"matplotlib.pyplot.figure"
]
] |
Manny27nyc/chainercv | [
"1db5572aa4bac6c40fd811c51dd63f1b6ad57dcf"
] | [
"tests/links_tests/model_tests/light_head_rcnn_tests/test_light_head_rcnn.py"
] | [
"import numpy as np\nimport unittest\n\nimport chainer\nfrom chainer import testing\nfrom chainer.testing import attr\n\nfrom chainercv.links.model.light_head_rcnn import LightHeadRCNN\nfrom chainercv.utils import assert_is_detection_link\nfrom chainercv.utils import generate_random_bbox\n\n\ndef _random_array(xp, ... | [
[
"numpy.array",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.arange"
]
] |
PengJingchao/DFNet | [
"49e83501f81515aebca211351e315896da7afc54"
] | [
"modules/dataset/rgb_t_dataset_separate.py"
] | [
"import sys\nimport numpy as np\nfrom PIL import Image\n\nimport torch\nimport torch.utils.data as data\nimport matplotlib.pyplot as plt\nfrom ..utils import *\n\nimport matplotlib.patches as patches\n\nimport os\nfrom ..sample_generator import *\n\nimport sys\n# from pretrain_options import *\n\nfrom ..img_cropper... | [
[
"numpy.concatenate",
"numpy.asarray",
"numpy.zeros",
"numpy.reshape",
"numpy.copy",
"numpy.random.randn",
"torch.from_numpy"
]
] |
auroua/NPENASv1 | [
"65bdece174f0da2f9a3c716b86859abba077d279"
] | [
"nas_lib/models_darts/darts_ops.py"
] | [
"import torch\nimport torch.nn as nn\n\nOPS = {\n 'none': lambda C, stride, affine: Zero(stride),\n 'avg_pool_3x3': lambda C, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, count_include_pad=False),\n 'max_pool_3x3': lambda C, stride, affine: nn.MaxPool2d(3, stride=stride, padding=1),\n 'skip_connect... | [
[
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
OMaraLab/Rh_NHCs_NMR | [
"fff030d004864765adc6dc4fe2b39051fcbd2790"
] | [
"orbitals/Rh2_CSe_DMAD_CF3_dppm2/Shift_tensorify.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nwith open(\"Rh2_CSe_Ring_dppm2.out\") as f:\n lines = f.readlines()\n for i, line in enumerate(lines):\n if \"Orbital pair contributions to the principal shielding components of Nuc=2Se (ppm)\" in line:\n pair_start = i+2\n if \"... | [
[
"matplotlib.pyplot.matshow",
"numpy.asarray",
"numpy.zeros",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axvline"
]
] |
smitexx/umucv | [
"875ab90b77fc189a87cef4f16cd090218a574962"
] | [
"code/shape/trebol5.py"
] | [
"#!/usr/bin/env python\n\n# Paso 5: Finalmente comparamos los invariantes de los contornos \n# encontrados en la imagen con el modelo y señalamos\n# los que son muy parecidos\n \n\n# ./trebol4.py --dev=dir:../../images/cards.png\n\nimport cv2 as cv\nfrom umucv.stream import autoStr... | [
[
"numpy.zeros_like",
"numpy.fft.fft",
"numpy.zeros"
]
] |
TanKinh/CycleGan-handwriting_generation | [
"df974b8ae1927f2dbe84345da7c3f3a8a567f138"
] | [
"data/prepare_data/prepare_casia.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport argparse\nimport sys\nimport numpy as np\nimport scipy.misc\nimport os\nimport glob\nfrom PIL import Image\nfrom PIL import ImageDraw\nfrom PIL import ImageFont\nimport json\nimport collections\nimport ... | [
[
"numpy.lib.pad",
"numpy.fromstring",
"numpy.random.shuffle"
]
] |
garagonc/optimization-framework | [
"1ca57699d6a3f2f98dcaea96430e75c3f847b49f"
] | [
"prediction/FUR_Incremental_OneDay.py"
] | [
"import datetime\nimport time\nimport pandas as pd\nimport numpy as np\nimport tensorflow as tf\nimport random as rn\nimport os\n\nimport keras\nfrom keras import Input\nfrom keras.models import Sequential, Model\nfrom keras.layers import concatenate\nfrom keras.layers import Dense\nfrom keras.layers import LSTM, D... | [
[
"tensorflow.set_random_seed",
"pandas.to_datetime",
"numpy.reshape",
"numpy.zeros",
"tensorflow.get_default_graph",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.median",
"numpy.mean",
"tensorflow.ConfigProto",
"numpy.amin",
"numpy.std",
"numpy.amax",
"pan... |
akhil-rana/SlideLoader | [
"61719008c89fc7d758fa198234869fb22628ebeb"
] | [
"spritemaker.py"
] | [
"from pathlib import Path\nfrom PIL import Image\nimport numpy as np\nimport sys\nimport os\n\n\ndef createSpritesheet(datasetPath, labelsNames, width, height):\n # print(Path(__file__).parent.absolute())\n # Constants\n TRAINING_PATH = datasetPath+'/spritesheet/'\n # SPRITE_SIZE = 60\n print(TRAININ... | [
[
"numpy.array"
]
] |
haimin777/models | [
"e888d8d22bb0a296ac26ce0c32e29a35f4bee4c4"
] | [
"official/projects/qat/vision/tasks/retinanet_test.py"
] | [
"# Copyright 2022 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.distribute.get_strategy",
"tensorflow.test.main"
]
] |
gmke/WesternMeteorPyLib | [
"f218ac5abc9c1a53fe3844039909f8efb929b50e"
] | [
"wmpl/Utils/AtmosphereDensity.py"
] | [
"\"\"\" Plots NRL MSISE atmosphere density model. \"\"\"\n\nfrom __future__ import print_function, division, absolute_import\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.optimize\n\nfrom wmpl.PythonNRLMSISE00.nrlmsise_00_header import *\nfrom wmpl.PythonNRLMSISE00.nrlmsise_00 import *\nfrom ... | [
[
"matplotlib.pyplot.semilogx",
"numpy.vectorize",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.linspace",
"numpy.degrees",
"numpy.radians",
"matplotlib.pyplot.ylabel",
"matplotlib.p... |
mettalrose/text_processing | [
"52b47d7931a88cf8e0414aaaf0b8fccf339fd938"
] | [
"metadata_processing/process_metadata_one_semester.py"
] | [
"#!/usr/local/bin/python3\n# -*- coding: utf-8 -*-\n\n# DESCRIPTION: Given an excel file or files passed as arguments to the script,\n# create one csv file with all tabs for instructors in the original spreadsheet\n# The original spreadsheet needs a master tab, which is the first tab in\n# the original excel file.\... | [
[
"pandas.merge",
"pandas.read_excel",
"pandas.ExcelFile",
"numpy.where",
"pandas.concat",
"pandas.read_csv"
]
] |
dosemeion/nni | [
"9b2bb11d8bafed4002b7f9eae98a39f2fead7c1a"
] | [
"test/ut/compression/v2/test_iterative_pruner_torch.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport random\nimport unittest\n\nimport torch\nimport torch.nn.functional as F\n\nfrom nni.algorithms.compression.v2.pytorch.pruning import (\n LinearPruner,\n AGPPruner,\n LotteryTicketPruner,\n SimulatedAnnealingPruner,\n ... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.BatchNorm2d",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d",
"torch.nn.CrossEntropyLoss"
]
] |
Lifelong-ML/LASEM | [
"c4ec052c850e37f54bc3e6faf6b988a4c5239f10"
] | [
"classification/model/cnn_darts_model.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom random import shuffle\n\nfrom utils.utils import get_value_of_valid_tensors, savemat_wrapper, savemat_wrapper_nested_list, count_trainable_var2\nfrom utils.utils import new_weight, new_bias, new_ELLA_KB_param, get_list_of_valid_tensors, data_x_add_dummy, data_x_and... | [
[
"tensorflow.range",
"numpy.zeros",
"numpy.squeeze",
"tensorflow.argmax",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.gradients",
"tensorflow.norm",
"numpy.argmax",
"tensorflow.name_scope",
"tensorflow.nn.softmax",
"tensorflow.contrib.layers.apply_regularization",
... |
vroger11/audio_loader | [
"84af1dde0eac92369d03b2993f3ffa46b13a1f89"
] | [
"audio_loader/ground_truth/c2si.py"
] | [
"\"\"\"Tools helping with the C2SI corpus.\"\"\"\nimport re\n\nfrom glob import glob\nfrom os.path import join\n\nimport numpy as np\nimport pandas as pd\nimport soundfile as sf\n\nfrom audio_loader.ground_truth.challenge import Challenge\n\n\nEXPLICIT_TASKS = [\"maintained A\", \"reading\", \"describe an image\", ... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.empty"
]
] |
CompbioLabUnist/dream_challenge-anti-pd1_response | [
"5b45bf1c7b94878024d35db5478c39286bc0da6c"
] | [
"jwlee230/Program/Python/step01.py"
] | [
"\"\"\"\nstep01.py: Read data from TIDEpy\n\"\"\"\nimport argparse\nimport pandas\nimport step00\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n\n parser.add_argument(\"input\", help=\"Input PKL file\", type=str)\n parser.add_argument(\"output\", help=\"Output tar.gz file\", type=str... | [
[
"pandas.read_pickle"
]
] |
haribharadwaj/mne-python | [
"4faf87f4ac2deb133a40554df02f0596046611a7"
] | [
"mne/viz/backends/_notebook.py"
] | [
"\"\"\"Notebook implementation of _Renderer and GUI.\"\"\"\n\n# Authors: Guillaume Favelier <guillaume.favelier@gmail.com>\n#\n# License: Simplified BSD\n\nfrom contextlib import contextmanager, nullcontext\n\nfrom IPython.display import display\nfrom ipywidgets import (Button, Dropdown, FloatSlider, BoundedFloatTe... | [
[
"matplotlib.backends.backend_nbagg.FigureCanvasNbAgg",
"matplotlib.backends.backend_nbagg.FigureManager"
]
] |
gkiar/C-PAC | [
"0926b451dd8622b25eb68c7bcc770f0156238b23"
] | [
"CPAC/pipeline/cpac_cwas_pipeline.py"
] | [
"import os\n\nimport nipype.interfaces.io as nio\nfrom CPAC.pipeline import nipype_pipeline_engine as pe\n\nfrom CPAC.utils.configuration import Configuration\n\n\ndef prep_cwas_workflow(c, subject_infos):\n print('Preparing CWAS workflow')\n p_id, s_ids, scan_ids, s_paths = (list(tup) for tup in zip(*subject... | [
[
"numpy.loadtxt"
]
] |
abulte/pygpmf | [
"ac26d489f465df212e5e703881dc080d327d887b"
] | [
"gpmf/parse.py"
] | [
"from collections import namedtuple\nimport types\nimport struct\nimport logging\nimport numpy\n\n\nlogger = logging.getLogger(__name__)\n\nKLVItem = namedtuple(\"KLVItem\", [\"key\", \"length\", \"value\"])\nKLVLength = namedtuple(\"KLVLength\", [\"type\", \"size\", \"repeat\"])\n\n\ndef ceil4(x):\n \"\"\" Find... | [
[
"numpy.dtype",
"numpy.frombuffer"
]
] |
isequeir/jdsypymeasure | [
"0bd7e02a3578cdb733abac91b32361c4b32b6686"
] | [
"pymeasure/instruments/rigol/rigolds1202ze.py"
] | [
"#\n# This file is part of the PyMeasure package.\n#\n# Copyright (c) 2013-2020 PyMeasure Developers\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... | [
[
"numpy.concatenate",
"numpy.savetxt",
"matplotlib.pyplot.plot",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
Pranjal31/cuml | [
"ea9079ba2b9f6cd5416a7b0a13f9af4a384a8eb9"
] | [
"python/cuml/test/test_random_forest.py"
] | [
"# Copyright (c) 2019, NVIDIA CORPORATION.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"sklearn.ensemble.RandomForestClassifier",
"sklearn.datasets.fetch_california_housing",
"sklearn.metrics.accuracy_score",
"sklearn.ensemble.RandomForestRegressor",
"sklearn.datasets.make_regression",
"sklearn.model_selection.train_test_split",
"sklearn.datasets.make_classification"
]... |
akashpalrecha/pytorch-NMF | [
"21f6589bf25e2ec3e90edf7d3f7eec538ce04fa0"
] | [
"torchnmf/base.py"
] | [
"from torch import nn\n\n\nclass Base(nn.Module):\n\n def __init__(self):\n super().__init__()\n self.fix_neg = nn.Threshold(0., 1e-8)\n\n def fit(self, *args, **kwargs):\n raise NotImplementedError\n\n def fit_transform(self, *args, **kwargs):\n raise NotImplementedError\n\n ... | [
[
"torch.nn.Threshold"
]
] |
KyuboNoh/HY | [
"8ba9815137c2cff2f1931a1940e1b762e8df0b02"
] | [
"tests/base/test_Solver.py"
] | [
"import unittest\nfrom SimPEG import *\nfrom SimPEG.Mesh import TensorMesh\nfrom SimPEG.Utils import sdiag\nimport numpy as np\nimport scipy.sparse as sparse\n\nTOLD = 1e-10\nTOLI = 1e-3\nnumRHS = 5\n\ndef dotest(MYSOLVER, multi=False, A=None, **solverOpts):\n if A is None:\n h1 = np.ones(10)*100.\n ... | [
[
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.ones"
]
] |
ziongh/cudf | [
"3195eb7fe3bf52ac68fc5e718e746df3bfcb683a",
"3195eb7fe3bf52ac68fc5e718e746df3bfcb683a"
] | [
"python/cudf/cudf/core/column_accessor.py",
"python/cudf/cudf/utils/utils.py"
] | [
"# Copyright (c) 2021, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport itertools\nfrom collections import OrderedDict\nfrom collections.abc import MutableMapping\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Mapping,\n Optional,\n Tuple,\n Union,\n)\n\nimport p... | [
[
"pandas.api.types.is_integer",
"pandas.DataFrame",
"pandas.Index",
"pandas.api.types.is_list_like"
],
[
"numpy.isnat",
"numpy.asarray",
"numpy.dtype",
"pandas.Series"
]
] |
alexgonzl/TreeMazeAnalyses | [
"a834dc6b59beffe6bce59cdd9749b761fab3fe08"
] | [
"PreProcessing/robust_stats.py"
] | [
"import numpy as np\n\ndef mad(x):\n \"\"\" Computes median absolute deviation for an array.\n Defined as: median(abs(x-median(x)))\n\n Parameters\n ----------\n x: input numpy array (1D)\n\n Returns\n -------\n median absolute deviation (ignoring nan values)\n\n \"\"\"\n medx = np... | [
[
"numpy.full",
"numpy.int",
"numpy.array",
"numpy.nanmin",
"numpy.std",
"numpy.nanstd",
"numpy.arange",
"numpy.abs",
"numpy.nanmax",
"numpy.nanmedian",
"numpy.floor"
]
] |
nidiascampos/smartgreen | [
"d574d90918702ac3bd383ed77d673f871576c5b0"
] | [
"portPython/functions/normalizar.py"
] | [
"import pandas as pd\r\n\r\ndef normalizarDados(data):\r\n for index, row in data.iterrows():\r\n data.at[index, 'when'] = pd.Timestamp(row['when']).replace(minute=0, second=0, microsecond=0)\r\n\r\ndef table2timetable(data):\r\n data = data.set_index(['when'])\r\n data.index = pd.to_datetime(data.i... | [
[
"pandas.to_datetime",
"pandas.Timestamp"
]
] |
iory/ROMP | [
"d50bab681b5a60d15526fbeec1ed98cb020864b2"
] | [
"romp/lib/models/basic_modules.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport logging\n\nimport torch\nimport torch.nn as nn\n\nimport sys, os\nroo... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.split",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.Conv3d",
"torch.nn.InstanceNorm2d",
"torch.nn.BatchNor... |
doem97/PSENet | [
"4d95395658662f2223805c36dcd573d9e190ce26"
] | [
"models/post_processing/pse/setup.py"
] | [
"from distutils.core import setup, Extension\nfrom Cython.Build import cythonize\nimport numpy\n\nsetup(ext_modules=cythonize(Extension(\n 'pse',\n sources=['pse.pyx'],\n language='c++',\n include_dirs=[numpy.get_include()],\n library_dirs=[],\n libraries=[],\n extra_compile_args=['-O3'],\n ... | [
[
"numpy.get_include"
]
] |
xyyphant0m/spartan2 | [
"6c40247052cdce80c2787c9ee0c5485e218c082d"
] | [
"spartan/tensor/timeseries.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n'''\n@File : timeseries.py\n@Desc : Definition of timeseries structure.\n'''\n\n# here put the import lib\nfrom . import DTensor\n\n\nclass Timeseries:\n def __init__(self, val_tensor: DTensor, time_tensor: DTensor = None, labels: list = None, freq: in... | [
[
"numpy.array",
"numpy.linspace"
]
] |
sarvex/rasa | [
"ac1197b3f80071bb213d4fa66d5d24b4fc01e30e"
] | [
"rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py"
] | [
"import numpy as np\nimport logging\n\nfrom typing import Any, Optional, Text, List, Type, Dict, Tuple\n\nimport rasa.core.utils\nfrom rasa.nlu.config import RasaNLUModelConfig\nfrom rasa.nlu.components import Component, UnsupportedLanguageError\nfrom rasa.nlu.featurizers.featurizer import DenseFeaturizer\nfrom ras... | [
[
"numpy.array",
"numpy.reshape",
"numpy.zeros"
]
] |
lovelytt0/gMLP_phase | [
"39d39f092a79ee05eef3fe9268335840e2a56c71"
] | [
"Scripts/continous_run.py"
] | [
"import numpy as np\nimport matplotlib,h5py,os\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\nimport pandas as pd\nfrom obspy.signal.trigger import trigger_onset\nfrom tqdm import tqdm\nfrom datetime import datetime\nfrom contextlib import redirect_stdout\nimport random\n# from IPython.utils import ... | [
[
"scipy.stats.norm.pdf",
"numpy.lib.stride_tricks.as_strided",
"numpy.load",
"numpy.mean",
"numpy.where",
"numpy.sort",
"numpy.max",
"numpy.zeros_like",
"numpy.save",
"numpy.swapaxes",
"torch.tensor",
"numpy.arange",
"numpy.transpose",
"numpy.log10",
"num... |
atamazian/kaggle_plant-pathology | [
"f0bfb23ff56470336d602af3da340f29b28518cf"
] | [
"kaggle_plantpatho/augment.py"
] | [
"\"\"\"Module to perform efficient preprocess and data augmentation.\"\"\"\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom kornia import augmentation, geometry, image_to_tensor\n# Define the augmentations pipeline\nfrom torch import Tensor\nfrom torchvision import transforms as T\nfrom kaggle_plant... | [
[
"numpy.array",
"torch.no_grad",
"torch.Tensor"
]
] |
dials/iota | [
"0a0569c4c6e666c1410fa1a83715c7198179f83c"
] | [
"src/iota/components/iota_analysis.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\nfrom six.moves import range, zip\n\n\"\"\"\nAuthor : Lyubimov, A.Y.\nCreated : 04/07/2015\nLast Changed: 11/21/2019\nDescription : Analyzes integration results and outputs them in an accessible\n format... | [
[
"numpy.max",
"matplotlib.pyplot.text",
"numpy.zeros",
"numpy.median",
"matplotlib.pyplot.pcolor",
"numpy.min",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.std",
"matplotlib.pyplot.hist",
"numpy.argmax",
"matplotlib.pyplot.show"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.