repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
tensorflow/gnn
[ "c529f2a83230c028186f6c6754e17587e4ec90d1" ]
[ "tensorflow_gnn/graph/adjacency.py" ]
[ "\"\"\"GraphTensor adjacency types.\"\"\"\n\nfrom typing import Dict, Mapping, Optional, Tuple, Union\n\nimport tensorflow as tf\nfrom tensorflow_gnn.graph import graph_constants as const\nfrom tensorflow_gnn.graph import graph_piece as gp\nfrom tensorflow_gnn.graph import tensor_utils as utils\n\n# pylint: disable...
[ [ "tensorflow.control_dependencies", "tensorflow.shape", "tensorflow.identity", "tensorflow.python.framework.type_spec.register", "tensorflow.assert_equal", "tensorflow.TensorSpec" ] ]
jimfhahn/Annif
[ "1a35a273bbdda1f98ac98099fec1bc38e984f327", "1a35a273bbdda1f98ac98099fec1bc38e984f327" ]
[ "annif/util.py", "annif/suggestion.py" ]
[ "\"\"\"Utility functions for Annif\"\"\"\n\nimport glob\nimport os\nimport os.path\nimport tempfile\nimport numpy as np\nfrom annif import logger\nfrom annif.suggestion import VectorSuggestionResult\n\n\ndef atomic_save(obj, dirname, filename, method=None):\n \"\"\"Save the given object (which must have a .save(...
[ [ "numpy.average" ], [ "numpy.ones_like", "numpy.maximum", "numpy.zeros_like", "numpy.copyto", "numpy.argsort" ] ]
turoger/dgl
[ "4c7781f5c2a80f3b72c8888af10b6dbfbab3c31e", "4c7781f5c2a80f3b72c8888af10b6dbfbab3c31e" ]
[ "examples/pytorch/rgcn/experimental/write_mag.py", "python/dgl/dataloading/dataloader.py" ]
[ "import dgl\nimport json\nimport torch as th\nimport numpy as np\nfrom ogb.nodeproppred import DglNodePropPredDataset\nfrom pyinstrument import Profiler\n\n# Load OGB-MAG.\ndataset = DglNodePropPredDataset(name='ogbn-mag')\nhg_orig, labels = dataset[0]\nsubgs = {}\nfor etype in hg_orig.canonical_etypes:\n u, v =...
[ [ "numpy.stack", "torch.unique", "torch.nonzero", "torch.arange", "numpy.savetxt", "torch.stack" ], [ "numpy.isin" ] ]
Moonquakes/Tensorflow-lite-Demo
[ "20f00de6797c89bc1077ac165b11a3cc026d63cb", "20f00de6797c89bc1077ac165b11a3cc026d63cb" ]
[ "tensorflow/python/data/experimental/kernel_tests/serialization/cache_dataset_serialization_test.py", "tensorflow/python/data/experimental/ops/distribute_options.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.data.kernel_tests.test_base.default_test_combinations", "tensorflow.python.platform.test.main", "tensorflow.python.framework.combinations.combine", "tensorflow.python.data.ops.dataset_ops.Dataset.range" ], [ "tensorflow.python.data.util.options.create_option", "tenso...
MD-Studio/MDStudio_SMARTCyp
[ "92ebd48af891188d509c23e297437218c00ec136" ]
[ "examples/example_helpers.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas\nimport glob\n\nfrom rdkit import Chem\nfrom rdkit.Chem.Draw import rdMolDraw2D\n\nno_wrap_div = \"\"\"\n <div style=\"display: flex; flex-wrap: wrap; justify-content: space-around\">\n <div>{0}<div style=\"text-align:center\">Docking</div></div>\n <div>{1}<div...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
indudhiman/bragg-edge
[ "56af0a448534ef9cb5428879ba900e194dc05db2" ]
[ "ibeatles/step2/roi_handler.py" ]
[ "try:\n from PyQt4 import QtGui, QtCore\nexcept:\n from PyQt5 import QtGui, QtCore\nimport pyqtgraph as pg\nimport numpy as np\n\nimport ibeatles.step2.gui_handler\n\n\nclass Step2RoiHandler(object):\n \n def __init__(self, parent=None):\n self.parent = parent\n \n def save_table(self):...
[ [ "numpy.arange" ] ]
aw02m/Spiking_neural_networks
[ "4c23c50b52b15a9e5709cb672fd18cd22218b9f2", "4c23c50b52b15a9e5709cb672fd18cd22218b9f2" ]
[ "notebooks/bif-betaeps_third.py", "discrete_network/tests/test_cubic_calculation.py" ]
[ "import numpy as np\nimport torch\nfrom discrete_network.network import KNNet, KNNetParameters, KNNetState\nfrom discrete_network.method.force_method import ForceParameters, ForceLearn\nfrom discrete_network.device import device\nimport matplotlib.pyplot as plt\n\nprint(f\"Device = {device.type}\")\n\n# params_spik...
[ [ "torch.zeros", "torch.sqrt", "numpy.arange", "numpy.save", "torch.linalg.norm", "numpy.concatenate", "torch.log", "torch.rand", "numpy.array", "numpy.zeros", "torch.as_tensor" ], [ "torch.tensor", "torch.allclose", "torch.as_tensor", "torch.zeros" ...
arharvey918/python-dlpy
[ "423985ebe65acbcbe9a7996bb26aee5e66eddc49", "423985ebe65acbcbe9a7996bb26aee5e66eddc49" ]
[ "dlpy/model_conversion/sas_onnx_parse.py", "dlpy/tests/test_model.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n#\n# Copyright SAS Institute\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# ...
[ [ "numpy.array", "numpy.transpose", "numpy.clip" ], [ "numpy.array", "pandas.Timestamp", "numpy.array_equal" ] ]
jrobertson5151/nba2
[ "cb62ca73dc098cd7584ef5f3d7b2b50ef3fe9063" ]
[ "src/data/nba_data_player.py" ]
[ "import time\nimport requests\nimport urllib.request\nfrom bs4 import BeautifulSoup\nimport re\nfrom datetime import datetime\nimport pandas as pd\nfrom nba_driver import *\nimport numpy as np\nimport string\n\ndef get_player_soup(driver, player_id):\n soup = get_soup(driver,\n 'https://www.ba...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
nienkebrinkman/Moment_tensor_inversion
[ "f26d8a5a726b9055cfd841f8bf1958a9a828ac72", "f26d8a5a726b9055cfd841f8bf1958a9a828ac72" ]
[ "Get_Parameters.py", "Blindtest.py" ]
[ "# ---------------------------------------------------------------------------------------------------------------------#\n# Parameters [edit manually] #\n# ---------------------------------------------------------------------...
[ [ "numpy.array" ], [ "matplotlib.pylab.tight_layout", "matplotlib.pylab.vlines", "matplotlib.pylab.subplot", "numpy.log10", "matplotlib.pylab.figure", "matplotlib.pylab.plot", "matplotlib.pylab.legend", "matplotlib.pylab.savefig", "numpy.zeros", "matplotlib.pylab.clos...
Halo1236/Dive-into-DL-PyTorch
[ "586b4e9ca77b2121ce5f5bec8b0a893b33f1b574" ]
[ "mytorch/3.12-l2-regularization.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\ncreated by Halo 2020/10/28 11:28\nhttps://tangshusen.me/Dive-into-DL-PyTorch/#/chapter03_DL-basics/3.12_weight-decay\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport mytorch.d2lzh_pytorch as d2l\n\nn_train, n_test, num_inputs = 20, 10...
[ [ "torch.ones", "torch.zeros", "torch.randn", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.matmul", "torch.nn.Linear", "torch.nn.init.normal_", "torch.optim.SGD" ] ]
gohar94/nums
[ "2d8b0d7dd7b48c5b56641d4f03279b5ce2185db5", "2d8b0d7dd7b48c5b56641d4f03279b5ce2185db5", "2d8b0d7dd7b48c5b56641d4f03279b5ce2185db5" ]
[ "tests/core/array/test_bop.py", "nums/core/linalg.py", "tests/core/array/test_random.py" ]
[ "# coding=utf-8\n# Copyright (C) 2020 NumS Development 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# Unless requir...
[ [ "numpy.arange", "numpy.product", "numpy.tensordot" ], [ "numpy.eye" ], [ "numpy.max", "scipy.stats.uniform.cdf", "scipy.stats.norm.cdf", "numpy.min" ] ]
ph4ge/scikit-learn-mooc
[ "a8d0feded54d987fe88480e7ade7d218be69019e", "a8d0feded54d987fe88480e7ade7d218be69019e" ]
[ "python_scripts/trees_regression.py", "python_scripts/trees_sol_02.py" ]
[ "# %% [markdown]\n# # Decision tree for regression\n#\n# In this notebook, we present how decision trees are working in regression\n# problems. We show differences with the decision trees previously presented in\n# a classification setting.\n#\n# First, we load the penguins dataset specifically for solving a regres...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "sklearn.tree.DecisionTreeRegressor", "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "sklearn.linear_model.LinearRegression", "sklearn.tree.plot_tree" ], [ "m...
L706077/tensorflow_AlexNet
[ "3012d2455e4791c84b463b473a053f58bcf140ad" ]
[ "kaggle_mnist_alexnet_model.py" ]
[ "import tensorflow as tf\nimport ops as op\n\n\ndef input_placeholder(image_size, image_channel, label_cnt):\n with tf.name_scope('inputlayer'):\n inputs = tf.placeholder(\"float\", [None, image_size, image_size, image_channel], 'inputs')\n labels = tf.placeholder(\"float\", [None, label_cnt], 'lab...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.train.RMSPropOptimizer", "tensorflow.nn.max_pool", "tensorflow.scalar_summary", "tensorflow.placeholder", "tensorflow.name_scope", "tensorflow.argmax", "tensorflow.nn.dropout" ] ]
gegedenice/self-oa-barometre
[ "556d2ab968a3c59e300c62f238898e904c4d2054" ]
[ "app.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport base64\nimport os\nimport io\n\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output, State\nimport dash_table as dt\nimport dash_bootstrap_components as dbc\nfrom dash_extensions i...
[ [ "pandas.read_json" ] ]
oleurud/aipnd-project
[ "48049e8d30b4c4613884fee8ffebad4a7fdd0bdb" ]
[ "load_data.py" ]
[ "import torch\nfrom torchvision import datasets, transforms\n\n\ntrain_transforms = transforms.Compose([transforms.RandomRotation(30),\n transforms.RandomResizedCrop(224),\n transforms.RandomHorizontalFlip(),\n ...
[ [ "torch.utils.data.DataLoader" ] ]
SupermeLC/PyNeval
[ "2cccfb1af7d97857454e9cbc3515ba75e5d8d4b0" ]
[ "pyneval/metric/utils/klib/glib/Inputer.py" ]
[ "import glob\nimport os\nimport numpy as np\nfrom scipy import ndimage\nfrom PIL import Image\nimport tensorflow as tf\nfrom LabelDefinition import class_d_label\nimport cv2\nimport TiffFile\nimport pims\n\ndef readImageAndLabelFromFolders(paths,\n number=None,\n ...
[ [ "tensorflow.image.random_contrast", "tensorflow.FixedLenFeature", "numpy.asarray", "tensorflow.cast", "numpy.concatenate", "tensorflow.TFRecordReader", "tensorflow.random_shuffle", "tensorflow.image.random_flip_left_right", "tensorflow.decode_raw", "tensorflow.image.rgb_to_...
nguigs/pylearn-parsimony
[ "f712d2828823d6d55a2470ce060bcaeda2d0589a", "f712d2828823d6d55a2470ce060bcaeda2d0589a", "f712d2828823d6d55a2470ce060bcaeda2d0589a" ]
[ "parsimony/functions/neural.py", "parsimony/utils/plots.py", "parsimony/datasets/simulate/l1mu_l2_tvmu.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nThe :mod:`parsimony.functions.neural` module contains classes for neural\r\nnetworks.\r\n\r\nLoss functions should be stateless. Loss functions may be shared and copied\r\nand should therefore not hold anything that cannot be recomputed the next time\r\nit is called.\r\n\r\nCre...
[ [ "numpy.dot", "numpy.log", "numpy.maximum", "numpy.multiply", "numpy.clip", "numpy.asarray", "numpy.ones", "numpy.exp", "numpy.sign", "numpy.diag_indices", "numpy.tanh", "numpy.zeros", "numpy.sum", "numpy.divide" ], [ "numpy.dot", "scipy.spatial.V...
HiPERCAM/hcam_finder
[ "af2d598f56f3c347829d75906a3f37be25f3238c" ]
[ "hcam_finder/shapes.py" ]
[ "import pkg_resources\nimport numpy as np\nfrom astropy import units as u\n\nfrom ginga.util import wcs\nfrom ginga.canvas.types.all import Polygon, Path\nfrom ginga.util.bezier import get_bezier\n\nfrom hcam_widgets.compo.utils import field_stop_centre, gtc_focalplane_equivalencies\n\n\nclass CCDWin(Polygon):\n ...
[ [ "numpy.loadtxt", "numpy.linspace" ] ]
zysoong/ai-greedy-snake
[ "99e7dde9f623decda1f905cc9c576a011c466b4e", "99e7dde9f623decda1f905cc9c576a011c466b4e" ]
[ "ddqn.py", "adhdp.py" ]
[ "from greedysnake import GreedySnake, Direction, Signal\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import backend as K\nimport configparser\nimport sys\nimport warnings\nfrom collections import deque\nimport random\nwarnings.filterwarnings(\"ignore\")\nnp.set_p...
[ [ "tensorflow.keras.layers.Input", "tensorflow.keras.backend.set_value", "tensorflow.keras.models.clone_model", "numpy.sqrt", "tensorflow.nn.softmax", "tensorflow.keras.layers.Dense", "numpy.set_printoptions", "tensorflow.keras.optimizers.Adam", "numpy.argmax", "numpy.random....
skesamsetty/User-Data-Analysis
[ "864c619c8c87f2e6f62993da87df20b21de7ff07" ]
[ "Code/user_data_analyzer.py" ]
[ "# Function to send reports\ndef sendReportEmail():\n \"\"\"Based on From EMail ID, Password and To EMail ID from Config files,\n we are trying to send data from the gmail account.\n \"\"\"\n import smtplib\n from email.mime.text import MIMEText\n from email.mime.multipart import MIMEMultipart...
[ [ "pandas.concat", "pandas.read_csv", "pandas.read_sql_table", "pandas.json_normalize", "pandas.read_sql" ] ]
aleSuglia/py-bottom-up-attention
[ "a97142ad3526c11272c471ee7d610494f1247b7b" ]
[ "detectron2/modeling/postprocessing.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nfrom torch.nn import functional as F\n\nfrom detectron2.layers import paste_masks_in_image\nfrom detectron2.structures import Instances\n\n\ndef detector_postprocess(results, output_height, output_width, mask_threshold=0.5):\n \"\"\"\n R...
[ [ "torch.nn.functional.interpolate" ] ]
pyfar/sofar
[ "1f214e02d6e957ee0f56dca0566bb71a5105dd53" ]
[ "tests/test_sofar.py" ]
[ "import sofar as sf\nfrom sofar.sofar import (_update_conventions,\n _get_conventions,\n _format_value_for_netcdf,\n _format_value_from_netcdf,\n _atleast_nd,\n _nd_newaxis,\n ...
[ [ "numpy.ma.masked_array", "numpy.atleast_2d", "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros" ] ]
matcolgit/simulator_sib
[ "8d276d7bcb8a234adb76f64b00116414d355f1d1" ]
[ "sim/lib/settings/town_settings_tirschenreuth.py" ]
[ "import numpy as np\n\n'''\nSettings for town generation\n'''\n\ntown_name = 'Tirschenreuth'\n\n# Make sure to download country-specific population density data\n# from https://data.humdata.org/organization/facebook\npopulation_path='lib/data/population/population_deu_2019-07-01.csv' # Population density file\n\nsi...
[ [ "numpy.array" ] ]
drcut/mmediting
[ "e7f13f16dc63f1698d819248ed045983b35c0dbe", "e7f13f16dc63f1698d819248ed045983b35c0dbe", "e7f13f16dc63f1698d819248ed045983b35c0dbe" ]
[ "mmedit/models/backbones/sr_backbones/edvr_net.py", "mmedit/models/backbones/encoder_decoders/decoders/indexnet_decoder.py", "mmedit/models/backbones/sr_backbones/edsr.py" ]
[ "import torch\nimport torch.nn as nn\nfrom mmcv.cnn import ConvModule, constant_init, kaiming_init\nfrom mmcv.ops import ModulatedDeformConv2d, modulated_deform_conv2d\nfrom mmcv.runner import load_checkpoint\nfrom mmedit.models.common import (PixelShufflePack, ResidualBlockNoBN,\n ...
[ [ "torch.sigmoid", "torch.cat", "torch.nn.ModuleDict", "torch.nn.Conv2d", "torch.sum", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.Upsample", "torch.nn.LeakyReLU", "torch.nn.modules.utils._pair", "torch.chunk", "torch.stack" ], [ "torch.nn.ModuleList...
KiriKoppelgaard/NLP-E21
[ "d5ce2f739b06f3a7eae1825626a134fbc4b2314b" ]
[ "syllabus/classes/class5/neural_network_as_nnmodule.py" ]
[ "\"\"\"\nLogistic regression implemented using the nn.module class\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom sklearn import datasets\n\n\nclass Model(nn.Module):\n def __init__(self, n_input_features=10):\n super().__init__()\n self.linear1 = nn.Linear(n_input_features, 30)\n self...
[ [ "torch.sigmoid", "sklearn.datasets.make_classification", "torch.nn.BCELoss", "torch.tensor", "torch.nn.Linear" ] ]
mpc-msri-dev/EzPC
[ "a489c49d5c92f51df0277a7e5751e1b8baeb0bc1", "a489c49d5c92f51df0277a7e5751e1b8baeb0bc1", "a489c49d5c92f51df0277a7e5751e1b8baeb0bc1" ]
[ "Athos/Networks/SqueezeNetCIFAR10/Squeezenet_model.py", "Athos/HelperScripts/FindAccuracy_Porthos.py", "Athos/tests/tf/unittests/test_non_linear.py" ]
[ "'''\r\n\r\nAuthors: Nishant Kumar.\r\n\r\nCopyright:\r\nCopyright (c) 2020 Microsoft Research\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without ...
[ [ "tensorflow.get_variable", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.train.AdamOptimizer", "tensorflow.get_default_graph", "tensorflow.nn.conv2d", "tensorflow.Var...
KunyFox/MRTv2
[ "7b7a156be6f99082964227babd9e157708255b2c" ]
[ "mxmrt/from_tensorflow.py" ]
[ "from tensorflow_parser import TFParser\nfrom tensorflow.core.framework import tensor_pb2 as tpb2\nfrom tensorflow.core.framework import tensor_shape_pb2 as tspb2\nfrom tensorflow.core.framework import attr_value_pb2 as apb2\nfrom tensorflow.python.framework import dtypes\nimport mxnet as mx\nfrom mxnet import nd\n...
[ [ "numpy.product" ] ]
magenta/midi-ddsp
[ "3ff97496b42becead5289b349524b38f5b55d530" ]
[ "midi_ddsp/modules/ddsp_inference.py" ]
[ "# Copyright 2022 The MIDI-DDSP 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 required by...
[ [ "tensorflow.reshape", "tensorflow.concat", "tensorflow.keras.initializers.GlorotUniform" ] ]
bandarads/video_emotion_prediction
[ "65c4c6bfd9ee81375f1b26d62e59e64f736aae48" ]
[ "GB/ExtractwMASKGB.py" ]
[ "import numpy as np\r\nfrom cv2 import cv2\r\nimport os.path\r\nimport boundingbox\r\nimport CropMaskOverlay\r\nfrom pathlib import Path\r\nimport datetime\r\nimport uuid\r\n\r\nVIDEO_NUMBER = 266\r\n\r\n\r\n\r\nLM_FOLDER_PATH = \"\\\\Users\\\\George\\\\Documents\\\\Python\\\\ADS CapStone\\\\aff_wild_annotations_bb...
[ [ "numpy.array" ] ]
ajmal017/amp
[ "8de7e3b88be87605ec3bad03c139ac64eb460e5c", "8de7e3b88be87605ec3bad03c139ac64eb460e5c", "8de7e3b88be87605ec3bad03c139ac64eb460e5c", "8de7e3b88be87605ec3bad03c139ac64eb460e5c", "8de7e3b88be87605ec3bad03c139ac64eb460e5c", "8de7e3b88be87605ec3bad03c139ac64eb460e5c" ]
[ "im/kibot/notebooks/kibot_data_analysis.py", "core/feature_analyzer.py", "dev_scripts/to_clean/gen_utils.py", "core/dataflow/nodes/volatility_models.py", "core/notebooks/gallery_timeseries_study.py", "im/ib/data/extract/gateway/download_realtime_data.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.5.1\n# kernelspec:\n# display_name: Python [conda env:.conda-develop] *\n# language: python\n# name: conda-env-.conda-develop-...
[ [ "pandas.read_parquet" ], [ "matplotlib.pyplot.show", "pandas.DataFrame" ], [ "pandas.merge", "pandas.to_datetime", "pandas.ewmstd", "numpy.cumsum", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.all", "numpy.isneginf", "numpy.mean", "numpy.argmin",...
sokazaki/mmediting
[ "e1b544ed524892edc10f273805f920ecab2f5ff3", "e1b544ed524892edc10f273805f920ecab2f5ff3" ]
[ "mmedit/models/losses/perceptual_loss.py", "tests/test_search_transformer.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision.models.vgg as vgg\nfrom mmcv.runner import load_checkpoint\n\nfrom mmedit.utils import get_root_logger\nfrom ..registry import LOSSES\n\n\nclass PerceptualVGG(nn.Module):\n \"\"\"VGG network used in calculating perceptual loss.\n\n In this implementatio...
[ [ "torch.nn.MSELoss", "torch.nn.L1Loss", "torch.Tensor" ], [ "torch.randn" ] ]
Rohan-Chaudhury/aimet
[ "1c38cac8cc0fd32dca40ce5e39940805d29f7a4a", "1c38cac8cc0fd32dca40ce5e39940805d29f7a4a", "1c38cac8cc0fd32dca40ce5e39940805d29f7a4a", "1c38cac8cc0fd32dca40ce5e39940805d29f7a4a" ]
[ "TrainingExtensions/tensorflow/test/python/test_spatial_svd.py", "TrainingExtensions/torch/test/python/test_elementwise_ops.py", "NightlyTests/torch/test_cross_layer_equalization.py", "TrainingExtensions/torch/test/python/test_quantizer_GPU.py" ]
[ "# /usr/bin/env python3.5\n# -*- mode: python -*-\n# =============================================================================\n# @@-COPYRIGHT-START-@@\n#\n# Copyright (c) 2019, Qualcomm Innovation Center, Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# ...
[ [ "tensorflow.nn.bias_add", "tensorflow.Graph", "tensorflow.compat.v1.ConfigProto", "numpy.allclose", "numpy.array_equal", "tensorflow.keras.Input", "tensorflow.keras.layers.Conv2D", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.compat.v1.Session", "tensorflow.com...
jichangjichang/Paddle
[ "4fa3cee5499c6df0ad6043b0cfa220d09f2034e8", "4fa3cee5499c6df0ad6043b0cfa220d09f2034e8", "4fa3cee5499c6df0ad6043b0cfa220d09f2034e8", "4fa3cee5499c6df0ad6043b0cfa220d09f2034e8" ]
[ "python/paddle/fluid/transpiler/inference_transpiler.py", "python/paddle/fluid/tests/unittests/test_dist_train.py", "python/paddle/fluid/tests/unittests/test_rpn_target_assign_op.py", "python/paddle/fluid/tests/book/high-level-api/word2vec/test_word2vec_new_api.py" ]
[ "# Copyright (c) 2018 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 ...
[ [ "numpy.multiply", "numpy.subtract", "numpy.add", "numpy.array", "numpy.zeros", "numpy.divide" ], [ "numpy.allclose" ], [ "numpy.hstack", "numpy.expand_dims", "numpy.random.random", "numpy.arange", "numpy.ones", "numpy.transpose", "numpy.where", "...
shangliy/ee660
[ "c1345d61ddcc1122472358d55ac87ffc03441339" ]
[ "python/demos/ch02/bernoulliEntropyFig.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport matplotlib.pylab as pl\n\n\ndef entropy(p):\n \"\"\"calculate the entropy\"\"\"\n h = -p * np.log2(p) - (1 - p) * np.log2(1 - p)\n return h\n\nx = np.linspace(0.01, 0.99, 100)\ny = entropy(x)\n\npl.plot(x, y)\npl.xlabel('p(X=1)')\npl.ylabel('H(X)')\npl.s...
[ [ "matplotlib.pylab.show", "numpy.log2", "numpy.linspace", "matplotlib.pylab.ylabel", "matplotlib.pylab.plot", "matplotlib.pylab.savefig", "matplotlib.pylab.xlabel" ] ]
cabelo/depthai-experiments
[ "c90962aef58ab58a4326e068979e92aeec7e2f03" ]
[ "gen2_examples/02_mono_preview.py" ]
[ "#!/usr/bin/env python3\n\nimport cv2\nimport depthai as dai\nimport numpy as np\n\n# Start defining a pipeline\npipeline = dai.Pipeline()\n\n# Define a source - two mono (grayscale) cameras\ncam_left = pipeline.createMonoCamera()\ncam_left.setCamId(1)\ncam_left.setResolution(dai.MonoCameraProperties.SensorResoluti...
[ [ "numpy.ascontiguousarray" ] ]
Pverheijen/airflow
[ "dfe8337ca2d3ed173d9ecc112938271519792c40" ]
[ "airflow/providers/apache/hive/hooks/hive.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\")...
[ [ "pandas.DataFrame" ] ]
schwieni/acados
[ "a8aad1db6917739227c3da436f6f8e729e2872aa" ]
[ "interfaces/acados_template/acados_template/acados_sim_solver.py" ]
[ "# -*- coding: future_fstrings -*-\n#\n# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren,\n# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor,\n# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan,\n# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf,...
[ [ "numpy.ravel", "numpy.array", "numpy.zeros" ] ]
xr0038/jasmine_warpfield
[ "d3dc8306c30c955eea997e7cb69c1910df6a9515" ]
[ "challenge/case1/generate_case1.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom argparse import ArgumentParser as ap\nfrom astropy.table import QTable\nfrom astropy.coordinates import SkyCoord, Longitude, Latitude, Angle\nimport numpy as np\nimport astropy.units as u\nimport warpfield as w\nfrom warpfield.DUMMY import get_jasmine\n\ndescrip...
[ [ "numpy.random.uniform", "numpy.random.seed" ] ]
Kammerlo/keras-yolo3-serving
[ "9cc134388aa6f325f3b35f0a05e9cab380f81bb3" ]
[ "utils/letterboxlayer.py" ]
[ "from keras.engine import Layer\r\nimport tensorflow as tf\r\n\r\nclass LetterBoxLayer(Layer):\r\n\r\n def __init__(self,net_size,**kwargs):\r\n super(LetterBoxLayer, self).__init__(**kwargs)\r\n self.net_size = net_size\r\n\r\n # save config to save and load the keras model correctly\r\n def...
[ [ "tensorflow.constant", "tensorflow.shape", "tensorflow.maximum", "tensorflow.image.resize_images", "tensorflow.cast", "tensorflow.expand_dims" ] ]
zhut19/straxen
[ "25b92dd4f18b51700e6df83b230e58ec3bbb7163", "ffcf06ad86471caf11cc831f2ff68d70b59464af" ]
[ "tests/test_peaklet_processing.py", "tests/test_channel_split.py" ]
[ "import numpy as np\nfrom hypothesis import given, settings\nimport hypothesis.strategies as strat\n\nimport strax\nfrom strax.testutils import fake_hits\nimport straxen\nfrom straxen.plugins.peaklet_processing import get_tight_coin\n\n\n@settings(deadline=None)\n@given(strat.lists(strat.integers(min_value=0, max_v...
[ [ "numpy.unique", "numpy.sort", "numpy.ones", "numpy.max", "numpy.diff", "numpy.sum" ], [ "numpy.asarray", "numpy.arange", "numpy.testing.assert_array_equal", "numpy.unique" ] ]
jacobtomlinson/cuxfilter
[ "0b88a6b609d993b8d11629763c35dfb2b2581927" ]
[ "python/cuxfilter/tests/test_dashboard.py" ]
[ "import pytest\n\nimport cuxfilter\nimport cudf\nimport pandas as pd\nimport numpy as np\n\n\nclass TestDashBoard:\n\n df = cudf.DataFrame(\n {\"key\": [0, 1, 2, 3, 4], \"val\": [float(i + 10) for i in range(5)]}\n )\n cux_df = cuxfilter.DataFrame.from_dataframe(df)\n dashboard = cux_df.dashboard...
[ [ "numpy.array", "pandas.DataFrame" ] ]
archettialberto/neural_weighted_a_star
[ "a7172f1de81ad5cc7e301031f271ded3e93a2283", "a7172f1de81ad5cc7e301031f271ded3e93a2283" ]
[ "model/dnwa.py", "model/feature_extractor/combresnet18_pad.py" ]
[ "import torch\n\nfrom a_star.neighbor_utils import NeighborUtils\nfrom model.feature_extractor.fe_factory import get_feature_extractor\nfrom model.wh_model import WHModel\nfrom utils.collections import ModelSolution\n\n\nclass DNWA(WHModel):\n def __init__(self, **kwargs):\n super().__init__(**kwargs)\n ...
[ [ "torch.cuda.synchronize", "torch.rand", "torch.cuda.Stream", "torch.cuda.stream" ], [ "torch.mean", "torch.nn.Conv2d" ] ]
emolinaro/UCloud-Reports
[ "52eee04dee6db4cb67194aa9c88b261cfef2bcf5" ]
[ "2020/1/main.py" ]
[ "import pandas as pd\nimport streamlit as st\nimport plotly.express as px\nfrom PIL import Image\n\n\n@st.cache\ndef load_data(file):\n data = pd.read_csv(file)\n return data\n\n\n#####################\n### HTML SETTINGS ###\n#####################\n\nucloud_color = '#006AFF'\npwrai_color = 'red'\ndgx1_color =...
[ [ "pandas.concat", "pandas.read_csv" ] ]
eubchain/tfdistributedtestcase
[ "a81f99e051537fcd860de28587f0ab2bd9b1b5d4", "a81f99e051537fcd860de28587f0ab2bd9b1b5d4" ]
[ "4_nlp_processing/1_cnn_text_classify/text_cnn.py", "4_nlp_processing/1_cnn_text_classify/train_mul.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\nimport numpy as np\n\n\nclass TextCNN(object):\n \"\"\"\n A CNN for text classification.\n Uses an embedding layer, followed by a convolutional, max-pooling and softmax layer.\n \"\"\"\n def __init__(\n self, sequence_l...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.nn.conv2d", "tensorflow.name_scope", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.argmax", "tensorflow.nn...
MuellerDominik/P5-AIonFPGA
[ "13fc60fb973a4a87a4af1b49c17d5dd1fd239ed5" ]
[ "doc/report/graphics/originals/threshold.py" ]
[ "#!/usr/bin/env python3\n\n'''aionfpga ~ threshold graphic\nCopyright (C) 2020 Dominik Müller and Nico Canzani\n'''\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef y(t):\n return 0.4*np.sin(2*np.pi/4*t + np.pi/6) + 1.7\n\nt1 = np.linspace(-0.5, 8.5, 1001)\ny1 = y(t1)\n\nt2 = np.linspace(1, 8, 8)\ny...
[ [ "numpy.linspace", "numpy.asarray", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.sin", "matplotlib.pyplot.xlim", "matplotlib.pyplot.show", "numpy.sum" ] ]
deepface/caffe-face
[ "1add78b01945e64da96aeac3459c2f116866538d" ]
[ "testFLW/testFLW.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\npair = open('pair.txt', 'r').readlines()\npic1= []\nnum1 = []\npic2_num2 = []\nnum2 = []\nfor i in range(len(pair)):\n d = pair[i].split()\n if 0<len(d):\n pic1.append(d[0])\n else:\n pic1.append(None)\n if 1<len(d...
[ [ "numpy.dot", "numpy.linspace", "matplotlib.use", "numpy.arange", "scipy.io.loadmat", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.where", "matplotlib.pyplot.figure" ] ]
RAPNet/RAP
[ "83662d8d44190f2f32cb2a455881b74a76e782c0" ]
[ "panoptic_benchmark/utils/model_serialization.py" ]
[ "from collections import OrderedDict\nimport logging\n\nimport torch\n\nfrom panoptic_benchmark.utils.imports import import_file\n\n\ndef align_and_update_state_dicts(model_state_dict, loaded_state_dict):\n \"\"\"\n Strategy: suppose that the models that we will create will have prefixes appended\n to each...
[ [ "torch.as_tensor" ] ]
vikua/time-series-experiments
[ "2f9d3fa842866c39c8c1a9906c8c5d4870a6f7da", "2f9d3fa842866c39c8c1a9906c8c5d4870a6f7da" ]
[ "time_series_experiments/pipeline/tasks.py", "tests/nbeats/test_stacks.py" ]
[ "import abc\n\nimport attr\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.base import BaseEstimator\n\nfrom .data import TaskData, ColumnType\nfrom .dataset import VarType\n\n\nclass Task(abc.ABC):\n @abc.abstractmethod\n def fit(self, data: TaskData):\...
[ [ "numpy.unique", "numpy.isnan", "numpy.reshape", "numpy.arange", "sklearn.preprocessing.OneHotEncoder", "numpy.asarray", "numpy.concatenate", "numpy.vectorize", "numpy.mean", "numpy.searchsorted", "numpy.argsort", "pandas.Timestamp", "numpy.roll", "numpy.vsta...
Stihotvor/rattlesnake
[ "3affaa5df6b661c4b1d2799d58608f69d668d6e9" ]
[ "app.py" ]
[ "import time\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport pyaudio\nimport numpy as np\n\nmatplotlib.use('Agg')\n# https://stackoverflow.com/questions/7088672/pyaudio-working-but-spits-out-error-messages-each-time\n\n\nclass Plotter:\n def __init__(self):\n self.count = 0\n self.x =...
[ [ "numpy.abs", "numpy.invert", "matplotlib.pyplot.ylim", "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.frombuffer", "matplotlib.pyplot.xlim", "matplotlib.pyplot.figure" ] ]
twj2417/srf
[ "63365cfd75199d70eea2273214a4fa580a9fdf2a", "63365cfd75199d70eea2273214a4fa580a9fdf2a" ]
[ "srfnef/functions/crystal_to_id.py", "srfnef/functions/data_transform/pet_cylindrical.py" ]
[ "# encoding: utf-8\n'''\n@author: Minghao Guo\n@contact: mh.guo0111@gmail.com\n@software: nef\n@file: crystal_to_id.py\n@date: 6/14/2019\n@desc:\n'''\n\nimport numpy as np\nfrom srfnef import nef_class\nfrom srfnef.geometry import PetEcatScanner\n\n\n@nef_class\nclass CrystalToId:\n def __call__(self, crystal_po...
[ [ "numpy.cos", "numpy.sin", "numpy.round", "numpy.arctan2", "numpy.floor", "numpy.zeros" ], [ "numpy.hstack", "scipy.sparse.coo_matrix" ] ]
KevinMusgrave/pytorch-adapt
[ "947b9f1b748d2078cecbf4a00c34f73108d9ecde", "ff1491e1bfcc586afb8ee619712c8816ddf10358", "947b9f1b748d2078cecbf4a00c34f73108d9ecde", "ff1491e1bfcc586afb8ee619712c8816ddf10358" ]
[ "tests/datasets/test_mnistm.py", "src/pytorch_adapt/hooks/domain_confusion.py", "tests/layers/test_randomized_dot_product.py", "tests/hooks/test_itl.py" ]
[ "import unittest\n\nimport torch\nimport tqdm\nfrom torchvision import transforms as torch_transforms\n\nfrom pytorch_adapt.datasets import MNISTM\nfrom pytorch_adapt.utils.constants import IMAGENET_MEAN, IMAGENET_STD\n\nfrom .. import DATASET_FOLDER, RUN_DATASET_TESTS\nfrom .utils import skip_reason\n\n\nclass Tes...
[ [ "torch.utils.data.DataLoader" ], [ "torch.nn.CrossEntropyLoss" ], [ "torch.Size", "torch.mm", "torch.randn", "torch.tensor", "torch.isclose" ], [ "torch.manual_seed", "torch.cat" ] ]
CornsSalinas/corns-dicompyler-core
[ "3c88b713fa167fa90541de2040bf5672a93ac9c8" ]
[ "dicompylercore/dicomparser.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# dicomparser.py\n\"\"\"Class that parses and returns formatted DICOM RT data.\"\"\"\n# Copyright (c) 2009-2016 Aditya Panchal\n# Copyright (c) 2009-2010 Roy Keyes\n# This file is part of dicompyler-core, released under a BSD license.\n# See the file license.txt i...
[ [ "numpy.matrix", "numpy.amax", "numpy.amin", "numpy.memmap", "numpy.round", "numpy.argmin", "numpy.array", "numpy.fabs" ] ]
ioannis-vm/RESSPyLab
[ "306fc24d5f8ece8f2f2de274b56b80ba2019f605", "306fc24d5f8ece8f2f2de274b56b80ba2019f605", "306fc24d5f8ece8f2f2de274b56b80ba2019f605", "306fc24d5f8ece8f2f2de274b56b80ba2019f605", "306fc24d5f8ece8f2f2de274b56b80ba2019f605", "306fc24d5f8ece8f2f2de274b56b80ba2019f605" ]
[ "RESSPyLab/model_minimizer.py", "RESSPyLab/sqp_solver.py", "RESSPyLab/uvc_model.py", "RESSPyLab/vc_parameter_identification.py", "examples/sample_multi_run.py", "RESSPyLab/uvc_limited_info_opt.py" ]
[ "\"\"\"@package model_minimizer\nModel minimizer method to solve the trust-region subproblem.\n\"\"\"\nimport numpy as np\nfrom numpy import linalg as la\n\nfrom .posdef_check import posdef_check\n\nTOL = np.sqrt(np.finfo(float).eps)\n\n\ndef h_lambda(evals, evecs, lam):\n \"\"\" Returns the positive definite H ...
[ [ "numpy.diag", "numpy.linalg.solve", "numpy.abs", "numpy.sqrt", "numpy.linalg.eig", "numpy.matmul", "numpy.linalg.norm", "numpy.finfo", "numpy.shape", "numpy.argmin", "numpy.linalg.cholesky" ], [ "numpy.logical_not", "numpy.finfo", "numpy.row_stack", ...
vinoo999/alpha-zero-general
[ "01bd6ac40d7b1fed97a84e37f7a549be8d50f668" ]
[ "Arena.py" ]
[ "from pytorch_classification.utils import Bar, AverageMeter\nimport multiprocessing as mp\nimport numpy as np\nimport time, copy\nfrom utils import *\n\nclass Arena():\n \"\"\"\n An Arena class where any 2 agents can be pit against each other.\n \"\"\"\n def __init__(self, player1, player2, game, displa...
[ [ "numpy.where" ] ]
opimentel-github/sne-lightcurves-synthetic
[ "4273ac6dc8defd25d257f9ef6a1115510a71b3d2" ]
[ "synthsne/generators/time_meshs.py" ]
[ "from __future__ import print_function\nfrom __future__ import division\nfrom . import _C\n\nimport numpy as np\n\n###################################################################################################################################################\n\ndef get_random_time_mesh(ti, tf, min_dt):\n\tif tf...
[ [ "numpy.sort", "numpy.concatenate", "numpy.random.permutation", "numpy.random.uniform", "numpy.array" ] ]
daeseoklee/DeepPocket
[ "a20904e3c9ab8acbb498aa40aee91ac99149dc66" ]
[ "segment_pockets.py" ]
[ "'''\nSegment out pocket shapes from top ranked pockets\n'''\nimport torch\nimport torch.nn as nn\nfrom unet import Unet\nimport numpy as np\nimport logging\nimport argparse\nimport wandb\nimport sys\nimport os\nimport molgrid\nfrom skimage.morphology import binary_dilation\nfrom skimage.morphology import cube\nfro...
[ [ "torch.zeros", "torch.load", "scipy.spatial.distance.cdist", "torch.tensor", "numpy.argwhere", "numpy.any", "torch.cuda.is_available", "torch.nn.DataParallel", "numpy.where" ] ]
npucino/hylite
[ "dff1314a2a0c281fd2fc1a5ee03bdba3e0c49f28", "dff1314a2a0c281fd2fc1a5ee03bdba3e0c49f28" ]
[ "hylite/correct/panel.py", "hylite/project/basic.py" ]
[ "import matplotlib.pyplot as plt\nfrom matplotlib import path\nimport numpy as np\nfrom scipy.optimize import least_squares\nimport matplotlib.patches as patches\nimport cv2\n\nimport hylite\nfrom hylite.reference.features import HyFeature\nfrom hylite import HyData\nfrom hylite.project import pix_to_ray_pano, pix_...
[ [ "numpy.nanmax", "numpy.dot", "matplotlib.pyplot.imshow", "numpy.nanmedian", "numpy.sqrt", "numpy.nanmin", "numpy.max", "numpy.mean", "numpy.nanmean", "numpy.cross", "matplotlib.patches.PathPatch", "scipy.optimize.least_squares", "matplotlib.pyplot.figure", "...
miiklay/pymapd
[ "4665ea704eb7ffabf72048f1cb3519b4497b8830", "4665ea704eb7ffabf72048f1cb3519b4497b8830" ]
[ "tests/test_ipc.py", "pymapd/_parsers.py" ]
[ "import os\nimport pytest\n\npa = pytest.importorskip(\"pyarrow\")\npd = pytest.importorskip(\"pandas\")\n\nimport numpy as np # noqa\nimport pandas.util.testing as tm # noqa\nfrom pymapd._parsers import _load_schema, _load_data # noqa\n\nHERE = os.path.dirname(__file__)\n\n\ndef make_data_batch():\n arrow_ve...
[ [ "pandas.util.testing.assert_frame_equal", "numpy.random.seed", "numpy.random.randint" ], [ "numpy.dtype" ] ]
yvesnana/rxnaamapper
[ "48fb6a6f45f5ec087f99cedbac34eda2a65e14a3" ]
[ "src/rxn_aa_mapper/training.py" ]
[ "\"\"\"Training utilities.\"\"\"\nimport os\nfrom typing import Any, Dict, Union\n\nimport pytorch_lightning as pl\nimport torch\nfrom loguru import logger\nfrom pytorch_lightning.callbacks.base import Callback\nfrom pytorch_lightning.callbacks.early_stopping import EarlyStopping\nfrom pytorch_lightning.callbacks.m...
[ [ "torch.cuda.is_available" ] ]
sash-a/Mava
[ "976d0863e058fd92f066d8a8fabe2f5e2f3f60ce", "976d0863e058fd92f066d8a8fabe2f5e2f3f60ce" ]
[ "tests/adders/episode_adders_test_data.py", "mava/utils/environments/RoboCup_env/robocup_utils/trainer.py" ]
[ "import dm_env\nimport numpy as np\n\nfrom mava.adders.reverb import base\nfrom mava.utils.wrapper_utils import parameterized_restart, parameterized_termination\nfrom tests.adders.adders_utils import make_sequence, make_trajectory\n\nagents = {\"agent_0\", \"agent_1\", \"agent_2\"}\nreward_step1 = {\"agent_0\": 0.0...
[ [ "numpy.array", "numpy.random.random_sample" ], [ "numpy.random.randint" ] ]
willu47/energy_demand
[ "59a2712f353f47e3dc237479cc6cc46666b7d0f1", "59a2712f353f47e3dc237479cc6cc46666b7d0f1" ]
[ "energy_demand/geography/WeatherRegion.py", "energy_demand/charts/figure_HHD_gas_demand.py" ]
[ "\"\"\"\nWeather Region\n===============\nDepending on the number of weather stations, a ``WeatherRegion``\nis generated per weather station. Within this regions,\nregional load profiles are calculated.\n\n\"\"\"\nfrom datetime import date\nimport uuid\nimport numpy as np\nfrom energy_demand.technologies import tec...
[ [ "numpy.max", "numpy.zeros", "numpy.sum" ], [ "numpy.linspace", "matplotlib.pyplot.plot", "scipy.stats.linregress", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
dstarkey23/vessel_detection_satellite_imagery
[ "f00faee230499f094e0df50f5985a3f6422ed0be" ]
[ "vessel_detection.py" ]
[ "#image analysis project from vtx\n#add training dataset from kaggle project\n#https://www.kaggle.com/rhammell/ships-in-satellite-imagery\n#paper https://www.irjet.net/archives/V6/i9/IRJET-V6I9291.pdf\n\nimport numpy as np\nimport matplotlib.pylab as plt\nimport json\nfrom sklearn.model_selection import train_test_...
[ [ "matplotlib.pylab.tight_layout", "matplotlib.pylab.show", "numpy.unique", "sklearn.model_selection.train_test_split", "sklearn.metrics.roc_curve", "numpy.round", "numpy.argmax", "matplotlib.pylab.figure", "numpy.shape", "numpy.transpose", "numpy.argsort", "sklearn.m...
nevaan9/Python-Data-Cleaning-Cookbook
[ "c40322673ad93f59a3fe183fcd881e61053001f2", "c40322673ad93f59a3fe183fcd881e61053001f2", "c40322673ad93f59a3fe183fcd881e61053001f2" ]
[ "06 - Cleaning and Exploring data with Series/1. series_basics.py", "07 - Fixing Messy Data When Aggregating/1. row_iteration.py", "09 - Tidying and Reshaping/2. many_to_many_reshape.py" ]
[ "# import pandas and load nls data\nimport pandas as pd\npd.set_option('display.width', 78)\npd.set_option('display.max_columns', 7)\npd.set_option('display.max_rows', 200)\npd.options.display.float_format = '{:,.2f}'.format\nnls97 = pd.read_csv(\"data/nls97b.csv\")\nnls97.set_index(\"personid\", inplace=True)\n\n#...
[ [ "pandas.set_option", "pandas.read_csv" ], [ "pandas.set_option", "pandas.read_csv", "pandas.DataFrame" ], [ "pandas.merge", "pandas.read_csv" ] ]
BingqingCheng/ASAP
[ "d34a064cd7e409ad8b5ae0dec4f1c0a621717773", "d34a064cd7e409ad8b5ae0dec4f1c0a621717773", "d34a064cd7e409ad8b5ae0dec4f1c0a621717773", "d34a064cd7e409ad8b5ae0dec4f1c0a621717773" ]
[ "asaplib/compressor/sparsifier.py", "deprecated/frame_select_deprecated.py", "tests/test_frame_select.py", "deprecated/gen_LMBTR_descriptors_deprecated.py" ]
[ "\"\"\"\nsparsifier class\n\"\"\"\n\nfrom asaplib.compressor import random_split, fps, CUR_deterministic\n\nclass Sparsifier:\n def __init__(self, sparse_mode):\n \"\"\"\n Object handing the sparsification of data\n Parameters\n ----------\n sparse_mode: str\n ...
[ [ "numpy.asmatrix" ], [ "numpy.dot", "numpy.random.choice", "numpy.asarray", "numpy.genfromtxt", "numpy.asmatrix", "numpy.shape", "numpy.random.rand", "numpy.exp", "numpy.zeros", "numpy.sum" ], [ "numpy.shape" ], [ "numpy.savetxt", "numpy.unique" ...
tere-valdivia/icy_tower_tarea
[ "8f5def11bda593c181b140b97fcb452828c84dd6" ]
[ "Fondo.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 12 11:46:51 2017\n\n@author: terevaldivia\n\"\"\"\nimport os\nfrom CC3501Utils_personal import *\nimport numpy as np\n\nclass Fondo(Figura):\n \n def __init__(self, pos=Vector(0, 0), rgb=(1.0, 1.0, 1.0)):\n super(Fondo, self)....
[ [ "numpy.linspace" ] ]
douglascoenen/cbsyst
[ "79b9a1b549d598c10739129afecea4e0269020c8" ]
[ "cbsyst/cbsyst.py" ]
[ "import numpy as np\nfrom cbsyst.helpers import Bunch, maxL\nfrom cbsyst.MyAMI_V2 import MyAMI_K_calc, MyAMI_K_calc_multi\nfrom cbsyst.carbon_fns import *\nfrom cbsyst.boron_fns import *\nfrom cbsyst.helpers import ch, cp, NnotNone, calc_TF, calc_TS, calc_TB, calc_pH_scales\nfrom cbsyst.non_MyAMI_constants import *...
[ [ "numpy.array", "numpy.divide" ] ]
CUAI/Non-Homophily-Benchmarks
[ "af14a88470d30b1dadd3803d911dfc1064bcf172" ]
[ "dataset.py" ]
[ "from collections import defaultdict\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport scipy\nimport scipy.io\nfrom sklearn.preprocessing import label_binarize\nfrom ogb.nodeproppred import NodePropPredDataset\n\nfrom load_data import load_twitch, load_fb100, DATAPATH\nfrom data_utils impor...
[ [ "numpy.hstack", "numpy.expand_dims", "numpy.unique", "scipy.io.loadmat", "torch.tensor", "torch.where", "numpy.array", "numpy.empty", "torch.as_tensor" ] ]
sherwyn11/Sudoku-AI
[ "41166fd51337090eb1d86b3715bd57b538643a5d" ]
[ "recognition/recognition.py" ]
[ "import numpy as np\nimport cv2\n\nfrom helpers.constants import MODEL_PATH, DIGITS_PATH, DIGIT_RECOGNIZER_MODEL_NAME\nfrom helpers.helpers import preprocess_image, check_if_white\nfrom keras.models import load_model\n\n\nclass DigitRecognition:\n\n def __init__(self):\n '''\n Init function\n ...
[ [ "numpy.argmax" ] ]
konyul/monovideo
[ "f50db55c324c2ab4a66d414b47f0558b72a3a009", "f50db55c324c2ab4a66d414b47f0558b72a3a009", "f50db55c324c2ab4a66d414b47f0558b72a3a009", "f50db55c324c2ab4a66d414b47f0558b72a3a009" ]
[ "tests/test_data/test_datasets/test_lyft_dataset.py", "mmdet3d/ops/knn/knn.py", "mmdet3d/datasets/kitti_mono_dataset.py", "mmdet3d/core/bbox/coders/monoflex_bbox_coder.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport mmcv\nimport numpy as np\nimport tempfile\nimport torch\n\nfrom mmdet3d.core import limit_period\nfrom mmdet3d.datasets import LyftDataset\n\n\ndef test_getitem():\n np.random.seed(0)\n torch.manual_seed(0)\n root_path = './tests/data/lyft'\n # in...
[ [ "numpy.allclose", "numpy.random.seed", "torch.manual_seed", "torch.tensor", "torch.allclose", "numpy.array" ], [ "torch.cuda.set_device", "torch.cuda.current_device" ], [ "numpy.minimum", "torch.max", "numpy.maximum", "torch.cat", "numpy.linalg.inv", ...
kwonsungil/Faster-RCNN
[ "673879871a87f60d992eae24e0d8c6a6c0a22cec", "673879871a87f60d992eae24e0d8c6a6c0a22cec" ]
[ "models/Faster_RCNN_backup.py", "utils/faster_rcnn/roi.py" ]
[ "import tensorflow as tf\r\nimport numpy as np\r\nimport os\r\nfrom config.config_Faster_RCNN import cfg\r\nimport cv2\r\nfrom utils.faster_rcnn.anchors import *\r\nfrom utils.faster_rcnn.roi import proposal_target\r\nimport time\r\nfrom utils.faster_rcnn.load_coco import preprocess\r\n\r\n\r\n# from utils.faster_r...
[ [ "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.image.non_max_suppression", "tensorflow.GPUOptions", "tensorflow.train.AdamOptimizer", "tensorflow.to_int32", "tensorflow.summary.scalar", ...
featherineaugustus/Traffic-Flow-Prediction
[ "d49a74795f61c4ae47b6559b68a555c5f12b92a8" ]
[ "main_forcasting.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Mar 26 09:40:28 2022\r\n\r\n@author: Featherine\r\n\"\"\"\r\n\r\nimport pandas as pd\r\n\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.dates as md\r\n\r\nimport numpy as np\r\n\r\nimport sklearn\r\nfrom sklearn.model_selection import train_test_split\r\...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "pandas.to_datetime", "sklearn.metrics.r2_score", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.min", "matplotlib.pyplot.ylim", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.savefig", "pand...
MKLab-ITI/pygrank
[ "dc1793374d11f0b51c86a92cd5f40b34d5eb42ae" ]
[ "pygrank/core/backend/numpy.py" ]
[ "import numpy as np\nfrom numpy import abs, sum, exp, log, copy, repeat, min, max, dot, mean, diag, ones\nfrom scipy.sparse import eye\n\n\ndef backend_init():\n pass\n\n\ndef graph_dropout(M, _):\n return M\n\n\ndef separate_cols(x):\n return [x[:, col_num] for col_num in range(x.shape[1])]\n\n\ndef combi...
[ [ "numpy.finfo", "numpy.copy", "numpy.column_stack", "numpy.array", "numpy.sum" ] ]
hiflyin/Advanced-Feature-Processing-Lib
[ "f14df8d5cdb10f6a166e08353f3830233a22447b" ]
[ "feature_stuff/categorical.py" ]
[ "\nimport pandas as pd\nimport numpy as np\nfrom sklearn.preprocessing import LabelEncoder\nimport gc\n\n\ndef encode_labels(df, cols = None):\n '''\n Inputs:\n df: a pandas dataframe containing the column for which to calculate target encoding (categ_col)\n cols: all columns' names for which to...
[ [ "pandas.concat", "sklearn.preprocessing.LabelEncoder", "pandas.isnull", "pandas.get_dummies" ] ]
mikepm35/biopython
[ "120616cf0d28cb8e581898afd6604e5a2065a137" ]
[ "Tests/test_SVDSuperimposer.py" ]
[ "# Copyright 2017 by Maximilian Greil. All rights reserved.\n# This code is part of the Biopython distribution and governed by its\n# license. Please see the LICENSE file that should have been included\n# as part of this package.\n\n\"\"\"Tests for SVDSuperimposer module.\"\"\"\n\nimport unittest\n\ntry:\n fro...
[ [ "numpy.dot", "numpy.array", "numpy.around" ] ]
Alanapiereid/Streamlit_KERAS_LSTM_Fake_News
[ "4e2b88eb7b9f13ccf95d87a70afb946211db0059" ]
[ "Streamlit_app.py" ]
[ "import streamlit as st\nimport tensorflow as tf\nfrom tensorflow.keras.models import model_from_json\nfrom tensorflow.keras.losses import BinaryCrossentropy\nimport numpy as np\nfrom tensorflow.keras.preprocessing import text\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\nfrom tensorflow.keras...
[ [ "tensorflow.keras.preprocessing.sequence.pad_sequences" ] ]
brooklynbagel/Voice-Cloning-App
[ "6e0034dc0b4e21f669d28753b5f30b32cca382ad" ]
[ "glow.py" ]
[ "# *****************************************************************************\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redis...
[ [ "torch.sigmoid", "torch.cat", "torch.nn.utils.weight_norm", "torch.nn.ModuleList", "torch.IntTensor", "torch.zeros_like", "torch.det", "torch.nn.utils.remove_weight_norm", "torch.nn.functional.conv1d", "torch.tanh", "torch.sum", "torch.logdet", "torch.exp", ...
lzcn/torchutils
[ "8dc78ddcde72f27758e9774f3d1f5f6172e1a5e9" ]
[ "tests/torchutils/io/test_saver.py" ]
[ "import os\n\nimport torch.nn as nn\nfrom torchutils.io import ModelSaver\n\nmodel = nn.Linear(1, 1)\n\n\ndef test_saver_epoch(tmp_path):\n n_saved = 5\n num_epochs = 10\n saver = ModelSaver(tmp_path, filename_prefix=\"net\", score_name=\"score\", n_saved=n_saved)\n for epoch in range(num_epochs):\n ...
[ [ "torch.nn.Linear" ] ]
aniqueakhtar/PointCloudUpsampling
[ "21fcb829e2ed0a1ade5e9f887f4a6231efa6425a" ]
[ "pre_post_processing/test_results_GPU.py" ]
[ "import glob\nimport open3d as o3d\nimport numpy as np\nimport os\nfrom utils.pc_error_wrapper import pc_error\nfrom pytorch3d.loss import chamfer_distance\nimport torch\nimport pandas as pd\n\norig_pc = '/home/anique/Upsampling_3/Data/8i_test/orig/'\ninput_pc = '../Data/8i_test/8x/'\noutput_pc = 'results/8x_0x_ks5...
[ [ "torch.device", "numpy.asarray", "pandas.DataFrame", "torch.tensor" ] ]
mackelab/pyloric
[ "ff0fa2f0838e732f83823a7ff9c4d19e89483994" ]
[ "pyloric/utils/circuit_parameters.py" ]
[ "import numpy as np\nfrom typing import Dict, Tuple, Optional, List\nimport pandas as pd\nfrom torch import Tensor\nfrom typing import Union\n\n\ndef create_neurons(neuron_list):\n prinz_neurons = {\n \"LP\": {\n \"LP_0\": [100, 0, 8, 40, 5, 75, 0.05, 0.02], # this3 g_CaS g_A g_Kd\n ...
[ [ "numpy.asarray", "numpy.concatenate", "numpy.reshape", "pandas.DataFrame" ] ]
BiancaMT25/darts
[ "bb550dede6d8927a45aea0d9f3df53de32a6eee2" ]
[ "darts/metrics/metrics.py" ]
[ "\"\"\"\nMetrics\n-------\n\nSome metrics to compare time series.\n\"\"\"\n\nimport numpy as np\nfrom ..timeseries import TimeSeries\nfrom ..utils import _parallel_apply, _build_tqdm_iterator\nfrom ..utils.statistics import check_seasonality\nfrom ..logging import raise_if_not, get_logger, raise_log\nfrom warnings ...
[ [ "numpy.log", "numpy.abs", "numpy.isnan", "numpy.logical_or", "numpy.delete", "numpy.mean", "numpy.sum", "numpy.isclose" ] ]
benmaier/DigCT
[ "62fc3fddb7600e2a43761e08618b2e3df423569c", "62fc3fddb7600e2a43761e08618b2e3df423569c" ]
[ "analysis_collection/tracing_sim/results_deleting_edges_30_N_meas_100/FigS7_1.py", "analysis_collection/tracing_sim/results_smallworld_withQ_halfreact_NMEAS_100_ONLYSAVETIME_False/simulation.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as pl\nimport pickle\nfrom epipack.plottools import plot\nimport qsuite_config as cf\nimport matplotlib.ticker as mtick\n\nwith open('_qsuite/results_deleting_edges_30_N_meas_100/results_mean_std.p','rb') as f:\n data = pickle.load(f)\n\nmeans = data['means']\nstds =...
[ [ "numpy.sqrt", "matplotlib.pyplot.subplots", "numpy.cov", "numpy.diff", "matplotlib.pyplot.show", "matplotlib.ticker.PercentFormatter" ], [ "scipy.stats.expon.rvs", "numpy.linspace", "numpy.random.choice", "numpy.random.permutation", "numpy.random.binomial", "num...
laobadao/TF_VS_Caffe
[ "943b47daefa42f07db285a331647d09669085f9f", "943b47daefa42f07db285a331647d09669085f9f", "943b47daefa42f07db285a331647d09669085f9f" ]
[ "processor/utils/label_map_util.py", "np_processor/processor/np_utils/visualization_utils.py", "lib_pro/processor/utils/grid_anchor_generator.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.gfile.GFile" ], [ "tensorflow.concat", "numpy.cumsum", "tensorflow.map_fn", "numpy.histogram", "tensorflow.py_func", "numpy.ones_like", "tensorflow.summary.image", "numpy.uint8", "numpy.arange", "numpy.ceil", "matplotlib.pyplot.figure", "tensorfl...
sirdr/magenta
[ "a1a78f08eff27951146196cc772296520a44f57b" ]
[ "magenta/models/nsynth/reader.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.log", "tensorflow.FixedLenFeature", "tensorflow.slice", "tensorflow.reshape", "tensorflow.cast", "tensorflow.squeeze", "tensorflow.random_crop", "tensorflow.logging.info", "tensorflow.pad", "tensorflow.TFRecordReader", "tensorflow.train.batch", "tensorflow.pa...
agrippa/hpc-bootcamp
[ "7db008557a48e7a6d9eae2df2371a3c7b9f0678c" ]
[ "src/14_tf_regress/linear_regression.py" ]
[ "'''\nA linear regression learning algorithm example using TensorFlow library.\n\nThis example constructs a simple linear model of Y = W * X + b, using a gradient\ndescent optimizer to minize model error.\n\nAuthor: Aymeric Damien\nProject: https://github.com/aymericdamien/TensorFlow-Examples/\n'''\n\nfrom __future...
[ [ "numpy.fromfile", "tensorflow.multiply", "tensorflow.pow", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.Session" ] ]
mmagnuski/sarna
[ "0b4b7a5a9d4747724ff739c4e11bbbda1b286e92", "0b4b7a5a9d4747724ff739c4e11bbbda1b286e92" ]
[ "sarna/edu.py", "sarna/freq.py" ]
[ "import os\nimport platform\nimport importlib\n\nimport numpy as np\n\n\ndef test_system():\n '''Print simple system info and some other junk, just to see if\n system has been set up and homeworks are from different machines.'''\n\n try:\n import mne\n except ImportError:\n raise ImportErr...
[ [ "scipy.fftpack.ifft", "numpy.abs", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.ones", "scipy.fftpack.fft", "numpy.array", "numpy.random.randint" ], [ "numpy.nanpercentile", "numpy.unique", "numpy.isnan", "scipy.stats.zscore", "numpy.stack", "num...
elviswf/pytorch_cv
[ "a7f11f857a0c1d5e5a807aeed5e594659212fba0", "a7f11f857a0c1d5e5a807aeed5e594659212fba0", "a7f11f857a0c1d5e5a807aeed5e594659212fba0" ]
[ "models/focalLoss.py", "cub_attr1.py", "cub_deepRIS.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@Time : 2018/2/9 16:18\n@Author : Elvis\n\"\"\"\n\"\"\"\n focalLoss.py\n \n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass FocalLoss(nn.Module):\n \"\"\"\n This criterion is a implemenation ...
[ [ "torch.nn.functional.softmax", "torch.ones", "torch.pow", "torch.autograd.Variable" ], [ "torch.optim.Adam", "torch.nn.CrossEntropyLoss", "torch.max", "torch.load", "torch.autograd.Variable", "torch.cuda.is_available", "torch.save" ], [ "torch.optim.Adam", ...
BitShifter88/DeepLearning
[ "921048b2529911b44dfec98da640fb623f2dfd80" ]
[ "src/chartNN/model/multi_scale_one5x5.py" ]
[ "import torch.nn as nn\r\nimport math\r\nimport torch.utils.model_zoo as model_zoo\r\n\r\nimport torch\r\n\r\ndef conv3x3(in_planes, out_planes, stride=1):\r\n \"\"\"3x3 convolution with padding\"\"\"\r\n return nn.Conv1d(in_planes, out_planes, kernel_size=3, stride=stride,\r\n padding=1, ...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Sequential", "torch.cat", "torch.nn.MaxPool1d", "torch.nn.Linear", "torch.nn.Conv1d", "torch.nn.ReLU", "torch.nn.AvgPool1d" ] ]
andycasey/sick
[ "6c37686182794c4cafea45abf7062b30b789b1a2" ]
[ "sick/models/create.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\" Create models for *sick* \"\"\"\n\nfrom __future__ import division, print_function\n\n__all__ = (\"create\", )\n__author__ = \"Andy Casey <arc@ast.cam.ac.uk>\"\n\nimport cPickle as pickle\nimport logging\nimport os\nimport yaml\nfrom time import strftime\n\n...
[ [ "numpy.hstack", "numpy.memmap", "numpy.array", "numpy.loadtxt" ] ]
gwaygenomics/nf1_inactivation
[ "09c6292448cb121b3077a3df1399fc6d4d56d5d8" ]
[ "scripts/util/cancer_cv.py" ]
[ "'''\n(C) Gregory Way 2016\nNF1 Inactivation Classifier for Glioblastoma\ncancer_cv.py\n\nDescription:\nClasses to perform cross validation on pancan datasets\n\nUsage:\nImport only\n'''\n\n\nclass cancer_cv(object):\n \"\"\"\n A class to determine cross validation intervals for pancancer tissues with\n ca...
[ [ "pandas.concat", "pandas.DataFrame", "numpy.random.choice" ] ]
NCAR/solar-forcing
[ "5e7baf7656bd5b7b89672fc9d7ad5011b06bb722" ]
[ "solarforcing/calc.py" ]
[ "import numpy as np\nfrom numba import jit, jit_module\nimport pydantic\nfrom datetime import datetime\nfrom scipy import integrate\nimport xarray as xr\n\n@jit(nopython=True)\ndef gen_energy_grid(nbins, min_e=30., max_e=1000.):\n \"\"\"Generate a grid of energies for the flux spectrum\n \n This function g...
[ [ "numpy.log", "numpy.radians", "numpy.cosh", "numpy.arange", "numpy.arccos", "numpy.cos", "numpy.exp", "numpy.log10", "scipy.integrate.simps", "numpy.array", "numpy.empty" ] ]
mdiephuis/pytorch_sparse
[ "328aaf2f92cdc37c8daa2d38c53c995ffbd743c8" ]
[ "torch_sparse/diag.py" ]
[ "import warnings\nimport os.path as osp\nfrom typing import Optional\n\nimport torch\nfrom torch_sparse.storage import SparseStorage\nfrom torch_sparse.tensor import SparseTensor\n\ntry:\n torch.ops.load_library(\n osp.join(osp.dirname(osp.abspath(__file__)), '_diag.so'))\nexcept OSError:\n warnings.wa...
[ [ "torch.ones", "torch.arange" ] ]
OpenSO2/so2eval
[ "0bc896360f8021e930bdadc707540220fe6b0f9e" ]
[ "alignimages.py" ]
[ "# coding: utf-8\n\"\"\"Align two images.\n\nTry to automatically calculate the warp matrix between two images and align\nthose images accordingly.\n\"\"\"\nimport cv2\nimport numpy as np\n\n\ndef alignimages(im1, im2):\n\t\"\"\"Automatically align two images.\"\"\"\n\t# Find size of image1\n\tsz = im1.shape\n\n\t#...
[ [ "numpy.eye" ] ]
ajfriend/cyscs
[ "3ad1bb2fe18ac2789786003f5c6e76d9f5d66b13" ]
[ "cyscs/test/test_solve.py" ]
[ "import cyscs as scs\nimport pytest\nimport cyscs.examples as ex\n\nimport scipy.sparse as sp\nimport numpy as np\n\ndef test_simple_lp():\n data, cone = ex.simple_lp()\n sol = scs.solve(data, cone)\n\ndef test_extra_arg():\n data, cone = ex.simple_lp()\n sol = scs.solve(data, cone, eps=1e-9, alpha=.1, ...
[ [ "numpy.allclose" ] ]
ashwinvin/Visionlib
[ "f7d55778c6951ed5d436bc8010ddf282d4af00cc" ]
[ "visionlib/object/detection/detection.py" ]
[ "import numpy as np\nimport cv2\nimport os\nimport sys\nimport logging\nfrom visionlib.utils.webutils import web\nfrom visionlib.utils.imgutils import Image\n\nclass ODetection:\n \"\"\"This class contains all functions to detect objects from an image.\n . . .\n\n Methods:\n\n detect_obj...
[ [ "numpy.array", "numpy.argmax", "numpy.random.seed" ] ]
darpa-l2m/l2metrics
[ "5df0731646582aabd5072e30a1346bd19151747d" ]
[ "l2metrics/recovery_time.py" ]
[ "\"\"\"\nCopyright © 2021-2022 The Johns Hopkins University Applied Physics Laboratory LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the “Software”), to \ndeal in the Software without restriction, including without limitati...
[ [ "pandas.DataFrame" ] ]
i18MAME/image-analysis
[ "857cb5f2e9ff254361a1fc01fad7ec2165b06fb1" ]
[ "train.py" ]
[ "\"\"\"\nRetrain the YOLO model for your own dataset.\n\"\"\"\n\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping\n\nfro...
[ [ "numpy.random.shuffle", "numpy.array", "numpy.zeros", "numpy.random.seed" ] ]
antoinediez/Sisyphe
[ "f6bb067cd8898450174c5d97bb0f3f0cb5db8b87" ]
[ "sisyphe/initial.py" ]
[ "import math\nimport torch\nfrom .sampling import vonmises_quat_rand, quat_mult\n# from display import bo_display\n\n\ndef cyclotron_twist_z(N,L,k,kappa,dtype):\n pos = torch.tensor(L).type(dtype)*torch.rand(N,3).type(dtype)\n \n if type(L)==float or type(L)==int:\n qtarget = torch.cat((\n ...
[ [ "torch.zeros", "torch.sin", "torch.sum", "torch.tensor", "torch.rand", "torch.cos" ] ]
AI4Bharat/OpenHands
[ "a3c2c416395d70c7eb63294d955a84d1c8ea4410" ]
[ "openhands/models/decoder/bert_hf.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport transformers\nfrom .utils import AttentionBlock\n\n\nclass PositionEmbedding(nn.Module):\n def __init__(self, config):\n super().__init__()\n self.position_embeddings = nn.Embedding(\n config.max_position_embed...
[ [ "torch.mean", "torch.nn.Dropout", "torch.max", "torch.cat", "torch.nn.functional.dropout", "torch.randn", "torch.nn.Embedding", "torch.nn.Linear", "torch.arange" ] ]
kim5284/qiskit-metal
[ "f39270b3b620a7560c43b07dd8b669692accc926" ]
[ "qiskit_metal/analyses/em/kappa_calculation.py" ]
[ "\"\"\"\r\nThis code calculates the photon loss (kappa) due to the capacitive coupling between CPWs\r\nand input/output transmission lines in a quantum circuit. \r\n\r\nTwo cases are treated: In the first case, three arguments are passed to the function kappa_in\r\nand the resonant frequency of the CPW is input as ...
[ [ "scipy.special.ellipk" ] ]