repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
kiranvad/fdasrsf_python
[ "e45efa35f53eb04ddfef3dbfbfaf893084413755" ]
[ "test/test_all.py" ]
[ "import unittest\nimport numpy as np\nimport fdasrsf as fs \n\nclass TestFDASRSF(unittest.TestCase): \n \n # Returns True or False. \n def test_reparm(self): \n M = 101\n q1 = np.sin(np.linspace(0,2*np.pi,M))\n timet = np.linspace(0,1,M)\n gam = fs.optimum_reparam(q1, timet, q1...
[ [ "numpy.linspace" ] ]
utsekaj42/chaospy
[ "0fb23cbb58eb987c3ca912e2a20b83ebab0514d0" ]
[ "chaospy/distributions/operators/negative.py" ]
[ "\"\"\"\nNegative of a distribution.\n\nExample usage\n-------------\n\nInvert sign of a distribution::\n\n >>> distribution = -chaospy.Uniform()\n >>> distribution\n Negative(Uniform())\n >>> distribution.sample(5).round(4)\n array([-0.3464, -0.885 , -0.0497, -0.5178, -0.1275])\n >>> distribution...
[ [ "numpy.sum" ] ]
RCastroAB/struc2vec
[ "822a1691e279a7ce47918b0f210e7c50efe52782" ]
[ "src/struc2vec.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport random,sys,logging\nfrom concurrent.futures import ProcessPoolExecutor, as_completed\nfrom multiprocessing import Manager\nfrom time import time\nfrom collections import deque\n\nfrom utils import *\nfrom algorithms import *\nfrom algorithms_distances import *\...
[ [ "numpy.sort" ] ]
thePetrMarek/SequenceOfDigitsRecognition
[ "98a24a8da1c5c75096bcefe1fbf1dab8cc67438c" ]
[ "sequence_of_digits/sequence_reshaped_convolution_batchnorm.py" ]
[ "import tensorflow as tf\n\n'''\nRecurrent model for sequence recognition with dropout\n'''\n\n\nclass SequenceReshapedConvolutionBatchnorm:\n def get_name(self):\n return \"sequence_reshaped_convolution_batchnorm\"\n\n def input_placeholders(self):\n inputs_placeholder = tf.placeholder(tf.float...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.contrib.rnn.GRUCell", "tensorflow.count_nonzero", "tensorflow.nn.max_pool", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.cast", "tensorflow.equal", "tensorflow.control_dependencies", "tensorflow.trai...
SyedZiaul/freud
[ "04bcf9b3bcf45c14b05872205eb16205b2dbcf60" ]
[ "benchmarks/benchmark_box_ParticleBuffer.py" ]
[ "import numpy as np\nfrom benchmark import Benchmark\nfrom benchmarker import run_benchmarks\n\nimport freud\n\n\nclass BenchmarkParticleBuffer(Benchmark):\n def __init__(self, L, buf, images):\n self.L = L\n self.buffer = buf\n self.images = images\n\n def bench_setup(self, N):\n ...
[ [ "numpy.random.uniform", "numpy.random.seed" ] ]
kchiguichon/dfn
[ "0485ce36ed81683b60a08c98af28792ead1425d3" ]
[ "src/models/neural_models.py" ]
[ "# Copyright 2019 Kenneth Chiguichon\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 ...
[ [ "tensorflow.concat", "tensorflow.transpose", "tensorflow.keras.layers.Activation", "tensorflow.random.normal", "tensorflow.keras.layers.Dense", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.keras.utils.get_custom_objects", "tensorflow.expand_dims", "tensorflow.one...
bengisug/multiagent-particle-envs
[ "c87280f18fbaf885932fe6da4d600ab474fd83fe" ]
[ "multiagent/policies/attention/multi_head_attention.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass MultiHeadAttention(torch.nn.Module):\n\n def __init__(self, d_model=16, head_count=4, bias=True):\n super(MultiHeadAttention, self).__init__()\n self.head_count = head_count\n self.d_model = d_model\n self.d_k = d_model // head_count\n ...
[ [ "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.nn.Linear", "torch.matmul", "torch.nn.ReLU" ] ]
nastiag67/tools
[ "9989c98acd67ff8fda900d0a2ae3a6d21e2bbd88" ]
[ "tests/models/test_clustering.py" ]
[ "\"\"\"Tests for `clustering` module.\"\"\"\n\nimport pytest\nimport pandas as pd\n\nfrom sklearn.datasets import make_classification\nfrom sklearn.decomposition import PCA\n\nfrom pipelitools.models import clustering as c\n\n\n@pytest.fixture(scope=\"function\")\ndef df_binary():\n X_train, y_train = make_class...
[ [ "sklearn.decomposition.PCA", "sklearn.datasets.make_classification", "pandas.Series" ] ]
danielkingai2/allennlp
[ "65a146d20697ac431564ef1bedb18d61011e727e" ]
[ "allennlp/training/tensorboard_writer.py" ]
[ "from typing import Any, Callable, Dict, List, Optional, Set\nimport logging\nimport os\n\nfrom tensorboardX import SummaryWriter\nimport torch\n\nfrom allennlp.common.from_params import FromParams\nfrom allennlp.data.dataloader import TensorDict\nfrom allennlp.nn import util as nn_util\nfrom allennlp.training.opti...
[ [ "torch.tensor" ] ]
TheDutchDevil/pipelines
[ "a5ba3f0fcd98ffd60f98bce964927ab63382d5d7" ]
[ "components/deprecated/tfx/Trainer/component.py" ]
[ "# flake8: noqa TODO\n\nfrom kfp.components import InputPath, OutputPath\n\n\ndef Trainer(\n examples_path: InputPath('Examples'),\n schema_path: InputPath('Schema'),\n\n model_path: OutputPath('Model'),\n\n train_args: {'JsonObject': {'data_type': 'proto:tfx.components.trainer.TrainArgs'}},\n eval_a...
[ [ "tensorflow.io.gfile.listdir" ] ]
DavidLeoni/prova-qcb
[ "38520ab66b34a145e43ffb0ee808562eae31c325" ]
[ "jupman.py" ]
[ "\n# Library to be included in Jupyter notebooks \n\n__author__ = \"David Leoni\"\n__status__ = \"Development\"\n\nimport sys\nimport unittest\nimport inspect\nimport os\nimport argparse\n\ndef detect_relpath(in_cells):\n \"\"\" Hacky way to find out relative path to jupman.py\n\n in_cells: \"In\" cells o...
[ [ "matplotlib.pyplot.imshow", "pandas.plotting.table", "matplotlib.pyplot.subplots", "matplotlib.image.imread", "matplotlib.pyplot.show" ] ]
mofeing/autoray
[ "f6e53939297f15fe7387418e4f89d2eff8bcf0ef" ]
[ "tests/test_autoray.py" ]
[ "import importlib\n\nimport pytest\n\nimport autoray as ar\n\n\n# find backends to tests\nBACKENDS = [pytest.param(\"numpy\")]\nfor lib in [\"cupy\", \"dask\", \"tensorflow\", \"torch\", \"mars\", \"jax\", \"sparse\"]:\n if importlib.util.find_spec(lib):\n BACKENDS.append(pytest.param(lib))\n\n if ...
[ [ "numpy.conj", "numpy.linalg.norm", "numpy.stack" ] ]
Quitino/Non-LinearFactor-VIOSLAM
[ "f958a7480de35420479defaa829b6aa0c8a31b26" ]
[ "scripts/verify_dataset.py" ]
[ "#!/usr/bin/env python3\n\nimport sys\nimport math\nimport os\n\nimport numpy as np\n\ndataset_path = sys.argv[1]\n\nprint(dataset_path)\n\ntimestamps = {}\nexposures = {}\n\nfor sensor in ['cam0', 'cam1', 'imu0']:\n data = np.loadtxt(dataset_path + '/mav0/' + sensor + '/data.csv', usecols=[0], delimiter=',', dt...
[ [ "numpy.loadtxt", "numpy.searchsorted" ] ]
nicaogr/wildcat_box
[ "0d321dac85d4edbe615a3c609501a688f162f799", "0d321dac85d4edbe615a3c609501a688f162f799" ]
[ "wildcat/demo_watercolor.py", "wildcat/trainResNet50_MLP2_IconArt_v1.py" ]
[ "import argparse\n\nimport torch\nimport torch.nn as nn\n\nfrom wildcat.engine import MultiLabelMAPEngine\nfrom wildcat.models import resnet101_wildcat\nfrom wildcat.watercolor import watercolorClassification\n\nparser = argparse.ArgumentParser(description='WILDCAT Training')\nparser.add_argument('data', metavar='D...
[ [ "torch.nn.MultiLabelSoftMarginLoss", "torch.cuda.is_available" ], [ "numpy.array", "torch.nn.Sequential", "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "torch.load", "torch.nn.MultiLabelSoftMarginLoss", "torch.utils.data.DataLoader", "matplotlib.pyplot.s...
fengwang/aydin
[ "22d7db71de168510bd3aa98fc22384deb8d9916f" ]
[ "aydin/features/groups/uniform.py" ]
[ "from functools import reduce\nfrom operator import mul\nfrom typing import Tuple, Union, Sequence\n\nimport numexpr\nimport numpy\nfrom numba import jit, cuda\nfrom numba.cuda import CudaSupportError\n\nfrom aydin.features.groups.base import FeatureGroupBase\n\n\nfrom aydin.util.array.nd import nd_range_radii\nfro...
[ [ "numpy.ascontiguousarray", "numpy.zeros_like" ] ]
nineye/pytorch_geometric
[ "a52728dcd8167827a6fa058047190e23d2982d18" ]
[ "examples/graph_saint.py" ]
[ "import os.path as osp\n\nimport torch\nimport torch.nn.functional as F\nfrom torch_geometric.datasets import Flickr\nfrom torch_geometric.data import GraphSAINTRandomWalkSampler\nfrom torch_geometric.nn import SAGEConv\nfrom torch_geometric.utils import degree\n\npath = osp.join(osp.dirname(osp.realpath(__file__))...
[ [ "torch.nn.functional.nll_loss", "torch.cat", "torch.nn.functional.dropout", "torch.nn.Linear", "torch.no_grad", "torch.cuda.is_available" ] ]
saipraneeth133/VoidDetection
[ "0d17cb9255d3f09ca97e630cb220eaa4fb0b3edf" ]
[ "rcnn_implementation.py" ]
[ "# split into train and test set\nfrom os import listdir\nfrom xml.etree import ElementTree\nfrom numpy import expand_dims\nfrom numpy import mean\nfrom numpy import zeros\nfrom numpy import asarray\nfrom mrcnn.utils import Dataset\nfrom matplotlib import pyplot\nfrom mrcnn.visualize import display_instances\nfrom ...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.imshow", "numpy.expand_dims", "matplotlib.pyplot.title", "numpy.asarray", "matplotlib.patches.Rectangle", "matplotlib.pyplot.subplot", "numpy.mean", "matplotlib.pyplot.show" ] ]
kuraisle/multipletau
[ "0321de77616f05ca90106075f7f6ecd137437be7" ]
[ "tests/test_ac_cc.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Test correlation-autocorrelation identity\"\"\"\nfrom __future__ import division, print_function\n\nimport sys\n\nimport numpy as np\n\nimport multipletau\n\nfrom test_autocorrelate import get_sample_arrays\n\n\ndef test_ac_cc_m():\n myframe = sys._getframe(...
[ [ "numpy.concatenate", "numpy.all" ] ]
Hongbo-Miao/ogb
[ "1d6dde8080261931bc6ce2491e9149298af1ea98" ]
[ "examples/linkproppred/collab/mlp.py" ]
[ "import argparse\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nfrom ogb.linkproppred import PygLinkPropPredDataset, Evaluator\n\nfrom logger import Logger\n\n\nclass LinkPredictor(torch.nn.Module):\n def __init__(self, in_channels, hidden_channels, out_channels, num...
[ [ "torch.sigmoid", "torch.cat", "torch.load", "torch.nn.functional.dropout", "torch.nn.ModuleList", "torch.nn.Linear", "torch.nn.functional.relu", "torch.no_grad", "torch.log", "torch.cuda.is_available", "torch.device" ] ]
jshleap/alphafold
[ "dc1742fd8b96f71e884e2cc1cf2c4204b0cfe577" ]
[ "alphafold/data/pipeline_multimer.py" ]
[ "# Copyright 2021 DeepMind Technologies Limited\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 applic...
[ [ "numpy.asarray", "numpy.argmax", "numpy.pad", "numpy.ones" ] ]
MiroK/tieler
[ "5204e12157528b18ab1161d4bc5655194c4e8dcb" ]
[ "tieler/tile_data.py" ]
[ "from tieler.tile_cpp import fill_mesh_function\n \nfrom dolfin import MeshFunction, info, SubsetIterator\nfrom collections import defaultdict\nimport numpy as np\nimport six\n\n\ndef mf_from_data(mesh, data):\n '''Build tdim mesh function from the data of TileMesh'''\n return _mx_from_data(mesh, data,\n ...
[ [ "numpy.prod" ] ]
OverHall27/DLMugenKnock
[ "f08553213028e90baff7b4de3c640b51485f4a15" ]
[ "Question_theory/myanswers/perceptron_2.py" ]
[ "import numpy as np\nnp.random.seed(0)\n\nclass NN:\n\n def __init__(self, x, lr):\n #self.weight = np.random.normal(0., 1, [x.shape[1], 1])\n self.weight = np.random.normal(0., 1, x.shape[1])\n self.b = 1.\n self.lr = lr\n self.y = np.zeros(x.shape[0])\n\n def forward(sel...
[ [ "numpy.dot", "numpy.random.seed", "numpy.random.normal", "numpy.array", "numpy.zeros", "numpy.where" ] ]
elv-pierre/lpips-tensorflow
[ "f444e441be0bdfa2eeb3ed014ccba10ffd433f43" ]
[ "lpips_tf.py" ]
[ "import os\nimport sys\n\nimport tensorflow as tf\nfrom six.moves import urllib\n\n_URL = 'http://rail.eecs.berkeley.edu/models/lpips'\n\n\ndef _download(url, output_dir):\n \"\"\"Downloads the `url` file into `output_dir`.\n\n Modified from https://github.com/tensorflow/models/blob/master/research/slim/datas...
[ [ "tensorflow.import_graph_def", "tensorflow.transpose", "tensorflow.shape", "tensorflow.reshape", "tensorflow.squeeze", "tensorflow.to_float", "tensorflow.get_default_graph", "tensorflow.GraphDef" ] ]
muralispaiitm/IRIS_Flowers_Prediction
[ "c81874f2df4f5d2d97412719959ecfa312b923d7" ]
[ "app.py" ]
[ "from flask import Flask, render_template, request\nimport pickle\nimport numpy as np\n\nmodel = pickle.load(open('iri.pkl', 'rb'))\n\napp = Flask(__name__)\n\n@app.route('/')\ndef Home():\n return render_template('home.html')\n\n@app.route('/predict', methods=['POST'])\ndef Predict_Val():\n data1 = request.f...
[ [ "numpy.array" ] ]
vanavski/Text_tonal_analyzer
[ "a990d965dc4eca5bb43a70a050eb3ad10323760b" ]
[ "Python/Temp/ModelsFit.py" ]
[ "import os\n\nimport pandas\nfrom sklearn.externals import joblib\nfrom sklearn.naive_bayes import GaussianNB\n\ncwd = os.getcwd()\n\n\ndef read_training_data():\n training_data = dict()\n data = pandas.read_csv(os.path.join('..', '..', 'Databases', 'dataset_with_trigrams.csv'), sep=';',\n ...
[ [ "sklearn.externals.joblib.dump", "sklearn.naive_bayes.GaussianNB" ] ]
GSGSS/git_learning
[ "ceeabfe88edf2ecbfaf58eb42ca878a7a0910c4c" ]
[ "AIlearning/pandas_test.py" ]
[ "# from pandas import Series,DataFrame\nimport pandas as pd\n\nobj = pd.Series([3, 4, 6, -1])\n\n# print(obj)\n# print(obj.values)\n# print({'a': 1, 'b': 2})\n\n# obj2 = pd.Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd']) # 索引可以重复\n# print(obj2)\n\n# DataFram操作高维数组\ndata = {'city': ['shanghai', 'shanghai', 'beijin...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
MattH688/BERNAISE
[ "fdeff715c1730dd7867ee371d1150f06b4c52d15" ]
[ "problems/flow_spiral2D.py" ]
[ "import dolfin as df\nimport numpy as np\nimport os\nfrom . import *\nfrom common.io import mpi_is_root, load_mesh, mpi_barrier, mpi_comm, mpi_bcast, mpi_gather\nfrom common.cmd import MPI_rank\n# from mpi4py import MPI\nfrom common.bcs import Fixed, Pressure, NoSlip\n#\nfrom ufl import max_value\n__author__ = \"Ma...
[ [ "numpy.concatenate", "numpy.ptp", "numpy.amin" ] ]
elitap/classimbalance
[ "ae807ec533da5eef18f4180b29383399bc57696a" ]
[ "src/contrib/transforms.py" ]
[ "from typing import Dict, Hashable, List, Mapping, Optional, Sequence, Tuple, Union\n\nimport numpy as np\nimport warnings\n\nfrom monai.config import KeysCollection\nfrom monai.transforms.croppad.array import (\n SpatialCrop,\n)\n\nfrom monai.transforms.transform import MapTransform, Randomizable\nfrom monai.tr...
[ [ "numpy.unique", "numpy.asarray", "numpy.floor_divide", "numpy.subtract", "numpy.array", "numpy.unravel_index" ] ]
patrikperssonmath/MDPN
[ "b7ffa649118c9b882c9e5050d7b784abefeb99ed" ]
[ "Converters/sfm_colmap_converter.py" ]
[ "# MIT License\n\n# Copyright (c) 2020 Patrik Persson and Linn Öström\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n...
[ [ "numpy.concatenate", "numpy.array", "numpy.expand_dims", "numpy.zeros" ] ]
plageon/TSP
[ "8f0680bfc341728921a285ae13b3063a72c85f55" ]
[ "Genetic Algorithm.py" ]
[ "import numpy as np\nimport math\nimport matplotlib.pyplot as plt\nimport random\n\npos_list = np.array([[530.0, 209.0], [1126.0, 1229.0], [1492.0, 901.0], [692.0, 1332.0],\n [1485.0, 163.0], [1960.0, 710.0], [1602.0, 922.0], [1692.0, 1134.0],\n [733.0, 1444.0], [570.0, 1280....
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.close", "numpy.average", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros" ] ]
lenas95/pyunicorn
[ "cf02dabd14108cebbeaa36112e644f95b00630f2" ]
[ "tests/test_climate/test_tsonis.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# This file is part of pyunicorn.\n# Copyright (C) 2008--2019 Jonathan F. Donges and pyunicorn authors\n# URL: <http://www.pik-potsdam.de/members/donges/software>\n# License: BSD (3-clause)\n#\n# Please acknowledge and cite the use of this software and its author...
[ [ "numpy.array", "numpy.allclose", "numpy.isclose" ] ]
basiralab/MONAI
[ "5b36d0227c1326701b86dbdfc0f209845240b96f" ]
[ "monai/metrics/utils.py" ]
[ "# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre...
[ [ "numpy.expand_dims", "numpy.ones_like", "torch.isnan", "torch.zeros", "numpy.asarray", "torch.sum", "numpy.zeros_like", "numpy.any" ] ]
saadabbasi/LatEstimator
[ "f0397f54d73226511bd2925c9a9e83e6cfff98d6" ]
[ "hw_nas_bench_api/nas_201_models/shape_searchs/generic_size_tiny_cell_model.py" ]
[ "#####################################################\n# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019.01 #\n#####################################################\nfrom typing import List, Text, Any\nimport random, torch\nimport torch.nn as nn\n\nfrom models.cell_operations import ResNetBasicblock\nfrom models.ce...
[ [ "torch.nn.functional.softmax", "torch.nn.functional.gumbel_softmax", "torch.zeros", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.Linear", "torch.matmul", "torch.distributions.Categorical", "torch.nn.AdaptiveAvgPool2d", "torch.no_grad", "torch.nn....
an2018x/trafficAI
[ "8dcb32bc23b665dc3d624879f1b08916ac528a5e" ]
[ "lightTest.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom torchvision import datasets,models,transforms\nimport torchvision\nimport os\nimport cv2\nfrom PIL import Image\n\nclass Net(nn.Module):\n def __init__(sel...
[ [ "torch.max", "torch.nn.functional.log_softmax", "torch.load", "torch.nn.Conv2d", "torch.nn.Linear", "torch.cuda.is_available" ] ]
mahdinobar/V2V-PoseNet-pytorch
[ "90045b61c45f18dc20b410e2de14bd22be55fe0e" ]
[ "integral-pose/show_acc.py" ]
[ "import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom accuracy import *\nfrom plot import *\n\n\ngt_file = r'./test_s3_gt.txt'\npred_file = r'./test_res.txt'\n\n\ngt = np.loadtxt(gt_file)\ngt = gt.reshape(gt.shape[0], -1, 3)\n\npred = np.loadtxt(pred_file)\npred = pred.reshape(pred.shape[0], -1, 3)...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "numpy.loadtxt" ] ]
cooparation/detection_pytorch
[ "fea3b5a04a13eba060406845a65ac07f177b6112" ]
[ "ssd/modeling/resnet_ssd.py" ]
[ "import torch.nn as nn\nfrom ssd.modeling.ssd import SSD\n\n\n# borrowed from https://github.com/amdegroot/ssd.pytorch/blob/master/ssd.py\ndef add_vgg(cfg, batch_norm=False):\n layers = []\n in_channels = 3\n for v in cfg:\n if v == 'M':\n layers += [nn.MaxPool2d(kernel_size=2, stride=2)]...
[ [ "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
theodoho/udkm1Dsim
[ "1d2c10bc052f0b6ebb8f65c45cf8ce3f32dddddb" ]
[ "udkm1Dsim/helpers.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# The MIT License (MIT)\n# Copyright (c) 2020 Daniel Schick\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,...
[ [ "numpy.log", "numpy.sqrt", "numpy.einsum", "numpy.asarray", "numpy.linalg.matrix_power", "numpy.size", "numpy.zeros_like", "numpy.floor", "numpy.exp", "numpy.array", "numpy.zeros" ] ]
Geosyntec/pybmp
[ "9264c3d569d66f55d97f9287acb7d147dfc948ea" ]
[ "pybmpdb/bmpdb.py" ]
[ "import os\r\nimport logging\r\nfrom pkg_resources import resource_filename\r\nfrom functools import partial\r\nfrom pathlib import Path\r\n\r\nimport numpy\r\nimport pandas\r\nfrom bulwark import checks\r\n\r\nfrom . import info, utils\r\n\r\nimport wqio\r\n\r\n\r\n__all__ = [\"load_data\", \"transform_parameters\...
[ [ "pandas.read_csv", "numpy.where" ] ]
mohan-chinnappan-n/tensorflow
[ "91546f51184b92bbc4eb453b96cf1838f43b9350" ]
[ "tensorflow/contrib/data/python/framework/function.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.util.tf_inspect.ismethod", "tensorflow.python.framework.function._parse_kwargs_as_attrs", "tensorflow.python.ops.variable_scope.get_variable_scope", "tensorflow.python.framework.function._get_op_def", "tensorflow.python.framework.ops.get_default_graph", "tensorflow.pytho...
autonlab/fastlvm
[ "05e77da39ca525eacf1a1e3aa2cc551e6cf18dcd" ]
[ "fastlvm/utils.py" ]
[ "import copy\nimport numpy as np\nimport utilsc\nimport typing\nfrom d3m.metadata import base as metadata_base\nfrom d3m import container\nfrom common_primitives import utils\n\n_stirling = utilsc.new_stirling()\n\n\ndef read_corpus(fname, vocab=[], stopwords=[]):\n return utilsc.read_corpus(fname, vocab, stopwo...
[ [ "numpy.array", "numpy.random.default_rng" ] ]
emillj/gekkoJaponicus
[ "d77c8c7a303b97a3643eb3f3c8b995b8b393f3f7" ]
[ "chart_web.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport glob\nimport datetime\nimport numpy as np\nimport pandas as pd\nimport json\nimport os\n\nimport quantmod as qm\n\nimport flask\nimport dash\nfrom dash.dependencies import Input, Output\nimport dash_core_components as dcc\nimport dash_html_components as html...
[ [ "pandas.to_datetime", "pandas.DataFrame.from_dict" ] ]
fdibaldassarre/waifu2x-tensorflow
[ "aa170c306d655047a7d6b13f588d13b6bdd28736" ]
[ "src/Waifu2x.py" ]
[ "#!/usr/bin/env python3\n\nimport json\nimport os\n\nfrom PIL import Image\nimport numpy as np\n\nimport tensorflow as tf\nfrom tensorflow.keras import Sequential\nfrom tensorflow.keras import layers\n\nfrom src.Places import MODELS_FOLDER\n\nOP_SCALE = 'scale'\nOP_NOISE = 'noise'\nOP_NOISE_SCALE = 'noise_scale'\n\...
[ [ "tensorflow.multiply", "numpy.maximum", "tensorflow.constant", "numpy.expand_dims", "tensorflow.greater", "numpy.asarray", "tensorflow.keras.Sequential", "numpy.round" ] ]
gma-coretechs/hccpy
[ "59d23e91a927f8c90ffadb067e9d804b5505d503" ]
[ "hccpy/adhoc/X_NW_diag_diff.py" ]
[ "from itertools import chain\nimport logging\nimport sys\n\nfrom pyspark.sql import functions as f\nfrom pyspark.sql.session import SparkSession\nfrom pyspark.sql.window import Window\nfrom pyspark.sql.types import ArrayType, StringType\n\nfrom hccV2421.hcc_2421 import HCCEngine\nimport pandas as pd\nimport numpy a...
[ [ "pandas.set_option", "pandas.concat" ] ]
SlipknotTN/HyperGAN
[ "bd39759521d52a706f6f0f561e0c8355a3ef427e" ]
[ "examples/static.py" ]
[ "import argparse\nimport os\nimport uuid\nimport tensorflow as tf\nimport hypergan as hg\nimport hyperchamber as hc\nimport numpy as np\nfrom hypergan.generators import *\nfrom hypergan.viewer import GlobalViewer\nfrom common import *\nfrom hypergan.search.random_search import RandomSearch\n\nfrom hypergan.samplers...
[ [ "tensorflow.train.start_queue_runners" ] ]
thorwhalen/spyn
[ "35a9a85a96736764de9ef20f4cedb260b9b7a8c7" ]
[ "spyn/utils/color.py" ]
[ "__author__ = 'thor'\n\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\ndef shifted_color_map(cmap, start=0, midpoint=0.5, stop=1.0, name='shiftedcmap'):\n '''\n Function to offset the \"center\" of a colormap. Useful for\n data with a negative min and positive max and you want ...
[ [ "matplotlib.pyplot.register_cmap", "matplotlib.colors.LinearSegmentedColormap", "numpy.linspace" ] ]
olonok69/RL_Stable_baselines
[ "3634cc60e8de8e9dfa7cb50fdc6272284b8a7cc9" ]
[ "algos/Td3.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport gym\nfrom tensorflow.keras.models import load_model\n#!pip3 install box2d-py\n\nprint(tf.config.list_physical_devices('GPU'))\n\nenv= gym.make(\"LunarLanderContinuous-v2\")\nstate_low = env.observation_space.low\nstate_high = env.observation_space.high\naction_lo...
[ [ "tensorflow.convert_to_tensor", "tensorflow.clip_by_value", "tensorflow.device", "tensorflow.concat", "numpy.random.choice", "tensorflow.random.normal", "tensorflow.keras.layers.Dense", "tensorflow.math.minimum", "tensorflow.keras.losses.MSE", "tensorflow.math.reduce_mean",...
ictnlp/COKD
[ "15074b67c4917f22ef3f6495d96f092835ddfda5" ]
[ "fairseq/data/dictionary.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nfrom collections impor...
[ [ "torch.is_tensor", "torch.Tensor", "torch.IntTensor" ] ]
yiminglin-ai/face_embedding
[ "a96ba31f75cf9a9a2bcebbd47c7bbffecafb73ed" ]
[ "face_embedding_train.py" ]
[ "import argparse\nimport logging\nimport os\nimport time\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn.functional as F\nimport torch.utils.data.distributed\nfrom torch.nn.utils import clip_grad_norm_\n\nimport ibug.face_embedding.backbones.iresnet as iresnet\nimport ibug.face_embedding.backbone...
[ [ "torch.distributed.broadcast", "torch.optim.lr_scheduler.LambdaLR", "torch.distributed.init_process_group", "torch.utils.data.distributed.DistributedSampler", "torch.cuda.set_device", "torch.distributed.destroy_process_group", "torch.device", "torch.nn.parallel.DistributedDataParal...
RJRL12138/LSTM-CRF-Terminology-extraction
[ "4919d7685e2dd1297aa7a682316950a15f0755dd" ]
[ "LSTM_CRF_model.py" ]
[ "from keras.initializers import Constant\nfrom keras.models import Model, Input\nfrom keras.layers import LSTM, Embedding, Dense, TimeDistributed, Dropout, Bidirectional\nfrom keras_contrib.layers import CRF\nfrom sklearn_crfsuite.metrics import flat_classification_report\nimport numpy as np\nfrom config import Con...
[ [ "numpy.array", "numpy.argmax" ] ]
feudalism/spatialmath-python
[ "eac94363822c642d9e360db0d5f86585334473c5" ]
[ "spatialmath/geom3d.py" ]
[ "# Part of Spatial Math Toolbox for Python\n# Copyright (c) 2000 Peter Corke\n# MIT Licence, see details in top-level file: LICENCE\n\nimport numpy as np\nimport math\nfrom collections import namedtuple\nimport matplotlib.pyplot as plt\nimport spatialmath.base as base\nfrom spatialmath import SE3\nfrom spatialmath....
[ [ "numpy.dot", "matplotlib.pyplot.gca", "numpy.eye", "numpy.linalg.norm", "numpy.finfo", "numpy.delete", "numpy.cross", "numpy.array", "numpy.zeros" ] ]
kohei-us/keras-onnx
[ "fdb9f68f20d60fd7cb244db3100ff1138ab6cc64" ]
[ "keras2onnx/ktf2onnx/tests/backend_test_base.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\n\"\"\"Unit Test Base.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport logging\nimport os\nimpo...
[ [ "tensorflow.graph_util.convert_variables_to_constants", "tensorflow.import_graph_def", "numpy.random.seed", "numpy.testing.assert_array_equal", "tensorflow.reset_default_graph", "tensorflow.Session", "numpy.testing.assert_allclose", "tensorflow.python.ops.variables.global_variables...
TsingHuasuya/tfsnippet
[ "3f51f704e09c654eaf39e231948efed2868669fd" ]
[ "tfsnippet/examples/utils/multi_gpu.py" ]
[ "import multiprocessing as mp\nimport traceback\nfrom contextlib import contextmanager\n\nimport six\nimport tensorflow as tf\n\nfrom .misc import is_dynamic_tensor, cached\n\n__all__ = ['detect_gpus', 'average_gradients', 'MultiGPU']\n\n\n@cached\ndef detect_gpus():\n \"\"\"\n Detect the GPU devices and thei...
[ [ "tensorflow.device", "tensorflow.concat", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.reduce_mean", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.expand_dims", "tensorflow.ConfigProto", "tensorflow.name_scope" ] ]
TakuyaShintate/tsts
[ "483db1edc2f765a5449137446a77acaf17684ce9" ]
[ "tsts/solvers/solver.py" ]
[ "import json\nimport os\nimport sys\nimport warnings\nfrom typing import List, Optional\n\nimport torch\nfrom torch.optim import Optimizer\nfrom torch.utils.data import ConcatDataset\nfrom tsts.cfg import get_cfg_defaults\nfrom tsts.collators import Collator, build_collator\nfrom tsts.core import ContextManager\nfr...
[ [ "torch.utils.data.ConcatDataset", "torch.load" ] ]
shivanshuman021/RouteIC
[ "d5e2faddf60fc6756c414f8ca5d19e4409b5c212" ]
[ "model/train_fcn_pytorch.py" ]
[ "import argparse\nimport os\nimport time\nimport sys\n\nimport h5py\nimport numpy as np\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nplt.rcParams['figure.figsize'] = (10.0, 10.0) # set default size of plots\nplt.rcParams['image.interpolation'] = 'nearest'\nplt.rcParams['image.cmap']...
[ [ "matplotlib.pyplot.legend", "torch.load", "numpy.asarray", "torch.utils.data.DataLoader", "matplotlib.pyplot.plot", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "matplotlib.pyplot.tight_layout", "numpy.swapaxes", "torch.from_numpy", "matplotlib.pyplot.subplot...
ajijohn/planet-snowcover
[ "c1dde5a1984ef12bf293680968e93252a2ad240f" ]
[ "pipeline/Prepare_NDVI.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n\n#get_ipython().system('export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt')\n\n\n# In[2]:\n\n\n#get_ipython().run_line_magic('matplotlib', 'inline')\nfrom osgeo import gdal\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport rasterio as rio\nimpo...
[ [ "numpy.array" ] ]
r0mainK/ur-lstm
[ "ffda3fb817f85b488b44e33b8ef69fbd60e71910" ]
[ "experiments/models/copy_model.py" ]
[ "from torch import Tensor\nimport torch.nn as nn\n\nfrom .utils import create_lstm_variant\nfrom .utils import ModelType\n\n\nclass CopyModel(nn.Module):\n def __init__(self, model_type: ModelType, hidden_size: int, forget_bias: float):\n super(CopyModel, self).__init__()\n self.lstm = create_lstm_...
[ [ "torch.nn.Linear" ] ]
HLJ1997/human-action-recognition
[ "550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0" ]
[ "src/lib/classifier/dnn/feature_procs.py" ]
[ "''' This script defines functions/class to process features:\n\n* def extract_multi_frame_features\n Convert raw skeleton data into features extracted from multiple frames\n by calling `class FeatureGenerator`.\n\n* class FeatureGenerator:\n Compute features from a video sequence of raw skeleton data.\n\n...
[ [ "numpy.random.random", "numpy.nonzero", "numpy.arctan2", "numpy.concatenate", "numpy.mean", "numpy.repeat", "numpy.array", "numpy.zeros" ] ]
david-hoffman/dphtools
[ "f9f19ef5b0a00169562947c78a41c1f02e222a6a" ]
[ "tests/test_fitfuncs.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# test_fitfuncs.py\n\"\"\"\nTesting for fitfuncs.\n\nCopyright (c) 2021, David Hoffman\n\"\"\"\n\n\nimport unittest\n\nimport numpy as np\nfrom dphtools.utils.fitfuncs import exponent, exponent_fit\nfrom numpy.testing import assert_allclose\n\n\nclass TestExponentFit...
[ [ "numpy.random.randn", "numpy.linspace", "numpy.testing.assert_allclose" ] ]
isgeles/SMARTS
[ "423275123ae4aab8b7d409140d82b50555a5267c" ]
[ "smarts/core/smarts.py" ]
[ "# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rig...
[ [ "sklearn.metrics.pairwise.euclidean_distances", "numpy.argwhere" ] ]
mishraka/taskonomy
[ "c8fae8117d91bb8d12c518fd15c18f99d53ce69c" ]
[ "taskbank/tools/run_img_task.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport argparse\nimport importlib\nimport itertools\nimport math\nimport os\nimport pdb\nimport pickle\nimport random\nimport subprocess\nimport sys\nimport threading\nimport time\nimport json\nfrom multiprocessing import Pool\n\nimport matplotlib...
[ [ "tensorflow.InteractiveSession", "matplotlib.use", "numpy.squeeze", "tensorflow.train.Coordinator", "tensorflow.reset_default_graph", "numpy.argmax", "tensorflow.logging.set_verbosity", "numpy.array" ] ]
adabbott/cclib
[ "6a3d32fb4af96947a5ef577043441e24faa96ff6" ]
[ "src/cclib/method/orbitals.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# This file is part of cclib (http://cclib.github.io), a library for parsing\n# and interpreting the results of computational chemistry packages.\n#\n# Copyright (C) 2017, the cclib development team\n#\n# The library is free software, distributed under the terms of\n# the GNU Lesser Gen...
[ [ "numpy.allclose" ] ]
freidrichen/advent-of-code-2019
[ "08aca50e86700504d35c934a308a640a95de586e" ]
[ "day8/python/main.py" ]
[ "import numpy as np\n\n\ninput_file = \"../input.txt\"\nwith open(input_file, 'r') as f:\n input_text = f.read()\nimage_data = np.array([int(i) for i in input_text.strip()]).reshape((-1, 6, 25))\n\n# Test:\n# image_data = np.array([int(i) for i in \"123456789012\"]).reshape((-1, 2, 3))\n\nfewest_zeros = np.argmi...
[ [ "numpy.take_along_axis", "numpy.argmax", "numpy.count_nonzero", "numpy.masked_zeros" ] ]
mccullerlp/OpenLoop
[ "fe86dc6dec3740d4b6be6b88d8eef8566e2aa78d" ]
[ "phasor/signals/plot/ZPK_plot.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\"\"\"\nfrom __future__ import division, print_function, unicode_literals\nimport numpy as np\nimport math\n\nfrom matplotlib.text import OffsetFrom\nimport declarative\n\ndef eng_string(x, format='%.3f', si=False):\n '''\n Returns float/int value <x> formatted in a simplifie...
[ [ "numpy.log", "numpy.array", "numpy.searchsorted", "matplotlib.text.OffsetFrom" ] ]
claire-s11/automl
[ "57621e8f3eaddd2c0b421c65c0bbd323ebcf8f2d" ]
[ "efficientdet/keras/efficientdet_arch_keras.py" ]
[ "# Lint as: python3\n# Copyright 2020 Google Research. 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...
[ [ "tensorflow.keras.layers.AveragePooling2D", "tensorflow.initializers.VarianceScaling", "tensorflow.zeros_initializer", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.layers.Conv2D", "tensorflow.random_normal_initializer", "tensorflow.keras.layers.MaxPooling2D", "numpy.ma...
EileenWang90/mmpose
[ "3fa1328a3b6351bf9b35df60d4d959973a6f8a71" ]
[ "mmpose/models/backbones/litehrnet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import (ConvModule, DepthwiseSeparableConvModule,\n build_conv_layer, build_norm_layer, constant_init,\n normal_init)\nfrom torch.nn.modules.batchnorm import _BatchNorm\nimport torch.utils....
[ [ "torch.nn.Sequential", "torch.cat", "torch.nn.ModuleList", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.AdaptiveAvgPool2d", "torch.utils.checkpoint.checkpoint", "torch.nn.Upsample", "torch.split", "torch.nn.ReLU" ] ]
owenagnel/RockPaperScissors
[ "d7ac01570d925ac0bc23dc816721cedc88ac9439" ]
[ "source/gestureanalyst.py" ]
[ "'''GestureAnalyst class analyses frames and returns drawn hand\nand predicted gesture if one is found'''\nimport handtracker as ht\nimport torch\nimport model as cm\n# pylint: disable=E1101\n\nclass GestureAnalyst():\n '''Analyses frames for gestures'''\n def __init__(self, weights_location = 'source/model/m...
[ [ "torch.from_numpy", "torch.load" ] ]
Aria-K-Alethia/Semi-supervised-VAE
[ "5ede4e755515109a34d8f1bcc279c3c915a6c5ce" ]
[ "main.py" ]
[ "'''\n Copyright (c) 2020 Aria-K-Alethia@github.com\n\n Description:\n train and exp code\n Licence:\n MIT\n THE USER OF THIS CODE AGREES TO ASSUME ALL LIABILITY FOR THE USE OF THIS CODE.\n Any use of this code should display all the info above.\n'''\nfrom __future__ import print_functi...
[ [ "matplotlib.pyplot.legend", "torch.randint", "torch.load", "torch.cat", "torch.manual_seed", "matplotlib.pyplot.figure", "torch.argmax", "torch.zeros", "torch.stack", "torch.randn", "matplotlib.pyplot.gcf", "sklearn.manifold.TSNE", "matplotlib.pyplot.clf", "...
robust-ml/example
[ "6b971397c308a80d92976a4b8e4c7e4f209a9905" ]
[ "attack.py" ]
[ "import robustml\nimport sys\nimport tensorflow as tf\nimport numpy as np\n\nclass InceptionV3PGDAttack(robustml.attack.Attack):\n def __init__(self, sess, model, epsilon, max_steps=100, learning_rate=0.001, debug=False):\n self._sess = sess\n self._model = model\n self._epsilon = epsilon\n ...
[ [ "numpy.clip", "tensorflow.gradients", "tensorflow.placeholder", "numpy.sign", "numpy.copy", "tensorflow.one_hot", "tensorflow.nn.softmax_cross_entropy_with_logits_v2" ] ]
GIS-PuppetMaster/tinyflow
[ "9351a95957b68c37f480c169ff9dd012b68b4b1e" ]
[ "tests/LeNet5/memoryTest.py" ]
[ "import numpy as np\nfrom pycode.tinyflow import autodiff as ad\nfrom pycode.tinyflow import gpu_op\nfrom pycode.tinyflow import ndarray\nfrom pycode.tinyflow import train\n\n\ndef test_dense():\n\n inputs = ad.Placeholder(\"inputs\")\n filters = ad.Variable(\"filters\")\n b = ad.Variable(\"b\")\n y_ = ...
[ [ "numpy.zeros", "numpy.linspace", "numpy.ones" ] ]
yyc9268/sealion_count
[ "96237e54f04a5282d1e9757a823adbb0ccddae4e" ]
[ "cnn.py" ]
[ "# NOAA SEALION COUNTING CHALLENGE COMPETITION CODE 58th/385\r\n# Author : Young-chul Yoon\r\n\r\nimport tensorflow as tf\r\n\r\n############################### CNN materials ###########################################\r\ndef weight_variable(shape, w_name):\r\n initial = tf.truncated_normal(shape, stddev=0.1)\r\...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.train.ExponentialMovingAverage", "tensorflow.train.AdamOptimizer", "tensorflow.nn.conv2d", "tensorflow.Variable", ...
YangTaoCN/IntroNeuralNetworks
[ "45b0311f85c9cdd9d3f0806e0059201e2655697f" ]
[ "backtest.py" ]
[ "import pandas_datareader.data as pdr\nimport yfinance as fix\nimport numpy as np\nfix.pdr_override()\n\n\ndef back_test(strategy, seq_len, ticker, start_date, end_date, dim):\n \"\"\"\n A simple back test for a given date period\n :param strategy: the chosen strategy. Note to have already formed the model...
[ [ "numpy.array" ] ]
pangyuteng/aigonewrong
[ "98a2c7a172be4664fc372d581cef5f23cf317b51" ]
[ "puzzles/planb/archive/mypandas.py" ]
[ "import pandas as pd\n\nd = {}\n\n# transform each row\ndef transform(row):\n l = row.iloc[0]\n v=l.strip('\\n').split(\" \")\n b=int(v[0])\n i=int(v[2])\n o=int(v[3])\n for x in range(4+i,4+i+o):\n d[v[x+o]]=(b,float(v[x]))\n for y in range(4,4+i):\n del d[v[y]]\n\ndf = pd.read_c...
[ [ "pandas.read_csv" ] ]
itsraina/insightface
[ "e78eee59caff3515a4db467976cf6293aba55035" ]
[ "reconstruction/ostec/external/stylegan2/run_generator.py" ]
[ "# Copyright (c) 2019, NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, visit\n# https://nvlabs.github.io/stylegan2/license.html\n\nimport argparse\nimport numpy as np\nimport PIL.Image\nimport dnnlib\nimport dnnli...
[ [ "numpy.load", "numpy.random.RandomState", "numpy.stack" ] ]
ddr95070/RMIsaac
[ "ee3918f685f0a88563248ddea11d089581077973" ]
[ "sdk/packages/object_pose_estimation/apps/pose_cnn_decoder/evaluation/pose_evaluation_utils.py" ]
[ "'''\nCopyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n\nNVIDIA CORPORATION and its licensors retain all intellectual property\nand proprietary rights in and to this software, related documentation\nand any modifications thereto. Any use, reproduction, disclosure or\ndistribution of this software and r...
[ [ "numpy.dot", "matplotlib.pyplot.imshow", "numpy.abs", "numpy.asarray", "numpy.median", "numpy.squeeze", "numpy.linalg.norm", "numpy.quaternion", "numpy.int_", "matplotlib.animation.FuncAnimation", "numpy.array", "numpy.zeros", "numpy.where", "matplotlib.pypl...
soodoku/decline
[ "a4b6c5e20d4660d6d343e35663fcc49c5af03578" ]
[ "incline/trend.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas as pd\nfrom scipy.signal import savgol_filter\nfrom scipy.interpolate import UnivariateSpline\n\n\ndef naive_trend(df, column_value='value'):\n \"\"\"\n naive_trend\n\n Gives the naive slope: look to the right, look to the left, \n travel one unit each, and get ...
[ [ "scipy.interpolate.UnivariateSpline", "scipy.signal.savgol_filter", "pandas.concat" ] ]
Wizardcn/Detection
[ "3901f0748c32562854537b93f384597a37581685" ]
[ "Transmitter.py" ]
[ "from math import sqrt\r\nimport numpy as np\r\nimport random\r\n\r\n\r\ndef generate_mi(Pm0, n):\r\n \"\"\" input message generator function \"\"\"\r\n mi = []\r\n m0 = 0 # m0 counter\r\n m1 = 0 # m1 counter\r\n for i in range(n):\r\n if random.uniform(0, 1) < Pm0:\r\n mi.append(...
[ [ "numpy.array", "numpy.sqrt", "numpy.power" ] ]
leon3428/SatSeg
[ "c3a4c3064ab0629cc82e3e4c6c4d80ff009770be" ]
[ "training.py" ]
[ "import numpy as np\nimport os\nimport matplotlib.pyplot as plt\n\nos.environ[\"KERAS_BACKEND\"] = \"plaidml.keras.backend\"\n\nimport keras\nfrom keras.layers import Conv2D, Conv2DTranspose, MaxPool2D, Concatenate, Input, BatchNormalization, Activation\nfrom keras.models import Model, load_model\nfrom keras.utils ...
[ [ "numpy.load", "numpy.array" ] ]
njanirudh/nca
[ "00cdc9783d4ee7186697caa0beadef6ad0d1ba6e" ]
[ "examples/dim_reduct.py" ]
[ "\"\"\"NCA for linear dimensionality reduction.\n\"\"\"\n\nimport argparse\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\n\nfrom torchnca import NCA\nfrom sklearn.decomposition import PCA\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom sklearn.pipeline import Pipelin...
[ [ "numpy.linspace", "numpy.concatenate", "sklearn.manifold.TSNE", "numpy.random.randn", "torch.cuda.is_available", "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "torch.device", "torch.from_numpy", "numpy.stack", "numpy.sin", "numpy.repeat", "matplotlib.p...
jfarrugia-uom/hyperstar
[ "896db10da2506e5144b99361dfb43609edf05012" ]
[ "train_refactored.py" ]
[ "#!/usr/bin/env python\n\nimport datetime\nimport glob\nimport os\nimport sys\nimport pickle\nimport random\nimport numpy as np\nimport tensorflow as tf\nfrom projlearn import *\nfrom projlearn.toyota import Toyota\nimport pandas as pd\nimport gensim\nfrom tqdm import tqdm \n\nflags = tf.app.flags\nFLAGS = flags.FL...
[ [ "pandas.read_csv", "tensorflow.constant", "tensorflow.summary.FileWriter", "tensorflow.global_variables", "tensorflow.variables_initializer", "tensorflow.ConfigProto", "numpy.savez_compressed", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.train.AdamOptimizer",...
stefantaubert/deepvoice3_pytorch
[ "0b9a65757446c2fb54db199612752e0a1a58a9d2" ]
[ "synthesis.py" ]
[ "# coding: utf-8\n\"\"\"\nSynthesis waveform from trained model.\n\nusage: synthesis.py [options] <checkpoint> <text_list_file> <dst_dir>\n\noptions:\n --hparams=<parmas> Hyper parameters [default: ].\n --preset=<json> Path of preset parameters (json).\n --checkpoint-seq2se...
[ [ "torch.LongTensor", "torch.load", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available", "torch.device" ] ]
karmic-creditor/pygeopackage
[ "13366d54f80bd827b84c6538b9b08b6656111ef4" ]
[ "src/geopackage/_geopackage.py" ]
[ "import os\nimport sys\nimport json\nimport sqlite3\n\nimport tempfile\nfrom io import BytesIO, StringIO\nfrom sqlite3 import Binary as sBinary\nfrom collections import OrderedDict, MutableMapping\n\ntry:\n import geomet\n from geomet import wkt as geometwkt\n from geomet import wkb as geometwkb\n _HASG...
[ [ "pandas.read_sql_query" ] ]
brumen/openpilot
[ "ac31b2ace59eb4b1f1f3eb0181bf84e715c26d56" ]
[ "models/lane_detect/lane_models/road_model.py" ]
[ "\nimport cv2\nimport numpy as np\nimport threading\n\nfrom typing import Union\n\nfrom openpilot.models.lane_detect.lane_config import BASE_TU, BASE_CU\n\nfrom openpilot.models.lane_detect.hough_lines import HoughLanesImage\n\nfrom openpilot.models.lane_detect.lane_models.lane_generator_hough import LaneGeneratorC...
[ [ "numpy.uint8", "numpy.ones" ] ]
lovaulonze/bulk_mater
[ "1c611861c1c9bd16cc2d2fd7a1b3f084d135391c" ]
[ "extract.py" ]
[ "import os, os.path\nimport numpy\n\ndef extract_to_txt(base_dir):\n for name in [\"polarizability_df.npz\",\n \"polarizability_tetra.npz\"]:\n fname = os.path.join(base_dir, name)\n if os.path.exists(fname):\n print(\"Found {}\".format(fname))\n f = numpy.load...
[ [ "numpy.load", "numpy.vstack" ] ]
dragonrobotics/2018-PowerUp
[ "0fb6be22420b1488ca3d6abb04588e8564d768b9" ]
[ "autonomous/fsm_auto.py" ]
[ "\"\"\"\nAutonomous module.\n\nThis module contains classes and functions for autonomous, which is designed as\na finite-state automaton updated per tick in autonomousPeriodic.\n\nAutonomous transitions between these states:\n\n - **init**: The robot closes the claw, fully lowers the lift, and\n transitions...
[ [ "numpy.abs", "numpy.arctan2", "numpy.mean", "numpy.array", "numpy.sum" ] ]
aws-samples/aws-photo-to-sketch
[ "e242f021f2a0d2ee840cb476b2ec63b132652807" ]
[ "src/src/predictor.py" ]
[ "# This file implements a flask server for inference. You can modify the file to align with your own inference logic.\nfrom __future__ import print_function\n\nimport io\nimport json\nimport os\nimport pickle\nimport signal\nimport sys\nimport traceback\n\nimport flask\nfrom flask import request\n\nimport tensorflo...
[ [ "tensorflow.convert_to_tensor", "tensorflow.constant", "tensorflow.shape", "tensorflow.cast", "numpy.ndim", "tensorflow.image.resize", "numpy.array", "tensorflow.keras.preprocessing.image.img_to_array" ] ]
Asadullah-Dal17/learn-opencv-python
[ "2892e1b253f1c8977662148a8721d8efb7bd63b6" ]
[ "source-code/Basic stuff/test_installation.py" ]
[ "import cv2 as cv \nimport numpy as np\n\nprint(f'opencv_version: {cv.__version__}')\n\nimg = np.zeros((500,500, 3), dtype=np.uint8)\ncv.putText(img, f'version: {cv.__version__}', (100, 250), cv.FONT_HERSHEY_PLAIN, 2.4, (0,255,0), 2, cv.LINE_AA)\ncv.imshow('img', img)\ncv.waitKey(0)\ncv.destroyAllWindows()" ]
[ [ "numpy.zeros" ] ]
csjunxu/Open3D
[ "ef042a6c50e54c4bb56ccb4657a745c9b38c1b7f" ]
[ "src/Python/Tutorial/Basic/pointcloud.py" ]
[ "# Open3D: www.open3d.org\n# The MIT License (MIT)\n# See license file or visit www.open3d.org for details\n\nimport numpy as np\nfrom open3d import *\n\nif __name__ == \"__main__\":\n\n print(\"Load a ply point cloud, print it, and render it\")\n pcd = read_point_cloud(\"../../TestData/fragment.ply\")\n p...
[ [ "numpy.asarray" ] ]
jeanmichelscherer/mef90
[ "48b9b7d8bdaccb846a76833853f6ea81ce6fc9b1" ]
[ "python/pymef90/mesh/mef90ABAQUS.py" ]
[ "import numpy as np\nimport io\n\ndef ABAQUSread(filename):\n '''\n Import an abaqus file\n '''\n def ABAQUScellType(cellType):\n if cellType.upper() in (\"B21\", \"B21H\", \"T2D2\"):\n return \"BAR2\"\n elif cellType.upper() in (\"S3R\",\"STRI3\",\"CPE3\", \"CPE3R\", \"CPE3S\",...
[ [ "numpy.array" ] ]
simran-arora/emmental-tutorials
[ "d5b82140f3826b6d90156b20d9c6731b7fe07e8c" ]
[ "data_augmentation/eda/image/modules/soft_cross_entropy_loss.py" ]
[ "from typing import List\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import Tensor\n\n\nclass SoftCrossEntropyLoss(nn.Module):\n \"\"\"\n Calculate the CrossEntropyLoss with soft targets\n :param weight: Weight to assign to each of the classes. Default: None\n :ty...
[ [ "torch.nn.functional.cross_entropy", "torch.Tensor" ] ]
BruceResearch/BiTr-Unet
[ "d1f5ad5df7ff5e65c7797bfafd51a782f6114af3" ]
[ "postprocess/dataset.py" ]
[ "# Modified from @github: https://github.com/shu-hai/two-stage-VAE-Attention-gate-BraTS2020\n\nfrom torch.utils.data import Dataset\nimport numpy as np\nimport os\nimport numpy as np\n\nnp.random.seed(0)\n\nimport random\n\nrandom.seed(0)\n\n\n# from random import sample\n\n\ndef validation_sampling(data_list, test...
[ [ "numpy.random.random", "numpy.random.seed", "numpy.concatenate", "numpy.load", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
reonho/capstone21
[ "3c3fd09dbfa727bc69949024b0e5a74308c98fa3" ]
[ "python_backend/triton_client/tao_triton/python/postprocessing/detectnet_processor.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n# \n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to...
[ [ "numpy.min", "numpy.unique", "sklearn.cluster.DBSCAN", "numpy.max", "numpy.float64", "numpy.array", "numpy.sum" ] ]
sidgairo18/unsupervised-style-learning
[ "90445645b67862ed0ac7ba987f31443cfce6aca5" ]
[ "src/triplet_dataloader.py" ]
[ "# Partly written by author: Siddhartha Gairola\n# Substantially adaptee from References 1, 2 in Readme.txt file.\n\nfrom __future__ import print_function, division\nimport os\nimport torch\nfrom skimage import io, transform\nimport numpy as np\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision imp...
[ [ "numpy.uint8", "matplotlib.pyplot.ion", "numpy.zeros", "numpy.ndarray" ] ]
rhodescoffey/alignment
[ "46d231f4fab932837ec69998b86685e1e394edbb" ]
[ "align_funcs.py" ]
[ "\"\"\"\n align_funcs.py\n\n The alignment algorithm takes in TextGrid classes and extracts meaningful\n data. This information consists of the beginning of a phoneme's utterance,\n its end, and its phonemic transcription. With this information the program\n finds the edit distance between two given ...
[ [ "numpy.argmin" ] ]
wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels
[ "e6df7ffc9b0318fdce405e40993c79785b47c785" ]
[ "Multitask-CNN-RNN/utils/logging_utils.py" ]
[ "import os\nimport pandas as pd\nimport pickle\nimport matplotlib.pyplot as plt\nplt.rcParams.update({'font.size': 12})\ndef draw_plots(df, title, save_path):\n\tplt.figure()\n\tfor i, key in enumerate(df.keys()):\n\t\tif key !='loss':\n\t\t\tplt.plot(df.index, df[key], linewidth=2, label = key)\n\tplt.legend()\n\t...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.cla", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.figure" ] ]
sw1001/ENLP-Project
[ "79e1257665a4c3ecc342505061041bed886891b5" ]
[ "src/model_svm.py" ]
[ "import time\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn import metrics\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.metrics import classification_report\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.svm import *\n\nTRAIN_DATA_FILE = 'train_mapped.tsv...
[ [ "pandas.read_csv", "sklearn.metrics.recall_score", "sklearn.metrics.precision_score", "sklearn.model_selection.train_test_split", "sklearn.metrics.confusion_matrix", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.metrics.f1_score", "sklearn.metrics.classification_repor...
nhayato/dl-from-scratch3
[ "6138c70ba611e9b1ae59212730d0ec0eb72ea0ce" ]
[ "steps/step23.py" ]
[ "if '__file__' in globals():\n import os\n import sys\n sys.path.append(os.path.join(os.path.dirname(__file__), '..'))\n\nimport numpy as np\nfrom dezero import Variable\n\n\ndef main():\n x = Variable(np.array(1.0))\n\n print(x)\n y = (x + 3)**2\n y.backward()\n\n print(y)\n print(x.grad...
[ [ "numpy.array" ] ]
hc-super66/Word2Vec-Learning
[ "ea279a81ae59fb86715aad1bcd2e9be11cd152d7" ]
[ "imdb_preprocess.py" ]
[ "from __future__ import absolute_import\r\nfrom __future__ import print_function\r\n\r\nimport logging\r\nimport os\r\nimport re\r\nimport sys\r\nfrom collections import defaultdict\r\n\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom bs4 import BeautifulSoup\r\nfrom gensim.models import KeyedVectors\r\nfro...
[ [ "pandas.read_csv", "pandas.DataFrame", "numpy.random.rand", "numpy.random.uniform", "numpy.zeros" ] ]
gunnarsnorri/rescueranger
[ "0dfe3856e3c823fad39a684e0185e4ad9de03870" ]
[ "scripts/PID_test.py" ]
[ "#!/usr/bin/env python\nimport PID\nimport time\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.interpolate import spline\n\n#P=2.0, I=0.0, D=1.0, Derivator=0, Integrator=0, Integrator_max=100, Integrator_min=-100, reference=0.0\n\ndef PID_test(P=2.0, I=0.0, D=1.0, reference=0.0):\n pidx = PID.P...
[ [ "matplotlib.pyplot.title", "scipy.interpolate.spline", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ArnavM1499/Hanabi-HumanAI
[ "c2c159c28c784950a2c98cbd8bf81bfc9036484d" ]
[ "game_net/lstm_two_stage.py" ]
[ "import numpy as np\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\nfrom tqdm import tqdm\n\ntorch.multiprocessing.set_sharing_strategy(\"file_system\")\n\nGAME_STATE_LENGTH = 583 + 20\n\nDATA_ALL = \"../log/features0825/lstm_extended/00005_all.npy\"\nDATA_TRAIN = DATA_ALL.replace(\"_all\", \"_tra...
[ [ "torch.nn.Sequential", "torch.nn.CrossEntropyLoss", "torch.nn.Dropout", "torch.clamp", "torch.nn.LSTM", "torch.nn.utils.rnn.pad_sequence", "numpy.load", "torch.nn.utils.rnn.pack_padded_sequence", "torch.tensor", "torch.nn.Linear", "torch.nn.utils.rnn.pad_packed_sequence...
chi3x10/OpenSfM
[ "9766a11e11544fc71fe689f33b34d0610cca2944" ]
[ "opensfm/test/test_bundle.py" ]
[ "import copy\n\nimport numpy as np\nimport pytest\nfrom opensfm import (\n config,\n geometry,\n pybundle,\n pygeometry,\n pymap,\n reconstruction,\n tracking,\n types,\n)\n\n\ndef test_unicode_strings_in_bundle() -> None:\n \"\"\"Test that byte and unicode strings can be used as camera i...
[ [ "numpy.radians", "numpy.allclose", "numpy.linspace", "numpy.ones", "numpy.std", "numpy.random.rand", "numpy.exp", "numpy.meshgrid", "numpy.zeros" ] ]