repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
kblancato/theia-net
[ "cdb912e1b35701f22928e084913e004352a6fe95" ]
[ "theia-net/classification/modules/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass CNN(torch.nn.Module):\n \"\"\"\n 1D CNN model architecture.\n \n Attributes\n ----------\n num_in : int\n Exposure in seconds.\n \n n_classes : int\n Nu...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.cat", "torch.nn.Linear", "torch.nn.Conv1d", "torch.nn.AvgPool1d" ] ]
kangzhiq/sunpy
[ "fad034a2ca0bebfa041e47b18a0789d2bc4b4aa6" ]
[ "sunpy/timeseries/tests/test_timeseries_factory.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jun 23 12:08:21 2016\n\n@author: alex_\n\"\"\"\n\nimport os\nimport glob\nimport pytest\nimport datetime\nimport numpy as np\nfrom pandas import DataFrame\nfrom collections import OrderedDict\n\nimport sunpy.data.test\nimport sunpy.timeseries\nfrom sunpy.util.metadat...
[ [ "numpy.arange", "pandas.DataFrame" ] ]
skyduy/zfverify
[ "a49e314df7b8b3822dd941b44d68c0fde77df9c9" ]
[ "Verify-Manual-python/predict/predictOneVsAll.py" ]
[ "# coding: utf-8\nfrom numpy import dot, hstack, ones, argmax\nfrom sigmoid import sigmoid\n\n\ndef predictOneVsAll(all_theta, X):\n m = X.shape[0]\n\n X = hstack((ones((m, 1)), X))\n\n real_all_theta = all_theta.transpose()\n all_predict = sigmoid(dot(X, real_all_theta))\n\n Accuracy = all_predict.m...
[ [ "numpy.dot", "numpy.argmax", "numpy.ones" ] ]
middlec000/wordler
[ "ad76dea50f0baab398d16366bfc55557ae187fce" ]
[ "src/main.py" ]
[ "import streamlit as st\nimport pandas as pd\nfrom helper_methods import *\n\n\ndef suggest(df: pd.DataFrame, original_length: int, num_words_to_display: int, sort_by: str) -> None:\n \"\"\"\n Print the suggested words nicely and ordered by the desired metric.\n\n Args:\n df (pd.DataFrame): Remainin...
[ [ "pandas.read_csv" ] ]
Rocketknight1/pytorch-pretrained-BERT
[ "2c03c10d5e34badf17298e8f070c8c0169febe22" ]
[ "pytorch_pretrained_bert/modeling.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may...
[ [ "torch.nn.Softmax", "torch.load", "torch.zeros", "torch.nn.Embedding", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.ones", "torch.sqrt", "torch.from_numpy", "torch.arange", "tensorflow.train.list_variables", "torch.ones_like", "torch.sigmoid", "to...
flo-compbio/xlmhg
[ "c29d913386443396254774b8cff5cff2b5731323" ]
[ "tests/01_algorithms/test_correct_pval.py" ]
[ "# Copyright (c) 2016-2019 Florian Wagner\n#\n# This file is part of XL-mHG.\n\n\"\"\"Tests for the Cython implementations of the XL-mHG p-value..\"\"\"\n\nimport numpy as np\nfrom scipy.stats import hypergeom\n\nfrom xlmhg import mhg, mhg_cython\n\ndef test_cross():\n \"\"\"Compares p-values calculated using PV...
[ [ "scipy.stats.hypergeom.sf", "numpy.empty", "numpy.ones" ] ]
guylapid/materialize
[ "8629a120a5a628b6ef06f379b48ba723797db944" ]
[ "demo/http_logs/apps/loadgen.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright Materialize, Inc. and contributors. All rights reserved.\n#\n# Use of this software is governed by the Business Source License\n# included in the LICENSE file at the root of this repository.\n#\n# As of the Change Date specified in that file, in accordance with\n# the Business...
[ [ "numpy.random.poisson", "numpy.sum", "numpy.random.zipf" ] ]
pints-team/markov-builder
[ "7accb6e7bc64a2a2afa35d4594c3f4dc3284923c" ]
[ "examples/simulation.py" ]
[ "#!/usr/bin/env python3\n\n# Simulate data from the Beattie model and M10 model using a Gillespie\n# algorithm output plots into examples/example_output or\n# MARKOVBUILDER_EXAMPLE_OUTPUT if it exists\n\nimport logging\nimport os\nimport sys\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nfrom markov_bui...
[ [ "pandas.concat", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
hummat/if-net
[ "6eb6b3860159ba0a46167844020d8cbc7717fbb4" ]
[ "models/local_model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n# 1D convolution is used for the decoder. It acts as a standard FC, but allows to use a batch of point samples features,\n# additionally to the batch over the input objects.\n# The dimensions are used as follows:\n# batch_size (N) = #3D obje...
[ [ "torch.Tensor", "torch.cat", "torch.reshape", "torch.nn.MaxPool3d", "torch.nn.Conv3d", "torch.nn.functional.grid_sample", "torch.nn.Conv1d", "torch.nn.ReLU", "torch.nn.BatchNorm3d" ] ]
lazy-turtle/SharpMask-RCNN
[ "f6a3106b029b8147cecec429ec9a3d747449274f" ]
[ "mrcnn/model.py" ]
[ "\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict...
[ [ "numpy.amax", "numpy.expand_dims", "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.reduce_sum", "tensorflow.minimum", "tensorflow.cast", "tensorflow.image.crop_and_resize", "tensorflow.image.non_max_suppression", "tensorflow.equal...
HumaticsLAB/AttentionBasedMultiModalRNN
[ "0c060a97cdddf1348938a5f2d456e83e5f8bf887" ]
[ "config.py" ]
[ "import torch\n\nDEVICE = torch.device('cuda:0')\nDATASET_PATH = \"dataset/images\"\nTRAIN_DATASET = \"dataset/train.csv\"\nTEST_DATASET = \"dataset/test.csv\"\nCOMPOSED_GTREND = \"dataset/gtrends.csv\"\nCATEG_DICT = \"category_labels.pt\"\nCOLOR_DICT = \"color_labels.pt\"\nFAB_DICT = \"fabric_labels.pt\"\nNUM_EPOC...
[ [ "torch.device" ] ]
PauloCirino/deep-learning-coursera
[ "69a89206bf4b0ec3148a1b69a2b31fb79e6adc7c" ]
[ "Neural-Networks-and-Deep-Learning/Logistic Regression as a Neural Network/Logistic Regression with a Neural Network mindset.py" ]
[ "\n# coding: utf-8\n\n# # Logistic Regression with a Neural Network mindset\n# \n# Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone yo...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "numpy.dot", "scipy.misc.imresize", "scipy.ndimage.imread", "numpy.log", "numpy.abs", "numpy.squeeze", "matplotlib.pyplot.plot", "numpy.round", "numpy.exp", "matplotlib.pyplot.xlabel", "numpy.array", "n...
mtsolmn/lantz-drivers
[ "f48caf9000ddd08f2abb837d832e341410af4788" ]
[ "lantz/drivers/microsoft/usbcam.py" ]
[ "import cv2\nimport numpy as np\nfrom lantz.core import Action, Driver, Feat\n\n\nclass USBCam(Driver):\n\n def __init__(self, device_id):\n self.device_id = device_id\n self._flipud = False\n self._fliplr = False\n self._rotation = 0\n return\n\n def initialize(self):\n ...
[ [ "numpy.fliplr", "numpy.flipud" ] ]
uniLee1119/Final-NeuralFBProphet
[ "40caac12a1805da6a061452ea5571b48d6f2bb8f" ]
[ "src/Final-NeuralFBProphet/prop_two_optim.py" ]
[ "import argparse\n\nimport joblib\nimport numpy as np\nimport optuna\nfrom fbprophet import Prophet\nfrom optuna import Trial\nfrom optuna.samplers import TPESampler\nfrom sklearn.metrics import mean_squared_error\n\nfrom data.dataset import two_seconds_dataset\n\nparse = argparse.ArgumentParser(\"Optimize\")\npars...
[ [ "sklearn.metrics.mean_squared_error", "numpy.max", "numpy.min" ] ]
millerda/seaborn
[ "5a67fa98ed4efa5b3761f2d9d184fb8addfac6de" ]
[ "seaborn/rcmod.py" ]
[ "\"\"\"Control plot style and scaling using the matplotlib rcParams interface.\"\"\"\nimport warnings\nimport functools\nimport matplotlib as mpl\nfrom cycler import cycler\nfrom . import palettes\n\n\n__all__ = [\"set_theme\", \"set\", \"reset_defaults\", \"reset_orig\",\n \"axes_style\", \"set_style\", ...
[ [ "matplotlib.rcParams.update" ] ]
brenobeirigo/vrplot
[ "e9ec5450940bd576f43c4ed07f17ae228dbd0eb8" ]
[ "vrplot/animated.py" ]
[ "################################################################################\n## PLOT ########################################################################\n################################################################################\n\n# ANIMATIONS\n#%matplotlib widget\nimport matplotlib.pyplot as plt\...
[ [ "matplotlib.pyplot.subplots", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.close" ] ]
Cryaaa/tribolium-clustering
[ "f5751ec8c007e95e8a9688d2d8e34508b04f0822" ]
[ "tribolium_clustering/data_visualisation/_plot_cvi_each_timepoint_3D.py" ]
[ "def plot_cvi_each_timepoint_3D(cvi_scores_concatenated, timepoints_list, cluster_numbers, cvi_name = '', timepoint_label = 'Timepoints'):\n '''Plots a 3D plot displaying timepoint indices, cluster numbers and their cluster validation index scores\n \n Parameters\n ----------\n cvi_scores_concatenate...
[ [ "numpy.meshgrid", "numpy.reshape", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
beconstant/urnn
[ "7c74d0eff7181756c080cd44cce732cef2089242" ]
[ "utils/theano_complex_extension.py" ]
[ "import numpy as np\n\nfrom theano import tensor\n\n\n#------------------------------------------------------------------------------\n# Complex theano funcs\n\ndef frac(A):\n return A[0, :, :], A[1, :, :]\n\n\ndef skew_frac(A):\n return tensor.tril(A, -1) - tensor.tril(A, -1).T,\\\n tensor.triu(A, ...
[ [ "numpy.tensordot" ] ]
ryscet/pySeries
[ "3ab1e0a9dbdeaef34c6c6d1fed5b248203c84fea" ]
[ "pyseries/Pipelines/AnalyzeBinRIv.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 24 12:27:09 2016\n\n@author: user\n\"\"\"\n\nimport sys\nsys.path.insert(0, '/Users/user/Desktop/repo_for_pyseries/pyseries')\n\nimport pyseries.LoadingData as loading\nimport pyseries.Preprocessing as prep\nimport pyseries.Analysis as analysis\nimport matplotlib...
[ [ "matplotlib.pyplot.plot", "scipy.signal.welch", "matplotlib.pyplot.figure" ] ]
yzhq97/distortion-free-wide-angle.pytorch
[ "3d8899a84e5f5c4fca62385116bfdaf4876b2ff7" ]
[ "src/data.py" ]
[ "import cv2\nimport os\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom stereographic import get_uniform_stereo_mesh\nfrom perception import get_face_masks, get_object_masks\n\n\nclass ImageDataset(Dataset):\n\n def __init__(self, args, root='data'):\n\n self.Q = args.Q\n self.mesh_d...
[ [ "numpy.log", "numpy.pad", "numpy.linalg.norm", "numpy.stack", "numpy.exp" ] ]
pkan2/addons
[ "8fe50d7600a592b06984f1ead61fdd8adb008ad1" ]
[ "tensorflow_addons/layers/normalizations_test.py" ]
[ "# Copyright 2019 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.convert_to_tensor", "numpy.expand_dims", "numpy.sqrt", "tensorflow.cast", "numpy.mean", "tensorflow.random.set_seed", "numpy.random.randint", "tensorflow.keras.layers.deserialize", "tensorflow.keras.optimizers.RMSprop", "tensorflow.keras.layers.Conv2D", "num...
sosaucily/hummingbot
[ "082883319253399b2c7a321c709c97dcd84b9b72" ]
[ "hummingbot/client/command/config_command.py" ]
[ "import asyncio\nfrom typing import (\n List,\n Any,\n)\nfrom decimal import Decimal\nimport pandas as pd\nfrom os.path import join\nfrom hummingbot.client.settings import (\n GLOBAL_CONFIG_PATH,\n CONF_FILE_PATH,\n)\nfrom hummingbot.client.config.global_config_map import global_config_map\nfrom humming...
[ [ "pandas.DataFrame" ] ]
samkreter/kmeans-clustering-with-spatial-bias
[ "17d47c564074f8d789b7f5370ea0acc56c19f529" ]
[ "getDataSet.py" ]
[ "import scipy.io\nimport numpy as np\n\n#convert main dataset\n# mat = scipy.io.loadmat(\"Indian_pines.mat\")\n# npMat = np.array(mat['indian_pines'])\n\n# np.save(\"npIndian_pines.npy\",npMat)\n\n#convert ground truth data set\nmat = scipy.io.loadmat(\"Indian_pines_gt.mat\")\nnpMat = np.array(mat['indian_pines_gt'...
[ [ "numpy.array", "numpy.save" ] ]
alanbseo/deepgreen
[ "b8a19c83d75f275c5e58bc7a48beb22ce61a81d9" ]
[ "PythonScripts/Flickr_BatchTagging_EU_keal.py" ]
[ "import os\nimport json\n\nimport numpy as np\nimport pandas as pd\n\nfrom keras.applications import inception_resnet_v2\n\nfrom keras.preprocessing import image\n\nimg_width, img_height = 331, 331\n\n\nimport fnmatch\n\nfrom shutil import copyfile\n\nimport PIL\nfrom PIL import ImageFile\n\nImageFile.LOAD_TRUNCATE...
[ [ "numpy.expand_dims", "numpy.empty", "pandas.DataFrame", "numpy.concatenate", "numpy.ceil", "numpy.argsort", "numpy.array", "numpy.vstack" ] ]
brettkoonce/fairscale
[ "05ce7971d256893a7707a8a99e89ec3ef75ab7c0" ]
[ "tests/nn/model_parallel/test_layers.py" ]
[ "# coding=utf-8\n\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apac...
[ [ "torch.nn.Embedding", "torch.cuda.is_available", "torch.split", "torch.distributed.get_rank", "torch.allclose", "torch.ones", "torch.randn", "torch.distributed.barrier", "torch.equal", "torch.mul", "torch.rand", "torch.nn.Sequential", "torch.LongTensor", "to...
neilshah13/capstone21
[ "1be9175d70041cb3ee429f31dd51dd11c7ab39af" ]
[ "python_backend/triton_client/tao_triton/python/postprocessing/trafficcamnet_processor.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n# \n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to...
[ [ "numpy.min", "numpy.unique", "sklearn.cluster.DBSCAN", "numpy.max", "numpy.float64", "numpy.array", "numpy.sum" ] ]
rezoo/chainer_computational_cost
[ "987b0a2cd7670390ca0d69152214d6bc8f656c7b" ]
[ "tests/test_cost_calculators/test_connection.py" ]
[ "import chainer.functions as F\nimport numpy as np\n\nfrom chainer.functions.connection.convolution_2d \\\n import Convolution2DFunction\nfrom chainer.functions.connection.deconvolution_2d \\\n import Deconvolution2DFunction\nfrom chainer.functions.connection.linear import LinearFunction\n\nfrom helpers impor...
[ [ "numpy.int64", "numpy.random.randn" ] ]
zaman13/Optoelectronic-tweezers-interface
[ "a43440b9035a69ee54c5b34fe49e8b3dd0ac8d11" ]
[ "Codes/OET_interface_v0.5.py" ]
[ "\n\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 15 20:34:23 2021\n\n@author: Mohammad Asif Zaman\n\n\nKeyboard commands:\n \nx : Quit/exit program \nArrow keys: Movement\nq : Increase object size\na : Decrease object size\nw : Increase width of the object\nd : ...
[ [ "numpy.cos", "numpy.sin" ] ]
hatim-ez/berkeley-cs294-deep-rl
[ "8ffd415e8140b18f9456bc8560a099e98456bf05" ]
[ "hw4/model_based_policy.py" ]
[ "import tensorflow as tf\nimport tensorflow_probability as tfp\nimport numpy as np\n\nimport utils\n\n\nclass ModelBasedPolicy(object):\n\n def __init__(self,\n env,\n init_dataset,\n horizon=15,\n num_random_action_selection=4096,\n ...
[ [ "tensorflow.losses.mean_squared_error", "tensorflow.concat", "tensorflow.truncated_normal", "tensorflow.unstack", "tensorflow.zeros", "numpy.squeeze", "tensorflow.placeholder", "tensorflow.contrib.framework.argsort", "tensorflow.subtract", "tensorflow.global_variables_initi...
itprorh66/SolarPV-Simulator
[ "0e689e608d4c1888dde82f506ad42c3291f33f60" ]
[ "SolarPV/NasaData.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Apr 26 19:11:58 2018\nModified on 02/22/2019 for version 0.1.0\nModified on 02/04/2021 to simplify the logic and make better use of Pandas methods\n\n@author: Bob Hentz\n\n-----------------------------------------------------------------------...
[ [ "pandas.json_normalize", "pandas.to_datetime" ] ]
FredaXin/eda_and_beyond
[ "d78d25c305f1a23f1568d420ba8bb6bee12e5c38" ]
[ "eda_and_beyond/eda_tools.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.linear_model import LinearRegression, LassoCV, RidgeCV\nfrom sklearn.model_selection import cross_val_score, train_test_split\nfrom sklearn.preprocessing import StandardScaler, PolynomialFeatures\nfrom s...
[ [ "pandas.concat", "matplotlib.pyplot.tight_layout", "numpy.sum", "sklearn.metrics.r2_score", "sklearn.metrics.median_absolute_error", "matplotlib.pyplot.figure", "sklearn.metrics.mean_absolute_error", "matplotlib.pyplot.subplots", "sklearn.model_selection.train_test_split", ...
alwinw/sktime
[ "a6f17bd586df6bbc8e6c783f08eda4c30d2353f9" ]
[ "sktime/transformers/series_as_features/dictionary_based/_sax.py" ]
[ "# -*- coding: utf-8 -*-\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport scipy.stats\n\nfrom sktime.transformers.series_as_features.base import BaseSeriesAsFeaturesTransformer\nfrom sktime.transformers.series_as_features.dictionary_based import PAA\n\n# TO DO: verify this returned pandas is consis...
[ [ "numpy.asarray", "numpy.arange", "pandas.Series", "pandas.DataFrame" ] ]
orestisfl/arxiv-classifier
[ "df41ad84137b48f77c3a27ee1c84471e22819967" ]
[ "train.py" ]
[ "import json\nimport logging\nimport os\nimport pickle\nimport random\n\nimport pandas as pd\nfrom scipy.special import softmax\nfrom simpletransformers.classification import ClassificationModel\n\nlogging.basicConfig(level=logging.INFO)\ntransformers_logger = logging.getLogger(\"transformers\")\ntransformers_logge...
[ [ "scipy.special.softmax", "pandas.DataFrame" ] ]
sun-xiaoyu/allennlp
[ "b49aff6aac4e9912564ee8235250d50c9d17e53f" ]
[ "allennlp/modules/seq2seq_encoders/pytorch_transformer_wrapper.py" ]
[ "from typing import Optional\n\nfrom overrides import overrides\nimport torch\nfrom torch import nn\n\nfrom allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder\nfrom allennlp.nn.util import add_positional_features\n\n\n@Seq2SeqEncoder.register(\"pytorch_transformer\")\nclass PytorchTransformer(S...
[ [ "torch.nn.TransformerEncoderLayer", "torch.nn.Embedding", "torch.nn.TransformerEncoder", "torch.nn.init.xavier_uniform_" ] ]
VoxelPi/compm
[ "745019d4e0d156910f19ed9168949f150356a349" ]
[ "ue/ue_05/problem_6.py" ]
[ "import numpy as np\n\ndef pseudo(A):\n # Check if matrix A is injective.\n if np.linalg.det(A.T @ A) < 1e-9:\n print(\"the given matrix is not injective.\")\n return\n\n # Return pseudo-inverse (See lecture notes page 155)\n print(\"the given matrix is injective.\")\n return np.linalg....
[ [ "numpy.linalg.det", "numpy.linalg.lstsq", "numpy.array", "numpy.linalg.inv" ] ]
gizzmo25/pythoncode-tutorials
[ "39a413fc1da232ad6de7e5f1e8955564dc65448e", "39a413fc1da232ad6de7e5f1e8955564dc65448e" ]
[ "machine-learning/image-transformation/cropping.py", "machine-learning/edge-detection/edge_detector.py" ]
[ "import numpy as np\r\nimport cv2\r\nimport matplotlib.pyplot as plt\r\n\r\n# read the input image\r\nimg = cv2.imread(\"city.jpg\")\r\n# convert from BGR to RGB so we can plot using matplotlib\r\nimg = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\r\n# disable x & y axis\r\nplt.axis('off')\r\n# show the image\r\nplt.imshow...
[ [ "matplotlib.pyplot.imsave", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ], [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
scottwedge/ev3sim
[ "751c9902e7615d27d52e4b45b34e6acb47c06d24" ]
[ "ev3sim/devices/colour/base.py" ]
[ "import random\nimport numpy as np\n\n\nclass ColourSensorMixin:\n\n RGB_RAW = \"RGB-RAW\"\n\n device_type = \"lego-sensor\"\n mode = RGB_RAW\n\n SENSOR_RADIUS = 1\n SENSOR_POINTS = 100\n\n def _SenseValueAboutPosition(self, centrePosition, valueGetter):\n # Randomly sample value from SENSO...
[ [ "numpy.array", "numpy.cos" ] ]
zbzhzhy/Hyperspectral-Image-Super-resolution-via-Deep-Progressive-Zero-centric-Residual-Learning
[ "39f103a19fd54cc765487389f14f90a23e5e96bf" ]
[ "demo_cave/Hyper_loader_2.py" ]
[ "import numpy as np\r\nimport torch\r\nimport cv2\r\nfrom torch.utils.data import Dataset, DataLoader, TensorDataset\r\nfrom torch.autograd import Variable\r\nimport scipy.ndimage as scin\r\nfrom scipy import ndimage\r\nfrom get_name import get_name\r\nimport scipy.io as scio\r\nimport h5py\r\n# import lmdb\r\nimpo...
[ [ "numpy.rot90", "scipy.io.loadmat", "numpy.tensordot", "numpy.transpose", "numpy.load", "numpy.flip" ] ]
marcusfilipesr/ross
[ "e00bc10e694ecaf82ee24af82f649da7458fc91d" ]
[ "ross/results.py" ]
[ "\"\"\"ROSS plotting module.\n\nThis module returns graphs for each type of analyses in rotor_assembly.py.\n\"\"\"\nimport copy\nimport inspect\nfrom abc import ABC\nfrom collections.abc import Iterable\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport toml\nfrom plotly import graph_objec...
[ [ "numpy.imag", "numpy.sqrt", "numpy.linspace", "numpy.arctan", "pandas.DataFrame", "numpy.dtype", "numpy.max", "numpy.zeros_like", "numpy.exp", "numpy.hstack", "numpy.ones_like", "numpy.arange", "numpy.sin", "numpy.real", "numpy.repeat", "numpy.isclos...
EdwardYGLi/snake_RL
[ "210f552faca380c054fb5310b6c61ea2b1dfadcc" ]
[ "snake.py" ]
[ "\"\"\"\nCreated by Edward Li at 10/6/20\nfollowed game code from https://github.com/maurock/snake-ga\n\"\"\"\n\nimport argparse\nimport random\nimport sys\nfrom collections import deque\nimport itertools\n\nimport numpy as np\nimport pygame\n\n\ndef update_screen():\n pygame.display.update()\n\n\ndef display(pl...
[ [ "numpy.array", "numpy.sqrt", "numpy.array_equal", "numpy.ones" ] ]
mjw99/Musketeer
[ "0299a7974ad90c09d8d9206fcf862e45f9fddf30" ]
[ "musketeer/equilibriumConstants.py" ]
[ "import tkinter as tk\n\nimport numpy as np\n\nfrom . import moduleFrame\n\n\nclass GetKsCustom():\n def __init__(self, titration):\n self.titration = titration\n popup = tk.Toplevel()\n popup.title(\"Edit equilibrium constant values\")\n popup.grab_set()\n # TODO: implement\n\...
[ [ "numpy.identity", "numpy.insert" ] ]
eposs/solution_scattering
[ "c9e1570cdc7ad0b5b9303770e798bd0bb71650c3" ]
[ "quickplots.py" ]
[ "import glob\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom saxs_plots import real_space_plotter\n\ndats = glob.glob('./*dat')\ndiffs = [item for item in dats if \"diff\" in item]\nsums = [item for item in dats if \"sum\" in item]\navgs = [item for item in dats if \"diff\" not in item]\nspfs = [item fo...
[ [ "pandas.read_table" ] ]
qin-yu/elf
[ "bb8e0a41c1c2539ac6f866271751139271fbeeb1" ]
[ "elf/parallel/operations.py" ]
[ "import multiprocessing\n# would be nice to use dask for all of this instead of concurrent.futures\n# so that this could be used on a cluster as well\nfrom concurrent import futures\nfrom numbers import Number\nfrom functools import partial\nfrom tqdm import tqdm\n\nfrom .common import get_blocking\nfrom ..util imp...
[ [ "numpy.isin" ] ]
igorperic17/object_detection_tf_example
[ "4d79eb45f5cf05af51e1055f72e4226dfa0f3538" ]
[ "benchmark.py" ]
[ "import tensorflow.compat.v2 as tf\nimport tensorflow_datasets as tfds\n\ntf.enable_v2_behavior()\n\nfrom tensorflow.python.framework.ops import disable_eager_execution\ndisable_eager_execution()\n\nfrom tensorflow.python.compiler.mlcompute import mlcompute\nmlcompute.set_mlc_device(device_name='gpu')\n\n\n(ds_trai...
[ [ "tensorflow.compat.v2.keras.layers.Flatten", "tensorflow.compat.v2.enable_v2_behavior", "tensorflow.compat.v2.keras.layers.MaxPooling2D", "tensorflow.python.compiler.mlcompute.mlcompute.set_mlc_device", "tensorflow.compat.v2.keras.layers.Dense", "tensorflow.compat.v2.keras.optimizers.Adam"...
kasimte/RLs
[ "0eba84bd7cc571269f874b65923bec2188828ef6" ]
[ "gym_wrapper.py" ]
[ "import gym\r\nimport numpy as np\r\nimport threading\r\n\r\n\r\nclass MyThread(threading.Thread):\r\n\r\n def __init__(self, func, args=()):\r\n super().__init__()\r\n self.func = func\r\n self.args = args\r\n\r\n def run(self):\r\n self.result = self.func(*self.args)\r\n\r\n d...
[ [ "numpy.array", "numpy.where" ] ]
asmaalrawi/geopm
[ "e93548dfdd693a17c81163787ba467891937356d" ]
[ "integration/experiment/power_sweep/gen_plot_node_efficiency.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the ...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.figure", "matplotlib.pyplot.margins", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.setp", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.pyplot.yticks", "matplotlib.pyplot.hist", ...
googleinterns/smart-content-summary
[ "595c8e2cb0e160a87cacb954a2a030953fdce6c5" ]
[ "classifier/run_classifier_utils.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.metrics.mean", "tensorflow.train.Scaffold", "tensorflow.concat", "tensorflow.reduce_mean", "tensorflow.reshape", "tensorflow.train.init_from_checkpoint", "tensorflow.truncated_normal_initializer", "tensorflow.trainable_variables", "tensorflow.equal", "tensorflow...
wyli/cpp-py-example
[ "a5a09f1a5d93565dadb082aefa2807e1d157187f" ]
[ "ex/gauss.py" ]
[ "#!/usr/bin/env python3\n\nfrom pymycpp import Bitmap\nimport scipy.ndimage as ndi\n\n\nif __name__ == '__main__':\n img = Bitmap('baboon.bmp')\n\n data_np = img.data()\n\n ndi.gaussian_filter(input=data_np,\n sigma=(5, 15, 0),\n order=0,\n ...
[ [ "scipy.ndimage.gaussian_filter" ] ]
simpsus/fmp_python
[ "858e3ff276aa24da77d242c0d72c7ec2a91ac875" ]
[ "fmp_python/common/fmpdecorator.py" ]
[ "import os\nimport functools\nimport pandas as pd\nimport inspect\nfrom datetime import datetime\nfrom pathlib import Path\n\nfrom fmp_python.common.fmpexception import FMPException\n\n\nclass FMPDecorator():\n\n @classmethod\n def inject_api_key(cls,func):\n @functools.wraps(func)\n def deco_fu...
[ [ "pandas.DataFrame" ] ]
Fariborzzz/fiftyone
[ "06975961f5ee649dd36429feb21c959dfc0744ed" ]
[ "fiftyone/utils/eval/regression.py" ]
[ "\"\"\"\nRegression evaluation.\n\n| Copyright 2017-2021, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nimport logging\nimport itertools\nimport numbers\n\nimport numpy as np\nimport sklearn.metrics as skm\nfrom tabulate import tabulate\n\nimport eta.core.utils as etau\n\nimport fiftyone.core.e...
[ [ "sklearn.metrics.explained_variance_score", "sklearn.metrics.r2_score", "numpy.sqrt", "sklearn.metrics.median_absolute_error", "numpy.asarray", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.mean_squared_error", "sklearn.metrics.max_error", "numpy.mean", "numpy.arr...
Laubeee/caffe-tensorflow
[ "1a5c027b19c6e9d4bc5f2cb4d5906efe46c60466" ]
[ "convert.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport sys\nimport numpy as np\nimport argparse\nfrom kaffe import KaffeError, print_stderr\nfrom kaffe.tensorflow import TensorFlowTransformer\n\nimport shutil\nimport tensorflow as tf\nfrom tensorflow.python.tools.freeze_graph import freeze_graph\n\n\ndef fatal_error(msg):\n ...
[ [ "tensorflow.InteractiveSession", "tensorflow.python.tools.freeze_graph.freeze_graph", "tensorflow.placeholder", "numpy.save", "tensorflow.train.Saver" ] ]
kuna-systems/detr
[ "ae18dec551b4810eb44d58d612c5181812305a1b" ]
[ "d2/detr/detr.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nimport math\nfrom typing import List\n\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nimport torch.nn.functional as F\nfrom scipy.optimize import linear_sum_assignment\nfrom torch import nn\n\nfrom detectr...
[ [ "torch.nn.functional.softmax", "torch.ones", "torch.Tensor", "torch.load", "torch.device", "torch.as_tensor" ] ]
AndyYuan96/MVF-End-to-End-Multi-View-Fusion-for-3D-Object-Detection-in-LiDAR-Point-Clouds-
[ "cf34897f25353a3f348d0a39c8db5ba15cadb2d7" ]
[ "pcdet/models/bbox_heads/anchor_target_assigner.py" ]
[ "# This file is modified from https://github.com/traveller59/second.pytorch\n\nimport numpy as np\nimport numpy.random as npr\nimport numba\nfrom ...utils import common_utils\n\n\ndef unmap(data, count, inds, fill=0):\n '''Unmap a subset of item (data) back to the original set of items (of\n size count)'''\n ...
[ [ "numpy.linspace", "numpy.einsum", "numpy.concatenate", "numpy.where", "numpy.reshape", "numpy.arange", "numpy.stack", "numpy.sin", "numpy.full", "numpy.zeros", "numpy.transpose", "numpy.meshgrid", "numpy.array", "numpy.sum", "numpy.maximum", "numpy.t...
islamazhar/trees
[ "502565c5bf02503c7bece09cddd93f9368da02c3" ]
[ "trees/mcmc.py" ]
[ "import random\nimport logging\nimport numpy as np\n\nclass MetropolisHastingsSampler(object):\n\n def __init__(self, tree, X):\n self.tree = tree\n self.X = X\n self.last_move = None\n self.likelihoods = []\n\n def initialize_assignments(self):\n self.tree.initialize_from_d...
[ [ "numpy.arange", "numpy.exp", "numpy.random.random" ] ]
flying-Yan/BCNN
[ "31ebb985cb1556b6f98aa71459ee74c3490bbe1d" ]
[ "models/cb_ResNet18.py" ]
[ "import torch\nimport torch.nn as nn\nfrom models.binarized_fun import * \n\nclass ResBlock_1(nn.Module):\n\n def __init__(self, inchannel):\n super(ResBlock_1, self).__init__()\n \n self.tanh = nn.Hardtanh(-1.3,1.3)\n \n self.conv1 = nn.Sequential(\n self.tanh,...
[ [ "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Hardtanh" ] ]
TauferLab/SOMOSPIE
[ "512bfc1a287d014f3c3d885a22b23825ce536c92" ]
[ "deprecated/hyppo_testing/hypppo2.py" ]
[ "#!/usr/bin/env python3\n\n# Code by Travis Johnston, 2017.\n# Modified and parallelized by Danny Rorabaugh, 2018/9.\n# HYbrid Parallel Piecewise POlynomial.\n\n\nimport argparse, csv, random\nimport numpy as np\n### https://docs.python.org/3.1/library/itertools.html#itertools.combinations_with_replacement\nfrom it...
[ [ "numpy.product", "numpy.linalg.lstsq", "numpy.std", "numpy.savetxt", "numpy.argsort", "numpy.array", "numpy.loadtxt" ] ]
Stargrazer82301/CAAPR
[ "4adead7dd85072cf14e2afb0f6b99b4f92d34201" ]
[ "CAAPR/CAAPR_Main.py" ]
[ "# Import smorgasbord\r\nimport sys\r\nimport os\r\nimport gc\r\nimport time\r\nimport random\r\n#import warnings\r\n#warnings.filterwarnings('ignore')\r\nimport matplotlib\r\nmatplotlib.use('Agg')\r\nimport multiprocessing as mp\r\nimport CAAPR\r\nimport CAAPR.CAAPR_IO\r\nimport CAAPR.CAAPR_Pipeline\r\nimport pdb\...
[ [ "matplotlib.use" ] ]
HXPRedBlue/mmocr
[ "914613d53484712be67c38d50bb902a218884b24" ]
[ "mmocr/apis/inference.py" ]
[ "import numpy as np\nimport torch\nfrom mmcv.ops import RoIPool\nfrom mmcv.parallel import collate, scatter\nfrom mmdet.datasets import replace_ImageToTensor\nfrom mmdet.datasets.pipelines import Compose\n\n\ndef disable_text_recog_aug_test(cfg, set_types=None):\n \"\"\"Remove aug_test from test pipeline of text...
[ [ "torch.no_grad" ] ]
rileydr/SSFC-Data
[ "b9169dfe47c939f4c7a49d9e53e05ba90d066301" ]
[ "code/utilities/densmore_v3.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.linear_model import LinearRegression, LogisticRegression\nfrom sklearn.model_selection import train_test_split, cross_val_score\nfrom sklearn.preprocessing import PolynomialFeatures, StandardScaler\nfrom...
[ [ "matplotlib.pyplot.yticks", "sklearn.linear_model.LogisticRegression", "matplotlib.pyplot.title", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier", "sklearn.preprocessing.StandardScaler", "numpy.exp", "matplotlib.pyplot.xticks", "matplotlib.p...
yemen2016/FakeNewsDetection
[ "1caad62b068fb125f18c2f35299c36981a86ba55" ]
[ "ML Code/NB.py" ]
[ "from sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm\nfrom sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\nfrom sklearn import decomposition, ensemble\nfrom sklearn.model_selection import cross_validate\nimport pandas, xgboost, numpy, textblob, string...
[ [ "sklearn.naive_bayes.MultinomialNB", "sklearn.metrics.precision_score", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score", "sklearn.feature_extraction.text.Tf...
otanet/RLAS2021_chatbot_DeepRL_20220111
[ "96c6c15ebd0f0c30f6532c64212eca48d134ba6a" ]
[ "dqn_agent.py" ]
[ "from keras.models import Sequential\nfrom keras.layers import Dense\n# from keras.optimizers import Adam\nfrom tensorflow.keras.optimizers import Adam\nimport random, copy\nimport numpy as np\nfrom dialogue_config import rule_requests, agent_actions\nimport re\n\n\n# Some of the code based off of https://jaromiru....
[ [ "numpy.amax", "tensorflow.keras.optimizers.Adam", "numpy.argmax", "numpy.array", "numpy.zeros" ] ]
ishine/AFILM
[ "be8b13ed3f45f4f58cbd37a9fe079d786be398e8" ]
[ "codes/utils.py" ]
[ "import os\nimport numpy as np\nimport h5py\nimport librosa\nimport soundfile as sf\nfrom scipy import interpolate\n\nfrom scipy.signal import decimate\nfrom matplotlib import pyplot as plt\n\n\ndef load_h5(h5_path):\n with h5py.File(h5_path, 'r') as hf:\n print('List of arrays in input file:', list(hf.ke...
[ [ "scipy.interpolate.splrep", "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "numpy.pad", "numpy.abs", "scipy.signal.decimate", "numpy.arange", "matplotlib.pyplot.savefig", "scipy.interpolate.splev", "numpy.angle", "numpy.zeros" ] ]
Jodainc/Method-Numerics-24.9-Point
[ "f99ebc3eae6ee5b2ef35219c3fc3aaf333a4572d" ]
[ "methodnumeric.py" ]
[ "import numpy as npp\nfrom matplotlib import pyplot as plt\nfrom numpy import array\n\n\nx_data = npp.array([87.8, 96.6, 176, 263, 351, 571,834,1129,1624,2107,2678,3380,4258])\ny_data = npp.array([153,204,255,306,357,408,459,510,561,612,663,714,765])\n\ns=[87.8, 96.6, 176, 263, 351, 571,834,1129,1624,2107,2678,338...
[ [ "numpy.polyfit", "matplotlib.pyplot.plot", "numpy.exp", "numpy.array", "numpy.polyval" ] ]
Niram7777/tensorflow
[ "0e40b3e0c30caff9427c1da54c40b6236608ec15" ]
[ "tensorflow/python/ops/array_ops.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.ops.gen_math_ops.select_v2", "tensorflow.python.util.tf_decorator.make_decorator", "tensorflow.python.ops.gen_array_ops.list_diff", "tensorflow.python.framework.ops.RegisterGradient", "tensorflow.python.ops.gen_array_ops.strided_slice", "tensorflow.python.ops.gen_array_o...
shaominghe/stargan_adience
[ "7b59cae38acd0f32bf63695280b833ba7366e804" ]
[ "solver_classification.py" ]
[ "from model import Generator\nfrom model import Discriminator\nfrom torch.autograd import Variable\nfrom torchvision.utils import save_image\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nfrom model_agecomparison import Classificationmodel, getCossloss, getKLloss\nimport os\nimport time\nimport...
[ [ "torch.mean", "torch.abs", "torch.load", "torch.zeros", "numpy.arange", "torch.nn.functional.cross_entropy", "torch.sum", "torch.cuda.is_available", "torch.autograd.grad", "torch.argmax" ] ]
prerakgarg07/cloudyfsps
[ "4a6a185343ed1e09b9f201a465c37e377ef42101" ]
[ "demos/test_hden.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import (division, print_function, absolute_import,\n unicode_literals)\nimport os\nimport sys\nimport numpy as np\nimport fsps\nfrom past.utils import old_div\nfrom cloudyfsps.ASCIItools import (writeASCII, compileASCII, check...
[ [ "numpy.array" ] ]
mengwa41/Ax
[ "fe20381214fd287a2088b0ccdd8c67337aaccf22" ]
[ "ax/service/tests/test_ax_client.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nimport sys\nimport time\nfrom math import ceil\nfrom typing import List, Tuple\nfrom unittest.m...
[ [ "numpy.int32" ] ]
bolecodex/amazon-sagemaker-immersion-day
[ "2894145bb0abd4961cb0e0b7c6d1e89264b76716" ]
[ "lab3/mnist-2.py" ]
[ "import tensorflow as tf\nimport argparse\nimport os\nimport numpy as np\nimport json\n\n\ndef model(x_train, y_train, x_test, y_test):\n \"\"\"Generate a simple model\"\"\"\n # Sequential: 创建顺序模型, 此模型为最简单的线性、从头到尾的结构顺序,不分叉,是多个网络层的线性堆叠。 参数:数组中的内容为模型中的层次结构\n model = tf.keras.models.Sequential([\n tf.k...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dropout" ] ]
onboarding92/AutonomousDrive
[ "80045ffd15ba9ee5b7c39ac7ffa9325616588cff" ]
[ "utils/utils.py" ]
[ "from __future__ import division\nimport math\nimport torch\nimport torch.nn as nn\nimport numpy as np\n\ndef load_classes(path):\n \"\"\"\n Loads class labels at 'path'\n \"\"\"\n fp = open(path, \"r\")\n names = fp.read().split(\"\\n\")[:-1]\n return names\n\n\ndef weights_init_normal(m):\n c...
[ [ "numpy.expand_dims", "torch.max", "torch.zeros", "torch.cat", "numpy.concatenate", "numpy.where", "torch.ones", "numpy.eye", "numpy.finfo", "numpy.argmax", "torch.sort", "numpy.zeros", "torch.nn.init.constant_", "torch.min", "torch.nn.init.normal_", ...
disease-data-intelligence/3G_weight_loss_prediction
[ "476ced900f5a4595877257e38eccbe5e53cb64c2" ]
[ "ML_scripts/ensemble_scoring.py" ]
[ "#!/usr/bin/python3\n\n# Import packages\nseed = 42\nimport numpy as np\nnp.random.seed(seed) # Set numpy random seed\nimport os\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import roc_curve\nimport utils as u\n\n###############################\n# Ensemble predictions\n#############...
[ [ "pandas.concat", "matplotlib.pyplot.tight_layout", "pandas.Series", "numpy.random.seed", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "sklearn.metrics.roc_curve", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.savefi...
cw-tan/deft
[ "abb4d23fa0bb53031c13daef9942bceba4afd655" ]
[ "test/tools_for_tests.py" ]
[ "import numpy as np\nfrom scipy.special import sph_harm\n\ndef get_box_geometry(vectors):\n \"\"\"expects box vectors in rows of 'vectors'\"\"\"\n\n # get box lengths, angles, and volume\n lengths = np.linalg.norm(vectors, axis=1)\n angles = np.empty(3)\n angles[0] = np.arccos(\n vectors[1...
[ [ "numpy.sqrt", "numpy.abs", "numpy.linalg.inv", "numpy.arange", "numpy.divide", "numpy.rint", "numpy.linalg.norm", "numpy.arccos", "scipy.special.sph_harm", "numpy.linalg.det", "numpy.arctan2", "numpy.array", "numpy.meshgrid", "numpy.zeros", "numpy.empty"...
npirvin/Radiative-Transport-PV
[ "d5236bfae5789fd2be5bb0190e962a83c24b3ae7" ]
[ "single_cell_power.py" ]
[ "\"\"\" Created on Thu Jun 21 14:31:46 2018\r\nAuthor: Nicholas Irvin \r\n\r\nThis module determines the output power of a cell.\r\nIf using the diffusion model, then spectral.py calculates the total current,\r\n and this module calcualtes the power.\r\nIf not using the diffusion model, then spectral.py calculate...
[ [ "numpy.log", "scipy.optimize.brentq", "scipy.optimize.minimize_scalar" ] ]
astaff/audio
[ "27a0f7653bc2918e314b4225782d2b29ef31ae4a" ]
[ "torchaudio/_backend.py" ]
[ "from functools import wraps\nfrom typing import Any, List, Union\n\nimport platform\nimport torch\nfrom torch import Tensor\n\nfrom . import _soundfile_backend, _sox_backend\n\n\n_audio_backend = \"soundfile\" if platform.system() == \"Windows\" else \"sox\"\n_audio_backends = {\"sox\": _sox_backend, \"soundfile\"...
[ [ "torch.is_tensor" ] ]
OmerRe/Zero_DCE_TF
[ "457c28751ccedd343a5bcdc750306d6f7501a3bc" ]
[ "test.py" ]
[ "import keras\nimport tensorflow as tf\nimport keras.backend as K\nimport os\nimport sys\nimport argparse\nimport time\nimport src.model\nimport numpy as np\nimport glob\n\nfrom PIL import Image\nfrom src.loss import *\nfrom src.model import DCE_x\nfrom keras import Model, Input\nfrom keras.layers import Concatenat...
[ [ "numpy.expand_dims", "numpy.asarray", "tensorflow.cast", "tensorflow.compat.v1.enable_eager_execution", "numpy.array" ] ]
sboominathan/DeepRL
[ "a415f23b9fff2f7179b1bd3c42ee46df64a605d4" ]
[ "agent/DDPG_agent.py" ]
[ "#######################################################################\n# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################...
[ [ "numpy.stack", "numpy.save" ] ]
hzhwcmhf/pytorch-pretrained-BERT
[ "485adde74244f9b614263420d1f823660e0f96fe" ]
[ "tests/optimization_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "torch.nn.MSELoss", "torch.tensor" ] ]
activatedgeek/uncertainty-da-bayesian-classification
[ "a270fb095f4790dea15327145897d09d0ba9c80b", "a270fb095f4790dea15327145897d09d0ba9c80b" ]
[ "src/bnn_priors/bnn_priors/models/dense_nets.py", "src/bnn_priors/bnn_priors/data/UCI/uci.py" ]
[ "from torch import nn, Tensor\n\nfrom .layers import Linear\nfrom .base import RegressionModel, RaoBRegressionModel, ClassificationModel\nfrom .. import prior\n\n__all__ = ('LinearNealNormal', 'LinearPrior', 'DenseNet', 'RaoBDenseNet',\n 'ClassificationDenseNet', 'LinearRegression', 'LogisticRegression',\...
[ [ "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Identity" ], [ "torch.mean", "torch.std", "numpy.loadtxt" ] ]
snad-space/ad_examples
[ "7c62a81f52e79874d6215b262f5a849d56eeae4f" ]
[ "ad_examples/ad/kde_outlier.py" ]
[ "import numpy.random as rnd\n\nfrom ..common.gen_samples import *\nfrom ..common.gen_samples import *\n\n\"\"\"\npythonw -m ad_examples.ad.kde_outlier\n\"\"\"\n\n\nif __name__ == \"__main__\":\n\n logger = logging.getLogger(__name__)\n\n args = get_command_args(debug=True, debug_args=[\"--debug\",\n ...
[ [ "numpy.random.seed" ] ]
wjy199708/my_point_painting
[ "32dd845b08a94e222e913471e42e9d9e128ba213" ]
[ "train.py" ]
[ "import torch\nimport copy\nfrom model import SSD, MultiBoxLoss\nfrom dataset import KittiDataset\nfrom torch.utils.data import DataLoader\nimport time\n\n\ndef train_model(model, dataloaders, criterion, optimizer, num_epochs=1):\n device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n ...
[ [ "torch.set_grad_enabled", "torch.utils.data.DataLoader", "torch.cuda.is_available" ] ]
DewMaple/head_box
[ "27ac90511344bfa75b340d1db960365e9eb148c7" ]
[ "utils/__init__.py" ]
[ "from distutils.version import LooseVersion\n\nimport tensorflow as tf\n\nTENSORFLOW_VERSION = LooseVersion(tf.__version__)\n\n\ndef tf_concat(axis, values, **kwargs):\n if TENSORFLOW_VERSION >= LooseVersion('1.0'):\n return tf.concat(values, axis, **kwargs)\n else:\n return tf.concat(axis, valu...
[ [ "tensorflow.concat" ] ]
todo-group/exact
[ "ee76421fab9b2b1eaf77d6b01830a18e66f7180a" ]
[ "gallery/ising-square-tc/plot.py" ]
[ "import math\nimport matplotlib.pyplot as plt\n\nfilename = \"result-p15.dat\"\n\nwith open(filename, 'r') as f:\n for line in f:\n data = line.split()\n if (data[0] == \"inf\"):\n free_energy_inf = float(data[6])\n energy_inf = float(data[7])\n\nL = []\nfree_energy = []\nener...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.xscale", "matplotlib.pyplot.yscale", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show" ] ]
dornik/sporeagent
[ "a95139c47534670f7a47f86adf62d3e488981409" ]
[ "dataset/dataset.py" ]
[ "import numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nimport torchvision\nimport os\nimport pickle\nimport trimesh\nimport sys\nimport skimage.io as skio\nfrom tqdm import tqdm\nimport open3d as o3d\nimport cv2 as cv\nfrom scipy.spatial.transform.rotation import Rotation\nimport glob\n\nimport co...
[ [ "numpy.hstack", "numpy.sqrt", "torch.cat", "numpy.linalg.inv", "numpy.uint8", "numpy.eye", "numpy.vstack", "numpy.arange", "numpy.linalg.norm", "numpy.dstack", "numpy.stack", "numpy.asarray", "numpy.ones", "scipy.spatial.transform.rotation.Rotation.from_eule...
sharmasaravanan/openface-Verification
[ "e2471e827eee2c86e92861f5fd59affa04c725ba" ]
[ "openface/torch_neural_net.py" ]
[ "# Copyright 2015-2016 Carnegie Mellon University\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless r...
[ [ "numpy.array" ] ]
kerrywang/Advanced-Lane-Finding
[ "146fd169b9c9a0c58d2bd6103e147fdc4a26684d" ]
[ "lane_finding_pipeline/GradientFilter.py" ]
[ "from lane_finding_pipeline.piplineinterface import PipeLineInterface\nimport cv2\nimport numpy as np\nimport constant\nimport os\nclass GradientFilter(PipeLineInterface):\n def __init__(self, filter=[]):\n self.filters = filter\n\n def addFilter(self, filterClass):\n assert isinstance(filterCla...
[ [ "numpy.absolute", "numpy.sqrt", "numpy.ones", "numpy.max", "numpy.zeros_like", "numpy.zeros" ] ]
liuweiping2020/advForNLP
[ "cb4d21ead7a05826999edec2e6745e5301c4a19c" ]
[ "src/run.py" ]
[ "# coding: UTF-8\nimport time\nimport torch\nimport numpy as np\nfrom trains.train_eval import train, init_network\nfrom importlib import import_module\nimport argparse\n\nparser = argparse.ArgumentParser(description='Chinese Text Classification')\nparser.add_argument('--model', type=str, required=True,\n ...
[ [ "torch.manual_seed", "numpy.random.seed", "torch.cuda.manual_seed_all" ] ]
gpaw789/weather_sim
[ "2b0137cc87c05d811771b5ffa413a477e685681d" ]
[ "master/GenerateWeather.py" ]
[ "import random\nimport datetime\nfrom time import sleep\nimport pickle\nimport helpers\nimport pandas as pd\n\n# structure\n# main() is text interface\n# build_position() is the function that builds the lat/long coodinates\n# running() is the function that runs while loop indefinitely and print the datastream\n# ge...
[ [ "pandas.DataFrame" ] ]
danielkelshaw/ConcreteDropout
[ "65be53d3ecf558992f1c473c90e206717946897b" ]
[ "tests/test_concrete_dropout.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch import Tensor\n\nfrom condrop.concrete_dropout import ConcreteDropout\n\n\nclass TestConcreteDropout:\n\n def test_forward(self):\n\n to_pass = torch.ones(5)\n\n cd = ConcreteDropout(\n weight_regulariser=1e-6,\n dropout_regular...
[ [ "torch.nn.Linear", "torch.ones" ] ]
bblais/pyndamics
[ "fc1552af4bd07ed36412c0455981bae050179ad7" ]
[ "examples/Reproduce ODE API.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nget_ipython().run_line_magic('pylab', 'inline')\n\n\n# ## Reproducing PyMC3 ODE_API_introduction\n# \n# https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/ODE_API_introduction.ipynb\n# \n# text for the equations taken from this original. Al...
[ [ "scipy.integrate.odeint" ] ]
RamanLab/iCOMIC
[ "1310bd51641ce28d4193fa21a002767ca434fc23" ]
[ "icomic/deseq_tsv.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nimport pandas as pd\nimport os\n\ntest_dir = './results/em_results'\n\nsample = []\nunit = []\ncondition = []\n\nfor file in os.listdir(test_dir):\n if file.endswith(\".counts\"):\n sample.append(file)\n else:\n pass\n \n\n\nfor i in range(len(samp...
[ [ "pandas.DataFrame" ] ]
poposca/digit_classifier
[ "63d1515b576b6f984fcf1eea5c6a4d6bc040be16" ]
[ "tensorflow_examples/lite/model_maker/core/task/configs.py" ]
[ "# Copyright 2019 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.Session" ] ]
highlight0112/pyscf
[ "4afbd42bad3e72db5bb94d8cacf1d5de76537bdd", "4afbd42bad3e72db5bb94d8cacf1d5de76537bdd" ]
[ "pyscf/tdscf/rks.py", "pyscf/grad/casscf.py" ]
[ "#!/usr/bin/env python\n# Copyright 2014-2018 The PySCF Developers. 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/LIC...
[ [ "numpy.where", "numpy.sqrt", "numpy.empty" ], [ "numpy.arange", "numpy.dot", "numpy.einsum" ] ]
Unifall/DEKR
[ "3f410bcab420166b030508efd6c71a027c66d5b5" ]
[ "lib/dataset/CrowdPoseDataset.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# The code is based on HigherHRNet-Human-Pose-Estimation.\n# (https://github.com/HRNet/HigherHRNet-Human-Pose-Estimation)\n# Modified by Zigang Geng (zigang@mail.ustc.edu....
[ [ "numpy.amax", "numpy.min", "numpy.amin", "numpy.max", "numpy.zeros" ] ]
jairideout/onecodex
[ "905d533376b808a0b2ea74c2e9c5ea1e87754a81" ]
[ "onecodex/viz/_distance.py" ]
[ "# -*- coding: utf-8 -*-\nfrom itertools import chain\nimport warnings\n\nfrom onecodex.exceptions import OneCodexException\nfrom onecodex.distance import DistanceMixin\n\n\nclass VizDistanceMixin(DistanceMixin):\n def _compute_distance(self, rank, metric):\n if rank is None:\n raise OneCodexEx...
[ [ "pandas.concat", "pandas.DataFrame", "sklearn.manifold.MDS", "sklearn.metrics.pairwise.euclidean_distances", "scipy.cluster.hierarchy.dendrogram", "scipy.spatial.distance.squareform", "numpy.random.RandomState" ] ]
vilmar-hillow/kaggle_tgs_salt
[ "8e4db82b08abbf44ed803a0800402ae48dc7ff86" ]
[ "build_submit.py" ]
[ "from pathlib import Path\nimport cv2\nimport numpy as np\nimport pandas as pd\n\n\npred_folder = Path('./predictions/')\n\n\ndef RLenc(img, order='F', format=True):\n \"\"\"\n img is binary mask image, shape (r,c)\n order is down-then-right, i.e. Fortran\n format determines if the order needs to be pre...
[ [ "numpy.where", "pandas.DataFrame.from_dict" ] ]
PacktPublishing/-Introduction-to-Bayesian-Analysis-in-Python
[ "e0ab762a6cd4423b59d0dbf22e8224028b88c29d" ]
[ "Section 3/3.2.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[7]:\n\n\nget_ipython().run_line_magic('matplotlib', 'inline')\nimport scipy.stats as stats\nfrom IPython.core.pylabtools import figsize\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfigsize(12.5, 9)\n\nnorm_pdf = stats.norm.pdf\n\nplt.subplot(311)\nx = np.li...
[ [ "matplotlib.pyplot.legend", "numpy.linspace", "matplotlib.pyplot.title", "matplotlib.pyplot.autoscale", "scipy.stats.norm.pdf", "numpy.max", "matplotlib.pyplot.subplot", "matplotlib.pyplot.hist" ] ]
ajaybhat/DLND
[ "014e4973835817c6e727ff164e5253371f28fe07" ]
[ "Project 5/helper.py" ]
[ "import math\nimport os\nimport hashlib\nfrom urllib.request import urlretrieve\nimport zipfile\nimport gzip\nimport shutil\n\nimport numpy as np\nfrom PIL import Image\nfrom tqdm import tqdm\n\n\ndef _read32(bytestream):\n \"\"\"\n Read 32-bit integer from bytesteam\n :param bytestream: A bytestream\n ...
[ [ "numpy.sqrt", "numpy.reshape", "numpy.squeeze", "numpy.dtype", "numpy.frombuffer" ] ]
Tripartito/AugmentedReality
[ "b0a4455bc15ab5a5647b221bd1efa715fe9114cc" ]
[ "CV/5_LinearFilters.py" ]
[ "# Modules normally used\nimport numpy as np\nimport cv2\n\ndef CreateFrame(img, krad, color): # Frame (trick to avoid out-of-bounds access)\n height, width, depth = img.shape\n\n if color == \"white\":\n frm = np.ones((height + krad * 2, width + krad * 2, depth))\n else:\n frm = np....
[ [ "numpy.sqrt", "numpy.linspace", "numpy.ones", "numpy.exp", "numpy.zeros" ] ]
YhHoo/Python-ANN
[ "6d3629f54100c9dee721108352f562cd28a2e5fc" ]
[ "activity_2.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom activity_1 import Neural_Object\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\n\ntemp = [] # to store the weights\n\n# ------------------------------------------\n# Load the saved optimized weights from .txt\n# -----------------------...
[ [ "numpy.linspace", "numpy.asarray", "numpy.ones", "numpy.meshgrid", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
pipete40/warehousing-tools
[ "58cd057af8d0ccd3af32001b8b0dfdb0ab6b9620" ]
[ "slotting/plots.py" ]
[ "\nimport numpy as np\nfrom . import aux_funcs as af\nfrom bokeh.resources import CDN\nfrom bokeh.embed import components\nfrom bokeh.palettes import Spectral11\nfrom bokeh.plotting import figure\nfrom bokeh.models import Label\nfrom bokeh.models.tickers import FixedTicker\n\ndef graph_groups_inventory(x, N, hs, in...
[ [ "numpy.asarray", "numpy.arange", "numpy.cumsum", "numpy.max", "numpy.diff" ] ]
arulvelkumar/jira-agile-metrics
[ "55c4a25cbaf487cf0a5faf57879c0a34473b59c9" ]
[ "jira_agile_metrics/calculators/defects_test.py" ]
[ "import pytest\nfrom pandas import Timestamp, NaT\n\nfrom ..conftest import (\n FauxJIRA as JIRA,\n FauxIssue as Issue,\n FauxFieldValue as Value,\n)\n\nfrom ..utils import extend_dict\n\nfrom ..querymanager import QueryManager\nfrom .defects import DefectsCalculator\n\n\n@pytest.fixture\ndef fields(minima...
[ [ "pandas.Timestamp" ] ]