repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
system123/SOMatch
[ "6f10cf28f506998a5e430ccd3faab3076fe350d5" ]
[ "datasets/csv_ua_dataset.py" ]
[ "import torch\n\nfrom torchvision import transforms\nfrom torch.utils.data import Dataset\nfrom functools import partial\nfrom skimage.io import imread\nfrom glob import glob\nfrom skimage import exposure, img_as_float, util\nfrom utils.augmentation import Augmentation, cropCenter, toGrayscale, cropCorner, cutout\n...
[ [ "numpy.array", "numpy.ones_like" ] ]
jansforte/Inteligencia-Artificial
[ "f5bf8f11f5e58b4a8b7becf049479534e48c75a5" ]
[ "redes neuronales/red_neuronal_basico.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\n\n#función sigmoidea\ndef sigmoid(x):\n return 1/(1+np.exp(-x))\n\n#Derivada de la sigmoidea\ndef sigmoid_der(x):\n return sigmoid(x)*(1-sigmoid(x))\n\n#primero generamos aleatoriamente 100 puntos espaciados linealmente entre -10 y 10\ninput = np.lins...
[ [ "numpy.array", "numpy.dot", "numpy.random.rand", "numpy.random.seed", "numpy.exp", "matplotlib.pyplot.show", "numpy.linspace" ] ]
eva5covergence/EVA5_AI_Projects
[ "7052373c52b6b9901cd0bc05a4758dd4b63f7480", "7052373c52b6b9901cd0bc05a4758dd4b63f7480" ]
[ "MultiObjectiveModel_YMPNet_Pavan/datasets/inference_dataset.py", "MultiObjectiveModel_YMPNet_Pavan/planer_models/model.py" ]
[ "\"\"\"\nCopyright (C) 2019 NVIDIA Corporation. All rights reserved.\nLicensed under the CC BY-NC-SA 4.0 license\n(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).\n\"\"\"\n\nimport numpy as np\nimport glob\nimport cv2\nimport os\n\nfrom utils import *\nfrom datasets.plane_dataset import *\n\nclass In...
[ [ "numpy.full", "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.random.seed", "numpy.eye", "numpy.stack", "numpy.arange", "numpy.expand_dims" ], [ "torch.nn.Linear", "torch.round", "torch.cat", "torch.nn.modules.utils._pair", "torch.stack", "...
Aethor/nintent
[ "a4c3a9cce22c46b65bfb9258ac25ce9c392674ff" ]
[ "train.py" ]
[ "import os\n\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\n\n\nimport argparse\nimport random\nfrom typing import Optional, List\n\nimport torch\nfrom torch.optim.optimizer import Optimizer\nfrom torch.nn.modules.loss import _Loss\nfrom torch.optim.lr_scheduler import _LRScheduler\nfrom transformers import BertTok...
[ [ "torch.cuda.is_available", "torch.tensor" ] ]
lithium-ion/ImpedanceAnalyzer
[ "e8d8c77b4f9b88d82b9f7fc40f29270aaa1e681b" ]
[ "application/fitPhysics.py" ]
[ "\"\"\" Provides functions for fitting physics-based models \"\"\"\n\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom scipy.interpolate import interp1d\nfrom scipy.optimize import leastsq\n\n\ndef prepare_data(data):\n \"\"\" Prepares the experimental data for fitting\n\n Parameters\n ----------\...
[ [ "numpy.concatenate", "numpy.poly1d", "scipy.interpolate.interp1d", "pandas.DataFrame", "numpy.real", "scipy.optimize.leastsq", "numpy.asscalar", "numpy.arctan2", "numpy.sqrt", "pandas.concat", "numpy.polyfit", "numpy.imag", "pandas.read_csv", "numpy.abs" ]...
xiaoweiChen/Tensorflow-2.x-Alexnet
[ "d9161ba6764143d3d8e84bee2268b0ac8ad95355" ]
[ "model.py" ]
[ "\nimport os, pathlib, PIL\nfrom tqdm import tqdm\n\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras import Model\n\nclass AlexNet(Model):\n def __init__(self, data_shape=(224, 224, 3), num_classes=100...
[ [ "tensorflow.keras.optimizers.SGD", "tensorflow.keras.preprocessing.image.load_img", "tensorflow.keras.layers.experimental.preprocessing.RandomFlip", "tensorflow.keras.layers.experimental.preprocessing.RandomRotation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.experimental.p...
clinfo/DeepKF
[ "ee4f1be28e5f3bfa46bb47dbdc4d5f678eed36c1", "ee4f1be28e5f3bfa46bb47dbdc4d5f678eed36c1" ]
[ "adw_test/script/plot_vec.py", "adw_test/dmm_input.py" ]
[ "import numpy as np\nimport joblib\nimport json\nimport sys\n\nif len(sys.argv)>2 and sys.argv[2]==\"all\":\n\timport matplotlib\n\tmatplotlib.use('Agg')\n\tfrom matplotlib import pylab as plt\nelse:\n\tfrom matplotlib import pylab as plt\n\n\n\n\nfilename_info=\"data/pack_info.json\"\nfilename_result=\"sim.jbl\"\n...
[ [ "matplotlib.pylab.axes", "matplotlib.use", "matplotlib.pylab.savefig", "matplotlib.pylab.show", "matplotlib.pylab.quiver", "matplotlib.pylab.ylim", "numpy.sqrt", "matplotlib.pylab.clf", "matplotlib.pylab.xlim" ], [ "numpy.array", "numpy.ones_like", "numpy.load",...
eendebakpt/qupulse
[ "5b5b48de10084d413e10cfd8f6e9f7536c69dd70" ]
[ "tests/hardware/tabor_simulator_based_tests.py" ]
[ "import unittest\nimport subprocess\nimport time\nimport platform\nimport os\n\nimport pyvisa.resources\nimport tabor_control\nimport numpy as np\n\nfrom qupulse.hardware.awgs.tabor import TaborAWGRepresentation, TaborChannelPair\nfrom qupulse._program.tabor import TaborSegment, PlottableProgram, TaborException, Ta...
[ [ "numpy.linspace", "numpy.ones", "numpy.asarray", "numpy.testing.assert_equal" ] ]
vilhub/DeBERTa
[ "87580930689ec9f75ef8dbebba367953ed3dfe63", "87580930689ec9f75ef8dbebba367953ed3dfe63" ]
[ "DeBERTa/deberta/ops.py", "DeBERTa/apps/tasks/ner_task.py" ]
[ "# Copyright (c) Microsoft, Inc. 2020\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n# Author: penhe@microsoft.com\n# Date: 01/15/2020\n#\n\nimport math\nfrom packaging import version\nimport torch\nfrom torch.nn import LayerNorm\...
[ [ "torch.sigmoid", "torch.onnx.symbolic_opset9.softmax", "torch.softmax", "torch.tensor", "torch.softmax_backward_data", "torch.empty_like" ], [ "numpy.mean", "numpy.argmax", "torch.tensor" ] ]
michael-p-sachen/ProHMR
[ "0167d05a9a45939a217d02b4ef8fd67977c15f82" ]
[ "prohmr/utils/geometry.py" ]
[ "from typing import Optional\nimport torch\nfrom torch.nn import functional as F\n\ndef aa_to_rotmat(theta: torch.Tensor):\n \"\"\"\n Convert axis-angle representation to rotation matrix.\n Works by first converting it to a quaternion.\n Args:\n theta (torch.Tensor): Tensor of shape (B, 3) contai...
[ [ "torch.zeros", "torch.cos", "torch.cat", "torch.nn.functional.normalize", "torch.stack", "torch.sin", "torch.einsum", "torch.norm", "torch.unsqueeze", "torch.eye", "torch.cross", "torch.div" ] ]
mehdi-mirzapour/eigenthemes
[ "7252c21831b6856e9047a26bdb09bb0787b957d0" ]
[ "jrk/jrk.py" ]
[ "import torch\nimport torch.nn as nn\nfrom jrk.encoder import Encoder\nimport numpy\nnumpy.set_printoptions(threshold=numpy.nan)\n\nclass JRK(nn.Module):\n def __init__(self, config):\n super(JRK, self).__init__()\n\n self.encoder = Encoder(config={\n 'type': config['type'],\n ...
[ [ "torch.zeros", "numpy.set_printoptions", "torch.nn.functional.embedding", "torch.log", "torch.Tensor" ] ]
ctralie/BoneTissue
[ "bafd9767a8345d6a1b1912ec049c523a9bb8ae8c" ]
[ "PolyMesh.py" ]
[ "\"\"\"\nProgrammer: Chris Tralie\nPurpose: Some simple routines for dealing with triangle meshes\n\"\"\"\nimport numpy as np\n\ndef loadOffFile(filename):\n \"\"\"\n Load a .off (or .coff) triangle mesh file\n Parameters\n ----------\n filename: string\n Path to the .off file\n Returns\n ...
[ [ "numpy.zeros_like", "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.sum", "numpy.arange", "numpy.cumsum", "numpy.cross" ] ]
vladdders/attention-ocr
[ "c29be8608ff58a341fdf921b30aa2cf5cc4f73ac" ]
[ "aocr/model/model.py" ]
[ "\"\"\"Visual Attention Based OCR Model.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nimport time\nimport os\nimport math\nimport logging\nimport sys\n\nimport distance\nimport numpy as np\nimport tensorflow as tf\n\nfrom six.moves import xrange # pylint: disable=redefined-bu...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.to_float", "tensorflow.control_dependencies", "tensorflow.tile", "tensorflow.nn.softmax", "tensorflow.identity", "tensorflow.cast", "tensorflow.rank", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow....
hoppe93/sitsi
[ "bf69900e6a3fa0a89efff5ecb5be7a64d43fab9b" ]
[ "sitsi/Algorithms/Tikhonov.py" ]
[ "r\"\"\"\nThis module calculates the best fitting radial profile for a given set of input\ndata, using Tikhonov regularization. The general least-squares problem we\nconsider is\n\n.. math::\n \n \\mathrm{min} \\sum_i\\left\\lVert I_i^{\\rm exp} - I_i \\right\\rVert_2^2\n\nwhere :math:`I_i^{\\rm exp}` is the ...
[ [ "numpy.concatenate", "numpy.divide", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.eye", "numpy.multiply", "numpy.linalg.lstsq", "numpy.linalg.svd", "numpy.vstack" ] ]
nonator/cp2018
[ "267950ce0fcb79c37da5b03e2cd5bb6278e9282f" ]
[ "00/src/pi_num.py" ]
[ "from numpy.random import rand\n\n\ndef main():\n N = 100000\n\n xy = rand(N, 2)\n\n r = xy[:,0] ** 2 + xy[:,1]**2\n\n n = sum(r < 1)\n\n pi_est = 4 * n / float(N)\n\n print(pi_est)\n\n\nif __name__ == '__main__':\n main()\n" ]
[ [ "numpy.random.rand" ] ]
PBibiloni/softcolor
[ "80194877d828e873a39a73b5936975436edd7017", "80194877d828e873a39a73b5936975436edd7017" ]
[ "softcolor/morphology.py", "examples/example_contrast_mapping.py" ]
[ "from math import ceil\nfrom warnings import warn\n\nfrom scipy.ndimage.filters import convolve\nfrom skimage import color\nimport numpy as np\nfrom skimage.morphology import disk\n\nfrom softcolor.aggregation_functions import conjunction_min, r_implication, implication_godel\nfrom softcolor.distance_between_images...
[ [ "numpy.full", "numpy.pad", "numpy.isnan", "scipy.ndimage.filters.convolve", "numpy.sum", "numpy.tile", "numpy.any", "numpy.all" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
rachelxwang/intravideo_search
[ "09b6f4688be367762c332c4d24e4832c754b159b" ]
[ "test/test_model.py" ]
[ "# -*- coding: utf-8 -*-\nimport cv2\nfrom PIL import Image, ImageChops\nimport os\nimport sys\nimport pytest\nimport torch\nimport numpy as np\nimport pytest_check as check\nsys.path.append('src')\nsys.path.append('utils')\nfrom build_vocab import Vocabulary\nfrom view import * # nopep8\nfrom model import * # no...
[ [ "numpy.array" ] ]
klusta-team/kwiklib
[ "617a6ceff55957728c3dc94109b64e4c427429c2", "617a6ceff55957728c3dc94109b64e4c427429c2" ]
[ "kwiklib/dataio/tools.py", "kwiklib/dataio/kwikloader.py" ]
[ "\"\"\"Utility functions for loading/saving files.\"\"\"\n\n# -----------------------------------------------------------------------------\n# Imports\n# -----------------------------------------------------------------------------\nimport os.path\nimport re\nimport cPickle\n\nimport numpy as np\nimport pandas as p...
[ [ "numpy.savetxt", "numpy.memmap", "numpy.sort", "numpy.fromfile", "numpy.abs", "pandas.read_csv", "numpy.fromstring", "numpy.dtype" ], [ "numpy.in1d", "numpy.array", "numpy.unique", "pandas.Series" ] ]
MinCiencia/ECQQ
[ "f93a01ce2dd140d073bd81afb9b4733c1d8a34c3" ]
[ "contributions_rnn/core/data.py" ]
[ "import tensorflow as tf\nimport pandas as pd\nimport numpy as np\nimport os\n\ndef _bytes_feature(value):\n \"\"\"Returns a bytes_list from a string / byte.\"\"\"\n if isinstance(value, type(tf.constant(0))):\n value = value.numpy() # BytesList won't unpack a string from an EagerTensor.\n return tf...
[ [ "tensorflow.data.experimental.sample_from_datasets", "tensorflow.data.TFRecordDataset", "tensorflow.train.Int64List", "tensorflow.train.Features", "tensorflow.stack", "pandas.concat", "tensorflow.cast", "tensorflow.train.FloatList", "tensorflow.io.FixedLenFeature", "tensorf...
GeorgeAdamson23/StormDataAnalysis
[ "27aea327ea17d7b4bcea4b99ec5b0b9d82c70c64" ]
[ "analyze_events.py" ]
[ "# Created by George Adamson on 08/02/2019\r\n# This script will analyze the storm event data that has been loaded into a SQL database using the load_events.py script\r\n# By design, this script focuses on the Southeast Michigan region (DTX) and Washtenaw County, Michigan\r\n\r\nimport sqlite3\r\nimport pandas as p...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.gcf", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
vita-epfl/rock-pytorch
[ "6f4c86d3fec7fe3b0ce65d2687d144e9698e964f" ]
[ "rock/detect.py" ]
[ "import os\nimport time\nfrom pathlib import Path\nfrom typing import Tuple, Optional\n\nimport torch\nimport torch.utils.data\n\nimport rock.ssd.prior_boxes\nimport rock.ssd.encoder\nimport rock.datasets.transforms\nimport rock.datasets.image_folder\nimport rock.model.network\nimport rock.utils.load\nimport rock.u...
[ [ "torch.device", "torch.no_grad", "torch.utils.data.DataLoader" ] ]
PuzeLiu/mushroom-rl
[ "99942b425e66b4ddcc26009d7105dde23841e95d", "99942b425e66b4ddcc26009d7105dde23841e95d", "2625ee7f64d5613b3b9fba00f0b7a39fece88ca5" ]
[ "mushroom_rl/algorithms/policy_search/black_box_optimization/reps.py", "mushroom_rl/algorithms/value/td/double_q_learning.py", "mushroom_rl/features/features.py" ]
[ "import numpy as np\n\nfrom scipy.optimize import minimize\n\nfrom mushroom_rl.algorithms.policy_search.black_box_optimization import BlackBoxOptimization\nfrom mushroom_rl.utils.parameters import to_parameter\n\n\nclass REPS(BlackBoxOptimization):\n \"\"\"\n Episodic Relative Entropy Policy Search algorithm....
[ [ "numpy.max", "numpy.array", "numpy.log", "numpy.ones", "numpy.exp", "numpy.finfo" ], [ "numpy.max", "numpy.random.uniform", "numpy.argwhere" ], [ "numpy.ones", "numpy.zeros" ] ]
RakeshJarupula/keras
[ "2ac6638e91d5aff77c22b45e9c8c84fb05a9e477", "2ac6638e91d5aff77c22b45e9c8c84fb05a9e477", "2ac6638e91d5aff77c22b45e9c8c84fb05a9e477" ]
[ "keras/layers/regularization/spatial_dropout3d.py", "keras/benchmarks/keras_examples_benchmarks/mnist_conv_custom_training_benchmark_test.py", "keras/layers/merging/concatenate.py" ]
[ "# Copyright 2015 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_export.keras_export", "tensorflow.compat.v2.shape" ], [ "tensorflow.compat.v2.keras.Input", "tensorflow.compat.v2.keras.utils.to_categorical", "tensorflow.compat.v2.keras.layers.Dropout", "tensorflow.compat.v2.keras.layers.MaxPooling2D", "tensorflow.compa...
Bodhis4ttva/LHC_Net
[ "8b47dff5117b078a99183afd1d103da06f37361c" ]
[ "Lib/Utils.py" ]
[ "from abc import ABC\r\n\r\nimport os\r\nimport random\r\nimport tensorflow as tf\r\nimport tensorflow_addons as tfa\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom shutil import copyfile\r\nimport csv\r\nfrom classification_models.tfkeras import Classifiers\r\nimport gc\r\n\r\n\r\ndef get_data(fil...
[ [ "tensorflow.image.central_crop", "numpy.array", "tensorflow.convert_to_tensor", "numpy.zeros", "tensorflow.image.resize", "tensorflow.keras.metrics.CategoricalAccuracy", "tensorflow.image.flip_left_right" ] ]
EngineerFreak/Proj_01
[ "c7c670b861ff4a5e56c333ad741a22860bebcd8d" ]
[ "main.py" ]
[ "##################################################################################\n# Project: Interface de usuário para classificadores\n# Author: Rafael Alves (EngineerFreak)\n# Created: Rafael Alves (EngineerFreak) - 14.02.2021\n# Edited :\n#######################################################################...
[ [ "matplotlib.pyplot.colorbar", "sklearn.datasets.load_breast_cancer", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.xlabel", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.figure", "sklearn.metrics.accuracy_score", "sklearn.svm.SVC", "matplotlib.pyp...
Delviet/3D-ResNets-PyTorch
[ "f6bf9ce3f41527916e4cd9b856f1dc50fdb52b6e" ]
[ "datasets/kinetics.py" ]
[ "import torch\r\nimport torch.utils.data as data\r\nfrom PIL import Image\r\nimport os\r\nimport math\r\nimport functools\r\nimport json\r\nimport copy\r\n\r\nfrom utils import load_value_file\r\n\r\n\r\ndef pil_loader(path):\r\n # open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pill...
[ [ "torch.stack" ] ]
jloveric/high-order-implicit-representation
[ "0ab5118d62abd3990d63fcd600558c70d044df06" ]
[ "language_interpolation.py" ]
[ "from typing import List\n\nimport os\nfrom omegaconf import DictConfig, OmegaConf\nimport hydra\nfrom pytorch_lightning.metrics.functional import accuracy\nfrom high_order_layers_torch.layers import *\nfrom pytorch_lightning import LightningModule, Trainer\nimport torch.optim as optim\nimport torch\nfrom high_orde...
[ [ "torch.argmax", "torch.nn.CrossEntropyLoss", "torch.where", "torch.utils.data.DataLoader" ] ]
B0BBB/seq2seq.pytorch
[ "54bb0e9f3e5c7db7f257841ed652e8ff447b8ee4" ]
[ "seq2seq/models/transformer.py" ]
[ "import math\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .modules.normalization import LayerNorm1d\nfrom .modules.attention import MultiHeadAttention\nfrom .seq2seq_base import Seq2Seq\nfrom seq2seq.tools.config import PAD\nfrom .modules.state imp...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.arange", "torch.nn.ReLU", "torch.nn.Embedding" ] ]
duncanmmacleod/cpnest
[ "5b3cbcfb236f7350e7272dc5fc7f14990f34cdff" ]
[ "cpnest/cpnest.py" ]
[ "#! /usr/bin/env python\n# coding: utf-8\n\nimport multiprocessing as mp\nfrom ctypes import c_double, c_int\nimport numpy as np\nimport os\nimport sys\nimport signal\n\nfrom multiprocessing.sharedctypes import Value, Array\nfrom multiprocessing import Lock\nfrom multiprocessing.managers import SyncManager\n\nimpor...
[ [ "numpy.array" ] ]
tomstitt/PyMFEM
[ "b00199ec0d7a5fba891f656575e91a64d3e35eb5" ]
[ "mfem/_par/pmesh.py" ]
[ "# This file was automatically generated by SWIG (http://www.swig.org).\n# Version 4.0.2\n#\n# Do not make changes to this file unless you know what you are doing--modify\n# the SWIG interface file instead.\n\nfrom sys import version_info as _swig_python_version_info\nif _swig_python_version_info < (2, 7, 0):\n ...
[ [ "numpy.array" ] ]
Crossfoot/autodE
[ "2c452c954a5268e6c9a80cd4efbbfe855e61f6bb" ]
[ "tests/test_path.py" ]
[ "import os\nimport numpy as np\nfrom autode.atoms import Atom\nfrom autode.methods import XTB, ORCA\nfrom autode.path import Path, AdaptivePath, PathPoint\nfrom autode.path.adaptive import pruned_active_bonds\nfrom autode.bonds import FormingBond, BreakingBond\nfrom autode.species import Species, Molecule\nfrom aut...
[ [ "numpy.array", "numpy.zeros" ] ]
berfubuyukoz/pytorch_pretrained_BERT
[ "5e2dcceeeefd87e87dbe3d8dbc39cae563f9972d" ]
[ "examples/distillation/scripts/binarized_data.py" ]
[ "# coding=utf-8\n# Copyright 2019-present, the HuggingFace Inc. team.\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# Unle...
[ [ "numpy.uint16" ] ]
czyczyyzc/MyFCIS
[ "5cbabab01ef967fd173caafd2b440a5fd7307932" ]
[ "Mybase/solver.py" ]
[ "import os\nimport cv2\nimport pickle\nimport numpy as np\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nfrom collections import defaultdict\nfrom .load_weights import *\nfrom .optim_utils import *\nfrom .fcis_utils.make_image import *\nfrom .fcis_utils.bboxes_target_layer import *\n\nMODEL_SAVE_PATH = ...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.train.get_checkpoint_state", "numpy.where", "matplotlib.pyplot.gcf", "tensorflow.stack", "tensorflow.control_dependencies", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "numpy.concatenat...
JIAQING-XIE/Fea2Fea
[ "10ca1dabecff121fdcfccd5c043c8b2984970d35" ]
[ "src/plot_dist.py" ]
[ "import seaborn as sns\nimport numpy as np\nimport pandas as pd\nimport os\nimport matplotlib.pyplot as plt\n\ntxt_dir = os.path.join('/home/jiaqing/桌面/Fea2Fea/', 'Result')\n\ndef read_file(dataset = 'planetoid', dataset_name = 'Cora', Property ='Degree', method = 'dist', count_zero = False):\n dir_name = []\n ...
[ [ "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
roger-yu-ds/iLab1
[ "17561b2f27fd972644387a7308875245454160c6" ]
[ "UTILS/utils.py" ]
[ "# This script is used to load the data\r\n\r\nfrom pathlib import WindowsPath\r\nfrom pathlib import Path\r\nimport pandas as pd\r\nimport xlwings as xw\r\nimport datetime\r\nimport pickle\r\nfrom typing import Tuple\r\nfrom typing import Dict\r\nfrom typing import List\r\nfrom collections import defaultdict\r\nim...
[ [ "numpy.isnan", "pandas.DataFrame", "pandas.Categorical", "pandas.concat", "pandas.read_csv", "pandas.get_dummies" ] ]
chenyao96/TVDNet
[ "26fb2bfe65612b89b1a98edfe3d3e7308c6272e3", "26fb2bfe65612b89b1a98edfe3d3e7308c6272e3" ]
[ "TVDNet/test.py", "TVDNet/models/spinal_net.py" ]
[ "import torch\nimport numpy as np\nfrom models import spinal_net\nimport cv2\nimport decoder\nimport os\nfrom dataset import BaseDataset\nimport draw_points\n# from boostnet_labeldata.tools import draw_gt_pts3\nimport argparse\n\ndef apply_mask(image, mask, alpha=0.5):\n \"\"\"Apply the given mask to the image.\...
[ [ "numpy.uint8", "numpy.random.rand", "torch.cuda.synchronize", "numpy.asarray", "torch.no_grad", "numpy.ones", "torch.manual_seed", "numpy.where", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "numpy.argsort", "numpy.repeat" ], [ ...
Horizon2333/videoqa_dataset_visualization
[ "38145885362fc0780bb041dd9dcdbc5f140162e7" ]
[ "msvd_visualize.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@Author : Horizon\r\n@Date : 2021-03-28 15:54:32\r\n\"\"\"\r\n\r\nimport os\r\nimport cv2\r\nimport json\r\nimport random\r\nimport argparse\r\nimport matplotlib.pyplot as plt\r\n\r\ndef get_msvd_item(msvd_path, anno):\r\n\r\n question = anno['question']\r\n answer = an...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
yuqZY/ECG_Encoder_Physionet2015
[ "5642de51838b028f2315e25ea2bd8e620ef0e65c" ]
[ "models/util.py" ]
[ "import numpy as np\r\nimport torch\r\nfrom torch import nn\r\nfrom torch.nn import init\r\n\r\n\r\n# def initialize_weights(net_l):\r\n# if not isinstance(net_l, list):\r\n# net_l = [net_l]\r\n# for net in net_l:\r\n# for m in net.modules():\r\n# if isinstance(m, nn.Conv1d):\r\n...
[ [ "numpy.concatenate", "torch.cat", "numpy.array", "numpy.zeros", "torch.nn.init.constant_", "numpy.copy", "torch.nn.init.xavier_uniform_", "torch.from_numpy", "torch.cuda.is_available", "numpy.vstack" ] ]
DaPulse/redash
[ "ef3d2c869d100631d5163e74426bfa98bf596265" ]
[ "redash/query_runner/excel.py" ]
[ "import logging\nimport yaml\n\nfrom redash.utils.requests_session import requests_or_advocate, UnacceptableAddressException\n\nfrom redash.query_runner import *\nfrom redash.utils import json_dumps\n\nlogger = logging.getLogger(__name__)\n\ntry:\n import pandas as pd\n import xlrd\n import openpyxl\n i...
[ [ "pandas.read_excel" ] ]
jpraveenkanna/Fashion_Classification-Myntra_Dataset
[ "378b1a5f7189e4958843344880ba3fbb51042cc9" ]
[ "app.py" ]
[ "\n#importing dependency\nfrom fastai.vision import load_learner,ImageList,DatasetType,open_image,Path\nimport pandas as pd\nimport warnings\nimport numpy as np\nfrom flask import Flask, request, render_template\nfrom werkzeug.utils import secure_filename\nwarnings.filterwarnings('ignore')\n\n#config\nupload_path =...
[ [ "pandas.read_csv" ] ]
riven314/LiuAlgoTrader
[ "be60e16b787591067bf7f18425ab2812bf0ffa32" ]
[ "liualgotrader/enhanced_backtest.py" ]
[ "import asyncio\nimport inspect\nimport sys\nimport traceback\nimport uuid\nfrom calendar import Calendar\nfrom datetime import date, datetime, timedelta\nfrom typing import Dict, List, Optional\n\nimport alpaca_trade_api as tradeapi\nimport pandas as pd\nfrom pytz import timezone\n\nfrom liualgotrader.common impor...
[ [ "pandas.date_range" ] ]
vsitzmann/cifar10_denoising
[ "b003caaf404cad6ffac87ffce24b11351536cdd7" ]
[ "denoising_unet.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport torch.nn.functional as F\n\nimport imageio\nimport skimage.measure\n\nimport torchvision\n\nfrom pytorch_prototyping.pytorch_prototyping import *\n\n\ndef num_divisible_by_2(number):\n return np.floor(np.log2(number)).astype(int)\n\n\ndef get_num_n...
[ [ "numpy.concatenate", "torch.cat", "torch.nn.MSELoss", "torch.nn.Tanh", "torch.nn.functional.interpolate", "torch.Tensor", "numpy.log2" ] ]
mvsantosdev/frbpoppy
[ "48386690faa5efd29924a216c6a31137a941acd0" ]
[ "frbpoppy/precalc.py" ]
[ "\"\"\"Create a lookup tables for redshift and the NE2001 dispersion measure.\"\"\"\n\nimport os\nimport numpy as np\nimport sqlite3\nimport sys\nfrom scipy.integrate import quad\nfrom tqdm import tqdm\nfrom joblib import Parallel, delayed\n\nimport frbpoppy.galacticops as go\nfrom frbpoppy.log import pprint\nfrom ...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.ones_like", "numpy.vectorize", "numpy.round", "numpy.diff", "numpy.stack", "numpy.arange", "numpy.cumsum", "numpy.meshgrid", "scipy.integrate.quad" ] ]
naskoap/covid-analysis
[ "26a418ed3d46a6014a3f59e2415cc62ea85d7f3c" ]
[ "bin/python/data_prep.py" ]
[ "import pandas as pd\nimport plotly as px\nfrom ipywidgets import interact\n\n\ncountry_df = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/web-data/data/cases_country.csv')\ncountry_df.columns = map(str.lower, country_df.columns)\ncountry_df = country_df.rename(columns={'country_region': 'c...
[ [ "pandas.read_csv" ] ]
cpeng-pz/Informer2020
[ "7bcc5e3220ee841b18788b6ff5d0d0907259aaf7" ]
[ "utils/timefeatures.py" ]
[ "from typing import List\n\nimport numpy as np\nimport pandas as pd\nfrom pandas.tseries import offsets\nfrom pandas.tseries.frequencies import to_offset\n\nclass TimeFeature:\n def __init__(self):\n pass\n\n def __call__(self, index: pd.DatetimeIndex) -> np.ndarray:\n pass\n\n def __repr__(s...
[ [ "pandas.to_datetime", "pandas.tseries.frequencies.to_offset" ] ]
oksanagit/profile_collection-1
[ "7849c588a7cdae13a16712753017361252252591" ]
[ "startup/10-machine.py" ]
[ "print(f\"Loading {__file__}...\")\n\nimport numpy as np\nfrom ophyd import (\n EpicsSignal,\n EpicsSignalRO,\n EpicsMotor,\n Device,\n Signal,\n PseudoPositioner,\n PseudoSingle,\n)\nfrom ophyd.utils.epics_pvs import set_and_wait\nfrom ophyd.pseudopos import pseudo_position_argument, real_posi...
[ [ "numpy.arcsin", "numpy.sin", "scipy.interpolate.InterpolatedUnivariateSpline" ] ]
ivanbgd/Coursera-Neural-Networks-for-Machine-Learning
[ "95b4583b1dbb53784fb8ba0381ca5ca87849ae14" ]
[ "AS4/utils.py" ]
[ "import numpy as np\nimport scipy.io as sio\nimport matplotlib.pyplot as plt\nfrom collections import namedtuple\nfrom sys import exit\n\n_report_calls_to_sample_bernoulli = True\n\n\ndef load_data(file_name = \".\\\\data_set.mat\"):\n \"\"\" Loads data from a .mat file. MATLAB 5.0 MAT-file\n This method ...
[ [ "numpy.dot", "numpy.reshape", "numpy.zeros", "numpy.round", "numpy.sum", "scipy.io.loadmat", "numpy.tile", "numpy.exp", "matplotlib.pyplot.title", "numpy.mean", "numpy.prod", "numpy.argmax", "numpy.abs", "numpy.sqrt", "numpy.floor", "matplotlib.pyplo...
cvut/pyrocon
[ "c2a65bdc2e178c968eb9847aaf45b2fd47239aaa", "c2a65bdc2e178c968eb9847aaf45b2fd47239aaa" ]
[ "interpolation/poly.py", "robCRSikt.py" ]
[ "# Coordinated Spline Motion and Robot Control Project\n# \n# Copyright (c) 2017 Olga Petrova <olga.petrova@cvut.cz>\n# Advisor: Pavel Pisa <pisa@cmp.felk.cvut.cz>\n# FEE CTU Prague, Czech Republic\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated ...
[ [ "numpy.array", "numpy.ones_like", "numpy.reshape", "numpy.empty_like", "numpy.vstack" ], [ "numpy.array", "numpy.isnan", "numpy.sin", "numpy.arccos", "numpy.arcsin", "numpy.eye", "numpy.any", "numpy.arctan2", "numpy.sqrt", "numpy.cos", "numpy.lin...
zazula/talos
[ "4a2a2c1c16310a2158692808cb0a6cfe4e4be326", "4a2a2c1c16310a2158692808cb0a6cfe4e4be326" ]
[ "tests/commands/test_latest.py", "talos/parameters/ParamSpace.py" ]
[ "def test_latest():\n\n print('\\n >>> start Latest Features... \\n')\n\n import talos\n from tensorflow.keras.models import Sequential\n from tensorflow.keras.layers import Dense\n\n x, y = talos.templates.datasets.iris()\n\n p = {'activation': ['relu', 'elu'],\n 'optimizer': ['Nadam', 'A...
[ [ "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Dense" ], [ "numpy.where", "numpy.array", "numpy.arange", "numpy.unique" ] ]
rochesterxugroup/csc_249_final_proj_a2d_det
[ "0f742981699352181e94a001f3d6f4a5b1824a54" ]
[ "mask_rcnn/utils/resnet_weights_helper.py" ]
[ "\"\"\"\nHelper functions for converting resnet pretrained weights from other formats\n\"\"\"\nimport os\nimport pickle\n\nimport torch\n\nimport mask_rcnn.nn as mynn\nimport mask_rcnn.utils.detectron_weight_helper as dwh\nfrom mask_rcnn.core.config import cfg\n\n\ndef load_pretrained_imagenet_weights(model):\n ...
[ [ "torch.sqrt", "torch.Tensor", "torch.load" ] ]
EiffL/NaMaster
[ "41cc7839083511fe6be2eb20e93b8916c5c1f1f3" ]
[ "test/testutils.py" ]
[ "import numpy as np\n\ndef normdiff(v1,v2) :\n return np.amax(np.fabs(v1-v2))\n\ndef read_flat_map(filename,i_map=0) :\n \"\"\"\n Reads a flat-sky map and the details of its pixelization scheme.\n The latter are returned as a FlatMapInfo object.\n i_map : map to read. If -1, all maps will be read.\n ...
[ [ "numpy.fabs" ] ]
Widbskdh/Opai
[ "f04c5281783f54c46be060428d9e58f3a6e15bb4" ]
[ "utils/logs/hooks_test.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.compat.v1.train.create_global_step", "tensorflow.Graph", "tensorflow.compat.v1.train.get_global_step", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.test.main", "tensorflow.compat.v1.train.ChiefSessionCreator" ] ]
jorana/verne
[ "df9ed569fe6716db74e3e594b989e5c9e9c8983c" ]
[ "verne/CalcLimits.py" ]
[ "import numpy as np\nfrom scipy.interpolate import interp1d\n\nimport argparse\n\n# Parse the arguments!\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='...')\n parser.add_argument('-exp', '--exp',\n help='Calculate limits for which experiment? \"CDMS\" or \"...
[ [ "numpy.log10", "numpy.loadtxt", "numpy.sort", "numpy.append" ] ]
AmberCrafter/pythonlib_meteo
[ "78593a85b09e7afd07bc1cc45c31566efcb14c60" ]
[ "basic.py" ]
[ "# =================================================================== #\r\n# Author: AmberCraft\r\n# License: MIT\r\n# Version: 1.0.0\r\n# Type: toolbox\r\n# Publish date: 2020-09-06\r\n# =================================================================== #\r\n# <ChangeLog>\r\n# <Version: 1.0.0>\r\n# This is the f...
[ [ "numpy.array", "numpy.sin", "numpy.log", "numpy.nansum", "numpy.exp", "numpy.deg2rad" ] ]
depp/ultrafxr
[ "e52408beb84de32fc3d439c3827f59e32260fb7d" ]
[ "math/coeffs/calc.py" ]
[ "import argparse\nimport math\nimport numpy\nimport numpy.polynomial.polynomial as polynomial\nimport pathlib\nimport sys\n\nfrom typing import List, TextIO, Tuple\n\nclass SolverError(Exception):\n pass\n\ndef chebyshev_nodes(n: int) -> numpy.ndarray:\n \"\"\"Generate N Chebyshev nodes in the range [-1,1].\"...
[ [ "numpy.max", "numpy.iscomplex", "numpy.sin", "numpy.zeros", "numpy.log", "numpy.exp2", "numpy.roots", "numpy.ones", "numpy.min", "numpy.arange", "numpy.linalg.solve", "numpy.abs", "numpy.all", "numpy.cos", "numpy.linspace", "numpy.polynomial.polynomi...
emarteca/gatsby
[ "144412f9a5a7d94e26407eff450a238e76a6a98a" ]
[ "get_failing_tests.py" ]
[ "import pandas as pd \nimport xml.etree.ElementTree as ET\nimport sys\n\n# before this, process with bash to get just the fails\ndef process_fails_file( filename):\n\tto_ret = pd.read_csv( filename, sep = ' ', header=None)\n\tto_ret = to_ret[to_ret[0] == \"FAIL\"]\n\tto_ret.drop([0], inplace=True, axis=1) # delete ...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
kavanase/DefectsWithTheBoys
[ "041c7569d13c331719a740067924cc464f0a6d9e" ]
[ "doped/pycdt/corrections/tests/test_kumagai_correction.py" ]
[ "# coding: utf-8\n\nfrom __future__ import division\n\n__status__ = \"Development\"\n\nimport os\nimport numpy as np\nimport unittest\n\nfrom pymatgen.io.vasp.outputs import Locpot\nfrom doped.pycdt.corrections.kumagai_correction import *\nfrom pymatgen.util.testing import PymatgenTest\n\n# Paths to files we are te...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.array" ] ]
ankitshah009/sonnet
[ "a07676192c6d0f2ed5967d6bc367d62e55835baf" ]
[ "sonnet/python/modules/conv.py" ]
[ "# Copyright 2017 The Sonnet 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 required ...
[ [ "tensorflow.reshape", "tensorflow.nn.conv3d_transpose", "tensorflow.nn.separable_conv2d", "tensorflow.bfloat16.is_compatible_with", "tensorflow.tile", "tensorflow.shape", "tensorflow.concat", "tensorflow.float32.is_compatible_with", "numpy.prod", "tensorflow.squeeze", "...
Lechatelia/own_mmdet
[ "eac5db1d1bee8eafe0ed46fa4bb61ca8605b502f" ]
[ "mmdet/ops/upsample.py" ]
[ "import torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom mmcv.cnn import xavier_init\r\n\r\nfrom .carafe import CARAFEPack\r\n\r\n\r\nclass PixelShufflePack(nn.Module):\r\n \"\"\" Pixel Shuffle upsample layer\r\n\r\n Args:\r\n in_channels (int): Number of input channels\r\n out_channels...
[ [ "torch.nn.functional.pixel_shuffle", "torch.nn.Conv2d" ] ]
ksrinivs64/lale
[ "e0ffc357c3711940078718717aebc5b06c9dc4ae", "e0ffc357c3711940078718717aebc5b06c9dc4ae" ]
[ "lale/lib/autogen/extra_trees_classifier.py", "lale/helpers.py" ]
[ "import sklearn\nfrom numpy import inf, nan\nfrom sklearn.ensemble import ExtraTreesClassifier as Op\n\nfrom lale.docstrings import set_docstrings\nfrom lale.operators import make_operator\n\n\nclass _ExtraTreesClassifierImpl:\n def __init__(self, **hyperparams):\n self._hyperparams = hyperparams\n ...
[ [ "sklearn.ensemble.ExtraTreesClassifier" ], [ "numpy.concatenate", "numpy.array", "torch.cat", "sklearn.model_selection.StratifiedKFold", "numpy.zeros", "numpy.random.RandomState", "sklearn.metrics.check_scoring", "sklearn.utils.metaestimators._safe_split", "torch.from_n...
jinseuk56/gms_dm_python
[ "6d47715830e7cc8e5c008e2ecf154f045942358b" ]
[ "codes/virtual_annular_detector.py" ]
[ "# Jinseok Ryu\n# Electron Microscopy and Spectroscopy Lab.\n# Seoul National University\n# last update : 20210604\n# virtual STEM imaging for 4D-STEM data\n\n\n# ********************************************************************************\nprint(\"Execute Python script in GMS 3\")\n\nimport DigitalMicrograph a...
[ [ "numpy.rollaxis", "numpy.min", "numpy.mean", "numpy.exp", "numpy.multiply", "numpy.where", "numpy.max", "numpy.nan_to_num", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.hypot", "numpy.round", "matplotlib.pyplot.show", "numpy.asarray", "numpy.sum"...
WxBDM/nwsapy
[ "728090300c1b4cd97b0e2f50f600c6168b04e0b1" ]
[ "nwsapy/endpoints/server_ping.py" ]
[ "import pandas as pd\n\nfrom nwsapy.core.inheritance.base_endpoint import BaseEndpoint\n\nclass ServerPing(BaseEndpoint):\n \"\"\"Sends a ping to the server.\n \"\"\"\n def __init__(self):\n super(ServerPing, self).__init__()\n \n def to_dict(self):\n \"\"\"Returns the glossary in a dic...
[ [ "pandas.DataFrame.from_dict" ] ]
samarthbhargav/nlp1-project
[ "4cec7ffb0ae800b8fc6ba57e4177b3f38ae28d0c" ]
[ "experiment/model.py" ]
[ "import numpy as np\nimport argparse\nimport codecs\nimport math\nimport os\nimport sys\nfrom itertools import count, takewhile, zip_longest\nfrom collections import defaultdict\n\nimport utils\n\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\n\nsys.path.insert(0, os.path.abspath(\"../\"))\n\n...
[ [ "matplotlib.pyplot.savefig", "numpy.arange", "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.figure" ] ]
shubham0704/MeshCNN
[ "0085e06ab6b06402344130af4e25f0038918bb73" ]
[ "util/edge_history.py" ]
[ "import mpl_toolkits.mplot3d as a3\nimport matplotlib.colors as colors\nimport pylab as pl\nimport numpy as np\nimport pdb\nV = np.array\nr2h = lambda x: colors.rgb2hex(tuple(map(lambda y: y / 255., x)))\nsurface_color = r2h((255, 230, 205))\nedge_color = r2h((90, 90, 90))\nedge_colors = (r2h((15, 167, 175)), r2h((...
[ [ "numpy.max", "numpy.ma.where", "numpy.array", "numpy.zeros", "numpy.min" ] ]
BIDS-Apps/rsHRF
[ "e1751e77629f9e960f156b1bd6a9842f7c34f719", "a07715b764df69fffbc7f1a43718e958662ade9b" ]
[ "rsHRF/CLI.py", "rsHRF/rsHRF_GUI/gui_windows/plotterWindow.py" ]
[ "import sys\nimport numpy as np\nimport os.path as op\nimport json\nfrom argparse import ArgumentParser\nfrom bids.layout import BIDSLayout\nfrom pathlib import Path\nfrom rsHRF import spm_dep, fourD_rsHRF, utils\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nwith open(op.join(op.dirname(op....
[ [ "numpy.fix" ], [ "matplotlib.use", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "matplotlib.figure.Figure" ] ]
sjyk/ar4ds
[ "668fc5d06152d4d5c3dbeeaaedb8bc3ddb393d88" ]
[ "examples/optimization.py" ]
[ "from _examples import *\nimport pandas as pd\n\nfrom ar4ds.api import *\nfrom ar4ds.core import *\n\n\"\"\"\nIntroduction to the query optimizer\n\"\"\"\n\ndata = pd.DataFrame(raw_data, columns=['title','branch', 'salary'])\ncode = '''implies(conj(eq(s.branch,'NY'), eq(t.branch,'SF')), gt(s.salary, t.salary))'''\n...
[ [ "pandas.DataFrame" ] ]
neuronalX/Funky_Reservoir
[ "ce11aafb02ad36d37232a8a813e70923e0da1cc8" ]
[ "reservoirpy/nodes/tests/test_io.py" ]
[ "# Author: Nathan Trouvain at 14/03/2022 <nathan.trouvain@inria.fr>\n# Licence: MIT License\n# Copyright: Xavier Hinaut (2018) <xavier.hinaut@inria.fr>\nimport numpy as np\nimport pytest\nfrom numpy.testing import assert_equal\n\nfrom reservoirpy.nodes import Input, Output\n\n\ndef test_input():\n inp = Input()\...
[ [ "numpy.ones", "numpy.testing.assert_equal" ] ]
m0tchy/hub
[ "54494b4c8aa83dc20e3b1e94017b9a029cb92822" ]
[ "tensorflow_hub/tools/make_nearest_neighbour_index/make_nearest_neighbour_index.py" ]
[ "# Copyright 2019 The TensorFlow Hub 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...
[ [ "tensorflow.compat.v1.enable_v2_behavior", "tensorflow.__version__.startswith" ] ]
HKJL10201/fast-feature-fool
[ "bdd44212461628e94e62e75e528fefcf6467336c" ]
[ "nets/googlenet.py" ]
[ "from urllib.request import urlretrieve\nimport tensorflow as tf\nfrom misc.layers import *\nimport numpy as np\nimport os\n\ndef model(image, weights, biases):\n #check image dimensions\n assert image.get_shape().as_list()[1:] == [224, 224, 3]\n layers = {}\n with tf.name_scope(\"conv1\"):\n lay...
[ [ "tensorflow.nn.lrn", "numpy.load", "tensorflow.reshape", "tensorflow.constant", "tensorflow.name_scope", "tensorflow.nn.softmax", "tensorflow.nn.avg_pool" ] ]
brandontrabucco/allenact
[ "f75ed98f7d5bcc87b460f0c13e24dafc18edc895" ]
[ "allenact_plugins/habitat_plugin/habitat_tasks.py" ]
[ "from abc import ABC\nfrom typing import Tuple, List, Dict, Any, Optional, Union, Sequence, cast\n\nimport gym\nimport numpy as np\nfrom habitat.sims.habitat_simulator.actions import HabitatSimActions\nfrom habitat.sims.habitat_simulator.habitat_simulator import HabitatSim\nfrom habitat.tasks.nav.shortest_path_foll...
[ [ "numpy.all", "numpy.sum", "numpy.isnan", "numpy.zeros" ] ]
ApfelPresse/CGSearchRace-NEAT
[ "95e832e31f5531649d7f44df2e799d2bc9d251a6" ]
[ "simulation.py" ]
[ "import math\nimport time\n\nimport numpy as np\nfrom CGSearchRace.Constants import Constants\nfrom CGSearchRace.Referee import Referee\nfrom CGSearchRace.Tracks import tracks\n\nfrom visualize_run import plot_current_frame, convert_to_gif\n\n\ndef min_max_scaler(value: float, min_value: float, max_value: float, ra...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.round", "numpy.sum", "numpy.cross" ] ]
Kitsunetic/3detr
[ "2ae2e23613a5777a94ec5a6b376ce3e5a3f0ef7c" ]
[ "utils/random_cuboid.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport numpy as np\n\n\ndef check_aspect(crop_range, aspect_min):\n xy_aspect = np.min(crop_range[:2]) / np.max(crop_range[:2])\n xz_aspect = np.min(crop_range[[0, 2]]) / np.max(crop_range[[0, 2]])\n yz_aspect = np.min(crop_range[1:]) / np.max(crop_range...
[ [ "numpy.max", "numpy.random.rand", "numpy.sum", "numpy.min", "numpy.all" ] ]
JBlaschke/dials
[ "83fbc79864411b67933bd9708bc2d5f7d8f0859b" ]
[ "command_line/shadow_plot.py" ]
[ "# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1\n\nfrom __future__ import absolute_import, division, print_function\n\nimport json\nimport sys\n\nimport libtbx\nimport libtbx.phil\nfrom scitbx.array_family import flex\n\nfrom dials.util import Sorry\n\nhelp_message = \"\"\"\nGenerate a 1d or 2d ...
[ [ "matplotlib.use", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xlim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.style.use", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.gcf",...
Ronalmoo/pytorch_tutorials
[ "962c256e41d0bdf1003d4f6f03445c9f151dcffc" ]
[ "deep_learning_with_pytorch_a_60_minute_blitz/neural_networks.py" ]
[ "# Define the network\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(Net, self).__init__()\n # 1 input image channel, 6 output channels, 3x3 square convolution\n # kernel\n ...
[ [ "torch.nn.MSELoss", "torch.nn.Linear", "torch.nn.Conv2d", "torch.randn" ] ]
bradyrx/climpred
[ "66d22ecf7351f205f9f510f4eac25e4431fac11f" ]
[ "climpred/tests/test_metrics.py" ]
[ "import numpy as np\nimport pytest\nimport xarray as xr\nimport xskillscore as xs\nfrom xarray.testing import assert_allclose\n\nfrom climpred.bootstrap import bootstrap_perfect_model\nfrom climpred.comparisons import PM_COMPARISONS\nfrom climpred.metrics import __ALL_METRICS__ as all_metrics, Metric, __pearson_r\n...
[ [ "numpy.random.seed", "numpy.arange" ] ]
Miguel-Hombrados/GPK-pytorch
[ "ef2addc5b40fa94a9ff1d8b650ee02d9044790c7" ]
[ "predGPMT.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Dec 28 18:50:45 2021\n\n@author: mahom\n\"\"\"\nimport torch\nimport gpytorch\nfrom to_torch import to_torch\nfrom opt_example import opt_example\ndef predGPMT(test_x,likelihood,model):\n \n test_x = to_torch(test_x)\n Ntest = torch.Tensor.size(test_x,0)\n ...
[ [ "torch.no_grad", "torch.Tensor.size" ] ]
mcsarge/ClassicDIY-MatrixDisplay
[ "2edc6ddbe98ef72b81d2ed25f3d2086c6f57564a" ]
[ "matrixdisplay/core.py" ]
[ "#!/usr/bin/env python\nfrom rgbmatrix import graphics\nfrom samplebase import SampleBase\nimport math\nimport time\nimport numpy as np\n\n\ndef scale_col(val, lo, hi):\n if val < lo:\n return 0\n if val > hi:\n return 255\n return 255 * (val - lo) / (hi - lo)\n\n\ndef rotate(x, y, sin, cos):...
[ [ "numpy.array" ] ]
aslansd/pyGLMHMM
[ "5930e1322435431c5835b2b3f241b2ca0d2fb887" ]
[ "src/pyGLMHMM/LBFGS.py" ]
[ "import torch\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom copy import deepcopy\nfrom functools import reduce\nfrom numba import jit\nfrom torch.optim import Optimizer\n\n#%% Helper Functions for L-BFGS\ndef is_legal(v):\n \"\"\"\n Checks that tensor is not NaN or Inf.\n\n Inputs:\n ...
[ [ "torch.cat", "numpy.argmin", "torch.isnan", "numpy.min", "numpy.max", "torch.mul", "numpy.linalg.matrix_rank", "torch.norm", "numpy.polyval", "torch.abs", "numpy.isreal", "torch.tensor", "numpy.arange", "numpy.sqrt", "numpy.append", "numpy.array", ...
lygztq/Knowledge-Distillation-Wheel
[ "0b1891052fb8998bf78e6c8ca8c76db85759c203" ]
[ "model/KD_model.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport os, sys\nfrom data_utils.DataManager import DataManager\n\nclass KDModel(object):\n def __init__(self, dataset_name, teacher_model, students_model):\n \"\"\"\n The class of Knowledge Distillation Model\n\n dataset_name: The name of your ...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.train.AdamOptimizer", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.argmax", "tensorflow.reset_default_graph", "tensorflow.train.Saver", "tensorflow.Session", "tensorflow.assign_add", "tensorflow.variabl...
ricklentz/deep-object-reid
[ "bf4d30d78e4a34847496d0efb50d98541f5274f9" ]
[ "torchreid/ops/non_local.py" ]
[ "# Copyright (C) 2020-2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n#\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nclass NonLocalModule(nn.Module):\n def __init__(self, in_channels, embed_dim=None, embed_factor=4, spatial_sub_sample=False):\n super().__init_...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.Conv2d", "torch.nn.functional.softmax", "torch.matmul" ] ]
riverhxz/wood_board
[ "043c1721ab0cc7d305c746b9843fcf348b565408" ]
[ "yolo3/utils.py" ]
[ "\"\"\"Miscellaneous utility functions.\"\"\"\n\nfrom functools import reduce\n\nfrom PIL import Image\nimport numpy as np\nfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgb\n\nimport imgaug.augmenters as iaa\nfrom imgaug.augmenters import Sometimes\nimport numpy as np\nimport imgaug as ia\nimport imgaug.augment...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "matplotlib.colors.hsv_to_rgb", "numpy.random.shuffle", "numpy.logical_and" ] ]
sebi06/napari_zeiss
[ "95386f259eafb2ae6a98838dcfd4abe9f95f2366" ]
[ "tools/napari_tools.py" ]
[ "# -*- coding: utf-8 -*-\n\n#################################################################\n# File : napari_tools.py\n# Version : 0.0.3\n# Author : czsrh\n# Date : 09.06.2021\n# Institution : Carl Zeiss Microscopy GmbH\n#\n# Disclaimer: This tool is purely experimental. Feel free to\n# use...
[ [ "numpy.round", "numpy.max", "numpy.min" ] ]
AIasd/leaderboard
[ "8f2152b364f530f06b2a0e7905e601d25f682f52" ]
[ "team_code/base_agent.py" ]
[ "import time\n\nimport cv2\nimport carla\n\nfrom leaderboard.autoagents import autonomous_agent\nfrom team_code.planner import RoutePlanner\n\nfrom srunner.scenariomanager.carla_data_provider import CarlaDataProvider\nimport numpy as np\nfrom leaderboard.utils.route_manipulation import interpolate_trajectory\n\nfro...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.min", "numpy.abs" ] ]
opoplawski/scipy
[ "582d59caabb4a2a6fcdd06b512dcd14daf7ca6b2" ]
[ "scipy/weave/accelerate_tools.py" ]
[ "#**************************************************************************#\n#* FILE ************** accelerate_tools.py ************************#\n#**************************************************************************#\n#* Author: Patrick Miller February 9 2002 *#\n#**...
[ [ "scipy.weave.build_tools.build_extension", "scipy.weave.base_info.custom_info", "numpy.testing.assert_", "scipy.weave.ext_tools.ext_module", "scipy.weave.md5_load.md5" ] ]
5AGE-zhang/TocoDecoy
[ "6ce34d717d965e7d36cb8d2b1b527d2fded7c2d3" ]
[ "dataset_generation/0_molecular_generation/ddc_pub/ddc_v3_unbiased.py" ]
[ "import os\nos.environ[\n \"TF_CPP_MIN_LOG_LEVEL\"\n] = \"3\" # Suppress UserWarning of TensorFlow while loading the model\n\nimport numpy as np\nfrom datetime import datetime\nfrom functools import wraps\nimport shutil, zipfile, tempfile, pickle\n\nfrom tensorflow.keras.layers import (\n Input,\n Concate...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "tensorflow.keras.layers.Input", "numpy.random.seed", "numpy.log", "numpy.exp", "tensorflow.keras.models.Model.from_config", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.load_mo...
mengmengliu1998/qd-3dt
[ "9fcd1c0b165793e259deb46a64fcbbdc33735f2f" ]
[ "scripts/nuscenes/eval/tracking/evaluate.py" ]
[ "# nuScenes dev-kit.\n# Code written by Holger Caesar, Caglayan Dicle and Oscar Beijbom, 2019.\n\nimport argparse\nimport json\nimport os\nimport time\nfrom typing import Tuple, List, Dict, Any\n\nimport numpy as np\n\nfrom nuscenes import NuScenes\nfrom nuscenes.eval.common.config import config_factory\nfrom nusce...
[ [ "numpy.nanargmax", "numpy.nanmean", "numpy.isnan" ] ]
grebtsew/DiscGolf
[ "a4bb9862a53cba09c2dc64596c5f96cbc72fac95" ]
[ "Calculations/Frisbee_Flight_Trajectory(3dmodel)_updated.py" ]
[ "import matplotlib.pyplot as plt\nimport math\nimport numpy as np\n\n\"\"\"\nTermology explained:\n\n x - axis are forward/backward / roll\n y - axis are height / spin\n z - axis are sides / pitch\n\n Above AREA\n[-----------]\n ________ _\n /| |\\ |\n| | | | | Side AREA\n \\| ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplots" ] ]
thequackdaddy/blaze
[ "21ba90c17b6b807623bbc9996bfc838f13ee6ea1" ]
[ "blaze/compute/tests/test_csv_compute.py" ]
[ "from blaze.compute.csv import pre_compute, CSV\nfrom blaze import compute, discover, dshape, into, join, concat, data\nfrom blaze.utils import example, filetext, filetexts\nfrom blaze.expr import symbol\nfrom pandas import DataFrame, Series\nimport pandas.util.testing as tm\nfrom datashape.predicates import iscoll...
[ [ "numpy.array", "numpy.arange" ] ]
lvotapka/mmvt_seekr
[ "077115e0fbf95233e1b00fd262de6a43282e69fa" ]
[ "mmvt_seekr/pdb2.py" ]
[ "'''\npdb2.py\nby Lane Votapka\nAmaro Lab 2015\n\nThis file contains multiple functions and classes that can be used to read and write PDB, PQR, and PQRXML formats in versatile ways.\nIt also contains some functions for processing loaded structures, such as center-of-mass calculations, etc.\n\n'''\nimport re, warni...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.matrix", "numpy.allclose", "numpy.linalg.eig", "numpy.cross" ] ]
JanKorinek/machine-learning-engineering-for-production-public
[ "e2fc12e4a32ba005e3d36f0e566d987956d241e0" ]
[ "course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py" ]
[ "import pickle\nimport numpy as np\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel, conlist\n\n\n\napp = FastAPI(title=\"Predicting Wine Class with batching\")\n\n# Open classifier in global scope\nwith open(\"models/wine-95-fixed.pkl\", \"rb\") as file:\n clf = pickle.load(...
[ [ "numpy.array" ] ]
g-votte/pfrl
[ "4c30c1d73f0941a2b649b62937eec346bb55a95e" ]
[ "tests/experiments_tests/test_hooks.py" ]
[ "import unittest\n\nimport numpy as np\n\nimport pfrl\n\n\nclass TestLinearInterpolationHook(unittest.TestCase):\n def test_call(self):\n\n buf = []\n\n def setter(env, agent, value):\n buf.append(value)\n\n hook = pfrl.experiments.LinearInterpolationHook(\n total_steps...
[ [ "numpy.arange" ] ]
prefrontalcortex/ai2thor
[ "f28ebbf2a6eb468a17996320eec485b3c7e3444d" ]
[ "ai2thor/util/trials.py" ]
[ "import numpy as np\nimport math\n\n\nclass TrialMetric(object):\n def init_trials(self, num_trials, metadata):\n ...\n\n def update_with_trial(self, trial_index, metadata):\n ...\n\n\nclass ObjectPositionVarianceAverage(TrialMetric):\n \"\"\"\n Metric that computes the average of the vari...
[ [ "numpy.array", "numpy.empty", "numpy.var" ] ]
kappakkala/mypyscripts
[ "4d83e35009687e11755b3d7edac4822b5bea9de7" ]
[ "bday_bot.py" ]
[ "import pandas as pd\nfrom datetime import datetime\nfrom telegram_api import TelegramApi\n\ndf_cal = pd.read_excel(r'C:/Users/kappakkala/Documents/Calendar.xlsx')\ndf_cal = df_cal.fillna(value=\"nothing\")\nevent = df_cal.at[int(datetime.today().strftime('%d'))-1, datetime.today().strftime('%B')]\n\nAPI_KEY = '' #...
[ [ "pandas.read_excel" ] ]
SlimFun/FedML
[ "47a14c84b9e07dd0f73c64647be024809ce2a490" ]
[ "fedml_experiments/distributed/contrastive_fed/CovaMNet.py" ]
[ "'''\nResNet for CIFAR-10/100 Dataset.\n\nReference:\n1. https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py\n2. https://github.com/facebook/fb.resnet.torch/blob/master/models/resnet.lua\n3. Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\nDeep Residual Learning for Image Recognition. https...
[ [ "torch.nn.Linear", "torch.cat", "torch.isnan", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.cuda.is_available", "torch.load", "torch.transpose", "torch.nn.init.constant_", "torch.nn.Conv1d", "torch.norm", "torch.nn.init.n...
aabobakr/adversarial-robustness-toolbox
[ "d62b2606132d6e6fd5946d6bdc8f1da940eb3282", "d62b2606132d6e6fd5946d6bdc8f1da940eb3282" ]
[ "tests/attacks/test_virtual_adversarial.py", "tests/attacks/test_zoo.py" ]
[ "# MIT License\n#\n# Copyright (C) IBM Corporation 2018\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, ...
[ [ "tensorflow.reset_default_graph", "numpy.argmax", "numpy.swapaxes" ], [ "numpy.random.rand", "numpy.testing.assert_almost_equal", "tensorflow.reset_default_graph", "numpy.swapaxes", "numpy.argmax" ] ]
squirrelo/scikit-bio
[ "f9016283638ef49ffccb3bb5f79e5a421462cfd1", "f9016283638ef49ffccb3bb5f79e5a421462cfd1" ]
[ "skbio/metadata/_testing.py", "skbio/alignment/tests/test_pairwise.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# ---------------------------------...
[ [ "pandas.DataFrame", "numpy.array", "numpy.arange" ], [ "numpy.array", "numpy.testing.assert_array_equal", "numpy.zeros" ] ]
ISM-Weimar/DeepEnergyMethods
[ "3a51131e0827446bf5986d698aaac396c7fa5037" ]
[ "tf2/Poisson2D_Dirichlet_SinCos.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nPoisson equation example\nSolve the equation -\\Delta u(x) = f(x) for x\\in\\Omega with Dirichlet boundary conditions u(x)=u0 for x\\in\\partial\\Omega\n@author: cosmin\n\"\"\"\nimport tensorflow as tf\nimport numpy as np\nimport time\nfrom utils.tfp_loss im...
[ [ "numpy.concatenate", "tensorflow.keras.backend.set_floatx", "numpy.array", "tensorflow.convert_to_tensor", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.contourf", "numpy.sin", "numpy.linalg.norm", "tensorflow.random.set_seed", "matplotlib.pyplot.title", "tensorflow....
nmallinar/EigenPro-pytorch
[ "43b4b8d92665b490f5773339a4288c92a111a2e1" ]
[ "mnist.py" ]
[ "import keras\nimport numpy as np\n\nfrom keras.datasets.mnist import load_data\n\n\ndef unit_range_normalize(samples):\n\tmin_vals = np.min(samples, axis=0)\n\tmax_vals = np.max(samples, axis=0)\n\tdiff = max_vals - min_vals\n\tdiff[diff <= 0.0] = np.maximum(1.0, min_vals[diff <= 0.0])\n\tnormalized = (samples - m...
[ [ "numpy.max", "numpy.min", "numpy.maximum" ] ]
MIR-MU/sr
[ "fe4c3aff1d1646201ca58cff705032dc7dc0a64b" ]
[ "generate_header_and_model.py" ]
[ "try:\n import tensorflow.compat.v1 as tf\nexcept ImportError:\n import tensorflow as tf\nimport numpy as np\nimport argparse\nimport os\nimport enum\nfrom models.model_espcn import ESPCN\nfrom models.model_srcnn import SRCNN\nfrom models.model_vespcn import VESPCN\nfrom models.model_vsrnet import VSRnet\nfro...
[ [ "tensorflow.trainable_variables", "numpy.array", "tensorflow.train.latest_checkpoint", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.graph_util.convert_variables_to_constants", "numpy.transpose", "tensorflow.train.write_graph", "tensorflow.identity" ] ]
ArnovanHilten/NVFlare
[ "bb45e7d606849c6bc8f7542347459c6ba1be00c4" ]
[ "nvflare/private/fed/utils/numproto.py" ]
[ "# Copyright (c) 2021-2022, 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "numpy.load", "numpy.save" ] ]