repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
peleiden/daluke
[ "d2c85ba6b80021b2959b369381c447d18b058576" ]
[ "tests/pretrain/test_pretrain_data.py" ]
[ "import os\n\nimport torch\nfrom pelutils import MainTest\nfrom transformers import AutoTokenizer\n\nfrom daluke import daBERT\nfrom daluke.data import BatchedExamples\nfrom daluke.pretrain.data import load_entity_vocab, DataLoader, calculate_spans\nfrom daluke.pretrain.data.build import DatasetBuilder\n\n\nclass T...
[ [ "torch.device", "torch.all", "torch.utils.data.RandomSampler" ] ]
aperrin66/DAPPER
[ "d9d09ed87ca58d59972296e317bfeea50ba6cdd0" ]
[ "dapper/mods/Lorenz96/anderson2009.py" ]
[ "\"\"\"A land-ocean setup from `bib.anderson2009spatially`.\"\"\"\n\nimport numpy as np\n\nimport dapper.mods as modelling\nfrom dapper.mods.Lorenz96.sakov2008 import X0, Dyn, LPs, Nx, Tplot\nfrom dapper.tools.localization import localization_setup, pairwise_distances\nfrom dapper.tools.viz import xtrema\n\nt = mod...
[ [ "numpy.arange", "numpy.zeros" ] ]
gyger/PICwriter
[ "a94d0f468a17256523086c2ce1d024a84c5952e3" ]
[ "picwriter/components/spiral.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport numpy as np\nimport gdspy\nimport picwriter.toolkit as tk\nfrom picwriter.components.waveguide import Waveguide\nfrom picwriter.components.sbend import SBend\n\n\nclass Spiral(tk.Component):\n \...
[ [ "scipy.special.ellipeinc", "scipy.optimize.fsolve", "numpy.sqrt" ] ]
gnicks007/data-driven-discretization-1d
[ "c5466d094d27dd85af932f00070893180d2f9918" ]
[ "pde_superresolution/layers_test.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 ...
[ [ "tensorflow.range", "tensorflow.Graph", "tensorflow.Session", "tensorflow.constant", "tensorflow.squeeze", "tensorflow.placeholder" ] ]
anetczuk/stock-monitor
[ "5852980837649ad3b8f76d413b61271f208a2399" ]
[ "src/stockmonitor/gui/widget/mpl/baseintradaychart.py" ]
[ "# MIT License\n#\n# Copyright (c) 2020 Arkadiusz Netczuk <dev.arnet@gmail.com>\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 t...
[ [ "pandas.Timestamp" ] ]
MBasting/Sudoku-solver
[ "7a5d9e070bc3a3cc59f8b2afc179163dad1a2d69" ]
[ "python/solver.py" ]
[ "import numpy as np\nimport copy\nimport random\nimport time\n\n\ndef solveSudoku(sudokuOriginal):\n blocks, rows, columns = fillPossibilities(sudokuOriginal)\n counter = 0\n start = time.time()\n res, sudoku1 = trySudoku(copy.deepcopy(sudokuOriginal), copy.deepcopy(blocks),\n ...
[ [ "numpy.arange", "numpy.zeros", "numpy.floor" ] ]
xphongvn/dcase2020
[ "7b4cee3cdef252f80e75ffe51450308dbd589fec" ]
[ "05_SVDD.py" ]
[ "import torch\nimport logging\nimport random\nimport numpy as np\nimport common as com\nimport os\nimport ipdb\nfrom sklearn import metrics\nfrom tqdm import tqdm\nfrom SVDD.datasets.dcase import DCASE_Dataset\nfrom SVDD.utils.config import Config\nfrom SVDD.deepSVDD import DeepSVDD\n\n#############################...
[ [ "numpy.full", "numpy.array", "numpy.random.seed", "numpy.mean", "torch.manual_seed", "torch.cuda.is_available", "sklearn.metrics.roc_auc_score" ] ]
s-tian/robosuite
[ "56c20db6231e03ec5910869f7227819943fc24b2" ]
[ "robosuite/utils/camera_utils.py" ]
[ "\"\"\"\nThis module includes:\n\n- Utility classes for modifying sim cameras\n\n- Utility functions for performing common camera operations such as retrieving\ncamera matrices and transforming from world to camera frame or vice-versa.\n\"\"\"\nimport json\nimport xml.etree.ElementTree as ET\n\nimport h5py\nimport ...
[ [ "numpy.concatenate", "numpy.array", "numpy.ones_like", "numpy.asarray", "numpy.matmul", "numpy.zeros", "numpy.ones", "numpy.tan", "numpy.eye", "numpy.stack", "numpy.clip", "numpy.all", "numpy.floor" ] ]
stevewongv/DSC-PyTorch
[ "bf2ae87d9cf763678de5d186c3f0184687516b8d" ]
[ "DSC.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\nfrom irnn import irnn\nfrom backbone.resnext.resnext101_regular import ResNeXt101\n\ndef conv1x1(in_channels, out_channels, stride = 1):\n return nn.Conv2d(in_channels,out_channels,kernel_size = 1,\n ...
[ [ "torch.cat", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.tensor" ] ]
pk1994/mlflow
[ "495946edb5d3a2837304a2318de3a70c47555112" ]
[ "mlflow/tracking/fluent.py" ]
[ "\"\"\"\nInternal module implementing the fluent API, allowing management of an active\nMLflow run. This module is exposed to users at the top-level :py:mod:`mlflow` module.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\n\nimport atexit\nimport time\nimport logging\nimport numpy as np\nimport pandas...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
shubhamagarwal92/visdial_conv
[ "237c853ebc72f5d4c072d581e919e1c434a2bf2e" ]
[ "visdialch/vqa_models/mcan/mca.py" ]
[ "# --------------------------------------------------------\n# OpenVQA\n# Written by Yuhao Cui https://github.com/cuiyuhao1996\n# --------------------------------------------------------\n\nfrom visdialch.vqa_models.mcan.fc import FC, MLP\nfrom visdialch.vqa_models.mcan.layer_norm import LayerNorm\n\nimport torch.n...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.matmul", "torch.nn.functional.softmax" ] ]
jpWang/LiLT
[ "c82d963c2c19df76f97b1ff94ae7da2f83c9dfe1" ]
[ "LiLTfinetune/trainers/xfun_trainer.py" ]
[ "import collections\nimport time\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport torch\nfrom packaging import version\nfrom torch import nn\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom transformers.utils import logging\nfrom transformers.file_utils import is_sagemaker_mp_enabled\n...
[ [ "torch.distributed.get_rank", "torch.cuda.amp.autocast", "torch.no_grad" ] ]
180flyer/StanfordQuadruped
[ "1fd0f8a503aeb08c124813a3e698d5e4df7465b3" ]
[ "pupper/HardwareConfig.py" ]
[ "\"\"\"\nPer-robot configuration file that is particular to each individual robot, not just the type of robot.\n\"\"\"\nimport numpy as np\n\n\nMICROS_PER_RAD = 11.333 * 180.0 / np.pi # Must be calibrated\nNEUTRAL_ANGLE_DEGREES = np.array(\n [[-7, -2, 2, -1], [18, 55, 33, 50], [-46, -37, -40, -39]]\n)\n\nPS4_CO...
[ [ "numpy.array" ] ]
twuebi/finalfusion-python
[ "1771c77e7e09822137b4889a6ce96d0623664e7a" ]
[ "tests/test_similarity.py" ]
[ "import pytest\nimport numpy\n\nSIMILARITY_ORDER_STUTTGART_10 = [\n \"Karlsruhe\",\n \"Mannheim\",\n \"München\",\n \"Darmstadt\",\n \"Heidelberg\",\n \"Wiesbaden\",\n \"Kassel\",\n \"Düsseldorf\",\n \"Leipzig\",\n \"Berlin\",\n]\n\n\nSIMILARITY_ORDER = [\n \"Potsdam\",\n \"Hambu...
[ [ "numpy.ones" ] ]
eyal-orbach/Details2Story-XLNetPlanCloze
[ "47fd98ca2d59f3d4113d2de510fe955fff49efb9" ]
[ "transformer_base.py" ]
[ "import logging\nimport os\nimport random\n\nimport numpy as np\nimport pytorch_lightning as pl\nimport torch\n\nfrom transformers import (\n AdamW,\n AutoConfig,\n AutoModel,\n AutoModelForQuestionAnswering,\n AutoModelForSequenceClassification,\n AutoModelWithLMHead,\n AutoTokenizer,\n)\nfrom...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.cuda.manual_seed_all", "torch.distributed.init_process_group" ] ]
DavidJanz/emukit
[ "7421cb7f4ed831b6581f3686806521ff7fb97e74" ]
[ "tests/emukit/test_acquisitions.py" ]
[ "from collections import namedtuple\n\nimport numpy as np\nimport pytest\nimport pytest_lazyfixture\nfrom scipy.optimize import check_grad\n\nfrom bayesian_optimization.test_entropy_search import entropy_search_acquisition\nfrom emukit.bayesian_optimization.acquisitions import ExpectedImprovement, NegativeLowerConf...
[ [ "numpy.array", "numpy.random.rand", "scipy.optimize.check_grad", "numpy.random.RandomState" ] ]
tallenglish/cayleydickenson
[ "6bf9e016968801183adf697e872c405a0073239a" ]
[ "group.py" ]
[ "from hypercomplex import Order, Names\n\nimport argparse as ap\nimport definitions as df\nimport graph_tool as gt\nimport graph_tool.draw as gtd\nimport itertools as it\nimport networkx as nx\nimport numpy as np\n\ndef group(**options):\n\n\tdef option(name, default, **options):\n\n\t\tif name in options:\n\n\t\t\...
[ [ "numpy.where", "numpy.roll", "numpy.zeros" ] ]
sarvex/graphics
[ "aeeb6e4753b8561ecfd39234ceea1436cd65e89e", "aeeb6e4753b8561ecfd39234ceea1436cd65e89e" ]
[ "tensorflow_graphics/projects/gan/architectures_style_gan_test.py", "tensorflow_graphics/projects/gan/exponential_moving_average.py" ]
[ "# Copyright 2020 The TensorFlow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "tensorflow.ones", "numpy.ones", "tensorflow.keras.utils.custom_object_scope", "tensorflow.test.main", "tensorflow.keras.models.clone_model" ], [ "tensorflow.distribute.get_replica_context", "tensorflow.distribute.get_strategy", "tensorflow.init_scope" ] ]
Pressio/pressio-hyperreduction
[ "3beba2532ccac64262fca81fbc35a9f0ce223620" ]
[ "tests/distributed/test_lspg_weighting_n6.py" ]
[ "\nimport numpy as np\nimport sys\nimport pressiotools.linalg as ptla\nfrom pressiotools.romoperators.lspgWeighting import computeLspgWeighting\n\nnp.set_printoptions(linewidth=340, precision=14)\ntol = 1e-14\n\n#-----------------------------\ndef runDof1(comm):\n rank = comm.Get_rank()\n\n np.random.seed(3274618...
[ [ "numpy.random.rand", "numpy.matmul", "numpy.random.seed", "numpy.set_printoptions", "numpy.asfortranarray", "scipy.linalg.pinv", "numpy.allclose", "numpy.transpose", "numpy.arange" ] ]
flokno/phonopy
[ "02e31d5998de0a9b664b67968bb511e21c400574" ]
[ "phonopy/harmonic/forces.py" ]
[ "# Copyright (C) 2011 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of phonopy.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyr...
[ [ "numpy.sum", "numpy.array" ] ]
yandex-research/ddpm-segmentation
[ "8a46740fc9536f68e0901fed720437eb45c57747" ]
[ "train_interpreter.py" ]
[ "import torch\nimport torch.nn as nn\nfrom tqdm import tqdm\nimport json\nimport os\nimport gc\n\nfrom torch.utils.data import DataLoader\n\nimport argparse\nfrom src.utils import setup_seed, multi_acc\nfrom src.pixel_classifier import load_ensemble, compute_iou, predict_labels, save_predictions, save_predictions,...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader", "torch.nn.DataParallel" ] ]
junkoda/junkoda_cellularlib
[ "bc97d6ab419d8e9e1c295a7662d94cfd1f5b3501" ]
[ "py/junkoda_cellularlib/graph.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\nclass Graph:\n \"\"\"\n Graph struture in a 2D image\n\n Methods:\n vetices\n edges\n plot_vertices()\n plot_edges()\n \"\"\"\n def __init__(self, ei, ev, nx, ny):\n \"\"\"\n ei: edge indices (index = ix*ny + iy)\n ...
[ [ "numpy.max", "numpy.empty", "matplotlib.pyplot.xlim", "matplotlib.cm.get_cmap", "pandas.DataFrame", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.min", "matplotlib.collections.LineCollection", "matplotlib.colors.Normalize", "...
mclaughlin6464/halotools_old
[ "96fbdf5fc156160f19ccd4ae3ee964f831d26fa6" ]
[ "halotools/mock_observables/pair_counters/pairs.py" ]
[ "r\"\"\"\nsimple python brute force pair counting functions. The primary purpose of these functions\nis as a sanity check on more complex pair counting techniques. These functions should not\nbe used on large data sets, as memory usage is very large, and runtimes can be very slow.\n\"\"\"\n\nfrom __future__ impor...
[ [ "numpy.extract", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.min", "numpy.shape", "numpy.where", "numpy.fabs", "numpy.atleast_1d", "numpy.sort", "numpy.sqrt", "numpy.arctan2", "numpy.atleast_2d" ] ]
mrazvan22/disProgModSummerSchool
[ "d3b8848792bd9d574259ee700a689736502502ea" ]
[ "notebooks/updateLeaderboard.py" ]
[ "import sys\nimport dropbox\nfrom dropbox.files import WriteMode\nfrom dropbox.exceptions import ApiError, AuthError\nimport argparse\nimport os\nimport evalOneSubmission\nimport numpy as np\nimport pandas as pd\nimport csv\nimport string\nimport time\nimport datetime\nimport pickle\nfrom scipy.stats import rankdat...
[ [ "numpy.logical_not", "scipy.stats.rankdata", "numpy.isnan", "pandas.read_csv" ] ]
le3t/ko-repo
[ "50eb0b4cadb9db9bf608a9e5d36376f38ff5cce5" ]
[ "data-science/scikit-learn/playML/SimpleLinearRegression.py" ]
[ "import numpy as np\n# from .metrics import r2_score\n\n\nclass SimpleLinearRegression1:\n\n def __init__(self):\n \"\"\"初始化Simple Linear Regression 模型\"\"\"\n self.a_ = None\n self.b_ = None\n\n def fit(self, x_train, y_train):\n \"\"\"根据训练数据集x_train, y_train训练Simple Linear Regres...
[ [ "numpy.mean" ] ]
megvii-research/GyroFlow
[ "776ad1e30253d77281b46a8bc7b95527b254d05f" ]
[ "dataset/data_loader.py" ]
[ "# -*- coding: utf-8 -*-\n# This repo is licensed under the Apache License, Version 2.0 (the \"License\")\n#\n# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS,...
[ [ "numpy.expand_dims", "numpy.load", "numpy.zeros" ] ]
lucky-luk3/msticpy
[ "623f726f15fa35dafae7e1e65df91b7601456002" ]
[ "msticpy/vis/entity_graph_tools.py" ]
[ "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
Prakash19921206/cv-tricks.com
[ "555ef027fed42129e8f57caf2de195b1034d987c" ]
[ "Tensorflow-tutorials/Keras-Tensorflow-tutorial/2_run_vgg.py" ]
[ "import numpy as np\nfrom keras import applications\nfrom keras.applications.imagenet_utils import preprocess_input, decode_predictions\nfrom keras.preprocessing import image\n#import matplotlib.pyplot as plt\n#import matplotlib.image as mpimg\n\n# build the VGG16 network\nmodel = applications.VGG16(weights='imagen...
[ [ "numpy.expand_dims" ] ]
Ysp9714/SlowFastNet-keras
[ "75dc4e75158e35d46b0ae1e9130fd18c1295eec6" ]
[ "slow_fast_net.py" ]
[ "import os\n\nimport tensorflow as tf\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.layers import Conv3D\nimport numpy as np\n\n\ndef swish(x, beta=1):\n return x * tf.nn.sigmoid(beta * x)\n\n\ndef mish(x):\n return x * tf.nn.tanh(tf.nn.softplus(x))\n\n\ntf.keras.utils.get_custom_objects().updat...
[ [ "numpy.concatenate", "tensorflow.init_scope", "numpy.array", "tensorflow.keras.layers.Add", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.GlobalAveragePooling3D", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Conv3D", "tensorflow.keras.utils.get_cus...
Y1fanHE/kdps
[ "c09810afb35d93018b9a7d7edb182e2f8f8a6049" ]
[ "pgsyn/gp/population.py" ]
[ "'''\nAuthor: He,Yifan\nDate: 2022-02-18 16:06:00\nLastEditors: He,Yifan\nLastEditTime: 2022-02-18 16:27:32\n'''\n\n\nfrom collections.abc import Sequence\nfrom bisect import insort_left\nimport numpy as np\nimport pickle\nfrom multiprocessing import Pool\nfrom functools import partial\n\nfrom pgsyn.gp.individual i...
[ [ "numpy.array" ] ]
melodrivemusic/keras-to-tensorflow
[ "23029767de3da085e6ac5cc98c6018b9e4abbab2" ]
[ "k2tf/convert.py" ]
[ "\"\"\"\nThis script converts a .h5 Keras model into a Tensorflow .pb file.\n\nAttribution: This script was adapted from https://github.com/amir-abdi/keras_to_tensorflow\n\nMIT License\n\nCopyright (c) 2017 bitbionic\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software a...
[ [ "tensorflow.python.framework.graph_io.write_graph", "tensorflow.identity" ] ]
ShuangXieIrene/ssds.pytorch
[ "b5ec682a42c923afe964205b21448e9f141d55bc" ]
[ "ssds/core/config.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom ast import literal_eval\nimport os\nimport os.path as osp\nimport numpy as np\n\n\"\"\"config system.\nThis file specifies default config options. You shou...
[ [ "numpy.array" ] ]
Halfknow/akshare
[ "754d86be72b5d6ed2f288e6d16d712da68a734a4" ]
[ "akshare/index/index_baidu.py" ]
[ "# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nAuthor: Albert King\ndate: 2019/12/2 23:53\ncontact: jindaxiang@163.com\ndesc: 百度指数\n感谢 https://cloudcrawler.club/categories/2019%E5%B9%B4%E6%9C%AB%E9%80%86%E5%90%91%E5%A4%8D%E4%B9%A0/\n\"\"\"\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport reque...
[ [ "pandas.to_datetime", "matplotlib.pyplot.show", "pandas.date_range" ] ]
yxliang/pva-faster-rcnn
[ "b0dc7d255da61188dda01e8760078b6991d6f7e2" ]
[ "lib/utils/blob.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Blob helper functions.\"\"\"\n\nimport numpy as np\ni...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.round", "numpy.min", "numpy.floor" ] ]
TommyLin/focus-stacking
[ "ac474ea4cf34fc61a197aefad97a02786eae388c" ]
[ "src/focus_stacking.py" ]
[ "#!/usr/bin/env python3\n\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nfrom skimage import filters\n\nfiles = [\"../images/fly1.jpg\", \"../images/fly2.jpg\"]\nsave_image = False\n\n\ndef gaussian_blur(fin=\"../images/fly1.jpg\", fout=\"fly1_blur.jpg\"):\n if fin == \"\" or fout == \"\":\n...
[ [ "matplotlib.image.imread", "matplotlib.image.imsave", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
MaximilianJanetschek/Urban_Intermodal_Transportation
[ "632caf668636448dc9290d54cf1c7b527c68a957" ]
[ "StatisticalAnalysis.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom scipy.stats import norm\nfrom scipy.spatial import distance\n\n\n\n\n'''\nREADME: \nThis is a standalone file, run to execute\nRequirement: Please make sure in results/distances folder:\n1. results0 includes the B...
[ [ "numpy.square", "scipy.spatial.distance.euclidean", "pandas.merge", "scipy.stats.norm.fit", "numpy.arange", "numpy.sort", "pandas.concat", "pandas.read_csv" ] ]
usnistgov/dioptra
[ "08a08e96c27787915bafc75a483431333e2c70ca" ]
[ "examples/patch-defended-pixel-threshold/src/attacks.py" ]
[ "#!/usr/bin/env python\n# This Software (Dioptra) is being made available as a public service by the\n# National Institute of Standards and Technology (NIST), an Agency of the United\n# States Department of Commerce. This software was developed in part by employees of\n# NIST and in part by NIST contractors. Copyri...
[ [ "numpy.array", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.median", "numpy.prod", "numpy.argmax", "tensorflow.compat.v1.disable_eager_execution" ] ]
penguinmenac3/deeptech
[ "0c7fb170d62f193dbbb2018f7b8d42f713178bb8" ]
[ "deeptech/model/layers/selection.py" ]
[ "\"\"\"doc\n# deeptech.model.layers.selection\n\n> These layers select parts of a tensor.\n\"\"\"\nimport torch\nfrom torch.nn import Module\nfrom deeptech.model.module_registry import add_module\n\n\n@add_module()\nclass Gather(Module):\n def __init__(self, axis):\n \"\"\"\n Gather tensors from on...
[ [ "torch.index_select", "torch.topk" ] ]
joey12300/PaddleDetection
[ "b457850659c43fbd4a26c4fc4b70a3709b9952d4" ]
[ "tools/infer.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.array" ] ]
alexandrovteam/sm-networks
[ "d549ea73a388a342f95c68e99f16eae7ea62c43f" ]
[ "table_server.py" ]
[ "import pyarrow.parquet\nimport pandas as pd\nimport numpy as np\nimport scipy.spatial.distance as ssd\nimport bottle\n\nfrom tempfile import mkdtemp\nimport os.path\nfrom glob import glob\nfrom zipfile import ZipFile\nimport json\n\nclass NetworkGenerator:\n def __init__(self, config):\n self.config = co...
[ [ "pandas.merge", "pandas.DataFrame", "pandas.concat", "pandas.read_csv", "numpy.add.outer" ] ]
nemanja-m/key-value-memory-network
[ "03b42fd9e7f8d90e2fbd3ea0f8be91f43ecd7e4a" ]
[ "lucy/train.py" ]
[ "import argparse\nimport os\nimport time\nfrom collections import namedtuple\n\nimport numpy as np\nimport torch\nfrom torch import optim\nfrom torch.nn import CosineEmbeddingLoss, CosineSimilarity\nfrom tqdm import tqdm\nfrom visdom import Visdom\n\nfrom .constants import MODELS_DIR\nfrom .dataset import Dataset\n...
[ [ "torch.device", "numpy.array", "numpy.zeros", "torch.no_grad", "numpy.mean", "torch.ones", "torch.cuda.is_available", "torch.nn.CosineSimilarity", "torch.nn.CosineEmbeddingLoss", "torch.sum" ] ]
erwanp/exojax
[ "79a148a1f30fda357a2586255569243815df05e7" ]
[ "examples/LUH16A/FidEMbu_modit/fit.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport tqdm\n\nimport jax.numpy as jnp\nfrom jax import random\nfrom jax import vmap, jit\n\nfrom exojax.spec import rtransfer as rt\nfrom exojax.spec import planck, moldb, contdb, response, molinfo\nfrom exojax.spec.l...
[ [ "numpy.array", "numpy.ones_like", "matplotlib.pyplot.text", "numpy.log", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tick_params", "numpy.savez", "pandas.read_csv" ] ]
Vignesh-95/seg-net-satellite-imagery
[ "5165b4d7d50e0646b710a9c8d700a4e815042ed8" ]
[ "seg-net-code-256-resolution-images/model.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.framework import dtypes\n\nimport os, sys\nimport numpy as np\nimport math\nfrom datetime import datetime\nimport time\nfrom PIL import Image\nfrom math import ceil\nfrom tensorflow.python.ops import gen_nn_ops\n# modules\...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.train.start_queue_runners", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.nn.lrn", "tensorflow.reshape", "numpy.nanmean", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.one...
zdassen/ml-tools
[ "a5ee4e06c6c808a3f78890dfae868c79fd8299fa" ]
[ "lib/data_loaders.py" ]
[ "# -*- coding: utf-8 -*-\r\n#\r\n# ml-tools/lib/data_loaders.py\r\n#\r\nimport numpy as np\r\n\r\n# TensorFlow & keras\r\nimport os\r\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\r\nimport tensorflow as tf\r\nfrom tensorflow.python.keras.datasets import mnist\r\n\r\n\r\ndef get_rinds_label(y, label, n):\r\n \"\...
[ [ "numpy.random.choice", "numpy.where", "tensorflow.python.keras.datasets.mnist.load_data", "numpy.hstack", "numpy.vstack" ] ]
cthoyt/embeddingdb
[ "e6c67e92e540c4315045a0b4de5b31490331c177" ]
[ "src/embeddingdb/sql/analysis.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Compute cross-correlations in embedding collections.\"\"\"\n\nfrom typing import BinaryIO, Mapping, Optional, Type, Union\n\nimport click\nimport joblib\nfrom sklearn.base import RegressorMixin\nfrom sklearn.cross_decomposition import CCA, PLSRegression\nfrom sklearn.linear_model i...
[ [ "sklearn.metrics.r2_score" ] ]
mila-iqia/COVI-ML
[ "5c6e7441d2ddfe2d11d2e76a884daeb9a114048d" ]
[ "ctt/models/modules.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom ctt.utils import thermometer_encoding, compute_moments\n\n\nclass HealthHistoryEmbedding(nn.Sequential):\n def __init__(self, in_features, embedding_size, capacity=128, dropout=0.1):\n super(HealthHistoryEmbedding, self).__init__(\n nn.Linear(in_feat...
[ [ "torch.nn.Linear", "torch.cos", "torch.nn.Dropout", "torch.arange", "torch.sin", "torch.norm", "torch.no_grad", "torch.nn.ReLU", "torch.log", "torch.pow" ] ]
fxcqz/Primes
[ "66d2e7e426c61c2eab74fc0d6c502f25be781ee4" ]
[ "primes/tests/utils/test_customcomplex.py" ]
[ "from nose.tools import *\nfrom primes.utils.custom_complex import CustomComplex\nimport numpy\n\n\ndef test_complex_init():\n # 2 ways of instantiating custom complex\n a = CustomComplex(2, 3)\n assert_equals(numpy.real(a), 2)\n assert_equals(numpy.imag(a), 3)\n b = CustomComplex(complex(1, 2))\n ...
[ [ "numpy.imag", "numpy.real" ] ]
Ahrvo-Trading-Systems/tcapy
[ "df8439aa5c754fc9a7fde463c44c489b27112f76", "df8439aa5c754fc9a7fde463c44c489b27112f76" ]
[ "tcapy_scripts/gen/copy_parquet_to_arrow.py", "test/test_tcapy/test_data_vendor_feed.py" ]
[ "\"\"\"Copies a folder of parquet files into another into arrow folder for use with vaex. Note you need to install vaex\nlibrary in addition to use this.\n\"\"\"\n\nfrom __future__ import print_function, division\n\n__author__ = 'saeedamen' # Saeed Amen / saeed@cuemacro.com\n\n#\n# Copyright 2021 Cuemacro Ltd. - h...
[ [ "pandas.read_parquet" ], [ "pandas.testing.assert_frame_equal" ] ]
Arya-A-Nair/learning-data-science
[ "0ecd48f7379a202b59dc93f59b9447f86512bd86" ]
[ "module_2.3_Binning.py" ]
[ "import pandas as pd\nimport numpy as np\n\ndf=pd.read_csv(\"corrected_data.csv\")\n\n#converting dtype=object to dtype=float64\ndf['price'] = pd.to_numeric(df['price'], errors='coerce')\n\n#to get evenly spaced integers over a range of numbers\nbins=np.linspace(min(df[\"price\"]), max(df[\"price\"]),4)\n\ngroup_na...
[ [ "pandas.read_csv", "pandas.to_numeric", "pandas.cut" ] ]
sem-onyalo/mlm-4-dcgan-celeba
[ "3fdfbfe88de3877a4273cdfe84e52978dcc27bf2" ]
[ "discriminator.py" ]
[ "from tensorflow.keras.layers import Conv2D, Dense, Dropout, Flatten, LeakyReLU\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.optimizers import Adam\n\ndef createDiscriminator(n_inputs=(80,80,3)):\n model = Sequential()\n model.add(Conv2D(128, (5,5), padding='same', input_shape=n_inpu...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.layers.Dropout", "tensorflow.keras.models.Sequential", "tensorflow.keras.optimizers.Adam" ] ]
FanKuan44/NASLib
[ "a8226e76e3dfe289f0c412bf48d197db17a03b9c" ]
[ "naslib/search_spaces/nasbench101/conversions.py" ]
[ "import numpy as np\n\n\"\"\"\n'naslib': the NASBench101SearchSpace object\n'spec': adjacency matrix + op list\n\"\"\"\n\n\ndef convert_naslib_to_spec(naslib_object):\n\n matrix = np.triu(np.ones((7, 7)), 1)\n\n ops_to_nb101 = {\n \"MaxPool1x1\": \"maxpool3x3\",\n \"ReLUConvBN1x1\": \"conv1x1-bn...
[ [ "numpy.ones" ] ]
mapillary/metropolis_sdk
[ "4d25e0687d192e1f64707a9474a4b0896e430c01" ]
[ "metropolis/utils/data_classes.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# Original copyright notice:\n# nuScenes dev-kit.\n# Code written by Oscar Beijbom, 2018.\n\nimport copy\nimport os.path as osp\nfrom abc import ABC, abstractmethod\nfrom functools import reduce\nfrom typing import Tuple, List, Dict, TYPE_CHECKING, Any, Optiona...
[ [ "numpy.dot", "numpy.load", "numpy.mean", "numpy.cos", "numpy.concatenate", "numpy.full", "numpy.sin", "numpy.logical_and", "numpy.eye", "numpy.vstack", "numpy.array", "numpy.zeros", "numpy.allclose", "numpy.stack", "numpy.hstack", "numpy.isnan", ...
yangyangkiki/pytorch-lightning-bolts
[ "01f1a936815262ec810551c56f5ac87198be7c3f" ]
[ "pl_bolts/models/rl/noisy_dqn_model.py" ]
[ "\"\"\"\nNoisy DQN\n\"\"\"\nimport argparse\nfrom typing import Tuple\n\nimport numpy as np\nimport pytorch_lightning as pl\nimport torch\n\nfrom pl_bolts.datamodules.experience_source import Experience\nfrom pl_bolts.models.rl.common.networks import NoisyCNN\nfrom pl_bolts.models.rl.dqn_model import DQN\n\n\nclass...
[ [ "numpy.mean" ] ]
serycjon/synth-rot
[ "1da61126de171c53d833b55ddbb70a2d7692e88f" ]
[ "synth_rot/generator.py" ]
[ "#!/usr/bin/python\n''' based on tfrecords-guide at http://warmspringwinds.github.io/tensorflow/tf-slim/2016/12/21/tfrecords-guide/ '''\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport sys\nimport random\n\nimport numpy as np\nimport cv2\nimport tensorflow as tf\n\nfrom . import rotator\...
[ [ "tensorflow.python_io.TFRecordOptions", "numpy.array", "tensorflow.train.BytesList", "numpy.random.rand", "tensorflow.train.FloatList", "tensorflow.train.Int64List", "tensorflow.python_io.TFRecordWriter", "numpy.random.uniform" ] ]
danmalowany-allegro/trains
[ "10f11ba0383bc0d54c54a4f079f2385403bd8ad6" ]
[ "examples/frameworks/pytorch/pytorch_distributed_example.py" ]
[ "# TRAINS - example of TRAINS torch distributed support\n# notice all nodes will be reporting to the master Task (experiment)\n\nimport os\nimport subprocess\nimport sys\nfrom argparse import ArgumentParser\nfrom math import ceil\nfrom random import Random\n\nimport torch as th\nimport torch.nn as nn\nimport torch....
[ [ "torch.nn.Linear", "torch.distributed.get_world_size", "torch.nn.functional.nll_loss", "torch.flatten", "torch.distributed.init_process_group", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.nn.Conv2d", "torch.utils.data.DataLoader", "torch.distributed.all_r...
jochenater/catboost
[ "de2786fbc633b0d6ea6a23b3862496c6151b95c2" ]
[ "contrib/python/numpy/py3/numpy/core/tests/test_print.py" ]
[ "import sys\n\nimport pytest\n\nimport numpy as np\nfrom numpy.testing import assert_, assert_equal\nfrom __tests__.core.tests._locales import CommaDecimalPointLocale\n\n\nfrom io import StringIO\n\n_REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan'}\n\n\n@pytest.mark.parametrize('tp', [np.float32, np.double, np...
[ [ "numpy.float32", "numpy.longdouble", "numpy.double" ] ]
Tontolda/genui
[ "c5b7da7c5a99fc16d34878e2170145ac7c8e31c4" ]
[ "src/genui/generators/extensions/genuidrugex/genuimodels/builders.py" ]
[ "\"\"\"\nbuilders\n\nCreated by: Martin Sicho\nOn: 1/26/20, 6:27 PM\n\"\"\"\nfrom django.core.files.base import ContentFile\nfrom django.db import transaction\nfrom pandas import Series\nimport torch\n\nfrom drugex.api.corpus import Corpus, BasicCorpus\nfrom genui.utils import gpu\nfrom genui.generators.extensions....
[ [ "torch.device" ] ]
toy270/Nara
[ "964ab5d7324b1d4d8670599402ea517af46e5637" ]
[ "narajangteo_crawling.py" ]
[ "\n# coding: utf-8\n\n# # <center> 나라장터 입찰공고 크롤링 with Python3</center>\n# \n# 나라장터에 올라오는 입찰공고를 모니터링하기 위해 개발된 간단한 프로그램으로, 검색어 리스트를 설정하면 그에 따라 최근 7일간 공고된 입찰공고 리스트를 가져와 엑셀파일로 정리해줍니다. 크롤링 프로그램이지만, BeautifulSoup을 사용하지 않습니다.\n\n# In[18]:\n\nimport pandas as pd\nimport numpy as np\nimport requests\nimport os\nimport datet...
[ [ "numpy.median", "pandas.concat", "numpy.mean", "numpy.std", "pandas.Categorical", "pandas.ExcelWriter", "pandas.read_html" ] ]
santhoshkumarvs/spark
[ "074533334d01afdd7862a1ac6c5a7a672bcce3f8" ]
[ "python/pyspark/ml/tests/test_algorithms.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "numpy.allclose", "numpy.isclose" ] ]
pondbooks/CDQL_with_Sim
[ "cc5b8680653e12db6003b154c58d8033f5a103b8" ]
[ "section_5_3/5_to_50/dynamics.py" ]
[ "import numpy as np \n\ndef angle_normalize(theta):\n x_plot = np.cos(theta)\n y_plot = np.sin(theta)\n angle = np.arctan2(y_plot,x_plot)\n return angle\n\n\ndef reward_func(x,u): #rewardがnumpy.array(1)型になっていると学習がうまくいかないことに注意.\n cost = -x[0,0]**(2) - 0.1*x[0,1]**(2) - 10.0*u**(2)\n return cost[0]\n\ndef D...
[ [ "numpy.array", "numpy.sin", "numpy.arctan2", "numpy.cos" ] ]
tamaslevente/trai
[ "4bf68463b941f305d9b25a9374b6c2a2d51a8046", "4bf68463b941f305d9b25a9374b6c2a2d51a8046" ]
[ "PC-NBV/generate_nbv_data.py", "camera_calibration_ws/monodepth-FPN/MonoDepth-FPN-PyTorch/main_fpn_curv_grad_t3_torch_old.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\nimport scipy.io as sio\nfrom open3d import *\nimport random\nfrom tf_ops.nn_distance import tf_nndistance \nimport time\nimport pdb\n\nif __name__ == '__main__':\n\n os.environ['CUDA_VISIBLE_DEVICES'] = \"0\"\n \n # view num\n #view_num = 33\n ...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.sum", "tensorflow.Session", "tensorflow.placeholder", "numpy.append" ], [ "torch.stack", "torch.isnan", "numpy.tile", "numpy.multiply", "numpy.where", "torch.cuda.is_available", "torch.load", "tor...
mattpitkin/samplers-demo
[ "127c869b870ce3e6b96e59bda0999bf2cc7d3849" ]
[ "content/downloads/code/test_zeus.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nExample of running Zeus to fit the parameters of a straight line.\n\"\"\"\n\nfrom __future__ import print_function, division\n\nimport os\nimport sys\nimport numpy as np\n\n# import zeus\nimport zeus\n\n# import model and data\nfrom createdata import *\n\nd...
[ [ "matplotlib.use", "numpy.random.normal", "numpy.array", "numpy.sum", "numpy.random.uniform", "numpy.isfinite" ] ]
BigRedT/gpv-1
[ "6a0c2173b44961cb492d00f94864c461aa77641d" ]
[ "exp/gpv/models/detr.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nDETR model and criterion classes.\n\"\"\"\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nimport utils.box_ops as box_ops\nfrom utils.detr_misc import (NestedTensor, nested_tensor_from_tensor_list,\n ...
[ [ "torch.nn.Linear", "torch.nn.Conv2d", "torch.nn.Embedding" ] ]
NAshwinKumar/deep-read
[ "aae93c62a0c85ce31eb0e2d759d4d95d7d076c5d" ]
[ "src/app/deep-read/core/video_to_text/screenclassifier.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nimport os\nimport numpy as np\nimport pandas as pd\n\n\nclass ScreenClassifier:\n\n def __init__(self):\n self.model = tf.keras.models.load_model(\"data/training/model_v3_xception\")\n self.imagedatagen =...
[ [ "tensorflow.keras.models.load_model", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.where", "pandas.DataFrame" ] ]
udday2014/HebbianLearning
[ "e0d17e53e3db8ce54b8fdd901702d2d6e0633732" ]
[ "models/gdes/top_6l/top2.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\n\nfrom neurolab import params as P\nfrom neurolab import utils\nfrom neurolab.model import Model\n\n\nclass Net(Model):\n\t# Layer names\n\tCONV3 = 'conv3'\n\tRELU3 = 'relu3'\n\tPOOL3 = 'pool3'\n\tBN3 = 'bn3'\n\tCONV4 = 'conv4'\n\tRELU4 = 'relu4'\n\tBN4 = 'bn...
[ [ "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.functional.dropout", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.nn.functional.relu", "torch.nn.functional.max_pool2d" ] ]
AIandSocialGoodLab/FeatureDeceptionGame
[ "0225291dec268f15c94a366228c6741da03b00ab", "0225291dec268f15c94a366228c6741da03b00ab" ]
[ "1i/test.py", "1l/nnIpoptSolve.py" ]
[ "from game import Game\nfrom approxMILP import ApproxMILP\nfrom approxMILPBS import ApproxMILPBS\nfrom learn import LearnNN\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport copy\n\nif __name__ == '__main__':\n seed = 99\n n = 5\n K = 12\n L = 100\n eps = 0.0001\n\n numExp ...
[ [ "numpy.savetxt", "numpy.ones", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.std", "numpy.loadtxt", "numpy.arange", "numpy.abs", "matplotlib.pyplot.show", "numpy.linspace" ], [ "numpy.array", "torch.tensor" ] ]
hanshiyi/POSBERT
[ "4d290945371b0043b3370459b9436364311320f8" ]
[ "pytorch_pretrained_bert/origin_modeling.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may ...
[ [ "torch.nn.Linear", "torch.ones", "torch.load", "torch.nn.CrossEntropyLoss", "torch.sigmoid", "torch.sqrt", "torch.nn.Softmax", "torch.FloatTensor", "torch.zeros_like", "torch.zeros", "torch.nn.Tanh", "torch.log", "torch.matmul", "torch.pow", "torch.nn.Dr...
est271/geomstats
[ "225fd9ecf8c5c681cdee5cb9ce0951a9f613aa1e" ]
[ "examples/plot_geodesics_s2.py" ]
[ "\"\"\"\nPlot a geodesic on the sphere S2\n\"\"\"\n\nimport logging\nimport os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport geomstats.visualization as visualization\nfrom geomstats.geometry.hypersphere import Hypersphere\n\nSPHERE2 = Hypersphere(dimension=2)\nMETRIC = SPHERE2.metric\n\n\ndef mai...
[ [ "matplotlib.pyplot.show", "numpy.linspace" ] ]
imrachbini/Efficient-CapsNet
[ "82b852002e3d268030d89ccfec586c6f9e2b2b2e" ]
[ "models/efficient_capsnet_graph_mnist.py" ]
[ "# Copyright 2021 Vittorio Mazzia & Francesco Salvetti. 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# U...
[ [ "tensorflow.keras.layers.Add", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.models.Model", "tensorflow.keras.Model", "numpy.prod", "tensorflow.keras.Input", "tensorfl...
FreemanTang/yolov3_tiny_tensorflow
[ "ea7a01e44db77e59669cf7ea6892ff5d5126461e" ]
[ "test_single_image_yolov3_tiny.py" ]
[ "####\n\n# edicted by Huangdebo\n# test the model using ckpt file\n\n# CMD:python test_single_image.py --input_image bird.jpg --class_name_path ./data/COCO.name --restore_path ./checkpoint/yolov3_tiny_COCO/model-step_30000_loss_0.075246_lr_0.0003061015\n# ***\n\nfrom __future__ import division, print_function\n\nim...
[ [ "numpy.asarray", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.variable_scope", "tensorflow.placeholder" ] ]
NumesSanguis/MLTensor
[ "bd5b467f0567254843fd9f7729b65decaa672fed" ]
[ "tutorial/CNN/cifar10_train.py" ]
[ "# Copyright 2015 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 appl...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.merge_all_summaries", "tensorflow.models.image.cifar10.cifar10.train", "tensorflow.python.platform.gfile.Exists", "tensorflow.models.image.cifar10.cifar10.inference", "tensorflow.models.image.cifar10.cifar10.distorted_inputs", "tensor...
SmirnovEgorRu/daal4py
[ "86ba419afe159edb3cb33e6b629f0800811853c8", "86ba419afe159edb3cb33e6b629f0800811853c8" ]
[ "examples/sycl/covariance_batch.py", "daal4py/sklearn/linear_model/_coordinate_descent_0_21.py" ]
[ "#*******************************************************************************\n# Copyright 2014-2020 Intel Corporation\n# All Rights Reserved.\n#\n# This software is licensed under the Apache License, Version 2.0 (the\n# \"License\"), the following terms apply:\n#\n# You may not use this file except in complian...
[ [ "numpy.ascontiguousarray", "numpy.allclose", "pandas.read_csv", "numpy.loadtxt" ], [ "numpy.max", "numpy.full", "scipy.sparse.issparse", "numpy.dot", "sklearn.utils.check_X_y", "numpy.asarray", "numpy.zeros", "numpy.reshape", "numpy.copy", "numpy.ones", ...
BBN-Q/libaps2
[ "7787c821279deeca14108d7ac9a49992c64fffe9" ]
[ "src/util/aps_debug_watcher.py" ]
[ "#!/usr/bin/env python\n\nimport sys\nimport socket\nimport struct\ntry:\n from QGL.drivers import APS2Pattern\n haveQGL = True\nexcept:\n warn(\"Could not load QGL. Will not be able to decode instructions.\")\n haveQGL = False\nimport numpy as np\nfrom ansicolor import * # from ansicolors\nimport argpa...
[ [ "numpy.fromstring" ] ]
researchai/unsupervised_meta_rl
[ "9ca4b41438277ef6cfea047482b98de9da07815a", "9ca4b41438277ef6cfea047482b98de9da07815a" ]
[ "tests/garage/tf/regressors/test_bernoulli_mlp_regressor_with_model.py", "tests/garage/tf/policies/test_continuous_mlp_policy_with_model.py" ]
[ "import pickle\nfrom unittest import mock\n\nimport numpy as np\nimport pytest\nimport tensorflow as tf\n\nfrom garage.tf.optimizers import ConjugateGradientOptimizer, LbfgsOptimizer\nfrom garage.tf.regressors import BernoulliMLPRegressorWithModel\nfrom tests.fixtures import TfGraphTestCase\n\n\ndef get_labels(inpu...
[ [ "numpy.ones_like", "numpy.array_equal", "tensorflow.ones_like", "numpy.mean", "numpy.concatenate", "tensorflow.compat.v1.placeholder", "numpy.zeros_like", "numpy.full", "numpy.sin", "numpy.arange", "numpy.zeros", "numpy.round", "tensorflow.compat.v1.variable_sco...
mfrigerio17/robot-model-tools
[ "97e25d5c4d1386c503d37a70b57400022c5b7ca0" ]
[ "src/robmodel/convert/urdf/imp.py" ]
[ "import xml.etree.ElementTree as ET\nfrom collections import OrderedDict as ODict\nimport logging, sys\n\nimport numpy as np\nimport math\n\nimport kgprim.core as primitives\nimport kgprim.motions as motions\nfrom kgprim.motions import MotionSequence\nfrom kgprim.motions import PoseSpec\nfrom kgprim.motions import ...
[ [ "numpy.array" ] ]
yiling-h/selective-inference
[ "dc66337b8dd72ed75ca09b4dcef8d6d814b5ed57" ]
[ "selectinf/randomized/paired_group_lasso_backup.py" ]
[ "from __future__ import print_function\nimport functools\nfrom copy import copy\n\nimport numpy as np\nfrom scipy.stats import norm as ndist\nfrom scipy.linalg import block_diag\n\nimport regreg.api as rr\n\nfrom .query import query, affine_gaussian_sampler\n\nfrom .randomization import randomization\nfrom .approx_...
[ [ "numpy.delete", "numpy.array", "numpy.zeros", "numpy.block", "scipy.linalg.block_diag", "numpy.exp", "numpy.linalg.det" ] ]
lucid281/pyEfi
[ "c8a5b69820a3c1e7c4c652f7e4194cd8ce8a6e18" ]
[ "app/ref/test-matlib.py" ]
[ "# this is just an example of using matplotlib with pyefi.\n# it's not an ideal because matplot uses many cpu cycles.\n\nimport redis\nfrom collections import deque\n\nimport matplotlib\n\n# ignore PEP E402\nmatplotlib.use('Qt5Agg') # needs to be here, before matplotlib.*\nimport matplotlib.pyplot as plt\nimport m...
[ [ "matplotlib.use", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axes" ] ]
lars-frogner/GriSPy
[ "98a2448ffc1454476d58a66843a9922c36f0ffcc" ]
[ "grispy/validators.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# This file is part of the\n# GriSPy Project (https://github.com/mchalela/GriSPy).\n# Copyright (c) 2019, Martin Chalela\n# License: MIT\n# Full Text: https://github.com/mchalela/GriSPy/blob/master/LICENSE\n\n\n\"\"\"Functions to validate GriSPy input parameter...
[ [ "numpy.all", "numpy.any", "numpy.isscalar", "numpy.isfinite" ] ]
lUllLabs/tensorlayer
[ "fb5b94715ca258cc699ef63d3ba8566ebad2a0cb" ]
[ "tests/test_models.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport unittest\n\ntry:\n from tests.unittests_helper import CustomTestCase\nexcept ImportError:\n from unittests_helper import CustomTestCase\n\nimport tensorflow as tf\nimport tensorlayer as tl\n\n\nclass VGG_Model_Test(CustomTestCase):\n\n @classmethod\n ...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.reset_default_graph", "tensorflow.placeholder", "tensorflow.Graph" ] ]
OpenMeasurement/virtual_society_modeling_framework
[ "709d23da1f4e4c010b4995d00f413dfacb477ad2" ]
[ "audience_modeling_toolbox/plotting.py" ]
[ "# MIT License\n\n# Copyright (c) 2021 OpenMeasurement\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# to use, copy,...
[ [ "numpy.max", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.gcf", "matplotlib.colors.LogNorm" ] ]
hirayamy/nngen
[ "63f72be83e4bb1a697a969fb6a14d0335ec0316f" ]
[ "nngen/onnx/slice_.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport numpy as np\n\nimport nngen.operator as operator\n\nfrom . import util\n\n\ndef Slice(visitor, node):\n\n srcs = []\n\n for src in node.input:\n src_obj = visitor.visit(src)\n ...
[ [ "numpy.array" ] ]
gost-gk/turel
[ "1a1164dae80d3ea8f53f966da42b384ed4f63daa" ]
[ "turel.py" ]
[ "from argparse import ArgumentParser\nimport random\nimport string\nimport sys\nimport time\nfrom typing import Dict, List, Tuple, Sequence, Optional, Union, Set, TypeVar\n\nfrom PIL import Image, ImageDraw, ImageFont\nimport keras\nfrom keras.layers import Dense\nfrom keras.models import Sequential\nimport numpy a...
[ [ "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.zeros", "numpy.copy", "numpy.load", "numpy.random.shuffle", "numpy.save", "numpy.random.get_state", "numpy.random.set_state" ] ]
chenxran/coqa-roberta-baselines
[ "c0eeaa809f9e8e963f24d66e2f6e131c995dd1ed", "c0eeaa809f9e8e963f24d66e2f6e131c995dd1ed" ]
[ "rc/utils/graph_utils.py", "rc/utils/data_utils.py" ]
[ "import matplotlib\nmatplotlib.use('agg')\n\nimport matplotlib.pyplot as plt\n\n\n################################################################################\n# Graphing Functions #\n################################################################################\n\ndef plot_learn(values, yAxis, xAxis, title=N...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.cla", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf" ], [ "torch.zeros", "numpy.max", "torch.ByteTensor", "tor...
statphysandml/pystatplottools
[ "b1dec1f057b4757b7ed969d56a3905ce904e19d0" ]
[ "pystatplottools/distributions/distributionDD.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\ndef transform_log10(data, columns):\n # Compute log10 of data\n log_data = data[columns].apply([\"log10\"])\n log_data.columns = log_data.columns.droplevel(1) + \"_log10\"\n cols_to_use = data.columns.difference(log_data.columns)\n data = pd.concat([data[...
[ [ "numpy.concatenate", "numpy.log10", "numpy.array", "numpy.array_equal", "numpy.empty", "scipy.stats.binned_statistic_dd", "pandas.DataFrame", "numpy.sum", "pandas.MultiIndex.from_tuples", "numpy.unravel_index", "numpy.any", "numpy.prod", "numpy.arange", "pan...
BonizzoniLab/SVD
[ "95ed967ae385ed0a339030763a07ea7acfa0c1d3" ]
[ "Grouping.py" ]
[ "import argparse\nimport collections \nimport numpy as np\n\nclass LOCUS():\n locus_name=''\n Supercontig=''\n start=''\n end=''\n groupDict={}\n alleleDict={}\n pass\n \ndef GroupsEvaluation(allelesfile, group_locus_dict):\n ''' Attribution of a variation group to an allele'''\n \n ...
[ [ "numpy.where", "numpy.array" ] ]
csdongxian/skip-connections-matter
[ "9b2e5cca9b673efcac253e16b2f55f6cda1a8692" ]
[ "utils_data.py" ]
[ "import os\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom PIL import Image\n\n\nclass SubsetImageNet(Dataset):\n def __init__(self, root, class_to_idx='./imagenet_class_to_idx.npy', transform=None):\n super(SubsetImageNet, self).__init__()\n self.root = ro...
[ [ "numpy.load" ] ]
SrikrishnaBhat/google-research
[ "46d08e390cffa1b94160de4cff60efaf4e7a421c" ]
[ "dreg_estimators/model.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.ones", "tensorflow.reshape", "tensorflow.to_float", "tensorflow.tile", "tensorflow.nn.softmax", "tensorflow.square", "tensorflow.shape", "tensorflow.concat", "tensorflow.argmax", "tensorflow.transpose", "te...
thepinetree/noisepage-pilot
[ "97ab95d2458fe3974aac13935094be17fca69522" ]
[ "evaluation/utils.py" ]
[ "import numpy as np\nimport xml.etree.ElementTree as ET\nfrom psycopg import cursor\nimport yaml\n\ndef param_sweep_space(ps_dist):\n '''Construct parameter sweep space from configuration.\n \n Parameters:\n ------------\n ps_dist : Dict[str, List[Any]]\n Contains parameter name to candidate v...
[ [ "numpy.arange" ] ]
prasoonpatidar/multiagentRL-resource-sharing
[ "e63ba7fc3c7ab019e9fd109cd45b739e3322152f" ]
[ "evaluation/RL_performance.py" ]
[ "'''\nInput:\n--priceHistory = {}, each value of the dic is a N len 1D list\n--purchaseHistroy = {}, each value of the dic is a M len 1D list, X_ij\n--providedResourceHistory ={}, each value of the dic is 2D array, size-M*N, Z_ij\n--sellersUtilityHistory = {}, each value of the dic is a N len 1D list\n--buyersUtili...
[ [ "numpy.concatenate", "numpy.array", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylim", "numpy.sum", ...
tsingcbx99/TorchSSL
[ "2011241f57ed60000902adf0acf09786429a8c21" ]
[ "models/meanteacher/meanteacher.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\nfrom torch.cuda.amp import autocast, GradScaler\n\nimport os\nimport contextlib\nfrom train_utils import AverageMeter\n\nfrom .meanteacher_utils import consistency_loss, Get_Scalar\nfrom train_utils import ce...
[ [ "torch.cat", "torch.cuda.synchronize", "torch.cuda.Event", "torch.max", "torch.no_grad", "numpy.array_str", "torch.softmax", "torch.cuda.device_count", "torch.nn.functional.cross_entropy", "torch.load", "numpy.clip", "torch.cuda.amp.GradScaler" ] ]
pooja-kabra/A_star
[ "a3bda60b735e993b85991d38eb03002a8cf4f4e8" ]
[ "A_star.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Apr 7 19:01:51 2021\r\n\r\n@author: Paras Savnani and Pooja Kabra\r\n\"\"\"\r\nimport time\r\nimport pygame\r\nimport sys\r\nimport math\r\nimport copy\r\nfrom collections import deque\r\n# from queue import PriorityQueue\r\nimport numpy as np\r\n\r\n# Note: Inp...
[ [ "numpy.zeros" ] ]
Amorteza1376/ML-Regression-Analysis
[ "d5c2eed721eaf9647a813b4f970b92248973c559" ]
[ "src/Q3-(4-5).py" ]
[ "import sys\nimport scipy.io as sio\nfrom pprint import pprint\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport openpyxl\nfrom pathlib import Path\n\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.multioutput import MultiOutputRegre...
[ [ "numpy.array", "sklearn.ensemble.GradientBoostingRegressor", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.arange", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_t...
calebkoy/pulse-check
[ "38c1b6c5b5bf5e264b69ef0cfe6498cf474a3f0b" ]
[ "app.py" ]
[ "import pickle\nimport re\n\nimport emoji\nimport flask\nimport numpy as np\nimport requests\nimport twitter\nimport yaml\n\nfrom sentiment import Sentiment\n\napp = flask.Flask(__name__, template_folder='templates')\n\ndef process_yaml():\n with open(\"config.yaml\") as file:\n return yaml.safe_load(file)\n\nd...
[ [ "numpy.array", "numpy.asarray" ] ]
sdi1100041/SLEIPNIR
[ "02dd3eca8574899fd3f0e287b1a050e76e5ba0de" ]
[ "ODIN_interface.py" ]
[ "from odin.core.GP_risk_minimization import GPRiskMinimization\nfrom odin.core.GP_approx_risk_minimization import GPApproxRiskMinimization\nfrom odin.core.ODE_risk_minimization import ODERiskMinimization\nfrom odin.core.ODE_approx_risk_minimization import ODEApproxRiskMinimization\nimport numpy as np\nimport tensor...
[ [ "numpy.array", "numpy.ceil", "numpy.savetxt", "numpy.load", "numpy.min", "numpy.loadtxt" ] ]
SamrahSyed/Visionet_ML_Project_Web_App
[ "a792dcbabf2e112836d87698bc423531c6c18e77" ]
[ "run3.py" ]
[ "from mylib.centroidtracker import CentroidTracker\nfrom mylib.trackableobject import TrackableObject\nfrom imutils.video import VideoStream\nfrom imutils.video import FPS\nfrom mylib.mailer import Mailer\nfrom mylib import config, thread\nimport time, schedule, csv\nimport numpy as np\nimport argparse, imutils\nim...
[ [ "numpy.array", "numpy.arange", "numpy.mean" ] ]
JaroslavHron/PyOP2
[ "3c88f9e7ef572387d8a78ee863b79349bc918272" ]
[ "test/unit/test_matrices.py" ]
[ "# This file is part of PyOP2\n#\n# PyOP2 is Copyright (c) 2012, Imperial College London and\n# others. Please see the AUTHORS file in the main source directory for\n# a full list of copyright holders. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, ar...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros_like", "numpy.asarray", "numpy.zeros", "numpy.ones", "numpy.identity", "numpy.allclose", "numpy.arange", "numpy.linalg.solve", "numpy.diag" ] ]
ThomasProctor/pandas
[ "9c202a1b7e2418ca53ac42179d2499223a21c710" ]
[ "pandas/tests/window/test_grouper.py" ]
[ "import numpy as np\nimport pytest\n\nimport pandas as pd\nfrom pandas import DataFrame, Series\nimport pandas._testing as tm\nfrom pandas.core.groupby.groupby import get_groupby\n\n\nclass TestGrouperGrouping:\n def setup_method(self):\n self.series = Series(np.arange(10))\n self.frame = DataFrame...
[ [ "numpy.array", "pandas.DataFrame", "pandas.date_range", "pandas.MultiIndex.from_tuples", "pandas.core.groupby.groupby.get_groupby", "pandas._testing.assert_frame_equal", "pandas.Timestamp", "numpy.arange", "pandas._testing.assert_series_equal" ] ]
nutszebra/adversarial-robustness-toolbox
[ "5d03b3c8164e912f76c2ac4778cea3f071ac115f" ]
[ "art/metrics_unittest.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport unittest\n\nimport keras\nimport keras.backend as k\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Flatten, Conv2D, MaxPooling2D\nimport numpy as np\nimport tensorflow as tf\nimport torch.nn as nn\ni...
[ [ "torch.nn.Linear", "tensorflow.train.AdamOptimizer", "torch.nn.MaxPool2d", "tensorflow.layers.max_pooling2d", "tensorflow.Session", "tensorflow.losses.softmax_cross_entropy", "torch.nn.Conv2d", "numpy.swapaxes", "tensorflow.layers.conv2d", "tensorflow.placeholder", "ten...
Jichao-Wang/MDOAU-net
[ "d16bde0386a3c5996c778ea6f5ba282f7a03b391" ]
[ "wjc_core.py" ]
[ "import torch\r\nimport numpy as np\r\nimport os\r\nimport matplotlib.pyplot as plt\r\nimport PIL.Image as Image\r\nfrom torch.utils.data import DataLoader\r\nfrom torch import nn, optim\r\nfrom torchvision.transforms import transforms\r\nfrom dataset import Train_Dataset, Validation_Dataset, Test_Dataset\r\nimport...
[ [ "matplotlib.pyplot.style.context", "torch.no_grad", "torch.save", "matplotlib.pyplot.close", "numpy.mean", "matplotlib.pyplot.cla", "matplotlib.pyplot.figure", "torch.squeeze", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "torch.load...
Manik2000/drinker_fate_analysis
[ "7c4a54eabe556cc9727610d1151d85ef69e1971b" ]
[ "utils.py" ]
[ "import numpy as np\n\n\nclass Drinker:\n \"\"\"Class implementation of a drinker.\"\"\"\n\n def __init__(self, v):\n \"\"\"Initialize class object's attributes.\"\"\"\n self.x = 0\n self.y = 0\n self.v = v\n self.trajectory = [(0, 0)]\n\n def move(self):\n \"\"\"M...
[ [ "numpy.array", "numpy.random.rand", "numpy.log", "numpy.random.randn", "numpy.random.uniform" ] ]