repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
basbeu/PyLaia | [
"d14458484b56622204b1730a7d53220c5d0f1bc1"
] | [
"laia/utils/dortmund_image_to_tensor.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\n\nimport cv2\nimport numpy as np\nimport torch\nfrom PIL import Image, ImageOps\n\n\ndef dortmund_distort(img, random_limits=(0.8, 1.1)):\n \"\"\"\n Creates an augmentation by computing a homography from three points in the\n image t... | [
[
"numpy.transpose",
"numpy.reshape",
"numpy.float32",
"numpy.asarray",
"numpy.median",
"matplotlib.pyplot.imshow",
"torch.from_numpy",
"matplotlib.pyplot.show",
"numpy.expand_dims",
"numpy.random.rand",
"numpy.mean"
]
] |
zhoub/dldt | [
"e42c01cf6e1d3aefa55e2c5df91f1054daddc575"
] | [
"tools/accuracy_checker/accuracy_checker/representation/pose_estimation_representation.py"
] | [
"\"\"\"\nCopyright (c) 2019 Intel Corporation\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or ag... | [
[
"numpy.max",
"numpy.min",
"numpy.size"
]
] |
hmaarrfk/vispy | [
"7f3f6f60c8462bb8a3a8fa03344a2e6990b86eb2"
] | [
"examples/basics/scene/surface_plot.py"
] | [
"# -*- coding: utf-8 -*-\n# vispy: gallery 30\n# -----------------------------------------------------------------------------\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n# -------------------------------------------------... | [
[
"numpy.random.normal"
]
] |
trailofbits/ceo | [
"d6a1ed729f8a1e400147b99dfcb65934e1924891"
] | [
"ceo/sampling.py"
] | [
"from sklearn.model_selection import ShuffleSplit, StratifiedShuffleSplit\nfrom sklearn.utils import shuffle as skshuffle\n\ndef shuffle(x, random_state=None):\n return skshuffle(x, random_state=random_state)\n\ndef split_shuffle(X,y=None, random_state=None):\n sss = ShuffleSplit(n_splits=1, test_size=0.25, r... | [
[
"sklearn.model_selection.ShuffleSplit",
"sklearn.model_selection.StratifiedShuffleSplit",
"sklearn.utils.shuffle"
]
] |
xAbdalla/Machine_Learning_Exercises-Stanford_University | [
"2b38413e91948b5d2614407ac9b62a60acd191d2"
] | [
"Python/ex3/ex3.py"
] | [
"import numpy as np\nfrom scipy.io import loadmat\nfrom scipy.optimize import fmin_cg\n\n# Ignore overflow and divide by zero of np.log() and np.exp()\n# np.seterr(divide = 'ignore')\n# np.seterr(over = 'ignore') \n\ndef sigmoid(z):\n return 1.0 / (1.0 + np.exp(-z))\n\ndef computeCost(theta, X, y, lamba=1):\n ... | [
[
"scipy.io.loadmat",
"numpy.zeros",
"numpy.matrix",
"numpy.insert",
"numpy.argmax",
"numpy.exp",
"numpy.log",
"scipy.optimize.fmin_cg",
"numpy.unique",
"numpy.mean"
]
] |
gtpedrosa/Python4WindEnergy | [
"8f97a5f86e81ce01d80dafb6f8104165fd3ad397"
] | [
"py4we/dakota.py"
] | [
"\"\"\" IO classes for YOUR_FILE_TYPE_NAME file types\r\n\r\nCopyright (C) 2013 DTU Wind Energy\r\n\r\nAuthor: Juan Pablo Murcia\r\nEmail: jumu@dtu.dk\r\nLast revision: 28.01.2014\r\n\r\nLicense: Apache v2.0, http://www.apache.org/licenses/LICENSE-2.0\r\n\"\"\"\r\n\r\n\r\nfrom __future__ import print_function\r\nfr... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.rc"
]
] |
teddylfwu/LanczosNetwork | [
"adb82d9bce4b14040952565708273eb7e6738d3c"
] | [
"runner/qm8_runner.py"
] | [
"from __future__ import (division, print_function)\nimport os\nimport numpy as np\nimport pickle\nfrom collections import defaultdict\nfrom tqdm import tqdm\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\nimport torch.optim as optim\nfrom torch.utils.data import Dataset, DataLoader\nfrom tensorboar... | [
[
"torch.utils.data.DataLoader",
"torch.optim.SGD",
"torch.no_grad",
"torch.nn.DataParallel",
"torch.optim.Adam",
"torch.optim.lr_scheduler.MultiStepLR",
"numpy.concatenate"
]
] |
zhuwenzhen/DomainBed | [
"e8e8ed831bf30887675e5b3a5117d9d66d0ee46f"
] | [
"domainbed/datasets.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport os\nimport torch\nfrom PIL import Image, ImageFile\nfrom torchvision import transforms\nimport torchvision.datasets.folder\nfrom torch.utils.data import TensorDataset, Subset\nfrom torchvision.datasets import MNIST, ImageFolder\nfrom ... | [
[
"torch.stack",
"torch.randint",
"torch.randn",
"torch.rand",
"torch.where",
"torch.utils.data.TensorDataset",
"torch.cat"
]
] |
cemkaraoguz/reinforcement-learning-an-introduction-second-edition | [
"735bfa6b66ffb52b7cf03966164e7bc1755942de"
] | [
"chapter07/03_WindyGridWorld_nStepSARSA_OffPolicy.py"
] | [
"'''\n03_WindyGridWorld_nStepSARSA_OffPolicy.py : n-step off-policy SARSA applied to Windy Grid World problem (Example 6.5)\n\nCem Karaoguz, 2020\nMIT License\n'''\n\nimport numpy as np\nimport pylab as pl\n\nfrom IRL.environments.Gridworlds import StochasticGridWorld\nfrom IRL.agents.TemporalDifferenceLearning imp... | [
[
"numpy.array",
"numpy.zeros"
]
] |
rcooke-ast/PYPIT | [
"0cb9c4cb422736b855065a35aefc2bdba6d51dd0"
] | [
"pypeit/tests/test_match.py"
] | [
"\"\"\"\nModule to run tests on sort and arsetup\n\"\"\"\nfrom IPython import embed\n\nimport pytest\n\nimport numpy as np\n\nfrom pypeit.core import framematch\nfrom pypeit.tests.tstutils import dummy_fitstbl\nfrom pypeit.pypmsgs import PypeItError\n\n\n@pytest.fixture\ndef fitstbl():\n return dummy_fitstbl()\n... | [
[
"numpy.array"
]
] |
frandorr/PROBA-V | [
"89c1aa4dfc58d66e7747293f6738fdd4e2ba6e6f"
] | [
"debug/main.py"
] | [
"from trainClass import *\nfrom utils.loss import *\nfrom utils.utils import *\nfrom modelsTF import *\nfrom tensorflow.keras.optimizers import Adam, SGD, Nadam\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow.keras.metrics import Mean\nimport tensorflow as tf\nimport numpy as np\nimport loggi... | [
[
"tensorflow.device",
"sklearn.model_selection.train_test_split",
"tensorflow.convert_to_tensor",
"tensorflow.keras.optimizers.Nadam"
]
] |
Featuretools/featuretools | [
"365abd9519d2eec8eec75936644a7b865d4ef40a"
] | [
"featuretools/tests/primitive_tests/test_distancetoholiday_primitive.py"
] | [
"from datetime import datetime\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom featuretools.primitives.standard.datetime_transform_primitives import (\n DistanceToHoliday,\n)\n\n\ndef test_distanceholiday():\n distance_to_holiday = DistanceToHoliday(\"New Year's Day\")\n dates = pd.Series... | [
[
"pandas.Series",
"pandas.date_range",
"numpy.testing.assert_array_equal"
]
] |
Agirljustsayhello/nilmtk | [
"bf985f0f637460bd8df3bb1cbf17b81a20303826"
] | [
"nilmtk/disaggregate/hart_85.py"
] | [
"from __future__ import print_function, division\nfrom collections import OrderedDict, deque\nfrom datetime import datetime\nfrom warnings import warn\n\nimport pandas as pd\n\nfrom nilmtk.feature_detectors.cluster import hart85_means_shift_cluster\nfrom nilmtk.feature_detectors.steady_states import (\n find_ste... | [
[
"numpy.fabs",
"pandas.DataFrame",
"numpy.abs",
"numpy.random.seed",
"numpy.add",
"pandas.MultiIndex.from_tuples"
]
] |
anderlli0053/SourceIO | [
"3c0c4839939ce698439987ac52154f89ee2f5341"
] | [
"library/goldsrc/mdl_v4/structs/model.py"
] | [
"from typing import List\n\nimport numpy as np\n\nfrom .mesh import StudioMesh\nfrom .....library.utils.byte_io_mdl import ByteIO\n\n\nclass StudioModel:\n vertex_dtype = np.dtype([\n ('id', np.uint32, (1,)),\n ('pos', np.float32, (3,)),\n ])\n\n def __init__(self):\n self.name = ''\n ... | [
[
"numpy.array",
"numpy.dtype"
]
] |
shuu-tatsu/subwordsLM | [
"baae8657e3cd2957689b2365155156cd9d18cad8"
] | [
"flair/models/language_model.py"
] | [
"import torch.nn as nn\nimport torch\nimport math\nfrom torch.autograd import Variable\nfrom typing import Dict, List\nfrom flair.data import Dictionary\n\n\nclass LanguageModel(nn.Module):\n \"\"\"Container module with an encoder, a recurrent module, and a decoder.\"\"\"\n\n def __init__(self,\n ... | [
[
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.load",
"torch.save",
"torch.autograd.Variable",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.nn.Dropout"
]
] |
Santhanalakshmimano/SpeedBump_detection_usingCV | [
"7b68f260cf1351d757983a48c5a62e063df807c9",
"7b68f260cf1351d757983a48c5a62e063df807c9"
] | [
"research/object_detection/anchor_generators/multiple_grid_anchor_generator.py",
"research/object_detection/dataset_tools/create_oid_tf_record.py"
] | [
"# Copyright 2017 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.minimum",
"tensorflow.to_float",
"tensorflow.ones",
"numpy.sqrt",
"tensorflow.constant"
],
[
"tensorflow.flags.DEFINE_integer",
"tensorflow.app.run",
"pandas.read_csv",
"tensorflow.logging.set_verbosity",
"pandas.DataFrame",
"tensorflow.logging.log_every... |
FrancisTembo/tensorflow-models | [
"042f74690d0cf412cb6b7fc19f4a41afdf547905"
] | [
"syntaxnet/dragnn/python/wrapped_units.py"
] | [
"\"\"\"Network units wrapping TensorFlows' tf.contrib.rnn cells.\n\nPlease put all wrapping logic for tf.contrib.rnn in this module; this will help\ncollect common subroutines that prove useful.\n\"\"\"\n\nimport abc\n\nimport tensorflow as tf\n\nfrom dragnn.python import network_units as dragnn\nfrom syntaxnet.uti... | [
[
"tensorflow.contrib.rnn.stack_bidirectional_dynamic_rnn",
"tensorflow.placeholder",
"tensorflow.constant_initializer",
"tensorflow.reshape",
"tensorflow.logging.info",
"tensorflow.zeros_initializer",
"tensorflow.contrib.rnn.DropoutWrapper",
"tensorflow.variable_scope",
"tensorf... |
bobolee1239/levoice | [
"56f20afe15f9e171b8971e14551180180cb86cfb"
] | [
"script/model/LeVoice.py"
] | [
"# ----------------------------------\n# File: LeVoice.py\n# ----------------------------------\nimport sys \nif '..' not in sys.path:\n sys.path.append('..')\n\nimport torch\nimport torch.nn.functional as F\nimport config\n\nfrom torch import nn\n\n# -----------------------------------------\n\ndef pad_fre... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.functional.pad",
"torch.rand",
"torch.nn.GRU",
"torch.nn.Conv2d",
"torch.nn.ReLU"
]
] |
ajey091/neml | [
"23dd2cdb83057fdd17a37fa19f4592c54f821dbf"
] | [
"test/test_tensors.py"
] | [
"#!/usr/bin/env python\n\nfrom neml.math import tensors\n\nimport common\n\nimport unittest\nimport numpy as np\nimport numpy.linalg as la\n\nclass TestVector(unittest.TestCase):\n def setUp(self):\n self.a = np.array([2.2,-1.2,2.5])\n self.b = np.array([0.0,5.8,1.1])\n\n self.va = tensors.Vector(self.a)\... | [
[
"numpy.allclose",
"numpy.eye",
"numpy.sum",
"numpy.zeros",
"numpy.einsum",
"numpy.outer",
"numpy.linalg.inv",
"numpy.isclose",
"numpy.cross",
"numpy.trace",
"numpy.array",
"numpy.dot",
"numpy.linalg.norm"
]
] |
dirmeier/jax | [
"9ba28d263479ed5b9cada97bf73aec92ccc69bc6"
] | [
"jax/core.py"
] | [
"# Copyright 2018 Google 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.result_type",
"numpy.dtype",
"numpy.shape",
"numpy.zeros"
]
] |
douglatornell/xarray | [
"6d93a95d05bdbfc33fff24064f67d29dd891ab58"
] | [
"xarray/core/pdcompat.py"
] | [
"# The remove_unused_levels defined here was copied based on the source code\n# defined in pandas.core.indexes.muli.py\n\n# For reference, here is a copy of the pandas copyright notice:\n\n# (c) 2011-2012, Lambda Foundry, Inc. and PyData Development Team\n# All rights reserved.\n\n# Copyright (c) 2008-2011 AQR Capi... | [
[
"numpy.where",
"numpy.bincount",
"pandas.core.algorithms.unique"
]
] |
kiukchung/Ax | [
"0f50d94056782d304e573c3c1dde567beb44b65a"
] | [
"ax/core/tests/test_experiment.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nfrom typing import Type\nfrom unittest.mock import patch\n\nimport pandas as pd\nfrom ax.cor... | [
[
"pandas.DataFrame.from_records"
]
] |
samqws-marketing/electronicarts_ava-capture | [
"a04e5f9a7ee817317d0d58ce800eefc6bf4bd150"
] | [
"capture-node/raw_file_format_readers.py"
] | [
"# Copyright (C) 2019 Electronic Arts Inc. All rights reserved.\n\nimport os\nimport struct\nimport cv2\nimport numpy as np\n\nimport lz4.block as lz4block\n\n'''\n Example Usage:\n \n # This script extracts all frames of the recorded file test.ava and outputs them as JPG and TIF images.\n\n from raw_file_form... | [
[
"numpy.array",
"numpy.matmul",
"numpy.clip",
"numpy.fromstring"
]
] |
arielsho/Table-Fact-Checking | [
"afbf987fcaa6cc002655d3fa38f95d88e2ec4f75"
] | [
"code/run.py"
] | [
"# encoding=utf8\nimport json\nimport pandas\nimport numpy\nfrom beam_search import dynamic_programming\nfrom multiprocessing import Pool\nimport multiprocessing\nimport sys\nimport time\nimport argparse\nimport os\nfrom APIs import *\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--synthesize\", defa... | [
[
"numpy.dtype"
]
] |
cnvrg/Blueprints | [
"e8574063605a2dd7a4c2f4d2cc18458edb2886be"
] | [
"Recommenders/recommenders_data_validation/data_validation.py"
] | [
"import argparse\nimport pandas as pd\nimport psutil\nimport time\nfrom cnvrg import Experiment\n\ntic=time.time()\nparser = argparse.ArgumentParser(description=\"\"\"Preprocessor\"\"\")\nparser.add_argument('-f','--filename', action='store', dest='filename', default='/data/movies_rec_sys/ratings_2.csv', required=T... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.concat"
]
] |
xinxin342/mmdetection-mini | [
"dad8367880a4e321b8ac64ee95d712da44d232d9"
] | [
"mmdet/apis/inference.py"
] | [
"import matplotlib.pyplot as plt\nfrom mmdet import cv_core\nimport numpy as np\nimport torch\nfrom mmdet.cv_core.parallel import collate\nfrom mmdet.cv_core.runner import load_checkpoint\n\nfrom mmdet.datasets.pipelines import Compose\nfrom mmdet.models import build_detector\nfrom mmdet.datasets import build_datas... | [
[
"torch.no_grad"
]
] |
orivej/tensorflow | [
"5ed2fc046a9e59d7fcffc1bc7202465805618aca"
] | [
"tensorflow/python/data/ops/dataset_ops.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.gen_dataset_ops.dummy_seed_generator",
"tensorflow.python.ops.gen_dataset_ops.shuffle_dataset",
"tensorflow.python.data.util.nest.is_sequence",
"tensorflow.python.data.util.nest.flatten_up_to",
"tensorflow.python.framework.smart_cond.smart_constant_value",
"tensorflo... |
artsobolev/IWHVI | [
"3a8b5631fe5b08587c594bd0aac43f84dc261579"
] | [
"hierarchical_vae/utils.py"
] | [
"import numpy as np\nimport scipy as sp\nimport scipy.special\nfrom tqdm import tqdm\n\nimport utils\nfrom .model import HierarchicalVAE\n\n\ndef calculate_evidence(sess, data, iwhvae, iwae_samples, iwhvi_samples, batch_size, n_repeats,\n tau_force_prior=False, tqdm_desc=None):\n losses = u... | [
[
"numpy.zeros",
"numpy.log",
"scipy.special.logsumexp",
"numpy.array",
"numpy.concatenate",
"numpy.mean"
]
] |
ProjetEtudeMLFI/TensorFI | [
"961a0205ec90935a238c58112e8119c34a70ba7c"
] | [
"Tests/nearest_neighbor.py"
] | [
"#!/usr/bin/python\n'''\nA nearest neighbor learning algorithm example using TensorFlow library.\nThis example is using the MNIST database of handwritten digits\n(http://yann.lecun.com/exdb/mnist/)\n\nAuthor: Aymeric Damien\nProject: https://github.com/aymericdamien/TensorFlow-Examples/\n'''\n\nfrom __future__ impo... | [
[
"tensorflow.placeholder",
"tensorflow.compat.v1.Session",
"tensorflow.negative",
"tensorflow.global_variables_initializer",
"numpy.argmax",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.arg_min",
"tensorflow.summary.FileWriter"
]
] |
hpzhen/ChZhShCh | [
"a5af067e342cf734fafb827eab17462c4bd6f74d"
] | [
"chzhshch/inner_package/show.py"
] | [
"# -*- coding: UTF-8 -*-\nimport matplotlib.ticker as ticker\nimport matplotlib.pyplot as plt\nimport mpl_finance as mpf\n# from mpl_finance import quotes_historical_yahoo\nimport numpy as np\nfrom pandas import Series, DataFrame\n# http://blog.csdn.net/xiaodongxiexie/article/details/53123371\n\nclass PlotShow(obje... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks",
"matplotlib.ticker.FuncFormatter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.ticker.MultipleLocator",
"matplotl... |
vandanavk/sagemaker-debugger | [
"5246cda198295aa1dd1656ad32b30c4bb1e2aec4"
] | [
"tests/tensorflow/hooks/test_mirrored_strategy.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 r... | [
[
"tensorflow.layers.conv2d",
"tensorflow.reshape",
"numpy.asarray",
"tensorflow.train.get_global_step",
"tensorflow.nn.softmax",
"tensorflow.contrib.learn.datasets.load_dataset",
"tensorflow.losses.sparse_softmax_cross_entropy",
"tensorflow.estimator.RunConfig",
"tensorflow.cont... |
SSLAB-SSU/deep-learning-from-scratch | [
"3609360751d67085e0963ee6d7af6d49380cd965"
] | [
"ch07/simple_convnet.py"
] | [
"# coding: utf-8\nimport sys, os\nsys.path.append('/Users/hxxnhxx/Documents/development/deep-learning-from-scratch') # 親ディレクトリのファイルをインポートするための設定\nimport pickle\nimport numpy as np\nfrom collections import OrderedDict\nfrom common.layers import *\nfrom common.gradient import numerical_gradient\n\n\nclass SimpleConv... | [
[
"numpy.sum",
"numpy.random.randn",
"numpy.argmax",
"numpy.zeros"
]
] |
acpadua/pycelle | [
"8ec8c474c04e115635a76d360f5f4c9613b01705"
] | [
"analyse_images.py"
] | [
"import numpy as np\r\n\r\nfrom math import sqrt\r\nfrom skimage import data\r\nfrom skimage.feature import blob_dog, blob_log, blob_doh\r\nfrom skimage.color import rgb2gray\r\nfrom pandas import DataFrame\r\nimport pandas as pd\r\n\r\nimport matplotlib.pyplot as plt\r\nimport os\r\nfrom os import path\r\nimport g... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.tight_layout",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.xlim",
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.where"
]
] |
FedeClaudi/fedes_utils | [
"2ef6f037303fc426d5c5b2851d2c99f17efa4002"
] | [
"fcutils/maths/coordinates.py"
] | [
"import numpy as np\n\n\ndef R(theta):\n \"\"\"\n Returns the rotation matrix for rotating an object\n centered around the origin with a given angle\n\n Arguments:\n theta: angle in degrees\n\n Returns:\n R: 2x2 np.ndarray with rotation matrix\n \"\"\"\n th... | [
[
"numpy.arctan2",
"numpy.hypot",
"numpy.cos",
"numpy.array",
"numpy.sin",
"numpy.radians"
]
] |
algonommy/Analyzing-Apple-Stock-Data-to-Predict-Gain-Loss-leveraging-Machine-Learning-Models | [
"04d5b42d58f64248a45b62c7f7a0835c481c12fb"
] | [
"Dash-app/app.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\nimport plotly.graph_objs as go\nfrom dash.dependencies import Input, Output\nimport datetime as dt\nimport pandas_datareader as web\n\n\n\napp = dash.Dash()\nserver = app.server\n\nstart = dt.datetime(2000,1,... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.concat"
]
] |
mrmotallebi/pytorch_geometric | [
"5d768659d2a54544219c057ad05172ca55b43119"
] | [
"torch_geometric/nn/pool/asap.py"
] | [
"from typing import Union, Optional, Callable\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.nn import Linear\nfrom torch_scatter import scatter\nfrom torch_sparse import SparseTensor\n\nfrom torch_geometric.nn import LEConv\nfrom torch_geometric.utils import softmax\nfrom torch_geometric.nn.pool.topk... | [
[
"torch.stack",
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.nn.functional.leaky_relu",
"torch.cat"
]
] |
jameshgrn/sliderule-python | [
"47fad1465358956a876c9680dd55e535ab5bdcb7"
] | [
"sliderule/ipysliderule.py"
] | [
"# Copyright (c) 2021, University of Washington\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice,\n# this l... | [
[
"numpy.transpose"
]
] |
brosscle/CT-TIQUA | [
"d56104cd60ffa962afae9506b6bc9d4afc0d0de9"
] | [
"CT_TIQUA/blast_ct/blast_ct/models/deepmedic.py"
] | [
"import torch.nn as nn\nimport torch\nfrom ..models.base import BiomedicalBlock, DownSample, UpSample, PreActBlock, crop_center\n\nSCALE_FACTORS = ((5, 5, 5), (3, 3, 3), (1, 1, 1))\nFEATURE_MAPS = (30, 30, 40, 40, 40, 40, 50, 50)\nFULLY_CONNECTED = (250, 250)\nDROPOUT = (.0, .5, .5)\n\n\nclass Path(BiomedicalBlock)... | [
[
"torch.nn.Sequential"
]
] |
SemyonSinchenko/QOpt | [
"0b273a887f765a16cac706510681c1a3f5901e72"
] | [
"notebooks/ResultViewer.py"
] | [
"#%%\nimport os\nimport pylab\nimport numpy as np\n\n#%%\n\nNUM_EDGES = 2474\nEXACT_SOLUTION = 1430\nsamples = np.loadtxt(os.path.join(\"results\", \"FFNN\", \"100vertexGraph\",\"stateAdvanced_1000steps.txt\"))\n\nloaded_matrix = np.loadtxt(\"data/g05_100.0\", skiprows=0, dtype=np.int32)\nedgelist = [[loaded_matrix... | [
[
"numpy.array",
"numpy.ones",
"numpy.arange",
"numpy.loadtxt"
]
] |
ericleehy/PeekingDuck | [
"8cf1be842235fa60bac13bc466cac09747a780ea"
] | [
"peekingduck/pipeline/nodes/dabble/keypoints_to_3d_loc.py"
] | [
"# Copyright 2022 AI Singapore\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agree... | [
[
"numpy.array",
"numpy.reshape"
]
] |
hanjoo0211/deep-learning-from-scratch | [
"dae38d476cc5156d6f111179b60c30124b47e59c"
] | [
"predictNumber.py"
] | [
"import numpy as np\nfrom PIL import Image\nfrom ch08.deep_convnet import DeepConvNet\nfrom common.functions import softmax\n\n\ndef predictNumber(img):\n img = img.convert(\"L\") # 흑백처리\n img = np.array(img) / 255 # normalize 해줘야함..\n img = img * -1 + 1 # 흑백반전도 해줘야함.. 검은배경에 흰 글자로 나오도록!\n imgArray = img... | [
[
"numpy.array",
"numpy.argmax"
]
] |
ErikEkstedt/Project | [
"c56b852440041775caaa242b7e86779666c0f1c3"
] | [
"gesture/environments/social.py"
] | [
"'''\nsocial movement environment (Roboschool for poses)\n'''\nfrom roboschool.scene_abstract import Scene, SingleRobotEmptyScene\nimport os\nimport numpy as np\nimport gym\nfrom OpenGL import GLE # fix for opengl issues on desktop / nvidia\nimport cv2\n\n\nPATH_TO_CUSTOM_XML = os.path.join(os.path.dirname(__file_... | [
[
"numpy.ones",
"numpy.fromstring",
"numpy.abs",
"numpy.clip",
"numpy.array",
"numpy.concatenate",
"numpy.random.randint",
"numpy.linalg.norm",
"numpy.isfinite"
]
] |
Jamal-dev/asymproj_edge_dnn_tensorFlow2 | [
"efb3a3721bc7e39dfa126d3c7af529b091bba9cb"
] | [
"create_dataset_arrays.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.save",
"numpy.concatenate"
]
] |
ng390/selfstudy-adversarial-robustness | [
"e225142564793ba7799d7e76727928f72cfb769e"
] | [
"convert_pytorch.py"
] | [
"# Copyright 2021 Google 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.train.Checkpoint",
"tensorflow.get_logger"
]
] |
yukgu/covid-model-seiir-pipeline | [
"3433034d3f089938e7993b6321d570365bdf62db"
] | [
"src/covid_model_seiir_pipeline/pipeline/regression/task/beta_regression.py"
] | [
"from pathlib import Path\n\nimport click\nimport numpy as np\nimport pandas as pd\n\nfrom covid_model_seiir_pipeline.lib import (\n cli_tools,\n math,\n static_vars,\n)\nfrom covid_model_seiir_pipeline.pipeline.regression.data import RegressionDataInterface\nfrom covid_model_seiir_pipeline.pipeline.regres... | [
[
"numpy.random.normal",
"numpy.random.seed",
"pandas.concat",
"numpy.exp"
]
] |
teomotun/Restaurant-Plug | [
"1ecaab7bb60706ec0eca96c2f3efb31276c536e7"
] | [
"Model/code/training_restaurant_features.py"
] | [
"import pandas as pd\nimport h5py\n\n# Paths\nDATA_HOME = \"/content/drive/My Drive/Yelp-Restaurant-Classification/Model/data/\"\nFEATURES_HOME = '/content/drive/My Drive/Yelp-Restaurant-Classification/Model/features/'\n\n# Get photo->business mapping from the file provided\ntrain_photo_to_biz_ids = pd.read_csv(DAT... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
potti95/fewrel | [
"5706b45c6936a60ef94326808e24d0ed0643a579"
] | [
"train_demo.py"
] | [
"from fewshot_re_kit.data_loader import get_loader, get_loader_pair, get_loader_unsupervised\nfrom fewshot_re_kit.framework import FewShotREFramework\nfrom fewshot_re_kit.sentence_encoder import FasttextSentenceEncoder, CNNSentenceEncoder, BERTSentenceEncoder, \\\n BERTPAIRSentenceEncoder, RobertaSentenceEncoder... | [
[
"numpy.load",
"torch.cuda.is_available"
]
] |
v-pooja/vmaf | [
"6c6a7b085213a90c080510035546eceb21284008"
] | [
"python/src/vmaf/core/niqe_train_test_model.py"
] | [
"__copyright__ = \"Copyright 2016-2018, Netflix, Inc.\"\n__license__ = \"Apache, Version 2.0\"\n\nimport numpy as np\nimport scipy.linalg\n\nfrom vmaf.core.train_test_model import TrainTestModel, RegressorMixin\n\n\nclass NiqeTrainTestModel(TrainTestModel, RegressorMixin):\n\n TYPE = 'NIQE'\n VERSION = \"0.1\... | [
[
"numpy.vstack",
"numpy.dot",
"numpy.cov",
"numpy.mean"
]
] |
cBioCenter/chell-viz-contact | [
"07edd56bea1693da76cf62d2ab7088193c86e9e2"
] | [
"utils/generate_raw_matrix_from_norm.py"
] | [
"import scipy.sparse as ssp\nimport numpy as np\ncounts = ssp.load_npz('./counts_norm.npz')\nnp.savetxt('./counts_norm.csv', counts.todense(), delimiter=',', fmt='%.3f')\n"
] | [
[
"scipy.sparse.load_npz"
]
] |
sigeisler/grb | [
"c89e21076dc05d1edb87dfe2eff20c29ba6bd0c1"
] | [
"grb/model/torch/gcn.py"
] | [
"\"\"\"Torch module for GCN.\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom grb.utils.normalize import GCNAdjNorm\n\n\nclass GCN(nn.Module):\n r\"\"\"\n\n Description\n -----------\n Graph Convolutional Networks (`GCN <https://arxiv.org/abs/1609.02907>`__)\n\n Par... | [
[
"torch.sum",
"torch.nn.init.calculate_gain",
"torch.nn.Linear",
"torch.nn.init.xavier_normal_",
"torch.nn.LayerNorm",
"torch.nn.ModuleList",
"torch.max",
"torch.zeros",
"torch.sparse.mm",
"torch.nn.Dropout"
]
] |
gucci-j/intro-deep-learning-keras | [
"ef79eb44b6080918067fe6fc38e0b79ecf88189c"
] | [
"chapter6/compare_weight_decay.py"
] | [
"from keras import Model, optimizers, initializers, regularizers\nfrom keras.layers import Input, Dense, Activation\nfrom keras.layers.normalization import BatchNormalization\nfrom keras.utils import to_categorical\nfrom keras.datasets import fashion_mnist\nimport matplotlib.pyplot as plt\n\n# パラメータ + ハイパーパラメータ\nim... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
]
] |
vuanvin/pytorch | [
"9267fd8d7395074001ad7cf2a8f28082dbff6b0b"
] | [
"test/distributed/fsdp/test_fsdp_checkpoint.py"
] | [
"# Owner(s): [\"oncall: distributed\"]\n\nimport contextlib\nfrom copy import deepcopy\nfrom functools import partial\n\nimport torch\nimport torch.nn as nn\nfrom torch.distributed._fsdp.fully_sharded_data_parallel import (\n FullyShardedDataParallel as FSDP,\n CPUOffload,\n)\nfrom torch.distributed.algorithm... | [
[
"torch.testing._internal.common_utils.instantiate_parametrized_tests",
"torch.utils.checkpoint.checkpoint",
"torch.nn.Linear",
"torch.testing._internal.common_utils.parametrize",
"torch.profiler.profile",
"torch.cuda.manual_seed",
"torch.testing._internal.common_utils.run_tests",
"... |
AngeloMono/yolact | [
"3be8b635972cfec845eaf7e0fa7d380d7a002c27"
] | [
"train.py"
] | [
"from data import *\nfrom yolact_utils.augmentations import SSDAugmentation, BaseTransform\nfrom yolact_utils.functions import MovingAverage, SavePath\nfrom yolact_utils.logger import Log\nfrom yolact_utils import timer\nfrom layers.modules import MultiBoxLoss\nfrom yolact import Yolact\nimport os\nimport sys\nimpo... | [
[
"torch.utils.data.DataLoader",
"torch.stack",
"torch.no_grad",
"torch.cuda.device_count",
"torch.set_default_tensor_type",
"torch.cuda.is_available",
"torch.zeros",
"torch.isfinite"
]
] |
IandRover/meta-gradient_RL | [
"5d2539aceb9fa68b1849feac7d37741f9e5f83a3"
] | [
"models.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass ActorNetwork(nn.Module):\n\n def __init__(self,input_size,hidden_size,action_size):\n super(ActorNetwork, self).__init__()\n self.fc1 = nn.Linear(input_size,hidden_size)\n self.fc2 = nn.Linear(hidden_size,hidden_s... | [
[
"torch.nn.Linear"
]
] |
data-umbrella/sprints-dashboard | [
"f8cdbe640fbc8001172b096065a79a9efe5c2829"
] | [
"scripts/app.py"
] | [
"import dash\n#import dash_core_components as dcc\nfrom dash import dcc\nfrom dash import html\n#import dash_html_components as html\nimport dash_bootstrap_components as dbc\nfrom dash.dependencies import Input, Output\nimport plotly.express as px\nfrom plotly import graph_objects as go\nimport pandas as pd\n\n# ht... | [
[
"pandas.read_csv"
]
] |
Zilleplus/HML | [
"ab9510e27103bb7c14e801606bb25b7c4e17e8ea"
] | [
"HML/chapter6/ex7.py"
] | [
"# Train and fine-tune a Decision Tree for the oons dataset\n# by following these steps:\n# a. Use make_moons(n_samples=10000, noise=0.4)\n#\n# b. Use train_test_split() to split the datset in to a training\n# set and test set.\n#\n# c. Use grid search with cross-validation (with the help of the\n# GridSearchCV cla... | [
[
"sklearn.tree.DecisionTreeClassifier",
"sklearn.datasets.make_moons",
"sklearn.model_selection.GridSearchCV",
"sklearn.model_selection.train_test_split"
]
] |
tjpuzhaolei/yolact | [
"d27ab4d5150d7ca5d12a950f0075b0886d9b9171"
] | [
"layers/modules/multibox_loss.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nimport pdb\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom ..box_utils import match, log_sum_exp, decode, center_size, crop\n\nfrom data import cfg, mask_type, activation_func\n\nclass MultiBoxLoss(nn.Module):\n \"\"\"SSD ... | [
[
"torch.sum",
"torch.nn.functional.log_softmax",
"torch.nn.functional.logsigmoid",
"torch.nn.functional.normalize",
"torch.nn.functional.softmax",
"torch.autograd.Variable",
"torch.no_grad",
"torch.zeros_like",
"torch.nn.functional.smooth_l1_loss",
"torch.sqrt",
"torch.a... |
harrisonzhu508/data | [
"a3b95ced4abad6653d20f67f3f285abeeb0c2b25"
] | [
"src/pipelines/weather/weather_pipeline.py"
] | [
"import re\nimport sys\nimport math\nfrom random import shuffle\nfrom functools import partial\nfrom typing import Any, Dict, List, Tuple\nfrom multiprocessing import cpu_count\nfrom multiprocessing.pool import ThreadPool as Pool\n\nimport numpy\nfrom tqdm.contrib import concurrent\nfrom pandas import DataFrame, Se... | [
[
"pandas.read_csv",
"numpy.cos",
"pandas.concat",
"numpy.sqrt",
"numpy.sin"
]
] |
DCAN-Labs/abcd-bids-tfmri-pipeline | [
"358581a244887a7fc385bc73c3c22e4683a22ad5"
] | [
"src/pipeline_utilities.py"
] | [
"#!/usr/bin/env python3\n# coding: utf-8\n\n\"\"\"\nCommon source for utility functions used by ABCD-BIDS task-fmri-pipeline\nGreg Conan: gconan@umn.edu\nCreated: 2021-01-15\nUpdated: 2021-11-12\n\"\"\"\n\n# Import standard libraries\nimport argparse\nfrom datetime import datetime # for seeing how long scripts tak... | [
[
"pandas.read_csv",
"pandas.get_dummies"
]
] |
pranaynanda/training-data-analyst | [
"f10ab778589129239fd5b277cfdefb41638eded5"
] | [
"courses/machine_learning/deepdive/09_sequence_keras/temperatures/utils/utils_display.py"
] | [
"# Copyright 2018 Google 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 law or agreed t... | [
[
"matplotlib.pyplot.legend",
"numpy.ma.masked_where",
"numpy.zeros",
"numpy.timedelta64",
"numpy.reshape",
"numpy.random.choice",
"matplotlib.pyplot.axvspan",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.text",
"numpy.random.rand",
"matpl... |
josepablocam/common-code-extraction | [
"a6978fae73eee8ece6f1db09f2f38cf92f03b3ad"
] | [
"downloaded_kernels/loan_data/parsed_kernels/kernel_107.py"
] | [
"\n# coding: utf-8\n\n# **Introduction**\n# In this post, you will discover the Keras Python library that provides a clean and convenient way to create a range of deep learning models on top of Theano or TensorFlow.\n# \n# All creidts to -- \"http://machinelearningmastery.com/tutorial-first-neural-network-python-ke... | [
[
"numpy.timedelta64",
"pandas.read_csv",
"numpy.random.seed",
"pandas.to_datetime",
"numpy.round",
"sklearn.model_selection.train_test_split"
]
] |
joelberkeley/GPflow | [
"78230b98f57c64b5ee2932ea0d2752eb9ff102ce"
] | [
"gpflow/models/gpr.py"
] | [
"# Copyright 2016-2020 The GPflow Contributors. 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... | [
[
"tensorflow.linalg.cholesky",
"tensorflow.reduce_sum"
]
] |
gkuwanto/RBL_SK5003 | [
"7da3b95afeca2aa3413993279fe13d6bb71cd5db"
] | [
"main.py"
] | [
"import argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom lib.file_parser import read_csv\n\n# Set random seed\nnp.random.seed(42)\n\n# Menambahkan argumen dalam cli\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-obj\", \"--objective\",\n help=\"Specify objective ... | [
[
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.random.seed",
"numpy.random.normal",
"numpy.abs",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ylim",
"matplotlib.p... |
kuonangzhe/gluon-cv | [
"f7d74019210dd0f22cb4543f061339533301c487"
] | [
"gluoncv/model_zoo/yolo/yolo3.py"
] | [
"\"\"\"You Only Look Once Object Detection v3\"\"\"\n# pylint: disable=arguments-differ\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nimport os\nimport numpy as np\nimport mxnet as mx\nfrom mxnet import gluon\nfrom mxnet import autograd\nfrom mxnet.gluon import nn\nfrom .darknet import... | [
[
"numpy.arange",
"numpy.expand_dims",
"numpy.array",
"numpy.concatenate",
"numpy.meshgrid"
]
] |
almarklein/pirt | [
"b43a57aad89ad2638a65e58079153567a49a43f2"
] | [
"pirt/gaussfun.py"
] | [
"\"\"\"\nThe gaussfun module implements functions for diffusion and Gaussian\nderivatives for data of any dimension.\n\nContents of this module:\n\n * gaussiankernel - Create a Gaussian kernel\n * gaussiankernel2 - Create a 2D Gaussian kernel\n * diffusionkernel - Create a discrete analog to the Gaussian kernel\... | [
[
"numpy.zeros_like",
"numpy.flipud",
"numpy.ceil",
"numpy.matrix",
"numpy.exp",
"numpy.arange",
"numpy.sqrt",
"numpy.array"
]
] |
reichlab/jacques | [
"772e6f69de944f5ce19af16b24dfd76d023861f9"
] | [
"test/test_kernel_smooth_quantile_fn.py"
] | [
"import os\nos.environ['CUDA_VISIBLE_DEVICES'] = '-1'\n\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow_probability as tfp\nimport unittest\n\nfrom jacques import kernels\n\n\nclass Test_Kernel_Smooth_Quantile_Fn(unittest.TestCase):\n def test_quantile_smooth_bw(self):\n tau = np.concatena... | [
[
"numpy.ones",
"numpy.full_like",
"numpy.cumsum",
"numpy.zeros",
"numpy.exp",
"numpy.array",
"tensorflow.constant",
"numpy.linspace"
]
] |
JxTang-bioinformatics/Tangbio | [
"7e0f0ed45371504c65d2a7ed419aed934e26c583"
] | [
"CaMelia model/Feature extraction/unionfeature_for_train.py"
] | [
"# -*- coding: utf-8 -*-\r\nfrom __future__ import division\r\nfrom sys import argv\r\nimport pandas as pd\r\nimport numpy as np\r\nimport os,time\r\nimport warnings\r\nwarnings.filterwarnings('ignore')\r\n###########################################\r\ndef reduce_mem(df):\r\n starttime = time.time()\r\n numer... | [
[
"pandas.read_csv",
"numpy.iinfo",
"pandas.merge",
"pandas.isnull",
"numpy.finfo"
]
] |
ganik/DeepSpeed | [
"788e1c40e83beacfc4901e7daa1e097d2efb82bb"
] | [
"tests/unit/test_partition.py"
] | [
"import pytest\n\nimport torch\nimport torch.distributed as dist\n\nfrom deepspeed.runtime.utils import partition_uniform\nfrom deepspeed.runtime.utils import partition_balanced\nfrom deepspeed.runtime.utils import prefix_sum_inc\nfrom deepspeed.runtime.utils import PartitionedTensor\n\nfrom .common import distribu... | [
[
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"torch.distributed.broadcast",
"torch.rand",
"torch.equal"
]
] |
takumiw/nishika-cable-classification-1st-place | [
"6438c36fa607b79cd1b2dad195881dacc6a48e9d"
] | [
"src/utils_metrics.py"
] | [
"from typing import Dict, List, Optional\n\nimport numpy as np\nfrom sklearn.metrics import accuracy_score, f1_score, log_loss\n\n\ndef calc_metrics(\n y_true: np.ndarray, y_pred: np.ndarray, y_prob: Optional[np.ndarray] = None, metrics: List[str] = [\"loss\"]\n) -> Dict[str, float]:\n result = {}\n for me... | [
[
"sklearn.metrics.f1_score",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.log_loss"
]
] |
DipeshV/olympic-hero | [
"73a82f36afed429b59895c68faffe838b90fc72b"
] | [
"code.py"
] | [
"# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#Path of the file\r\npath\r\n\r\n#Code starts here\r\ndata = pd.read_csv(path)\r\n\r\ndata.rename(columns={'Total':'Total_Medals'}, inplace=True)\r\nprint(data.head())\n\n\n# -----------... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.bar"
]
] |
Antolin1/DMG-Python | [
"ba3942e13006e1a32f3fe9f1b29615311f667274"
] | [
"dmg/realism/discriminativeModel.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 17 10:33:24 2021\n\n@author: Jose Antonio\n\"\"\"\n\n#of the paper Towards Char... using GNNs\n\n\nimport torch_geometric.nn as pyg_nn\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch_scatter.composite impo... | [
[
"torch.unsqueeze",
"torch.nn.functional.sigmoid",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.Dropout"
]
] |
mitiku1/Emopy-Multi-Input- | [
"b520eb3f3d121c9d456a52315f1fd78ef43f74fd"
] | [
"train/__main__.py"
] | [
"import argparse\nfrom train import start_training\nimport cv2\nfrom skimage import feature\nimport numpy as np\nimport dlib\nimport tensorflow as tf \nimport keras \n\ndef get_cmd_args():\n \"\"\" Parse user command line arguments\"\"\"\n parser = argparse.ArgumentParser()\n parser.add_argument(\"-d\",\"-... | [
[
"tensorflow.set_random_seed",
"numpy.random.seed"
]
] |
meliao/fourier_neural_operator | [
"216915c6f1acd0651c7203bc8f16824efc495c5f"
] | [
"experiments/21_use_other_frequencies/train_models.py"
] | [
"\"\"\"\n@author: Zongyi Li\nThis file is the Fourier Neural Operator for 1D problem such as the (time-independent) Burgers equation discussed in Section 5.1 in the [paper](https://arxiv.org/pdf/2010.08895.pdf).\n\"\"\"\n\nimport logging\nimport os\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport to... | [
[
"torch.utils.data.DataLoader",
"torch.linalg.norm",
"torch.view_as_real",
"torch.rand",
"torch.no_grad",
"numpy.random.seed",
"torch.cuda.is_available",
"torch.cat",
"scipy.io.loadmat",
"torch.divide",
"torch.manual_seed",
"torch.fft.rfft",
"torch.tensor",
"... |
kingfener/espresso | [
"da8352a6e97c82e5d92c39972666a772e6bb508a"
] | [
"setup.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nfrom setuptools import setup, find_packages, Extension\nimport sys\n\n\nif sys.version_info < (3,... | [
[
"numpy.get_include",
"torch.utils.cpp_extension.CppExtension"
]
] |
gourav108/coreml | [
"6bc2d494dff23cff923368e735992a4f4a47483c"
] | [
"object_detection/metrics/coco_evaluation.py"
] | [
"# Copyright 2017 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... | [
[
"numpy.logical_and",
"numpy.float32",
"tensorflow.logging.warning",
"tensorflow.py_func",
"tensorflow.control_dependencies"
]
] |
cemac/UNRESP_AQSensorTools | [
"0c73eb48ccd1680da866dc344ab22bc40ef899fb"
] | [
"aqtools/getAQMeshData.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nScript name: getAQMeshData.py\nAuthor: JO'N/ CEMAC (University of Leeds)\nDate: March 2018\nPurpose: Download data from an AQMesh pod using the API tool\nUsage: ./getAQMeshData.py <stationID> <startDate> <endDate> <variables> <outFreq>\n <stationID> - Unique ID of the AQMesh s... | [
[
"pandas.io.json.json_normalize",
"pandas.DataFrame"
]
] |
JONGHYEOK667/Udacity_SelfDrivingCar_P4 | [
"6cee1afbd33d704fd594c40ce80c893024f6d022"
] | [
"model.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# ---\n\n\n\n\n# In[1]: Setting GPU w/ Tensorflow running\n\n\nimport tensorflow as tf\nprint(tf.__version__)\n\nimport keras\nprint(keras.__version__)\ngpus = tf.config.experimental.list_physical_devices('GPU')\nif gpus:\n try:\n # Currently, memory growth needs to be... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.Cropping2D",
"tensorflow.config.experimental.list_logical_devices",
"tensorflow.keras.layers.Lambda",
"matplotlib.pyplot.ylabel",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.... |
mikedeltalima/python-qinfer | [
"8170c84a0be1723f8c6b09e0d3c7a40a886f1fe3"
] | [
"src/qinfer/utils.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n##\n# utils.py : some auxiliary functions\n##\n# © 2017, Chris Ferrie (csferrie@gmail.com) and\n# Christopher Granade (cgranade@cgranade.com).\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that th... | [
[
"numpy.ones",
"numpy.sum",
"numpy.diag",
"scipy.special.logit",
"numpy.dtype",
"scipy.special.gamma",
"numpy.log",
"numpy.apply_along_axis",
"numpy.isfinite",
"numpy.testing.assert_almost_equal",
"numpy.transpose",
"scipy.stats.binom",
"matplotlib.pyplot.figure"... |
TheJacksonLaboratory/JAX_Microbiome_Workshop | [
"800dffdec753b7b1c2a08b0e0ef29d85e54eb5cc"
] | [
"scripts/create-table.py"
] | [
"import pandas as pd\nimport sys\nimport os\nimport re\nimport shutil\nimport subprocess\n\ninputs=sys.argv[1]\noutput=sys.argv[2]\n#names=[\"Username\", \"IP\", \"Terminal 1\", \"Terminal 2\", \"RStudio\", \"Jupyter\", \"Download Files\"]\ndf = pd.read_csv(inputs, sep=\",\", header=None, names=[\"Username\", \"IP\... | [
[
"pandas.read_csv"
]
] |
samuelfneumann/rllab | [
"ccd80547380b25344b1b091e730beb646d12d192"
] | [
"rllab/optimizers/conjugate_gradient_optimizer.py"
] | [
"from rllab.misc import ext\nfrom rllab.misc import krylov\nfrom rllab.misc import logger\nfrom rllab.core.serializable import Serializable\nimport theano.tensor as TT\nimport theano\nimport itertools\nimport numpy as np\nfrom rllab.misc.ext import sliced_fun\nfrom ast import Num\n\n\nclass PerlmutterHvp(Serializab... | [
[
"numpy.arange",
"numpy.reshape",
"numpy.linalg.norm",
"numpy.isnan"
]
] |
cjm-sfw/multi-parsing | [
"439e8624c0183fdb7d70973fa91911b8f2087834"
] | [
"mmdet/datasets/densepose.py"
] | [
"import numpy as np\nfrom pycocotools.coco import COCO\n\nfrom .custom import CustomDataset\nfrom .registry import DATASETS\n\n\n@DATASETS.register_module\nclass DensePose(CustomDataset):\n\n CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',\n 'train', 'truck', 'boat', 'traffi... | [
[
"numpy.array",
"numpy.zeros"
]
] |
gh-determined-ai/determined | [
"9a1ab33a3a356b69681b3351629fef4ab98ddb56"
] | [
"model_hub/examples/huggingface/text-classification/glue_trial.py"
] | [
"\"\"\"\nThis example is largely based on the GLUE text-classification example in the huggingface\ntransformers library. The license for the transformer's library is reproduced below.\n\n==================================================================================================\n\nCopyright 2020 The HuggingF... | [
[
"numpy.argmax",
"numpy.squeeze"
]
] |
wuyifan2233/Tencent_WWF | [
"2b248a810295f95cb0483837cb8cb8797c144821"
] | [
"Final_data_building/video_based_split/split_vid_top14_p123.py"
] | [
"# -*- coding: UTF-8 -*-\nfrom math import e, inf\nimport os\nfrom numpy.lib.type_check import _imag_dispatcher\nimport pandas as pd\nimport shutil\nimport numpy as np\nimport cv2\nimport random\nfrom tqdm import tqdm\nimport pyfastcopy\nimport json,sklearn\nfrom sklearn.model_selection import train_test_split\n\n\... | [
[
"pandas.read_csv",
"numpy.random.seed",
"numpy.unique"
]
] |
trsvchn/captum | [
"38b57082d22854013c0a0b80a51c0b85269afdaf"
] | [
"tests/attr/neuron/test_neuron_deeplift.py"
] | [
"#!/usr/bin/env python3\n\nfrom __future__ import print_function\n\nfrom typing import Tuple, Union\n\nimport torch\nfrom captum._utils.typing import TensorOrTupleOfTensorsGeneric\nfrom captum.attr._core.neuron.neuron_deep_lift import NeuronDeepLift, NeuronDeepLiftShap\nfrom tests.attr.layer.test_layer_deeplift imp... | [
[
"torch.zeros",
"torch.ones",
"torch.tensor",
"torch.randn"
]
] |
minnieteng/smoke_project | [
"cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f"
] | [
"smoke/noaa/plot_grid.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\n\ngrid2D = np.load(r\"C:\\temp\\10km_grids\\20180808-23.npy\")\n\nfig, ax = plt.subplots(figsize=(16.2, 16))\nim = ax.imshow(grid2D)\nax.set_xlabel(\"Cols\")\nax.set_ylabel(\"Rows\")\nplt.colorbar(im)\n\nplt.savefig('grid2D.png')\n"
] | [
[
"numpy.load",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
]
] |
sherry-1001/dgl-ke | [
"2d2542a21f9725f764e9b927ed257c575f374f47"
] | [
"python/dglke/dataloader/sampler.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# sampler.py\n#\n# Copyright 2020 Amazon.com, Inc. or its affiliates. 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# htt... | [
[
"numpy.zeros",
"numpy.argmin",
"numpy.argsort",
"numpy.arange",
"numpy.array",
"numpy.concatenate",
"numpy.unique"
]
] |
hanqiu-hq/cvpods | [
"597fa669151fdad87c250fa118a9e3a555f4fb5e"
] | [
"cvpods/layers/tree_filter_v2.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# Copyright (C) 2019-2021 Megvii Inc. All rights reserved.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .tree_filter_core import MinimumSpanningTree, RandomSpanningTree, TreeFilter2D\n\n\nclass TreeFilterV2(nn.Module):\n def __init_... | [
[
"torch.nn.init.constant_",
"torch.nn.init.normal_",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.Conv2d",
"torch.zeros"
]
] |
live4dao/RLtrading | [
"c1655a7bfe1220c1d7ae5c0d46814bf3884e6cdb"
] | [
"__main__.py"
] | [
"import numpy as np\nimport pandas as pd\nimport trading_env\n\nfrom datetime import datetime\nst = datetime.now()\n## need to refactor the testcase\n\n# df = pd.read_csv('trading_env/test/data/SGXTWsample.csv', index_col=0, parse_dates=['datetime'])\ndf = pd.read_hdf('D:\\[AIA]\\TradingGym\\dataset\\SGXTWsample.h5... | [
[
"pandas.read_hdf",
"numpy.random.randint"
]
] |
dbis-uibk/NLP4MusA2020 | [
"1d0ab42a7aea416110fbacd632e5bce359b863e8"
] | [
"src/nlp4musa2020/analytics.py"
] | [
"\"\"\"Module providing common functions used for analytics.\"\"\"\nimport os.path\n\nfrom dbispipeline.analytics import extract_gridsearch_parameters\nfrom dbispipeline.db import DB\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\ndef get_results(project_name, filter_git_dirty=True):\n \"\"\"Returns t... | [
[
"pandas.read_sql_table",
"matplotlib.pyplot.savefig",
"pandas.DataFrame"
]
] |
afiolmahon/ducky25 | [
"c740931bee73526e0edb22f3a1f9bf3d71287b1a"
] | [
"catkin_ws/src/lane_filter/src/lane_filter_node.py"
] | [
"#!/usr/bin/env python\nimport rospy\nimport numpy as np\nfrom cv_bridge import CvBridge, CvBridgeError\nfrom sensor_msgs.msg import Image\nfrom std_msgs.msg import Float32\nfrom duckietown_msgs.msg import SegmentList, Segment, Pixel, LanePose, BoolStamped, Twist2DStamped\nfrom scipy.stats import multivariate_norma... | [
[
"numpy.sum",
"numpy.multiply",
"numpy.arcsin",
"numpy.empty",
"numpy.zeros",
"numpy.sin",
"numpy.array",
"scipy.ndimage.filters.gaussian_filter",
"numpy.inner",
"numpy.linalg.norm",
"scipy.stats.multivariate_normal"
]
] |
Lisennlp/distributed_train_pytorch | [
"da43ac6b5f4484b5f7bc92e3c778539b9017cb82"
] | [
"main.py"
] | [
"import argparse\nimport os\nimport random\n\nimport torch\nfrom torch import distributed as dist\nfrom torch.utils.data import DataLoader\nfrom torch.nn.parallel import DistributedDataParallel as DDP\nfrom torch.utils.data.distributed import DistributedSampler\nimport torch.nn as nn\nimport torch.nn.functional as ... | [
[
"torch.utils.data.DataLoader",
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.distributed.reduce",
"torch.nn.Linear",
"torch.distributed.get_rank",
"torch.utils.data.distributed.DistributedSampler",
"torch.argmax",
"torch.cuda.manual_seed",
"torch.nn.functional.softmax... |
dvd42/synbols | [
"3f12a4d9354c7e05313fe0028a108b29409b7171"
] | [
"synbols/visualization.py"
] | [
"from matplotlib import pyplot as plt\n\nfrom .utils import make_img_grid\n\n\ndef plot_dataset(x, y, h_axis=\"char\", v_axis=\"font\", n_row=20, n_col=40, hide_axis=False):\n img_grid, h_values, v_values = make_img_grid(x, y, h_axis, v_axis, n_row, n_col)\n\n plt.tight_layout()\n\n plt.imshow(img_grid)\n\... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
]
] |
ashutom/tensorflow-upstream | [
"3457a2b122e50b4d44ceaaed5a663d635e5c22df"
] | [
"tensorflow/python/autograph/pyct/transpiler.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.autograph.pyct.parser.parse_entity",
"tensorflow.python.autograph.pyct.transformer.EntityInfo",
"tensorflow.python.autograph.pyct.origin_info.resolve_entity",
"tensorflow.python.autograph.pyct.transformer.Context",
"tensorflow.python.autograph.utils.ag_logging.log",
"ten... |
datability-io/incubator-superset | [
"ebb799140a20964802c0b427d8687ee1b45679b3"
] | [
"superset/views/core.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... | [
[
"pandas.DataFrame.from_records"
]
] |
rucmlcv/IEPT_FSL | [
"54b0a58b5928771ef8dcc6dcd6f4314739ffe14a"
] | [
"SSL/dataloader/samplers.py"
] | [
"import torch\nimport numpy as np\n\n\nclass CategoriesSamplerBak():\n\n def __init__(self, label, n_batch, n_cls, n_per): #n_batch 为 一个epoch的episode数亩\n \n self.n_batch = n_batch\n self.n_cls = n_cls\n self.n_per = n_per\n self.n_step = 0\n self.mark = {}\n self.... | [
[
"numpy.array",
"torch.stack",
"torch.from_numpy",
"numpy.argwhere"
]
] |
jianwang-ntu/deeplift_tf2.0 | [
"957511e3e307fdb93f65bf54cc2b5214e5374f49"
] | [
"tests/conversion/sequential/test_conv2d_model_same_padding.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nimport unittest\nfrom unittest import skip\nimport sys\nimport os\nimport numpy as np\nnp.random.seed(1234)\nfrom deeplift.conversion import kerasapi_conversion as kc\nimport deeplift.layers as layers\nf... | [
[
"tensorflow.keras.layers.pooling.MaxPooling2D",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.convolutional.Convolution2D",
"numpy.random.seed",
"numpy.random.randn",
"tensorflow.keras.backend.learning_phase",
"tensorflow.keras.la... |
Rhcsky/KoSpeech | [
"dbff78140d150dcc71d14d65f81c011847e9574d"
] | [
"kospeech/optim/adamp.py"
] | [
"# AdamP\r\n# Copyright (c) 2020-present NAVER Corp.\r\n# MIT license\r\n\r\nimport torch\r\nfrom torch.optim.optimizer import Optimizer\r\nimport math\r\n\r\n\r\nclass AdamP(Optimizer):\r\n \"\"\"\r\n Paper: \"AdamP: Slowing Down the Slowdown for Momentum Optimizers on Scale-invariant Weights\"\r\n\r\n Co... | [
[
"torch.zeros_like"
]
] |
jlmaurer/PyRate | [
"bf1a3d916f1c83e7a0dda3ecc15858f8f1e4ee84"
] | [
"tests/test_mst.py"
] | [
"# This Python module is part of the PyRate software package.\n#\n# Copyright 2017 Geoscience Australia\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://... | [
[
"numpy.sum",
"numpy.empty",
"numpy.testing.assert_array_equal",
"numpy.isnan",
"numpy.array"
]
] |
ohad83/pandas | [
"c5576293859f4351e508471811948e9a1dac4a30"
] | [
"pandas/core/window/expanding.py"
] | [
"from textwrap import dedent\n\nfrom pandas.compat.numpy import function as nv\nfrom pandas.util._decorators import Appender, Substitution\n\nfrom pandas.core.window.common import WindowGroupByMixin, _doc_template, _shared_docs\nfrom pandas.core.window.rolling import _Rolling_and_Expanding\n\n\nclass Expanding(_Rol... | [
[
"pandas.util._decorators.Substitution",
"pandas.util._decorators.Appender",
"pandas.compat.numpy.function.validate_expanding_func"
]
] |
myelintek/tensorpack | [
"8d5ae5cc2cfcf2e4e53b4d1064ac9e727f736d09"
] | [
"examples/ConvolutionalPoseMachines/load-cpm.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n# File: load-cpm.py\n# Author: Yuxin Wu <ppwwyyxxc@gmail.com>\n\nimport cv2\nimport tensorflow as tf\nimport numpy as np\nimport argparse\n\nfrom tensorpack import *\nfrom tensorpack.utils import viz\nfrom tensorpack.utils.argtools import memoized\n\n\"\"\"\n15 chann... | [
[
"tensorflow.pad",
"numpy.load",
"numpy.zeros",
"numpy.exp",
"tensorflow.random_normal_initializer",
"tensorflow.image.resize_bilinear"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.