repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jinzhao3611/Political_Stance_Prediction | [
"b2314363e00a41836c5ae747ec29933601976736"
] | [
"train_ML.py"
] | [
"import argparse\nimport pickle\nfrom math import log\nfrom typing import Dict, List\nfrom collections import Counter\n\nfrom sklearn.feature_extraction import DictVectorizer\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.svm import LinearSVC\n\n... | [
[
"sklearn.linear_model.LogisticRegression",
"sklearn.neural_network.MLPClassifier",
"sklearn.feature_extraction.DictVectorizer",
"sklearn.svm.LinearSVC"
]
] |
ZLkanyo009/mindspore | [
"0a6ed86bb443ed233504fa7eee931a24637d50bb"
] | [
"tests/st/control/inner/test_120_if_after_while_in_if.py"
] | [
"# Copyright 2020 Huawei Technologies Co., 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 l... | [
[
"numpy.array"
]
] |
ericyinyzy/MTN_trajectory | [
"2c6e2cb07f89a118094257d6bea4e024d5ceda54"
] | [
"PIE/transformer/sublayer_connection.py"
] | [
"# -*- coding: utf-8 -*-\n# date: 2018-11-30 15:17\nimport torch.nn as nn\n\nfrom .layer_norm import LayerNorm\n\n\nclass SublayerConnection(nn.Module):\n \"\"\"\n A residual connection followed by a layer norm.\n Note for code simplicity the norm is first as opposed to last.\n \"\"\"\n\n def __init_... | [
[
"torch.nn.Dropout"
]
] |
mhamedouadghiri/examples | [
"853107847c1dd761592f0bc19d18fe2b0e26c051"
] | [
"tensorflow_examples/lite/model_maker/core/task/object_detector.py"
] | [
"# Copyright 2020 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.compat.v1.logging.warn",
"tensorflow.compat.v1.logging.info",
"tensorflow.io.gfile.GFile"
]
] |
Ivy286/cluster_basedfps | [
"7fc216537f570436f008ea567c137d03ba2b6d81"
] | [
"third_party_package/RDKit_2015_03_1/rdkit/Chem/BuildFragmentCatalog.py"
] | [
"# $Id$\n#\n# Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC\n#\n# @@ All Rights Reserved @@\n# This file is part of the RDKit.\n# The contents are covered by the terms of the BSD license\n# which is included in the file license.txt, found at the root\n# of the RDKit source tree.\n#\n\"\"\" ... | [
[
"numpy.zeros"
]
] |
divshacker/qiskit-nature | [
"08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb"
] | [
"qiskit_nature/circuit/library/initial_states/vscf.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.zeros"
]
] |
pr-shukla/maddpg-keras | [
"8e3d1501f78ac2b78ee2c7053dc9299862386c17"
] | [
"noise.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\nfrom tensorflow.keras import layers\r\nimport matplotlib.pyplot as plt\r\nimport math\r\nfrom tensorflow.keras.models import load_model\r\n\r\nclass OUActionNoise:\r\n def __init__(self, mean, std_deviation, theta=0.15, dt=0.4, x_initial=None):\r\n self.th... | [
[
"numpy.random.normal",
"numpy.zeros_like",
"numpy.sqrt"
]
] |
shayokdutta/nelpy_modified | [
"8f3bd505beed570bfe917ed0a7f1d8c13f31b69a"
] | [
"nelpy/filtering.py"
] | [
"#encoding : utf-8\n\"\"\"This module implements filtering functionailty for core nelpy objects\n\"\"\"\n\n# NOTE: I found a really good website + implementation of doing out-of-core\n# chunked signal filtering in Python that was scalable and efficient,\n# but I have since lost the url (I mad a note, but can't find... | [
[
"scipy.signal.firwin",
"scipy.signal.iirdesign",
"scipy.signal.butter",
"scipy.signal.filtfilt",
"scipy.signal.lfilter"
]
] |
bperez7/moments_models | [
"d83e67b5d85f611ebf8dc10bc0d7569c962a37c2"
] | [
"model_zoo/twod_models/group_mobilenet.py"
] | [
"import torch\nfrom torch import nn\nfrom functools import partial\nimport torch.utils.model_zoo as model_zoo\n#from .utils import load_state_dict_from_url\nfrom .temporal_modeling import temporal_modeling_module\nfrom model_zoo.inflate_from_2d_model import convert_rgb_model_to_group\nfrom inspect import signature\... | [
[
"torch.nn.Dropout",
"torch.nn.Conv1d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_",
"torch.utils.model_zoo.load_url",
"torch.nn.init.ones_",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.AdaptiveAvgPool2d",
... |
shirou/marketstore_value_exporter | [
"8c67c584562d8c4cf9d5b2d94ab51a8953e82b64"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport datetime\nimport logging\nimport os\nimport signal\nimport sys\nimport time\n\nimport pandas as pd\nimport pymarketstore as pymkts\nfrom prometheus_client import Gauge, start_http_server\nimport trading_calendars as tc\n\nlogging.basicConfig(\n level=logging.ERR... | [
[
"pandas.Timestamp.utcnow"
]
] |
jobsfan/pytorch | [
"221ae8e3673f8d2fbf0a58f40a30553c76084831"
] | [
"liuer/7.py"
] | [
"# 多维特征输入,目前还没搞懂啥意思,感觉y值不像是个分类,像是个回归\nimport numpy as np\nimport torch\n\nx_ = np.loadtxt('diabetes_data.csv.gz',delimiter=' ',dtype=np.float32)\ny_ = np.loadtxt('diabetes_target.csv.gz',delimiter=' ',dtype=np.float32)\ny_ = np.expand_dims(y_,axis=1)\n\nx_data = torch.from_numpy(x_)\ny_data = torch.from_numpy(y_)\n... | [
[
"torch.nn.Linear",
"torch.nn.Sigmoid",
"torch.from_numpy",
"numpy.loadtxt",
"torch.nn.BCELoss",
"numpy.expand_dims"
]
] |
GeorgeMLP/deepfake-detection | [
"9038ef46cea0dc1cd65bf7dbf25ea276391692e7"
] | [
"Faces-HQ/DeepFake Detection Faces-HQ.py"
] | [
"import cv2\nimport numpy as np\nimport os\nimport radialProfile\nimport glob\nfrom matplotlib import pyplot as plt\nimport pickle\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.svm import SVC\nfrom sklearn.linear_model import LogisticRegression\n\n\n# uncomment following code to create the fea... | [
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplots",
"numpy.mean",
"matplotlib.pyplot.tick_params",
"numpy.std",
"sklearn.svm.SVC",
"sklearn.linear_model.LogisticRegression",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"... |
npielawski/py_alpha_amd_release | [
"6fb5b3cdef65ba8902daea050785dd73970002c2"
] | [
"transforms/util.py"
] | [
"\n#\n# Py-Alpha-AMD Registration Framework\n# Author: Johan Ofverstedt\n# Reference: Fast and Robust Symmetric Image Registration Based on Distances Combining Intensity and Spatial Information\n#\n# Copyright 2019 Johan Ofverstedt\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy o... | [
[
"numpy.square",
"numpy.array"
]
] |
yiliucs/flower | [
"db4d7db353a702b79cbef48b9d4fa5831d91eb00"
] | [
"src/flwr/strategy/qffedavg.py"
] | [
"# Copyright 2020 Adap GmbH. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"numpy.square",
"numpy.float_power",
"numpy.append"
]
] |
echo-ray/Kashgari | [
"fc8ba49fd051bd8c09f0c4092aa96b656f27eced"
] | [
"kashgari/embeddings/bare_embedding.py"
] | [
"# encoding: utf-8\n\n# author: BrikerMan\n# contact: eliyar917@gmail.com\n# blog: https://eliyar.biz\n\n# file: bare_embedding.py\n# time: 2019-05-20 10:36\nimport logging\nfrom typing import Union, Optional\n\nfrom tensorflow import keras\n\nfrom kashgari.embeddings.base_embedding import Embedding\nfrom kashgari.... | [
[
"tensorflow.keras.Model"
]
] |
ehua7365/bn3d | [
"b2ab7411c32c836fe5d0e48900461c1911408774"
] | [
"tests/test_cli.py"
] | [
"import numpy as np\nimport pytest\nfrom click.testing import CliRunner\n\nfrom panqec.cli import cli, read_bias_ratios, read_range_input\n\n\n@pytest.fixture\ndef runner():\n \"\"\"Click CliRunner with isolated file system.\"\"\"\n _runner = CliRunner()\n with _runner.isolated_filesystem():\n yield... | [
[
"numpy.arange"
]
] |
jrm5100/clarite-python | [
"a39d4f56490418f148195d2ff5be4e2e63afbbba",
"a39d4f56490418f148195d2ff5be4e2e63afbbba"
] | [
"clarite/modules/survey/survey_design.py",
"tests/modify/test_modify.py"
] | [
"from typing import Optional, Union, Dict, Tuple\n\nimport click\nimport numpy as np\nimport pandas as pd\nfrom pandas.core.indexing import IndexingError\n\n\nclass SurveyDesignSpec:\n \"\"\"\n Holds parameters for building a statsmodels SurveyDesign object\n\n Parameters\n ----------\n survey_df: pd... | [
[
"pandas.Series",
"pandas.merge",
"pandas.concat"
],
[
"pandas.DataFrame"
]
] |
zeuseyera/pysc2 | [
"df837baa43afd486d9f70a83c64bf12ff1962781"
] | [
"pysc2/lib/colors.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"numpy.array",
"numpy.arange",
"numpy.zeros",
"numpy.mod"
]
] |
JiaminRen/RandWireNN | [
"8c729f62be049bc20db4f27cafa6866ba4744296"
] | [
"model.py"
] | [
"import torch.nn as nn\nfrom utils import Node, get_graph_info, build_graph, save_graph, load_graph\nimport torch\nimport math\nimport os\n\n\n\nclass depthwise_separable_conv_3x3(nn.Module):\n def __init__(self, nin, nout, stride):\n super(depthwise_separable_conv_3x3, self).__init__()\n self.depthwise = nn... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"torch.nn.Sigmoid",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.ones",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
aksakalli/incubator-superset | [
"e21a354b3b560465a866c25dd687fbeef73eee31"
] | [
"tests/utils_tests.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.int64",
"numpy.array",
"numpy.bool_"
]
] |
ICOS-Carbon-Portal/jupyter | [
"628c16b18352411a6c5cd9b44ed0c01aad9cf3ac"
] | [
"notebooks/icos_jupyter_notebooks/station_characterization/stc_functions.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 9 08:04:31 2020\n\n@author: Ida Storm \n\nFunctions to run the station characterization notebook on exploredata.\n\n\"\"\"\n\nimport pandas as pd\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport math\nimport nump... | [
[
"numpy.min",
"pandas.Timestamp",
"pandas.concat",
"matplotlib.patches.Rectangle",
"pandas.read_csv",
"matplotlib.ticker.FuncFormatter",
"matplotlib.pyplot.xticks",
"numpy.max",
"matplotlib.pyplot.colorbar",
"pandas.DataFrame",
"matplotlib.pyplot.get_cmap",
"matplotl... |
nathanlct/FCGF | [
"d9d100aeb92d16e33b610fd1031c5861ee72d2d6"
] | [
"classify.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\n\nfor voxel_size in [0.01, 0.05, 0.1, 0.15, 0.2, 0.4, 0.7, 1.0]:\n print('----------------------------------------------')\n print('TRAINING WITH VOXEL SIZE ', voxel_size)\n print('----------------------------------------------')\n\n batch_size = 64\n\n ... | [
[
"numpy.array",
"numpy.count_nonzero",
"tensorflow.keras.regularizers.l1",
"numpy.random.shuffle",
"numpy.logical_and",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.argmax",
"numpy.append",
"tensorflow.keras.optimizers.Ad... |
the21st/pymatting | [
"c6a48e2887e61d1f074a830e69b52c34fea9d7af"
] | [
"pymatting/laplacian/lbdm_laplacian.py"
] | [
"import numpy as np\nfrom numba import njit\nimport scipy.sparse\n\n\n@njit(\"f8[:, :](f8[:, :], f8)\")\ndef calculate_kernel_matrix(X, v):\n n, m = X.shape\n K = np.zeros((n, n))\n for i in range(n):\n for j in range(n):\n K[i, j] = np.exp(-np.sqrt(v) * np.sum(np.square(X[i] - X[j])))\n ... | [
[
"numpy.square",
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.std",
"numpy.arange",
"numpy.sqrt"
]
] |
mc51/Corona-Test-Comparison | [
"e237a7138f0b1c8c293f2d388f5788bd95b72072"
] | [
"app.py"
] | [
"import json\nimport glob\nimport logging\nimport sys\nimport dateparser\nimport subprocess\nimport os\nimport pandas as pd\nfrom pathlib import Path\nfrom flask import Flask, render_template\n\nlogging.basicConfig()\nlog = logging.getLogger(__name__)\nlog.setLevel(logging.INFO)\n\napp = Flask(__name__)\n\n\ndef ge... | [
[
"pandas.read_csv"
]
] |
OrthoDex/PCGrad-PyTorch | [
"957380c93807c43d6d7ebffa341789f0f7ac367c"
] | [
"tests/model.py"
] | [
"\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\n\nimport numpy as np\nimport random\n\n## dummy net to test code\nclass Net(nn.Module):\n\n def __init__(self):\n super(Net, self).__init__()\n # 1 input image channel, 6 output channels, 3x3 square convolution\n # kern... | [
[
"torch.nn.Linear"
]
] |
ethanwhite/torchgeo | [
"cb20e1abfd9213f9ee7700df972385db13568642"
] | [
"torchgeo/datasets/nasa_marine_debris.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"NASA Marine Debris dataset.\"\"\"\n\nimport os\nfrom typing import Callable, Dict, List, Optional\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport rasterio\nimport torch\nfrom torch import Tensor\n... | [
[
"matplotlib.pyplot.suptitle",
"numpy.load",
"matplotlib.pyplot.subplots",
"torch.from_numpy"
]
] |
srio/OASYS1-PHOTOLAB | [
"919dc56d3dd159a949f739feb37508b31d0309b0"
] | [
"orangecontrib/photolab/widgets/gui/ow_photolab_widget.py"
] | [
"import sys\n\nfrom oasys.widgets import widget\nfrom PyQt5 import QtWidgets\n\nfrom orangewidget import gui\nfrom orangewidget.settings import Setting\n\nfrom PyQt5.QtWidgets import QApplication\nfrom PyQt5.QtCore import QRect\nfrom PyQt5.QtGui import QTextCursor\n\nimport oasys.widgets.gui as oasysgui\nfrom oasys... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg"
]
] |
stefan-niculae/gplearn | [
"46b77e80b5294d95e757769ea0177544d91d5c31"
] | [
"gplearn/tests/test_genetic.py"
] | [
"\"\"\"Testing the Genetic Programming module's underlying datastructure\n(gplearn.genetic._Program) as well as the classes that use it,\ngplearn.genetic.SymbolicRegressor and gplearn.genetic.SymbolicTransformer.\"\"\"\n\n# Author: Trevor Stephens <trevorstephens.com>\n#\n# License: BSD 3 clause\n\nimport pickle\ni... | [
[
"sklearn.utils.testing.assert_false",
"sklearn.model_selection.GridSearchCV",
"numpy.mean",
"scipy.stats.pearsonr",
"sklearn.tree.DecisionTreeRegressor",
"sklearn.datasets.load_boston",
"numpy.bincount",
"sklearn.utils.validation.check_random_state",
"numpy.array",
"sklearn... |
bingrao/deeplearning | [
"8488478a4355a7f56d49c5126f529c21d5a95798"
] | [
"benchmarks/learning_fix/train.py"
] | [
"import torch.nn as nn\r\nfrom torch.autograd import Variable\r\nimport torch\r\nfrom nmt.data.batch import custom_collate_fn\r\nfrom nmt.model.transformer.model import build_model\r\nfrom nmt.utils.context import Context\r\nfrom benchmarks.learning_fix.preprocess import dataset_generation\r\nfrom torch.utils.data ... | [
[
"torch.nonzero",
"torch.autograd.Variable",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.KLDivLoss",
"torch.nn.CrossEntropyLoss"
]
] |
HEPonHPC/pandana | [
"8ee68071892f2a34b54a09ac54033f5d14d42019"
] | [
"pandana/core/cut.py"
] | [
"import pandas as pd\n\n\nclass Cut:\n \"\"\"Represents a selection criterion to be applied to a dataframe.\"\"\"\n\n def __init__(self, cut):\n self._cut = cut\n\n self._CurrDF = None\n self._CurrTab = None\n\n # Remember result for each instance of tables\n def __call__(self, tabl... | [
[
"pandas.Series"
]
] |
ltrottier/tensorflow-object-recognition | [
"cbf011f0241277411fb44ce78bbd09a6b4e5734f"
] | [
"stats.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\n\ndef create_n_observations(network_output_tensor, modes):\n with tf.variable_scope('n_observations'):\n n_observations = tf.get_variable(\n 'variable',\n [],\n initializer=tf.initializers.zeros(),\n trainable=Fals... | [
[
"tensorflow.initializers.zeros",
"tensorflow.summary.image",
"tensorflow.assign",
"tensorflow.shape",
"tensorflow.summary.scalar",
"tensorflow.argmax",
"tensorflow.equal",
"tensorflow.reshape",
"tensorflow.assign_add",
"tensorflow.variable_scope",
"tensorflow.variables_... |
pgiank28/jina | [
"f96030cf2e0d4393c03c206adc4717e328d069e7"
] | [
"tests/unit/test_gateway.py"
] | [
"import functools\nimport time\nfrom threading import Thread\n\nimport numpy as np\nimport pytest\nimport requests\n\nfrom jina.flow import Flow\n\nconcurrency = 10\n\n\n# @pytest.mark.skip('this tests hang up for unknown reason on github')\ndef test_rest_gateway_concurrency():\n def _request(status_codes, durat... | [
[
"numpy.max",
"numpy.min",
"numpy.mean"
]
] |
jiazhi412/stylegan2-ada-pytorch | [
"d6bc5a2bf8ec28970a117168cf79c3c71c032eca"
] | [
"projector.py"
] | [
"# 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 of this softwa... | [
[
"numpy.concatenate",
"torch.device",
"numpy.array",
"torch.nn.functional.avg_pool2d",
"torch.roll",
"numpy.random.RandomState",
"numpy.random.seed",
"numpy.sum",
"torch.nn.functional.interpolate",
"torch.no_grad",
"numpy.mean",
"torch.from_numpy",
"torch.manual_... |
mdca-aux-loss/MDCA-Calibration | [
"de8d0986a3b8b5794df316b577bc21c8c501ef36"
] | [
"experiments/rotated_mnist.py"
] | [
"import os\nfrom utils.misc import AverageMeter\n\nimport torch\nfrom utils import Logger, parse_args\nfrom solvers.runners import test\n\nfrom models import model_dict\nfrom datasets import corrupted_dataloader_dict, dataset_nclasses_dict, dataset_classname_dict, corrupted_dataset_dict\nfrom datasets.mnist import ... | [
[
"torch.nn.CrossEntropyLoss",
"torch.load"
]
] |
jbusecke/pygmt | [
"9ef6338dbb9bdd4c31dda94da6d4126852a6cd85"
] | [
"pygmt/clib/session.py"
] | [
"\"\"\"\nDefines the Session class to create and destroy a GMT API session and provides\naccess to the API functions.\n\nUses ctypes to wrap most of the core functions from the C API.\n\"\"\"\nimport ctypes as ctp\nimport sys\nfrom contextlib import contextmanager\n\nimport numpy as np\nimport pandas as pd\nfrom pa... | [
[
"numpy.empty",
"numpy.asarray",
"numpy.apply_along_axis",
"numpy.atleast_1d",
"pandas.api.types.is_string_dtype",
"numpy.char.encode",
"numpy.asanyarray"
]
] |
NemesiP/volatiltiy-forecasting | [
"a65899d70e64b3a884c96214b0f337e88c918169"
] | [
"Examples/Garch_example.py"
] | [
"import numpy as np\nfrom scipy.optimize import minimize\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndf = pd.read_csv('C:/Users/peter/Desktop/volatility-forecasting/data/Stocks/AMD.csv')\ndf = df.iloc[-1500:, :]\ndf['Chg'] = np.log(df.close).diff().fillna(0)\nreturns = df.Chg[1:].values\ndf['Date'] = p... | [
[
"pandas.to_datetime",
"numpy.array",
"numpy.zeros",
"numpy.log",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show",
"pandas.read_csv",
"scipy.optimize.minimize"
]
] |
omerholtzman/IML.HUJI | [
"2ac59cbd8cf27851af890f122a9ca87894bf8fdd"
] | [
"exercises/classifiers_evaluation.py"
] | [
"from IMLearn.learners.classifiers import Perceptron, LDA, GaussianNaiveBayes\nfrom IMLearn.learners.classifiers.perceptron import default_callback\nimport numpy as np\nfrom typing import Tuple\nimport plotly.graph_objects as go\nimport plotly.io as pio\nimport plotly.express as px\nimport pandas as pd\nfrom plotly... | [
[
"numpy.sin",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.load",
"numpy.linalg.eigvalsh",
"matplotlib.pyplot.ylabel",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.diag"
]
] |
esquije/caffe_jessedits | [
"5bf52f763828b31418eaee942cba3f91a7aca0a5"
] | [
"python/caffe/classifier.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nClassifier is an image classifier specialization of Net.\n\"\"\"\n\nimport numpy as np\n\nimport caffe\n\n\nclass Classifier(caffe.Net):\n \"\"\"\n Classifier extends Net for image class prediction\n by scaling, center cropping, or oversampling.\n Parameters\n --------... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.tile"
]
] |
FraLotito/evol-signal-comm | [
"fd06bdad06200a65a8910e8401f0de7632be3cf0"
] | [
"simple_signal/simple_signal_regression_limited/figura_zoom/backup3/plot_zoom.py"
] | [
"import graphviz\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib\n\nNUMBER_OF_GENERATIONS = 34\nmatplotlib.rcParams['pdf.fonttype'] = 42\nmatplotlib.rcParams['ps.fonttype'] = 42\nmatplotlib.rcParams[\"legend.loc\"] = 'best'\nmatplotlib.rcParams.update({'font.size': 15})\n\nf = open(\"sender.... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.mean",
"numpy.std",
"matplotlib.rcParams.update",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"
]
] |
fivebats/pensieve | [
"b6d8f914a0a3354149eb467e9bf2c517a5a63914"
] | [
"multi_video_sim/a3c.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport tflearn\n\n\nGAMMA = 0.99\nENTROPY_WEIGHT = 0.1\nENTROPY_EPS = 1e-6\nEPS = 1e-6\nMAX_BR_LEVELS = 10\nMASK_DIM = 6\n\n\nclass ActorNetwork(object):\n \"\"\"\n Input to the network is the state, output is the distribution\n of all actions.\n \"\"\"\n ... | [
[
"tensorflow.multiply",
"numpy.zeros",
"tensorflow.summary.scalar",
"numpy.log",
"tensorflow.subtract",
"numpy.sum",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.Variable",
"tensorflow.gradients",
"tensorflow.transpose",
"tensorflow.variable_scope",
"tensorflow.l... |
ameya30/IMaX_pole_data_scripts | [
"815f9b4cf3f7c827901daa8c90bcacaaaead0e66"
] | [
"my_scripts/imax_remove_mean_box_mymod.py"
] | [
"import os\nimport glob\n\nimport numpy as np \nimport matplotlib.pyplot as plt\n\nfrom astropy.io import fits\nfrom matplotlib.ticker import FuncFormatter\n\n###################### BEGIN ###################### \n\n# Get data\n\nfiles = glob.glob('/home/prabhu/sunrise_holly/normal... | [
[
"numpy.mean"
]
] |
tkameyama/incubator-mxnet | [
"47b0bdd00e7c5e1c9a448809b02e68c0e4b72e96"
] | [
"tests/python/unittest/test_gluon_data.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.pad",
"numpy.array",
"numpy.random.rand",
"numpy.asarray",
"numpy.ones",
"numpy.random.uniform",
"numpy.arange",
"numpy.stack"
]
] |
mehdidc/keras-yolo3 | [
"459b08438b13b6aacd1464960b1ad7d816a601d6"
] | [
"yolo3/model.py"
] | [
"\"\"\"YOLO_v3 Model Defined in Keras.\"\"\"\n\nfrom functools import wraps\n\nimport numpy as np\nimport tensorflow as tf\nfrom keras import backend as K\nfrom keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate, MaxPooling2D\nfrom keras.layers.advanced_activations import LeakyReLU\nfrom kera... | [
[
"numpy.array",
"tensorflow.image.non_max_suppression",
"numpy.minimum",
"numpy.argmax",
"numpy.floor",
"tensorflow.boolean_mask",
"numpy.expand_dims",
"numpy.maximum"
]
] |
houdinii/Interactive-Dashboards-and-Data-Apps-with-Plotly-and-Dash | [
"10e04ed5ab6e891f85417ba223706cfa7144f94b"
] | [
"chapter_05/app_v5_3.py"
] | [
"import re\n\nimport dash\nimport dash_html_components as html\nimport dash_core_components as dcc\nimport dash_bootstrap_components as dbc\nfrom dash.dependencies import Output, Input\nfrom dash.exceptions import PreventUpdate\nimport plotly.graph_objects as go\nimport plotly.express as px\nimport pandas as pd\n\n... | [
[
"pandas.read_csv"
]
] |
arsenal9971/DeeMicrolocalReconstruction | [
"0d5bbee86789d2c3acc6e9c872d270f46190d857"
] | [
"Task_adapted_recon_edge/learned_primal_dual_edge_detect.py"
] | [
"\"\"\"Partially learned gradient descent scheme for ellipses.\"\"\"\n\nimport os\nimport adler\nadler.util.gpu.setup_one_gpu()\n\nfrom adler.tensorflow import prelu, cosine_decay, reference_unet\n\nimport tensorflow as tf\nimport numpy as np\nimport odl\nimport odl.contrib.tensorflow\nimport scipy.ndimage\nimport ... | [
[
"numpy.random.rand",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.gradients",
"tensorflow.zeros_like",
"tensorflow.control_dependencies",
"tensorflow.global_variables_initializer",
"tensorflow.InteractiveSession",
"tensorflow.trainable_variables",
"numpy.empty",
... |
jyun25/librosa | [
"a297cac125175afe57fccbf5eecb65b79d088181"
] | [
"tests/test_effects.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\"\"\"Unit tests for the effects module\"\"\"\nimport warnings\n\n# Disable cache\nimport os\n\ntry:\n os.environ.pop(\"LIBROSA_CACHE_DIR\")\nexcept KeyError:\n pass\n\nfrom contextlib2 import nullcontext as dnr\nimport numpy as np\nimport pytest\n\nimport li... | [
[
"numpy.concatenate",
"numpy.zeros_like",
"numpy.asarray",
"numpy.zeros",
"numpy.percentile",
"numpy.ones",
"numpy.allclose",
"numpy.arange",
"numpy.abs",
"numpy.all",
"numpy.vstack"
]
] |
magnetar-iiith/PRIL | [
"dea35169ca823115b96b8fe88ca7ef545b353b08"
] | [
"helper.py"
] | [
"import numpy as np\n\ndef get_state_rewards(env):\n rews = [0.] * env.nS\n for i in range(env.nS):\n dictn = env.P[i]\n for a in range (env.nA):\n li = dictn[a]\n for (p,s,r,d) in li:\n rews[s] += p * r\n return rews\n\ndef get_transition_prob_matrix(env):\n\n tns_prob ... | [
[
"numpy.zeros"
]
] |
wohllab/milkyway_proteomics | [
"622969f7f4a5955ae2bff299ae7b08572d422814"
] | [
"galaxy_milkyway_files/tools/wohl-proteomics/MSGFcrux/tab_percolator_to_fido.py"
] | [
"import sys,os\nimport pandas\nfrom Bio import SeqIO\n\n\"\"\"\nConverter script for Percolator output to create Fido-readable files.\n\nBy Jose Fernandez Navarro,\nSLIGHTLY MODIFIED BY WILLIAM BARSHOP (LABORATORY OF JAMES A WOHLSCHLEGEL)\nThese modifications allow input of multiple tab delimited peptide-level perc... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
zackers14/CudaTensorflow | [
"db30da95a71c5a94fc4a8511551d454537847f8d"
] | [
"tensorflow/contrib/tensorrt/test/tf_trt_integration_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.core.protobuf.config_pb2.ConfigProto",
"tensorflow.python.ops.array_ops.identity",
"tensorflow.contrib.tensorrt.create_inference_graph",
"tensorflow.contrib.tensorrt.trt_convert.get_linked_tensorrt_version",
"tensorflow.python.platform.test.main",
"tensorflow.python.ops.nn.relu... |
machines-in-motion/dg_tools | [
"1c8d0c09da5185113e0dd69e6b59cd5c8270afa6"
] | [
"tests/test_memory_replay.py"
] | [
"import unittest\nimport numpy as np\n\nfrom dg_tools.dynamic_graph.dg_tools_entities import MemoryReplay\n\nclass TestMemoryReplay(unittest.TestCase):\n def test_basic(self):\n a = np.random.rand(2, 3)\n entity = MemoryReplay('')\n\n # Init from the matrix.\n entity.init(a)\n\n ... | [
[
"numpy.testing.assert_array_equal",
"numpy.random.rand"
]
] |
FarisHijazi/deep-learning-v2-pytorch | [
"543643095b2659ec97402a0309e0e5b90f8e003b"
] | [
"project-bikesharing/my_answers.py"
] | [
"import numpy as np\n\n\ndef sigmoid(x):\n return 1.0 / (1.0 + np.exp(-x))\n\n\ndef relu(x):\n return np.maximum(x, 0.0)\n\n\ndebug = True\n\n\nclass NeuralNetwork(object):\n def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):\n # Set number of nodes in input, hidden and outp... | [
[
"numpy.random.normal",
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.exp",
"numpy.maximum"
]
] |
wizofe/urus-mri-recon | [
"eab8e48dca31d2b936ce69ccc251ec5a4a10facc"
] | [
"main.py"
] | [
"# models\nimport shutil\nimport sys\n\nfrom tensorboardX import SummaryWriter\nfrom torch import optim\n\nfrom utils.myloss import *\nimport torch.nn.modules.loss as Loss\nfrom unet import UNet\nfrom utils import *\nfrom utils.cmplxBatchNorm import magnitude, normalizeComplexBatch_byMagnitudeOnly\nfrom utils.datas... | [
[
"torch.nn.modules.loss.MSELoss"
]
] |
feizy/deeplab | [
"64bb77dd256802306d86841889bba67820f226de"
] | [
"tools/train_voc.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2018/9/26 15:48\n# @Author : HLin\n# @Email : linhua2017@ia.ac.cn\n# @File : train_voc.py\n# @Software: PyCharm\n\nimport os\nimport pprint\nimport logging\nimport argparse\nimport torch\nimport torch.nn as nn\nfrom tqdm import tqdm\nimport numpy as np\nfrom math import ... | [
[
"torch.device",
"torch.save",
"torch.no_grad",
"numpy.load",
"torch.cuda.get_device_name",
"torch.cuda.current_device",
"torch.squeeze",
"torch.cuda.is_available",
"numpy.argmax",
"torch.load",
"torch.nn.CrossEntropyLoss"
]
] |
lvbu12/DL_sequence_models_homework | [
"6742c1ffdf2f6e35c3c88dcfd8a126ea070ae0dd"
] | [
"Week_02/Emojify/train_01.py"
] | [
"#_*_ coding:utf-8 _*_\r\nimport numpy as np\r\nfrom emo_utils import *\r\nimport emoji\r\nimport matplotlib.pyplot as plt\r\n\r\nX_train, Y_train = read_csv('data/train_emoji.csv')\r\nX_test, Y_test = read_csv('data/tesss.csv')\r\n\r\nmaxLen = len(max(X_train, key=len).split())\r\n\r\nindex = 1\r\nprint(X_train[in... | [
[
"numpy.array",
"numpy.dot",
"numpy.asarray",
"numpy.zeros",
"numpy.log",
"numpy.random.seed",
"numpy.random.randn",
"numpy.eye",
"numpy.argmax",
"numpy.sqrt"
]
] |
OnionMoeCat/Project-Behavioral-Cloning | [
"42a7e66e576e71736e942ce6e6ffad83244fa815"
] | [
"drive.py"
] | [
"import argparse\nimport base64\nfrom datetime import datetime\nimport os\nimport shutil\n\nimport numpy as np\nimport socketio\nimport eventlet\nimport eventlet.wsgi\nfrom PIL import Image\nfrom flask import Flask\nfrom io import BytesIO\n\nfrom keras.models import load_model\nimport h5py\nfrom keras import __vers... | [
[
"numpy.asarray"
]
] |
kenliufang/showandtell | [
"76c9adab967e58c652ab5cdf8de447d2b6e775af"
] | [
"im2txt/im2txt/inference_client.py"
] | [
"r\"\"\"Generate captions for images using default beam search parameters.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom concurrent import futures\nimport time\n\n\nimport math\nimport os\n\n\nimport tensorflow as tf\n\nfrom im2txt impo... | [
[
"tensorflow.flags.DEFINE_string",
"tensorflow.gfile.GFile"
]
] |
certik/pandas | [
"758ca05e2eb04532b5d78331ba87c291038e2c61"
] | [
"pandas/tests/test_tseries.py"
] | [
"# -*- coding: utf-8 -*-\nimport nose\nfrom numpy import nan\nimport numpy as np\nfrom pandas import Index, isnull, Timestamp\nfrom pandas.util.testing import assert_almost_equal\nimport pandas.util.testing as tm\nfrom pandas.compat import range, lrange, zip\nimport pandas.lib as lib\nimport pandas._period as perio... | [
[
"numpy.array_equal",
"pandas.lib.SeriesGrouper",
"pandas.algos.left_join_indexer_int64",
"pandas.algos.ensure_platform_int",
"pandas.Timestamp",
"pandas.util.testing._skip_if_no_scipy",
"pandas.compat.range",
"scipy.stats.rankdata",
"pandas.Timestamp.min.to_pydatetime",
"nu... |
sdjespersen/pyzinc | [
"54baeec6d1b2b36cef98428b3888558004ba43d3"
] | [
"tests/test_zinc_parser.py"
] | [
"# coding: utf-8\nimport io\nimport numpy as np # type: ignore\nimport pandas as pd # type: ignore\nimport pytest # type: ignore\nimport zincio\n\nfrom pandas.api.types import CategoricalDtype # type: ignore\nfrom pathlib import Path\n\n\ndef get_abspath(relpath):\n return Path(__file__).parent / relpath\n\n... | [
[
"pandas.to_datetime",
"pandas.Timestamp",
"pandas.api.types.CategoricalDtype"
]
] |
smsharma/gamma-gp | [
"573a9a7ecbf71a1e6c0d20e3d6ef189538c8b4e5"
] | [
"utils/psf_compute.py"
] | [
"###############################################################################\n# psf_compute.py\n###############################################################################\n#\n# The statistics of non-poissonian templates is modified by the non-zero point\n# spread functions associated with real instruments.... | [
[
"numpy.concatenate",
"numpy.random.normal",
"numpy.histogram",
"numpy.arccos",
"numpy.sin",
"numpy.linalg.norm",
"numpy.max",
"numpy.sum",
"numpy.min",
"numpy.where",
"numpy.random.uniform",
"numpy.arctan2",
"numpy.cos",
"numpy.linspace",
"numpy.mod"
]... |
zlin7/experiments_dnn | [
"24a2a1617a75fb74254301abc75682b5f90fce77"
] | [
"scripts/utility/load_cifar.py"
] | [
"from keras.datasets import cifar10\nimport numpy as np\n\ndef load_cifar_n_classes(classes = [1,3,5]): # Default car, cat, dog\n \n (x_train, y_train), (x_test, y_test) = cifar10.load_data() # Load in CIFAR-10 dataset\n \n indices_tr = [idx for idx in range(len(y_train)) if y_train[idx] in classes... | [
[
"numpy.where"
]
] |
nyck33/reinforcement-learning | [
"07de5dcab22e893072acf98ee84cc7ceb65ae1cf",
"07de5dcab22e893072acf98ee84cc7ceb65ae1cf",
"07de5dcab22e893072acf98ee84cc7ceb65ae1cf"
] | [
"2-cartpole/1-dqn/cartpole_only_per.py",
"1-grid-world/4-sarsa/environment.py",
"1-grid-world/4-sarsa/sarsa_agent.py"
] | [
"import sys\r\nimport gym\r\nimport pylab\r\nimport random\r\nimport numpy as np\r\nfrom SumTree import SumTree\r\nfrom collections import deque\r\nfrom keras.layers import Dense\r\nfrom keras.optimizers import Adam\r\nfrom keras.models import Sequential\r\n\r\nEPISODES = 300\r\n\r\n\r\n# 카트폴 예제에서의 DQN 에이전트\r\nclas... | [
[
"numpy.random.rand",
"numpy.reshape",
"numpy.zeros",
"numpy.argmax",
"numpy.amax"
],
[
"numpy.random.seed",
"numpy.array"
],
[
"numpy.random.rand",
"numpy.random.choice"
]
] |
pjh4993/AdelaiDet | [
"8b622b185eb66205a2341cd9fbef94a42019148b"
] | [
"adet/modeling/fcos/fcos.py"
] | [
"import math\nfrom typing import List, Dict\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom detectron2.layers import ShapeSpec, NaiveSyncBatchNorm\nfrom detectron2.modeling.proposal_generator.build import PROPOSAL_GENERATOR_REGISTRY\n\nfrom adet.layers import DFConv2d, NaiveGroupNo... | [
[
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.FloatTensor",
"torch.no_grad",
"torch.nn.BatchNorm2d",
"torch.nn.GroupNorm",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.functional.relu"
]
] |
WaveBlocks/WaveBlocks | [
"2af3730dcf27e54006ec602e696b4d4df25459d8",
"2af3730dcf27e54006ec602e696b4d4df25459d8"
] | [
"src/scripts_spawn_na/AposterioriSpawningNAKF.py",
"src/scripts_spawn_na/PlotInnerproducts.py"
] | [
"\"\"\"The WaveBlocks Project\n\nScript to spawn new wavepackets aposteriori to an already completed simulation.\nThis can be used to evaluate spawning errors and test criteria for finding the\nbest spawning time.\n\n@author: R. Bourquin\n@copyright: Copyright (C) 2011 R. Bourquin\n@license: Modified BSD License\n\... | [
[
"numpy.imag",
"numpy.real"
],
[
"numpy.imag",
"numpy.real",
"numpy.abs"
]
] |
mtn/ml | [
"2cd2c447c15baa41e9626fa453c2fdc872e73cd6"
] | [
"robotics/ekf_slam_and_pf_localization/code/ekf-slam/Laser.py"
] | [
"import numpy as np\nfrom Gridmap import Gridmap\n\n\nclass Laser(object):\n # Construct an Laser instance with the following set of variables,\n # which are described in Section 6.3.1 of Probabilistic Robotics\n # numBeams: Number of beams that comprise the scan\n def __init__(self, numBeams=41):\n... | [
[
"numpy.square",
"numpy.sin",
"numpy.array",
"numpy.ceil",
"numpy.tan",
"numpy.tile",
"numpy.cos",
"numpy.linspace",
"numpy.mod",
"numpy.floor"
]
] |
skylarkgit/face-verification | [
"75751ba2fc23994f1574a3c03d1323f30900adf1"
] | [
"server.py"
] | [
"from flask import Flask, request\nfrom flask_restful import Resource, Api, reqparse\nimport werkzeug\nimport face\nimport pprint\nfrom matplotlib import pyplot\nimport facenet.src.facenet as facenet\nfrom keras.models import load_model\nimport os\nimport tensorflow as tf\nfrom flask_cors import CORS, cross_origin\... | [
[
"tensorflow.get_default_graph"
]
] |
sidneydong/QUANTAXIS | [
"92815e2d50936b812b39619f9090aa761473d46a"
] | [
"QUANTAXIS/QAApplication/QAAnalysis.py"
] | [
"# Encoding:UTF-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2021 yutiansut/QUANTAXIS\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 with... | [
[
"pandas.to_datetime",
"numpy.std",
"numpy.cov",
"pandas.DataFrame"
]
] |
molimat/YOLOv4-Counter-in-TF | [
"2c112424336fa03e82de67cf6b8487e8cb99a54a"
] | [
"core/yolov4.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n\nimport numpy as np\nimport tensorflow as tf\nimport core.utils as utils\nimport core.common as common\nimport core.backbone as backbone\nfrom core.config import cfg\n\n# NUM_CLASS = len(utils.read_class_names(cfg.YOLO.CLASSES))\n# STRIDES = np.array(cfg.YOLO.... | [
[
"tensorflow.exp",
"tensorflow.shape",
"tensorflow.range",
"tensorflow.concat",
"tensorflow.sigmoid",
"tensorflow.expand_dims",
"tensorflow.reshape",
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.constant",
"tensorflow.reduce_max",
"tensorflow.math.reduc... |
ashim95/parser | [
"61e9cd6bf16dcf1aa2b9d51b3a6c04ed048b3199"
] | [
"supar/parsers/semantic_dependency.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\n\nimport torch\nimport torch.nn as nn\nfrom supar.models import (BiaffineSemanticDependencyModel,\n VISemanticDependencyModel)\nfrom supar.parsers.parser import Parser\nfrom supar.utils import Config, Dataset, Embedding\nfrom supar.utils.common import ... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.ExponentialLR"
]
] |
philtgun/compare-embeddings | [
"72c1cfffe17d6d3049f5e41ad6bef1e8a353f6a0"
] | [
"src/visualize.py"
] | [
"# Copyright 2022 Philip Tovstogan, Music Technology Group\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 ... | [
[
"numpy.fill_diagonal",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
pvgladkov/abstraction-and-reasoning-challenge | [
"0dfe16b5044f5aba0d5f53397dc615400e61aa69"
] | [
"arc_run.py"
] | [
"import pickle\n\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\n\nfrom arc.colors import TaskSolverColor\nfrom arc.sophisticated_trees import StackedTaskSolver\nfrom arc.trees import TaskSolverTree\nfrom arc.utils import load_data, flattener, get_logger\n\nBASE_PATH = '/data/arc'\n\n# BASE_PATH = ... | [
[
"numpy.equal",
"numpy.array",
"pandas.merge",
"pandas.Series"
]
] |
tomicapretto/pymc3 | [
"692a09f816acb573ba35927f930a214989b1c519"
] | [
"pymc3/tests/test_variational_inference.py"
] | [
"# Copyright 2020 The PyMC Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.zeros_like",
"numpy.random.rand",
"numpy.random.binomial",
"numpy.ones_like",
"numpy.random.normal",
"numpy.asarray",
"numpy.log",
"numpy.ones",
"numpy.random.randn",
"numpy.exp",
"numpy.mean",
"numpy.st... |
justinfmccarty/CityEnergyAnalyst_bigmacc | [
"a7f2d6085e83730bdc4bcb2321e1613070372027"
] | [
"cea/interfaces/dashboard/api/databases.py"
] | [
"\n\n\nimport os\nfrom collections import OrderedDict\n\nfrom flask_restplus import Namespace, Resource, abort\nimport pandas as pd\n\nimport cea.schemas\nfrom cea.databases import get_regions, get_database_tree, databases_folder_path\nfrom cea.utilities.schedule_reader import schedule_to_dataframe\n\napi = Namespa... | [
[
"pandas.ExcelFile"
]
] |
Rowing0914/TF2_RL | [
"c1b7f9b376cbecf01deb17f76f8e761035ed336a"
] | [
"tf_rl/examples/NerveNet/scripts/util_test/graph_operator_test.py"
] | [
"from graph_util.mujoco_parser import parse_mujoco_graph\nfrom graph_util.graph_operator import GraphOperator\nimport networkx as nx\nimport matplotlib.pyplot as plt\n\nnode_info = parse_mujoco_graph(task_name=\"WalkersHopperone-v1\")\ngraph_operator = GraphOperator(input_dict=node_info[\"input_dict\"],\n ... | [
[
"matplotlib.pyplot.show"
]
] |
JiaLei123/ML_camp | [
"87ba197737160958c9e05b08b277772e80b564e4"
] | [
"MXnet/rnn/rnn_gluon_w2v.py"
] | [
"import math\nimport os\nimport time\nimport numpy as np\nimport mxnet as mx\nfrom mxnet import gluon, autograd\nfrom mxnet.gluon import nn, rnn\nimport zipfile\nfrom MXnet import utils\nfrom gensim.models import word2vec\n\nwith zipfile.ZipFile('../data/ptb.zip', 'r') as zin:\n zin.extractall('../data/')\n\n\nc... | [
[
"numpy.random.uniform",
"numpy.zeros"
]
] |
brightcoder01/models | [
"bf95351ea51b5dfb192e42a02117a5fade498af3"
] | [
"tests/test_rnnts.py"
] | [
"import sqlflow_models\nfrom tests.base import BaseTestCases\n\nimport tensorflow as tf\nimport numpy as np\nnp.random.seed(22)\nimport unittest\n\n\nclass TestRNNBasedTimeSeriesModel(BaseTestCases.BaseTest):\n def setUp(self):\n # We use sin data plus perturbation to simulate time series data\n ti... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.random.seed",
"tensorflow.feature_column.numeric_column",
"numpy.arange"
]
] |
vishalbelsare/topopy | [
"73ccc9510bd34be2ead875bc3bc1081ccad26b1f"
] | [
"topopy/TopologicalObject.py"
] | [
"import sys\nimport time\nimport warnings\n\nimport numpy as np\nimport sklearn.preprocessing\n\nimport nglpy as ngl\n# import nglpy_cuda as ngl\n\n\nclass TopologicalObject(object):\n \"\"\" A base class for housing common interactions between Morse and\n Morse-Smale complexes, and Contour and Merge Tree... | [
[
"numpy.array",
"numpy.empty",
"numpy.genfromtxt",
"numpy.all",
"numpy.unique",
"numpy.atleast_2d"
]
] |
JWDebelius/monte_carlo_power | [
"36c625bb01cf1019a05669a0b4938774c66fea1f"
] | [
"machivellian/tests/test_power.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# ---------------------------------... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.random.seed",
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_array_equal",
"numpy.ones",
"scipy.stats.kruskal",
"numpy.arange",
"numpy.log10",
"numpy.vstack"
]
] |
nocmok/ridesharing-dispatcher | [
"cb982028250b3131479797826ada57062d10c5b6"
] | [
"playground/benchmarks/metrics_per_n_vehicles.py"
] | [
"import numpy as np\nimport pandas\nfrom pandas import read_csv\nimport matplotlib.pyplot as plt\nimport sys\n\nscript_dir=sys.path[0]\nds_name=sys.argv[1]\ncsv_path=script_dir + \"/\" + ds_name + \"/\" + ds_name + \"_metrics_per_n_vehicles.csv\"\npng_plot_path=script_dir + \"/\" + ds_name + \"/\" + ds_name + \"_me... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"pandas.read_csv",
"matplotlib.pyplot.subplots_adjust",
"numpy.unique"
]
] |
bhaney/endjinn | [
"14b2da858892d685903a11c223b963339e4a8aa3"
] | [
"endjinn/state_block/graph.py"
] | [
"import numpy as np\nimport networkx as nx\n\n\nclass Graph(object):\n \"\"\"\n Class for representing state graph with valid transitions.\n \"\"\"\n def __init__(self, node_labels=None, edgelist=None, stateful=False, weighted=False):\n \"\"\"\n\n :param node_labels: List of strings.\n ... | [
[
"numpy.max",
"numpy.zeros"
]
] |
shuyangli94/PyTorch_Speaker_Verification | [
"22c4457398d1eae4488f15fbbb524c38afb1f028",
"22c4457398d1eae4488f15fbbb524c38afb1f028"
] | [
"utils.py",
"train_speech_embedder.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 20 16:56:19 2018\n\n@author: harry\n\"\"\"\nimport librosa\nimport numpy as np\nimport torch\nimport torch.autograd as grad\nimport torch.nn.functional as F\n\nfrom hparam import hparam as hp\n\ndef get_device(use_cuda=True):\n cuda_ava... | [
[
"torch.device",
"numpy.dot",
"torch.stack",
"torch.cuda.current_device",
"torch.cuda.is_available",
"torch.tensor",
"numpy.abs",
"numpy.clip",
"torch.nn.functional.cosine_similarity",
"torch.exp"
],
[
"torch.device",
"torch.utils.data.DataLoader",
"torch.loa... |
xuanyuanXIV/carveme | [
"889f4d06d000f90711d92a9fada6bd413d353263"
] | [
"carveme/reconstruction/eggnog.py"
] | [
"import pandas as pd\n\n\ndef split_and_expand(df, col, sep):\n split_col = df[col].str.split(sep).apply(pd.Series, 1).stack()\n split_col.index = split_col.index.droplevel(-1)\n split_col.name = col\n df = df.drop(col, axis=1).join(split_col)\n df.reset_index(drop=True, inplace=True)\n return df\... | [
[
"pandas.read_csv"
]
] |
Froskekongen/oslodatascience-rl | [
"f265d50ded86075787d2696719d543615c941e29"
] | [
"common.py"
] | [
"import logging\nimport pandas as pd\nimport time\n\nclass LogProgress(object):\n '''\n Class for logging progress of RL agents\n logfile: file name of log file.\n console: output to console.\n level: logging level.\n name: name of logger. (not really relevant as of now...)\n '''\n def __ini... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
nft-appraiser/nft-appraiser-api | [
"6d6495049851afd3d9bfc6969d0e1c9bc430dc81"
] | [
"code/taskA/views_utils/utils.py"
] | [
"import os\nimport gc\nimport time\nimport imghdr\nfrom io import BytesIO\nfrom typing import List, Optional\n\nimport requests\nimport numpy as np\nimport pandas as pd\nfrom tqdm.notebook import tqdm # if you don't use IPython Kernel like jupyter, you should change \"tqdm.notebook\" to \"tqdm\"\nfrom cairosvg imp... | [
[
"numpy.array",
"pandas.json_normalize"
]
] |
lreis2415/PyGeoC | [
"ad2b3166a58ed5d0a8005e33873bd861305e514f"
] | [
"pygeoc/raster.py"
] | [
"\n# -*- coding: utf-8 -*-\n\"\"\"Raster Utility Class.\n用于创建栅格数据对象并进行简单操作,如另存为ASCII格式栅格、栅格重分类等。\n\n author: Liangjun Zhu\n\n changlog:\n\n - 12-04-12 jz - origin version.\n - 16-07-01 lj - reorganized for pygeoc.\n - 17-06-25 lj - check by pylint and reformat by Google style.\n - 17-07-20 lj ... | [
[
"numpy.max",
"numpy.full",
"numpy.ceil",
"numpy.isnan",
"numpy.isclose",
"numpy.zeros",
"numpy.copy",
"numpy.nansum",
"numpy.ones",
"numpy.nanmin",
"numpy.where",
"numpy.nanmean",
"numpy.floor",
"numpy.hstack",
"numpy.nanmax",
"numpy.dtype",
"num... |
3tew/rox-auto-fishing | [
"7887d563a088533e8326f8cac6572da6e473526c"
] | [
"repositories/render_repo.py"
] | [
"import psutil\nimport ctypes\nimport cv2\nimport numpy as np\nfrom PIL import Image\n\nimport config\n\n\ndef tracking_info(curTime):\n # Initialize FPS variables\n sec = curTime - config.PREV_TIME\n config.PREV_TIME = curTime\n fps = 1 / sec\n count_str = \"%d time\" % config.COUNT\n fps_str = \... | [
[
"numpy.hstack"
]
] |
RadZaeem/ml-testbed | [
"a5ea7716c5df9e3d8b53422c4fe62336c18a54d9"
] | [
"bit-rnn/train.py"
] | [
"import time\nimport functools\nimport importlib\n\nimport numpy as np\nimport tensorflow as tf\n\nimport reader\n\nimport bit_utils\nfrom bit_rnn_cell import BitGRUCell\nfrom model import PTBModel\n\nflags = tf.flags\nlogging = tf.logging\n\nflags.DEFINE_string('data_path', None, 'data_path')\nflags.DEFINE_string(... | [
[
"tensorflow.set_random_seed",
"tensorflow.uniform_unit_scaling_initializer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.Graph",
"numpy.exp",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"tensorflow.app.run",
"tensorflow.global_variables_initializer",
"tenso... |
lijiangfang/pytorch | [
"8824f49e686fbfcf895e3e9414c843cfbc4f31a5"
] | [
"torch/testing/_internal/common_methods_invocations.py"
] | [
"from functools import reduce, wraps, partial\nfrom itertools import product\nfrom operator import mul\nimport collections\nimport operator\nimport random\n\nimport torch\nimport numpy as np\nfrom torch._six import inf\nfrom torch.autograd import Variable\nimport collections.abc\n\nfrom typing import List, Sequence... | [
[
"numpy.random.choice",
"torch.polygamma",
"torch.triu_indices",
"torch.einsum",
"torch.linalg.svd",
"torch.testing.all_types_and",
"torch.randperm",
"numpy.exp",
"torch.ones",
"numpy.sinc",
"numpy.sign",
"torch.testing.floating_and_complex_types_and",
"torch.tes... |
markzhao98/optical-tweezers-archive | [
"1a7b813fd48c5e72a5872df6a6c7f046996e3f43"
] | [
"GUI_GM_1.0.py"
] | [
"# Run Micro-Manager ------------------------------------------------------------\r\n\r\n#import os\r\n#os.startfile(\"C:\\Program Files\\Micro-Manager-1.4\\ImageJ.exe\")\r\n\r\nimport Tkinter as tk\r\nimport PyDAQmx\r\nimport numpy as np\r\nimport time\r\nimport csv\r\n\r\n# The GUI -------------------------------... | [
[
"numpy.sin"
]
] |
lucaagozzino/Fantapalla_Forever_database | [
"8adf036924ceec6dc544e189c834937875a8646f"
] | [
"Algoritmo_rose/Utilities_fantapalla.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[367]:\n\n\nimport numpy as np\nfrom sympy.utilities.iterables import multiset_permutations\nimport random\nimport copy\nimport glob\nfrom IPython import display\nimport pandas as pd\nquotazioni = pd.read_csv ('Quotazioni_Fantacalcio.csv')\n\nfrom joblib import Paralle... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.float",
"pandas.concat",
"pandas.DataFrame",
"pandas.read_excel",
"numpy.sum",
"numpy.shape",
"numpy.sort",
"numpy.append",
"numpy.average",
"numpy.hstack",
"pandas.read_csv"
]
] |
Gerryflap/RL_project_common | [
"c143e3e98ab882188f511a4b4edcde8cd10fc9f4"
] | [
"environments/flappybird.py"
] | [
"import numpy as np\nimport pygame\nfrom ple import PLE\nimport ple.games\n\nfrom core import State, Action, FiniteActionEnvironment\n\n\"\"\"\n Flappy Bird Environment wrapper for PyGame Learning Environment's Flappy Bird\n https://github.com/ntasfi/PyGame-Learning-Environment\n\"\"\"\n\npygame.init()\n\n\nc... | [
[
"numpy.random.RandomState"
]
] |
SoumyaShreeram/Locating_AGN_in_DM_halos | [
"1cfbee69b2c000faee4ecb199d65c3235afbed42"
] | [
"imported_files/plotting_aim03.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Plotting.py for notebook 02_AGN_incidence_in_Major_Mergers\n\nThis python file contains all the functions used for plotting graphs and maps in the 2nd notebook (.ipynb) of the repository: 02. Creating a Major Merger (MM) catalogue to study AGN incidence due to galaxy mergers\n\nScrip... | [
[
"numpy.max",
"scipy.interpolate.interp1d",
"numpy.array",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.load",
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.any",
"numpy.where",
"numpy.transpose",
"numpy.arange",
"numpy.sqrt",
"matplotlib.patch... |
edosedgar/RLForSeg | [
"fc748d8e7d2f2a1e7ac0dddb3f268ec3025d40ca"
] | [
"agents/sac_obj_lvl_rew.py"
] | [
"import os\nimport torch\nimport elf\nimport numpy as np\nimport wandb\nfrom elf.segmentation.features import compute_rag\nfrom torch.nn import functional as F\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.data import DataLoader\nfrom collections import namedtuple\nimport matplotlib.pypl... | [
[
"numpy.ones_like",
"torch.cuda.amp.autocast",
"torch.load",
"torch.sigmoid",
"matplotlib.pyplot.subplots",
"torch.tensor",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.subplots_adjust",
"torch.zeros",
"torch.device",
"torch.min",
"torch.set_default_tensor_type"... |
Peter-Chou/cgec-initialized-with-plm | [
"f2e3615de99ca1044b247d3cc49e89d63b587f43",
"f2e3615de99ca1044b247d3cc49e89d63b587f43"
] | [
"experiments/roberta_roberta_share/eval_roberta_roberta_share.py",
"experiments/ernie_gpt2/eval_ernie_gpt2.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport sys\nfrom pathlib import Path\nimport os\nPROJECT_DIR = Path(__file__).resolve().parents[2]\nsys.path.append(os.fspath(PROJECT_DIR))\n\nimport torch\nfrom transformers import EncoderDecoderModel\n\nfrom experiments.eval_encoder_decoder_model import eval_test_result, get_test_datal... | [
[
"torch.cuda.is_available"
],
[
"torch.cuda.is_available"
]
] |
jeremylimconsulting/spiceai | [
"84b370dfce02dac03774a6c8cd74f72e39904ee7"
] | [
"ai/src/connector/stateful.py"
] | [
"from data import DataManager\nimport numpy as np\nimport pandas as pd\nimport copy\nfrom exception import LawInvalidException, DataSourceActionInvalidException\nfrom exec import somewhat_safe_exec, somewhat_safe_eval\n\n\nclass StatefulConnector:\n def __init__(\n self,\n data_manager: DataManager... | [
[
"pandas.DataFrame"
]
] |
ranahanocka/pytorch-a2c-ppo-acktr | [
"e3119e883861315885d22788d025c6b29f076018"
] | [
"envs.py"
] | [
"import os\n\nimport gym\nimport numpy as np\nfrom gym.spaces.box import Box\n\nfrom baselines import bench\nfrom baselines.common.atari_wrappers import make_atari, wrap_deepmind\n\ntry:\n import dm_control2gym\nexcept ImportError:\n pass\n\ntry:\n import roboschool\nexcept ImportError:\n pass\n\ntry:\n... | [
[
"numpy.concatenate"
]
] |
PacktPublishing/Hands-on-NLP-with-NLTK-and-scikit-learn- | [
"8bb2095093a822363675368a4216d30d14cac501"
] | [
"Section 3/nlp-3-sentiment-analysis.py"
] | [
"import collections\nimport nltk\nimport os\nfrom sklearn import (\n datasets, model_selection, feature_extraction, linear_model\n)\n\n\ndef extract_features(corpus):\n '''Extract TF-IDF features from corpus'''\n # vectorize means we turn non-numerical data into an array of numbers\n count_vectorizer = ... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.datasets.load_files",
"sklearn.feature_extraction.text.TfidfTransformer"
]
] |
JoaoLages/ecco | [
"0ef61c51b76c48cd8c21c7807c20510565f307de"
] | [
"src/ecco/activations.py"
] | [
"import torch\nimport numpy as np\n\n\ndef reshape_hidden_states_to_3d(hidden_states):\n \"\"\"\n Turn hidden_states from (layer, batch, position, d_model)\n to a tensor (layer, d_model, batch + position).\n Args:\n hidden_states: the hidden states return by the language model. A list of tensors... | [
[
"numpy.moveaxis",
"torch.stack"
]
] |
wvitzthum/DL_super_resolution | [
"59b2e68bad02579693d48f33ae64d524f08af5ff"
] | [
"src/trainer_esrgan.py"
] | [
"from datetime import datetime\nimport time\nimport copy\nimport torch\nfrom torch import nn\nfrom torch.optim.adam import Adam\nfrom torch.optim.lr_scheduler import MultiStepLR\n\nfrom .models import ESRGANDiscriminator, ESRGANGenerator\nfrom .trainer import Trainer\nfrom .utils import AverageMeter, PerceptualLoss... | [
[
"torch.nn.L1Loss",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.ones_like",
"torch.nn.BCEWithLogitsLoss",
"torch.zeros_like"
]
] |
evdcush/neorl | [
"a1af069072e752ab79e7279a88ad95d195a81821"
] | [
"neorl/rl/baselines/acer/acer_simple.py"
] | [
"import time\nimport warnings\n\nimport numpy as np\nimport tensorflow as tf\nfrom gym.spaces import Discrete, Box\nfrom collections import deque\n\nfrom neorl.rl.baselines.shared import logger\nfrom neorl.rl.baselines.shared.schedules import Scheduler\nfrom neorl.rl.baselines.shared.tf_util import batch_to_seq, se... | [
[
"tensorflow.group",
"numpy.copy",
"tensorflow.reshape",
"numpy.mean",
"tensorflow.gradients",
"tensorflow.control_dependencies",
"tensorflow.global_variables_initializer",
"tensorflow.square",
"tensorflow.summary.histogram",
"numpy.random.poisson",
"tensorflow.variable_... |
ChetanMadan/face_recognition | [
"fd1989ea536784baf86ec502fb5c05151bc99221"
] | [
"facerec_from_webcam_faster.py"
] | [
"import face_recognition\nimport cv2\nimport pandas as pd\n\n# This is a demo of running face recognition on live video from your webcam. It's a little more complicated than the\n# other example, but it includes some basic performance tweaks to make things run a lot faster:\n# 1. Process each video frame at 1/4 r... | [
[
"pandas.read_csv"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.