repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
young-oct/complex_sporco
[ "88488e69d77805ccf25030388dc9e03bcc6a6df1" ]
[ "tests/dictlrn/test_cbpdndl.py" ]
[ "from __future__ import division\nfrom builtins import object\n\nimport numpy as np\n\nfrom sporco.dictlrn import cbpdndl\n\n\n\nclass TestSet01(object):\n\n def setup_method(self, method):\n N = 16\n Nd = 5\n M = 4\n K = 3\n np.random.seed(12345)\n self.D0 = np.random.r...
[ [ "numpy.random.randn", "numpy.random.seed" ] ]
krantikiran68/EzPC
[ "cacf10f31cddf55e4a06908fcfc64f8d7d0f85bd" ]
[ "Athos/tests/tf/unittests/test_convolution.py" ]
[ "\"\"\"\n\nAuthors: Pratik Bhatu.\n\nCopyright:\nCopyright (c) 2021 Microsoft Research\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the...
[ [ "tensorflow.Graph", "tensorflow.constant", "tensorflow.as_dtype", "tensorflow.compat.v1.Session", "numpy.random.randn" ] ]
ekunnii/APPIAN
[ "1460ef4e1b5c98a558b7f89753f1a1a5541374cf", "1460ef4e1b5c98a558b7f89753f1a1a5541374cf" ]
[ "Test/validation_qc.py", "Initialization/initialization.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nfrom pyminc.volumes.factory import *\nimport sys\nimport os\nimport numpy as np\nfrom scipy.ndimage.measurements import center_of_mass\nif __name__ == \"__main__\":\n if os.path.exists(sys.argv[1]) :\n vol=volumeFromFile(sys.argv[...
[ [ "matplotlib.pyplot.imshow", "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "numpy.array", "numpy.sum" ], [ "numpy.amax", "numpy.split", "numpy.isnan", "numpy.mean", "numpy.a...
AndreaCoop/Video_creator
[ "2518a3527bff013466e887f6d1bc06fe2a8e4912" ]
[ "video_generator_script.py" ]
[ "# script to create an animated plot from a simulation\n\n# import data\n\n# import packages\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\n\n# +\n# input \n\n# data from a .txt file\nfile_data = \"sin_expdecay.txt\"\n\n#set title and legth of the movie\ntitle_movie = 'examp...
[ [ "numpy.amax", "numpy.amin", "matplotlib.pyplot.axes", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.show", "numpy.loadtxt", "matplotlib.pyplot.figure" ] ]
aturbofly/crab
[ "ca3d6a8f50573a09d154274dd14331ebc91abe17" ]
[ "scikits/crab/recommenders/knn/classes.py" ]
[ "\"\"\"\nGeneralized Recommender models.\n\nThis module contains basic memory recommender interfaces used throughout\nthe whole scikit-crab package.\n\nThe interfaces are realized as abstract base classes (ie., some optional\nfunctionality is provided in the interface itself, so that the interfaces\ncan be subclass...
[ [ "numpy.isnan", "numpy.lexsort", "numpy.setdiff1d", "numpy.vectorize", "numpy.array", "numpy.sum" ] ]
tristan-paul/TweetOff
[ "efaa020af8df43190f37a371272eee3a7731dd7e" ]
[ "tweetoff/predict.py" ]
[ "import numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.model_selection import cross_val_score\nfrom .models import User\nfrom .twitter import BASILICA\n\ndef predict_user(user1_name, user2_name, tweet_text):\n user1 = User.query.filter(User.name == user1_name).one()\n user2 = U...
[ [ "numpy.concatenate", "numpy.array", "sklearn.linear_model.LogisticRegression", "numpy.vstack" ] ]
theimgclist/tensorflow
[ "fdfb6f190577416b402b0b113568222ff4e0d672" ]
[ "models/research/deep_speech/deep_speech_model.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.keras.layers.Lambda", "tensorflow.shape", "tensorflow.keras.layers.Dense", "tensorflow.keras.backend.ctc_batch_cost", "tensorflow.keras.layers.Bidirectional", "tensorflow.keras.layers.BatchNormalization", "tensorflow.to_float", "tensorflow.keras.layers.Flatten", "te...
EPFL-LCN/pub-illing2021-neurips
[ "f5c9d7380f123a155a7c2b913df6f1fddb787be1" ]
[ "vision/CLAPPVision/vision/models/Supervised_Loss.py" ]
[ "import torch.nn as nn\nimport torch\n\nfrom CLAPPVision.utils import utils\n\nclass Supervised_Loss(nn.Module):\n def __init__(self, opt, hidden_dim, calc_accuracy):\n super(Supervised_Loss, self).__init__()\n\n self.opt = opt\n\n self.pool = None\n self.hidden_dim = hidden_dim\n ...
[ [ "torch.nn.Linear", "torch.nn.CrossEntropyLoss", "torch.nn.functional.adaptive_avg_pool2d", "torch.zeros" ] ]
kristianeschenburg/ddCRP
[ "3c503418050b45e2156964c1e0165e92eb980fab" ]
[ "ddCRP/Priors.py" ]
[ "import numpy as np\nfrom numpy.linalg import det\nfrom scipy.special import gammaln, multigammaln\nfrom ddCRP.PriorBase import Prior\n\n\nclass NIW(Prior):\n\n \"\"\"\n Normal-Inverse-Chi-Squared prior model for connectivity features.\n\n Parameters:\n - - - - - -\n mu0, kappa0: float\n prior...
[ [ "numpy.linalg.det", "numpy.log", "scipy.special.multigammaln", "scipy.special.gammaln" ] ]
csala/RDT
[ "ca639dc1eeae5f1bb9f78e8b163659680ce627e3" ]
[ "tests/integration/test_hyper_transformer.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom rdt import HyperTransformer\nfrom rdt.transformers import OneHotEncodingTransformer\n\n\ndef get_input_data_with_nan():\n data = pd.DataFrame({\n 'integer': [1, 2, 1, 3, 1],\n 'float': [0.1, 0.2, 0.1, np.nan, 0.1],\n 'categorical': ['a', 'a', ...
[ [ "pandas.to_datetime", "pandas.testing.assert_frame_equal", "pandas.DataFrame" ] ]
ishansharma/open_cv_feature_detection
[ "34f09d6e144d8220cca9295f0a59dba7f9488516" ]
[ "image_operations/transformations.py" ]
[ "import cv2\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\n\nimage = mpimg.imread('../../dataset/Hands/Hand_0000083.jpg')\n\n\ndef resize():\n scaleup = cv2.resize(image, None, fx=2, fy=2, interpolation=cv2.INTER_CUBIC)\n scaledown = cv2.resize(image, None, fx=0.5, fy=0.5, interpolation=c...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.image.imread", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
sylvainlapeyrade/LSTM_KDD99_Keras
[ "e07c05803dfd4ad454cf5043531bb3e205ec022b" ]
[ "src/unsw_processing.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom keras.utils import to_categorical\nfrom sklearn.preprocessing import (StandardScaler, OrdinalEncoder,\n LabelEncoder, MinMaxScaler)\npd.options.mode.chained_assignment = None # default='warn' | Disable warnings\n\n# ***** UNSW STRING ...
[ [ "pandas.read_csv", "sklearn.preprocessing.OrdinalEncoder", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.LabelEncoder", "sklearn.preprocessing.MinMaxScaler" ] ]
mkhorton/mp-dash-components
[ "b9af1b59f0120a90897631d9a7f8d9f0ae561de9" ]
[ "crystal_toolkit/core/legend.py" ]
[ "from pymatgen.core.periodic_table import Specie, Element\nfrom pymatgen.core.structure import Molecule\nfrom pymatgen.core.structure import SiteCollection, Site\nfrom pymatgen.analysis.molecule_structure_comparator import CovalentRadius\nfrom pymatgen.util.string import unicodeify_species\n\nfrom monty.json import...
[ [ "sklearn.preprocessing.LabelEncoder", "numpy.array", "matplotlib.cm.get_cmap" ] ]
Russell-Ryan/pyLINEAR
[ "d68e44bc64d302b816db69d2becc4de3b15059f9" ]
[ "pylinear/modules/extract/groupcollection.py" ]
[ "import numpy as np\nfrom shapely import geometry\nimport h5py\n\n\nfrom ... import h5table\nfrom ...utilities import pool\nfrom ...constants import COMPARGS,SEGTYPE\n\n\n\nclass GroupCollection(list):\n def __init__(self,minarea=0.1,ncpu=0,path='tables'):\n \n self.minarea=minarea\n self.path=path...
[ [ "numpy.array", "numpy.loadtxt", "numpy.unique" ] ]
benjonesbenjones/silver
[ "4c037577851682aed07e3bd1daf05403cc00c5f0" ]
[ "app.py" ]
[ "# by ben with <3\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output, State\nimport dash_colorscales\nimport pandas as pd\nimport cufflinks as cf\nimport numpy as np\n\napp = dash.Dash(__name__)\nserver = app.server\n\ndf_lat_lon = pd.r...
[ [ "pandas.read_csv", "numpy.linspace" ] ]
sroet/regreg
[ "299ff18b8680872d4d85447953793bf438f78bba" ]
[ "regreg/problems/dual_problem.py" ]
[ "import numpy as np\nfrom scipy import sparse\nfrom warnings import warn\n\nfrom ..algorithms import FISTA\nfrom ..problems.composite import (composite, nonsmooth as nonsmooth_composite,\n smooth as smooth_composite)\nfrom ..affine import (vstack as afvstack, identity as afidentity, power_L,\...
[ [ "numpy.zeros" ] ]
hongfz16/Garment4D
[ "9317dc262f3d35eb9e6cd6a7bfbb29f04560ca35" ]
[ "modules/mesh_encoder.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nimport pickle\nimport torch.nn.functional as F\nfrom .pointnet2encoder import Pointnet2MSGSEG\nimport sys\nsys.path.append('../')\nfrom utils import mesh_utils\nfrom smplx import batch_rodrigues\nfrom .pygcn import layers\nfrom .pygcn import utils as gcn_util...
[ [ "numpy.sqrt", "torch.cat", "torch.zeros", "torch.no_grad", "scipy.sparse.coo_matrix", "torch.softmax", "torch.ones", "torch.mm", "scipy.sparse.diags", "torch.from_numpy", "torch.nn.functional.relu", "numpy.zeros", "torch.isinf", "numpy.power", "torch.uns...
rayyang29/pygaggle
[ "6a0a1261293428e8df4817ef835c558ba5fd7b01" ]
[ "pygaggle/run/evaluate_passage_ranker.py" ]
[ "from typing import Optional, List\nfrom pathlib import Path\nimport logging\n\nfrom pydantic import BaseModel, validator\nfrom transformers import (AutoModel,\n AutoTokenizer,\n AutoModelForSequenceClassification,\n BertForSequenceClassific...
[ [ "torch.device", "torch.zeros" ] ]
wenxichen/tensorflow_yolo2
[ "f040d9932816d8b2f8d7a67231060f0beea821d4" ]
[ "yolo1-resnet-adv.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\nfrom tensorflow.python.ops import control_flow_ops\n# from datasets import dataset_factory\nfrom deployment import model_deploy\nfrom nets import nets_factory\n# from preproc...
[ [ "tensorflow.app.flags.DEFINE_string", "tensorflow.train.AdamOptimizer", "tensorflow.train.batch", "tensorflow.gfile.IsDirectory", "tensorflow.group", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.python.ops.control_flow_ops.with_dependencies", "tensorflow.get_col...
rickatx/message_response_pipeline
[ "7433c83e3b1cfd201da448c7545117fd79a13cea" ]
[ "udacity_root/data/process_data.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: ETL_Pipeline_Preparation.ipynb (unless otherwise specified).\n\n__all__ = ['load_data', 'clean_data', 'get_engine', 'save_data']\n\n# Cell\n\nimport numpy as np\nimport pandas as pd\nfrom sqlalchemy import create_engine\nimport sys\n\n# Cell\n\ndef load_data(messages_fil...
[ [ "pandas.read_csv" ] ]
hanaseleb/pycaret
[ "1fe6e1a6bee642351c4b6064d769f97294713f48" ]
[ "pycaret/tests/test_preprocess.py" ]
[ "import os\nimport sys\nimport pandas as pd\nimport numpy as np\nimport pytest\nimport pycaret.datasets\nimport pycaret.internal.preprocess\nimport pycaret.classification\n\nsys.path.insert(0, os.path.abspath(\"..\"))\n\n\ndef test_auto_infer_label():\n # loading dataset\n data = pycaret.datasets.get_data(\"j...
[ [ "numpy.random.randint" ] ]
NetVoobrazhenia/pandas_task
[ "0289391e47bb136dacce1cec700ef0f52a028801" ]
[ "lec/5.py" ]
[ "import pandas as pd\n\nworks = pd.read_csv(\"./works.csv\")\n\nnNa = works['skills'].notna()\ndf = works['skills'].dropna().str.lower().str.contains('питон|python')\n\nprint(f\"зарплата тех, у кого в скиллах есть python (питон):\\n\",\n ', '.join(f\"{i}\" for i in works[nNa][df]['salary'].values))\n" ]
[ [ "pandas.read_csv" ] ]
guialfredo/mmtracking
[ "05926b4d824a9f7b05e78a6375e6e63530a55df9" ]
[ "mmtrack/models/sot/base.py" ]
[ "from abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\n\nimport mmcv\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nfrom mmcv.runner import auto_fp16, load_checkpoint\nfrom mmcv.utils import print_log\n\nfrom mmtrack.utils import get_root_logger\n...
[ [ "torch.distributed.get_world_size", "torch.distributed.is_available", "torch.distributed.is_initialized" ] ]
jamesmtuck/DNA_stability
[ "52b8561807969c09db8ba81e1198f6cbcee28857" ]
[ "stability.py" ]
[ "# Contributed by James Tuck (jtuck@ncsu.edu) \n\nimport sys\nimport csv\nimport math\nfrom math import factorial\n\nimport matplotlib.pyplot as plt\nimport gmpy2 as g\nfrom gmpy2 import mpfr\n\n# Tune precision of gmpy2 module\ng.get_context().precision = 1000\n\ndef dumpXY(name, XY, labels):\n \"\"\" Write a c...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
dsj96/TITS
[ "ea9c4dc812ff871c7ccb2e3748e35d3b634920d0" ]
[ "FNN.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom torch.nn import Module\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nfrom torch.autograd import Variable\r\n\r\nfrom sklearn.model_selection import train_test_split\r\nimport math\r\nimport numpy as np\r\nimport argparse\r\n\r\nfrom metrics impor...
[ [ "torch.nn.functional.dropout", "sklearn.model_selection.train_test_split", "torch.nn.Linear", "torch.nn.functional.sigmoid", "numpy.mean" ] ]
prakhargurawa/Machine-Learning-A-Z
[ "f1b2dfbdfe67525c2d5061e66c3d31d612d35309", "f1b2dfbdfe67525c2d5061e66c3d31d612d35309" ]
[ "3_Classification/Model_Selection_Classification/random_forest_classification.py", "2_Regression/Model_Selection_Regression/polynomial_regression.py" ]
[ "# Random Forest Classification\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('ENTER_THE_NAME_OF_YOUR_DATASET_HERE.csv')\nX = dataset.iloc[:, :-1].values\ny = dataset.iloc[:, -1].values\n\n# Splitting the data...
[ [ "pandas.read_csv", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.StandardScaler", "sklearn.metrics.accuracy_score" ], [ "pandas.read_csv", "sklearn.metrics.r2_score", "numpy....
baptistesoulard/Production-plan-optimization
[ "38cd0501315c11fd0635d09e2869c54e2336f0bf" ]
[ "temp/Model5.py" ]
[ "# Import required packages\nimport pandas as pd\nimport gurobipy\nfrom matplotlib import pyplot as plt\nimport datetime\nfrom typing import List, Dict\n\n\ndef optimize_planning(\n timeline: List[str],\n workcenters: List[str],\n needs: Dict[str, int],\n wc_cost_reg: Dict[str, int],\n wc_cost_ot: Di...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "pandas.DataFrame", "pandas.DataFrame.from_dict", "matplotlib.pyplot.show" ] ]
bensondaled/puffsopto
[ "fdcf2fabb50c2bd2521a3d2702ad2e41217c0032" ]
[ "figs/figure_s7.py" ]
[ "\"\"\"\nFigure S7: logistic regression model, by subj\n\"\"\"\nimport matplotlib.pyplot as pl\nfrom figure_panels import *\n\n## Setup figure ##\nfig_id = 'sfig7'\nfigw,figh = 7.2,5.\nfig = pl.figure(fig_id, figsize=(figw,figh))\n\nrow_bottoms = [.85,.7,.55,.4,.25,.1]\nletter_ys = [.8, .6, 0, 0, 0, 0, 0, 0]\nlette...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.figure" ] ]
Velocities/stocker
[ "a163971c60dd70a2c20a6d23add33c25036efe46" ]
[ "stocker/get_data.py" ]
[ "import pandas as pd\r\nimport yfinance as yf\r\nimport requests\r\nimport datetime as dt\r\nfrom pytrends.request import TrendReq\r\n\r\n\r\ndef main(stock, years=1): # function to get data from Yahoo Finance\r\n end = dt.datetime.today().strftime('%Y-%m-%d') # today as the end date\r\n start = (dt.datetim...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
aryaman4/ludwig
[ "76ddea4634e4dcc1c0f956f2e61d80b0c3621a81" ]
[ "ludwig/utils/math_utils.py" ]
[ "#! /usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, Inc.\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/LICENS...
[ [ "numpy.max", "numpy.iinfo" ] ]
denizetkar/lstms.pth
[ "c1d6af1e106e17c51604ae8acdb5114828adff19" ]
[ "test/test_correctness.py" ]
[ "#!/usr/bin/env python\n\nimport torch as th\nimport torch.nn as nn\nfrom torch.autograd import Variable as V\n\nfrom lstms import SlowLSTM, LSTM, GalLSTM, MoonLSTM, SemeniutaLSTM\n\n\nif __name__ == '__main__':\n lstms = [\n (SlowLSTM, 'SlowLSTM'),\n (LSTM, 'LSTM'),\n ]\n for lstm, name in l...
[ [ "torch.zeros", "torch.nn.LSTM", "torch.manual_seed", "torch.sum", "torch.equal", "torch.rand" ] ]
lisiyuan656/datasets
[ "b097e0985eaaadc6b0c1f4dfa3b3cf88d116c607" ]
[ "tensorflow_datasets/core/deprecated/text/subword_text_encoder_test.py" ]
[ "# coding=utf-8\n# Copyright 2020 The TensorFlow Datasets 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 ...
[ [ "tensorflow.compat.v2.io.gfile.GFile", "tensorflow.compat.v2.compat.as_text" ] ]
ConnorJL/ProgGAN-PyTorch
[ "a64aec9640a094f5dc09184677c13236574f69a2" ]
[ "ProgGAN.py" ]
[ "import math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom scipy.misc import imsave\nfrom torch.autograd import Variable\nfrom torch.nn.init import kaiming_normal, calculate_gain\n\n\nclass ProgGAN(object):\n def __init__(self, nz=512, lr=0.0010):\n self...
[ [ "torch.nn.functional.upsample", "torch.mean", "torch.transpose", "torch.cat", "torch.sum", "torch.FloatTensor", "torch.autograd.Variable", "torch.nn.init.calculate_gain", "torch.sqrt", "torch.std", "torch.rand", "numpy.zeros", "torch.squeeze", "torch.nn.init...
An-Dang/clustinator
[ "d1737628cd65745eb7034eb4e0d59996f8976f8b", "d1737628cd65745eb7034eb4e0d59996f8976f8b" ]
[ "clustinator/clustering.py", "poc/src/clustering.py" ]
[ "from sklearn.cluster import DBSCAN\nimport numpy as np\n\n\nstates = [\"INITIAL\",\"login\",\"View_Items\",\"home\",\"logout\",\"View_Items_quantity\",\"Add_to_Cart\",\"shoppingcart\",\n \"remove\",\"deferorder\",\"purchasecart\",\"inventory\",\"sellinventory\",\"clearcart\",\"cancelorder\",\"$\"]\n\n# Da...
[ [ "numpy.mean", "sklearn.cluster.DBSCAN", "numpy.unique" ], [ "numpy.mean", "sklearn.cluster.DBSCAN", "numpy.unique" ] ]
KelvinKramp/Autotune123
[ "f6948e6da650bed0c05577e9565449e7e488ea2a" ]
[ "get_filtered_data.py" ]
[ "import numpy as np\nfrom scipy.signal import savgol_filter\n\n\ndef get_filtered_data(df, filter=\"No filter\"):\n # clean lists by removing sensitivity, removing IC ratio, removing empty values and converting strings\n # with ratios to floats.\n\n # x\n l = df[\"Parameter\"].to_list()\n l_time = []...
[ [ "numpy.asarray", "numpy.isnan", "scipy.signal.savgol_filter" ] ]
fgkcv25/LMC
[ "1c13ac671ef325448fb3f8264398648cbb3d56b7" ]
[ "Leitura de Arquivo/Leitura de arquivo.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue May 21 07:51:07 2019\r\n\r\n@author: 05873472955\r\n\"\"\"\r\n\r\n\r\nimport numpy as np\r\n\r\nwith open('C:\\\\Users\\\\05873472955\\\\Desktop\\\\LEitura de Arquivo\\\\A.txt') as arquivo:\r\n dados = arquivo.readlines()\r\n \r\ndados.remove(dados[1001])\r...
[ [ "numpy.asarray" ] ]
njaupan/SASAR
[ "b32e7eef9c85663656fdf19a58f7f39a768a8116" ]
[ "SASAR.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\n# June 2021\n# If using this pipeline please cite : XXXXXXXXXX\n#--------------------------------------------------------------------------+ \n# \n#\tSASAR is a meta-assembly tool \n# to reconcile different long read assembl...
[ [ "pandas.merge", "pandas.read_csv" ] ]
dingmyu/psa
[ "e27539bbd569cd1100a339336b9e3a2b0dad67fc" ]
[ "fail_wok/voc_deeplab/resnet.py" ]
[ "import torch.nn as nn\nimport torch\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom torchE.nn import SyncBatchNorm2d\n\nBatchNorm = nn.BatchNorm2d\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152']\n\n\nmodel_urls = {\n 'resnet18': 'https://download.p...
[ [ "torch.nn.Sequential", "torch.load", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.ReLU", "torch.utils.model_zoo.load_url" ] ]
BrunoKrinski/segtool
[ "cb604b5f38104c43a76450136e37c3d1c4b6d275" ]
[ "final_plot.py" ]
[ "import os\nimport cv2\nimport glob\nimport json\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cbook as cbook\n\ndef getminmax(x1, x2):\n aux1 = sorted(x1)\n aux2 = sorted(x2)\n\n #print(aux1[0], aux2[0])\n if aux1[0] < aux2[0]:\n p = aux1[0]\n else:\n ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "numpy.array", "matp...
telnoratti/burningwheel-tools
[ "78277752ddcd6f5b257603920385b61b113effac" ]
[ "gen_function.py" ]
[ "import sympy\nfrom sympy import rsolve, Function, expand, Rational, Sum, Poly\nfrom sympy.abc import *\n\nfrom sympy import O\nimport numpy as np\nfrom numpy.polynomial import polynomial as np_poly\n\n### Recurrence relations precomputed, needed for exploding cases\n# These are kept as recurrence relations because...
[ [ "numpy.zeros", "numpy.polynomial.polynomial.polymul" ] ]
wdecay/ShapeClassification
[ "0592a837f272c709322a1d7e74948268e8c82cce" ]
[ "layers/Output.py" ]
[ "import tensorflow as tf\n\nclass Output(tf.keras.layers.Layer):\n def __init__(self, num_classes, **kwargs):\n self.num_classes = num_classes\n super(Output, self).__init__(**kwargs)\n\n def build(self, input_shape):\n tfn_output_shape = input_shape[0][0].as_list()\n\n self.fully_...
[ [ "tensorflow.map_fn", "tensorflow.squeeze", "tensorflow.einsum" ] ]
sylvainletourneau/env_canada
[ "ec146f98b6b556a483358789f2a963b9fc421478" ]
[ "env_canada/ec_radar.py" ]
[ "from concurrent.futures import as_completed\nimport datetime\nfrom io import BytesIO\nimport json\nimport os\nfrom PIL import Image\nimport xml.etree.ElementTree as et\n\nimport cv2\nimport dateutil.parser\nimport imageio\nimport numpy as np\nimport requests\nfrom requests_futures.sessions import FuturesSession\n\...
[ [ "numpy.radians", "numpy.degrees", "numpy.cos", "numpy.sin", "numpy.array" ] ]
PaipaPsyche/SuperClusterCharacterization
[ "8d86ad31aa34dfa6a44592b94c42cba38487216d" ]
[ "Densidades (test)/plot_divergence.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Apr 6 13:06:41 2018\n\n@author: David\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom astropy.convolution import Gaussian2DKernel,convolve\n\n\n\n\n#Data Loading========\ndata1 = np.loadtxt(\"Halo.txt\")\ndata1=np.transpose(data1)\n\n\nprints=0#...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.axes", "numpy.transpose", "numpy.zeros", "numpy.sum", "numpy.loadtxt", "matplotlib.pyplot.figure" ] ]
Saiprasad16/agents
[ "9e0972fc0878b29925ae496e883d80e7da3928aa" ]
[ "tf_agents/utils/nest_utils.py" ]
[ "# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ...
[ [ "tensorflow.convert_to_tensor", "numpy.expand_dims", "tensorflow.concat", "tensorflow.stack", "numpy.squeeze", "tensorflow.rank", "tensorflow.nest.flatten", "tensorflow.nest.pack_sequence_as", "numpy.stack", "tensorflow.compat.v2.where", "tensorflow.TensorShape", "t...
Feverdreams/BMI
[ "53d59f996f21ad29bf2e8961eb9b45bfe1776252", "53d59f996f21ad29bf2e8961eb9b45bfe1776252" ]
[ "biosppy/plotting.py", "biosppy/signals/eeg.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nbiosppy.plotting\n----------------\n\nThis module provides utilities to plot data.\n\n:copyright: (c) 2015-2018 by Instituto de Telecomunicacoes\n:license: BSD 3-clause, see LICENSE for more details.\n\"\"\"\n\n# Imports\n# compat\nfrom __future__ import absolute_import, division, ...
[ [ "numpy.abs", "numpy.nonzero", "numpy.min", "numpy.linspace", "numpy.sqrt", "matplotlib.pyplot.get_cmap", "numpy.ones", "numpy.max", "numpy.mean", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.close", "numpy.angle", "numpy.array", "matplotlib.pyplot.show...
shania3322/joeynmt
[ "5afe9d00930f19949b2078141771bf4621f6e9ae" ]
[ "github/joeynmt/transformer_layers.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\nimport math\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch import Tensor\r\n\r\n\r\n# pylint: disable=arguments-differ\r\nclass MultiHeadedAttention(nn.Module):\r\n \"\"\"\r\n Multi-Head Attention module from \"Attention is All You Need\"\r\n\r\n Implementation modif...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.zeros", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.matmul", "torch.arange", "torch.nn.ReLU" ] ]
c-lai/3D-ResNets-PyTorch
[ "488d0d7c4760e60ead4db80fe6f017a8778318ff" ]
[ "model.py" ]
[ "import torch\nfrom torch import nn\n\nfrom models import (resnet, resnet2p1d, pre_act_resnet,\n wide_resnet, resnext, densenet, googlenet)\n\n\ndef get_module_name(name):\n name = name.split('.')\n if name[0] == 'module':\n i = 1\n else:\n i = 0\n if name[i] == 'feature...
[ [ "torch.cuda.set_device", "torch.load", "torch.nn.Linear", "torch.nn.DataParallel", "torch.nn.parallel.DistributedDataParallel" ] ]
adit98/google-research
[ "0714e9a5a3934d922c0b9dd017943a8e511eb5bc" ]
[ "jaxnerf/nerf/datasets.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.split", "numpy.sqrt", "numpy.linspace", "numpy.concatenate", "numpy.mean", "numpy.cross", "numpy.moveaxis", "numpy.random.randint", "numpy.square", "numpy.ones_like", "numpy.reshape", "numpy.arange", "numpy.eye", "numpy.stack", "numpy.sin", "n...
stacksmashing/TensorKartRealHW
[ "bb5e1eb164db0a78738ac6c0c7f07909c4d89dff" ]
[ "train3.py" ]
[ "#!/usr/bin/env python\n#model like in https://www.youtube.com/watch?v=tcpmucSLKo8\n\nimport numpy as np\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense, Dropout, Flatten\nfrom tensorflow.keras.layers import Conv2D\nfrom tensorflow.keras import optimizers\nfrom tensorflow....
[ [ "tensorflow.keras.layers.Dense", "sklearn.utils.shuffle", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.backend.square", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Dropout", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.Flatten" ] ]
epahfk84/shape_as_points
[ "bcda2fdaab22c26e33b074d3c993fbb55fd567a1" ]
[ "generate.py" ]
[ "import torch\nfrom torch.utils.data import Dataset, DataLoader\nimport numpy as np; np.set_printoptions(precision=4)\nimport shutil, argparse, time, os\nimport pandas as pd\nfrom collections import defaultdict\nfrom src import config\nfrom src.utils import mc_from_psr, export_mesh, export_pointcloud\nfrom src.dpsr...
[ [ "torch.__version__.split", "numpy.set_printoptions", "torch.utils.data.DataLoader", "pandas.DataFrame", "torch.cuda.is_available", "torch.device" ] ]
kevin-michael-cs230/bigbird
[ "38ef761f56d89be11f3a64e4aabac554c8454050" ]
[ "bigbird/core/modeling.py" ]
[ "# Copyright 2020 The BigBird 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 applicable law o...
[ [ "tensorflow.compat.v2.zeros_like", "tensorflow.compat.v2.ones_like", "tensorflow.compat.v2.math.count_nonzero", "tensorflow.compat.v2.slice", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.compat.v1.variable_scope", "tensorflow.compat.v2.ones", "tensorflow.compat.v2.identity", ...
ruslanmv/Machine-Learning-Codes
[ "dfc0ce1321c9953800d4238b3f4ab8f164bf26fc" ]
[ "rl2/cartpole/dqn_theano.py" ]
[ "# https://deeplearningcourses.com/c/deep-reinforcement-learning-in-python\n# https://www.udemy.com/deep-reinforcement-learning-in-python\nfrom __future__ import print_function, division\nfrom builtins import range\n# Note: you may need to update your version of future\n# sudo pip install -U future\n\nimport gym\ni...
[ [ "numpy.random.random", "numpy.sqrt", "matplotlib.pyplot.title", "numpy.random.choice", "matplotlib.pyplot.plot", "numpy.atleast_2d", "numpy.random.randn", "matplotlib.pyplot.show", "numpy.zeros", "numpy.empty" ] ]
JAAlvarado-Montes/huntsman-pocs
[ "eb5dfdc07e3084cb86b8f02373e83b7b27ecfe5a" ]
[ "src/huntsman/pocs/utils/dither.py" ]
[ "import numpy as np\nimport astropy.units as u\nfrom astropy.coordinates import SkyCoord, SkyOffsetFrame, ICRS\nfrom astropy.wcs import WCS\n\nimport matplotlib.pyplot as plt\n\n# Pattern for dice 9 3x3 grid (sequence of (RA offset, dec offset) pairs)\ndice9 = ((0, 0),\n (0, 1),\n (1, 1),\n ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "matplotlib.pyplot.subplot", "numpy.random.uniform", "numpy.zeros" ] ]
Shirling-VT/Tdiff_Validation
[ "a19c5c8b62b09d0cd60749154c4d744f1f56dfeb" ]
[ "py/get_fit_data.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"get_fit_data.py: utility module to fetch fitacf<v> level data.\"\"\"\n\n__author__ = \"Chakraborty, S.\"\n__copyright__ = \"Copyright 2020, SuperDARN@VT\"\n__credits__ = []\n__license__ = \"MIT\"\n__version__ = \"1.0.\"\n__maintainer__ = \"Chakraborty, S.\"\n__email__ = \"shibaji7@vt...
[ [ "numpy.abs", "numpy.unique", "numpy.mean", "pandas.DataFrame.from_records", "numpy.array" ] ]
abhinavarora/text
[ "69f67f3a775f3d3c6f85cfaa4ac3819500b90696", "69f67f3a775f3d3c6f85cfaa4ac3819500b90696" ]
[ "torchtext/transforms.py", "test/data/test_modules.py" ]
[ "import json\nfrom copy import deepcopy\nfrom functools import lru_cache\nfrom typing import Any, List, Optional, Union\n\nimport torch\nimport torchtext # noqa: F401\nfrom torch import Tensor\nfrom torch.nn import Module\nfrom torchtext._torchtext import CLIPEncoder as CLIPEncoderPyBind, GPT2BPEEncoder as GPT2BPE...
[ [ "torch.classes.torchtext.Vocab", "torch.classes.torchtext.CLIPEncoder", "torch.classes.torchtext.GPT2BPEEncoder", "torch.jit.isinstance" ], [ "torch.randint", "torch.cat", "torch.zeros", "torch.nn.functional.multi_head_attention_forward", "torch.nn.Linear", "torch.rand"...
grlee77/chainer
[ "c064bb33701bc35fee9500a334a8fc76e4179bfc" ]
[ "tests/onnx_chainer_tests/functions_tests/test_arrays.py" ]
[ "import chainer\nimport chainer.functions as F\nfrom chainer import testing\nimport numpy as np\nimport onnx\nimport pytest\n\nfrom onnx_chainer import export\nfrom onnx_chainer.testing import input_generator\nfrom onnx_chainer_tests.helper import ONNXModelChecker\nfrom onnx_chainer_tests.helper import ONNXModelTes...
[ [ "numpy.arange", "numpy.array", "numpy.zeros" ] ]
etrulls/d2-net
[ "95e5557d7f64641ba7991d7370b845c5a036f183" ]
[ "lib/pyramid.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom lib.exceptions import EmptyTensorError\nfrom lib.utils import interpolate_dense_features, upscale_positions\n\n\ndef process_multiscale(image, model, scales=[.5, 1, 2]):\n b, _, h_init, w_init = image.size()\n device = image.device\...
[ [ "torch.nn.functional.normalize", "torch.abs", "torch.max", "torch.cat", "torch.zeros", "torch.min", "torch.nn.functional.interpolate", "torch.nonzero", "torch.stack" ] ]
tho15/tfplusplus
[ "e151986f7d449ee5ccb440fbb947fbc64fd62f49" ]
[ "experimental/model.py" ]
[ "import numpy as np\nimport tensorflow as tf\n#import cv2\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport csv\nimport math\nimport os\nfrom keras.layers import Dense, Flatten, Lambda, Activation, MaxPooling2D, ELU, Dropout\nfrom keras.layers.convolutional import Conv2D\nfrom keras.models import Sequ...
[ [ "sklearn.utils.shuffle", "matplotlib.pyplot.imread", "tensorflow.global_variables", "sklearn.model_selection.train_test_split", "tensorflow.python.framework.graph_util.convert_variables_to_constants", "numpy.array" ] ]
graehl/pytorch-transformers
[ "59292fe230ee2c2c681b7966bf2bc1f374ce67d4" ]
[ "run_sent.py" ]
[ " #!/usr/bin/python3\n\n# pip3 install --user torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html\n# pip3 install --user transformers\n\n\n\nimport torch\nimport argparse\nimport sys\n\n\nmodelname=\"finmodel_distilbert\" #\"bert-base-cased-finetuned-mrpc\"\n\n\nparser = a...
[ [ "torch.softmax" ] ]
harshkasyap/PyAriesFL
[ "dd78dcebc771971abfee301b80cdd5d246c14840" ]
[ "data/generate_model.py" ]
[ "import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport torch\nimport sys\nimport traceback\n\n\n# prep\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import preprocessing\nfrom ...
[ [ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.save" ] ]
unsw-cse-soc/REST2Bot
[ "b4dc549ee61611afb8cfbee612f7b7c7ce9ee8a5" ]
[ "swagger/swagger_utils.py" ]
[ "import os\nimport re\n\nimport wordninja\nfrom nltk.stem import WordNetLemmatizer\nfrom pandas import read_csv\nfrom tabulate import tabulate\n\nfrom swagger.entities import Param\nfrom utils.preprocess import remove_stopword\nfrom utils.language_tool import LanguageChecker\nfrom utils.text import is_singular\n\nl...
[ [ "pandas.read_csv" ] ]
DeltaMarine101/neural_net
[ "fd0b9793a9b3dffd1ee2330ff8e3e9bda98cec33" ]
[ "nn.py" ]
[ "import math\nimport random as r\nimport numpy as np\nimport pickle\nimport time\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as cplt\n\n# data = [(np.array(list(map(float, i[38:].split()))) / 256., np.array(list(map(float, i[8:28].split())))) for i in open('data/mnist.txt').read().strip().split('\\n'...
[ [ "numpy.dot", "numpy.reshape", "matplotlib.pyplot.subplots", "numpy.random.rand", "matplotlib.pyplot.subplots_adjust", "numpy.exp", "matplotlib.colors.LinearSegmentedColormap.from_list", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.style.use" ] ]
calmarazlopez/Deep-Learning-Udacity-Nanodegree
[ "19114fe796043c550a6ba3b3ae67c1e239002c11" ]
[ "Predicting Bike-Sharing Patterns/my_answers.py" ]
[ "import numpy as np\n\n\nclass NeuralNetwork(object):\n def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):\n # Set number of nodes in input, hidden and output layers.\n self.input_nodes = input_nodes\n self.hidden_nodes = hidden_nodes\n self.output_nodes = out...
[ [ "numpy.dot", "numpy.random.normal", "numpy.exp", "numpy.zeros" ] ]
dhowardCS/git_vscode_demo
[ "edbe4397c3b27cd31cfd3036ebf465c40c79432b" ]
[ "SKlearn Course/knn_classifier1/main.py" ]
[ "import numpy as np \nimport pandas as pd\nfrom sklearn import neighbors, metrics\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\n\ndata = pd.read_csv('car.data')\nprint(data.head())" ]
[ [ "pandas.read_csv" ] ]
dotrungkien3210/paper_faceNet
[ "2a371e00e0d5faa717c66e289f102993ec712311" ]
[ "plot.py" ]
[ "import numpy as np\nimport os.path\nfrom model import create_model\nimport cv2\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport warnings\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.svm import LinearSVC\nfrom sklearn.metrics import f...
[ [ "numpy.square", "pandas.read_csv", "numpy.expand_dims", "matplotlib.pyplot.title", "sklearn.metrics.confusion_matrix", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Jannkar/doom_actionspace
[ "37663341f60a05943202b77394a4203d070fad95" ]
[ "agent_stable_baselines/stable_baselines/deepq/experiments/enjoy_mountaincar.py" ]
[ "import argparse\r\n\r\nimport gym\r\nimport numpy as np\r\n\r\nfrom stable_baselines.deepq import DQN\r\n\r\n\r\ndef main(args):\r\n \"\"\"\r\n Run a trained model for the mountain car problem\r\n\r\n :param args: (ArgumentParser) the input arguments\r\n \"\"\"\r\n env = gym.make(\"MountainCar-v0\")...
[ [ "numpy.random.random" ] ]
fmfn/lifelines
[ "fec81897674ebeb3223efba48b99e7b1302cdf9e" ]
[ "lifelines/fitters/SBGSurvival.py" ]
[ "from __future__ import print_function\nfrom lifelines.utils.DataHandler import DataHandler\nfrom lifelines.utils.ShiftedBetaGeometric import ShiftedBetaGeometric\nimport numpy as np\nimport pandas as pd\n\n\nclass SBGSurvival(object):\n \"\"\"\n This class implements an extended version of the Shifted-Beta-G...
[ [ "numpy.vstack", "pandas.DataFrame" ] ]
Space0726/FontTools
[ "a322a9bc403e93b0b32856a461fa6bf384d921e9" ]
[ "tools/derivativetools.py" ]
[ "\"\"\" Font tools for calculating derivative and using it.\n\nLast modified date: 2019/08/17\n\nCreated by Seongju Woo.\n\"\"\"\nimport math\nimport numpy as np\nimport bezier\nfrom fwig.tools import appendtools\n\ndef _calculate_distance(point_1, point_2):\n return math.sqrt(pow(point_1[0]-point_2[0], 2)\n ...
[ [ "numpy.asfortranarray" ] ]
francescobarbara/idad
[ "7931daeec5ae7db0c212d0b13f3c13d4784ecfdb" ]
[ "neural/critics.py" ]
[ "from collections import OrderedDict\n\nimport torch\nfrom torch import nn\n\n\n## MI critics\nclass CriticDotProd(nn.Module):\n \"\"\"\n Separable critic\n\n returns:\n scores_joint: tensor of shape [batch_size, batch_size] where only non-zero terms are on the diagonal\n scores_prod: tensor of shape...
[ [ "torch.nn.Softplus", "torch.cat", "torch.eye", "torch.nn.Linear", "torch.matmul", "torch.distributions.Normal", "torch.nn.ReLU" ] ]
Juanjoglvz/MachineLearning
[ "2d979978448bf14c628dad0d8b87062e5687a101" ]
[ "src/visualization/Interpretation.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import preprocessing \nfrom sklearn.cluster import KMeans\nfrom sklearn import metrics\nfrom sklearn.decomposition import PCA\n\n# Read the data and load it into memory\ndf_T = pd.read_csv(\"../../data/processed/T2_Accelerometer...
[ [ "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "sklearn.decomposition.PCA", "sklearn.preprocessing.MinMaxScaler" ] ]
zhivko/tensortrade
[ "af7a4a323415457d8ddb3befa3dabeac1844fdd0" ]
[ "examples/myexample/main.py" ]
[ "from tensortrade.oms.instruments import Instrument, BTC, USD\nfrom tensortrade.env.default.actions import BSH\n\nfrom tensortrade.env.generic import Renderer\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport ray\nimport numpy as np\nimport pandas as pd\n\nimport tensortrade.env.default as default\n\...
[ [ "pandas.Series", "torch.zeros", "matplotlib.pyplot.subplots", "pandas.DataFrame", "torch.cuda.is_available", "pandas.DataFrame.from_dict", "matplotlib.pyplot.show" ] ]
Originofamonia/DANN
[ "97541e913e050855818f562574b28b5f2b550a1f" ]
[ "train/main.py" ]
[ "import random\nimport os\nimport sys\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torchvision import datasets\nfrom torchvision import transforms\nimport numpy as np\n\n\ndef add_path(path):\n if path not in sys.path:\n print('Adding {}'.format(path))\...
[ [ "numpy.exp" ] ]
94mia/DeepLEGO
[ "9458b13da6117f6054ce406bdb3942358e2cd764" ]
[ "heads/pspnet.py" ]
[ "'''\nRe-implementation of head module of PSPNet introduced in paper [1]\nThe structure of this module refers to the Caffe implementation from [2]\n\nReference:\n[1] Pyramid Scene Parsing Network\n https://arxiv.org/abs/1612.01105\n[2] hszhao/PSPNet/evaluation/prototxt/pspnet101_cityscapes_713.prototxt\n http...
[ [ "torch.nn.functional.upsample", "torch.cat", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
iisys-hof/HUI-Audio-Corpus-German
[ "4d2de2ed538a6b943166e1e35c10ee8b0b266be6" ]
[ "huiAudioCorpus/converter/ListToHistogramConverter.py" ]
[ "from huiAudioCorpus.model.Histogram import Histogram\nfrom typing import List, TypeVar\n\nimport numpy as np\nnumber = TypeVar('number', int, float)\n\nclass ListToHistogramConverter:\n def __init__(self, stepSize: int):\n self.stepSize =stepSize\n\n def convert(self, list: List[number]):\n bin...
[ [ "numpy.histogram" ] ]
nnn112358/python-control_test
[ "58e1b5e6feec0477fd4bad3683fb8af470faed4f" ]
[ "pvtol-nested.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n#このファイルは、Python制御パッケージの基本的な機能を実証することを目的としています。\n#AstromとMrurayの平面垂直離着陸(PVTOL)機に対応する、かなり複雑な制御設計と解析を動作します。\n#\n\n\n# pvtol-nested.py - aircraftのスラスタベクトルの内外ループ制御設計\n\n\nfrom __future__ import print_function\nfrom matplotlib.pyplot import * # MATLAB プロット関数\nfrom contr...
[ [ "numpy.squeeze" ] ]
Gorilla-Lab-SCUT/SRDC-CVPR2020
[ "9cd07156e5c520e955a7df33c42819777d012ecb" ]
[ "data/prepare_data.py" ]
[ "import os\nimport shutil\nimport torch\nimport torchvision.transforms as transforms\nimport torchvision.datasets as datasets\nimport torch.nn.functional as F\nfrom utils.folder import ImageFolder\nimport numpy as np\nimport cv2\n\ndef generate_dataloader(args):\n # Data loading code\n traindir = os.path.join...
[ [ "torch.utils.data.DataLoader", "torch.from_numpy", "torch.cuda.FloatTensor", "numpy.random.normal", "numpy.transpose" ] ]
aky15/espnet
[ "1dc734839d34e2f2dd13cfa375713aecf232ae25" ]
[ "espnet/nets/pytorch_backend/transformer/decoder.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright 2019 Shigeki Karita\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"Decoder definition.\"\"\"\n\nimport logging\n\nfrom typing import Any\nfrom typing import List\nfrom typing import Tuple\n\nimport torch\n\nfrom espnet.nets.pytor...
[ [ "torch.nn.Dropout", "torch.nn.Module.__init__", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.ReLU" ] ]
gugarosa/dropout_rbm
[ "1b16e71315e1577b468ea2cd0d3c7fcf48bc6851" ]
[ "optimization.py" ]
[ "import argparse\n\nimport numpy as np\nimport torch\n\nimport utils.loader as l\nimport utils.objects as m\nimport utils.opt as o\nimport utils.target as t\n\n\ndef get_arguments():\n \"\"\"Gets arguments from the command line.\n\n Returns:\n A parser with the input arguments.\n\n \"\"\"\n\n # C...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
srijannnd/Data-Set-Visualization-App
[ "cbac1a5c076c056cfb5d26795c0505b60e2850b4" ]
[ "uploads/core/views.py" ]
[ "from django.shortcuts import render, redirect, get_object_or_404\nfrom uploads.core.models import Document\nfrom uploads.core.forms import DocumentForm\nimport pandas as pd\nimport seaborn as sns\n\n\ndef home(request):\n documents = Document.objects.all()\n if request.method == 'POST':\n form = Docum...
[ [ "pandas.read_csv" ] ]
VERITAS-Observatory/V2DL3
[ "3b4691cbb3a06805b722e494d4ae84ce7a866dd4" ]
[ "pyV2DL3/vegas/fillRESPONSE_not_safe.py" ]
[ "import logging\n\nimport numpy as np\n\nfrom pyV2DL3.vegas.irfloader import IRFLoader\nfrom pyV2DL3.vegas.util import getThetaSquareCut\n\nlogger = logging.getLogger(__name__)\n\n\ndef __fillRESPONSE_not_safe__(\n effectiveAreaIO, azimuth, zenith, noise, irf_to_store=None\n):\n\n if irf_to_store is None:\n ...
[ [ "numpy.sqrt" ] ]
SuperToxicCat/Drowsiness-Detection
[ "fac50f762719e76cb41a8a7d0206f63ae35cab89" ]
[ "face_landmarks.py" ]
[ "\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\n\n\ndef get_landmark_model(saved_model='models/pose_model'):\n \"\"\"\n \n Parameters\n ----------\n saved_model : string, optional\n Path to facial landmarks model. The default is 'models/pose_model'.\n\n...
[ [ "numpy.reshape", "numpy.array", "tensorflow.constant", "tensorflow.saved_model.load" ] ]
AnonSubm2021/TransStyleGAN
[ "0194cd6f0e96c801d55c0cb9683e1f552bcf6d48" ]
[ "metrics/prdc.py" ]
[ "\"\"\"\nprdc\nCopyright (c) 2020-present NAVER Corp.\nMIT license\n\"\"\"\nimport numpy as np\nimport sklearn.metrics\n\n__all__ = ['compute_prdc']\n\n\ndef compute_pairwise_distance(data_x, data_y=None):\n \"\"\"\n Args:\n data_x: numpy.ndarray([N, feature_dim], dtype=np.float32)\n data_y: num...
[ [ "numpy.take_along_axis", "numpy.expand_dims", "numpy.argpartition" ] ]
rigdenlab/SWAMP
[ "3e93ab27f4acf0124f7cb2d78a151cc3352b9c6e" ]
[ "swamp/clustering/spectral.py" ]
[ "from swamp.clustering.clustering import Clustering\nfrom sklearn.cluster import SpectralClustering\nfrom scipy.stats import randint, expon\n\n\nclass Spectral(Clustering):\n \"\"\"This class implements methods and datastructures to work with :py:obj:`sklearn.cluster.Spectral`\n\n :example:\n\n >>> from sw...
[ [ "scipy.stats.randint", "scipy.stats.expon", "sklearn.cluster.SpectralClustering" ] ]
BrunoCoimbra/decisionengine_modules
[ "bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f", "bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f" ]
[ "src/decisionengine_modules/glideinwms/resource_dist_plugins.py", "src/decisionengine_modules/glideinwms/sources/factory_entries.py" ]
[ "# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC\n# SPDX-License-Identifier: Apache-2.0\n\nimport pandas as pd\n\n_RESOURCE_FROM_COLUMN_MAP = {\n \"Grid_Figure_Of_Merit\": \"Grid_Figure_Of_Merit\",\n \"GCE_Figure_Of_Merit\": \"FigureOfMerit\",\n \"AWS_Figure_Of_Merit\": \"AWS_Figure_Of_Merit\",...
[ [ "pandas.DataFrame" ], [ "pandas.concat", "pandas.DataFrame" ] ]
moshes7/Competitions
[ "7434ed9ef51c6f8e61f87d180c025f4f0a7c32b9" ]
[ "models/pretrained_xception.py" ]
[ "from __future__ import print_function, division, absolute_import\n\n# -*- coding: utf-8 -*-\n\"\"\"pretrained-Xception.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1nrkV8ju4mc1uw5CqV7h8u7QInWkO0asL\n\"\"\"\n\nimport math\nimport torch...
[ [ "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.init.xavier_uniform_", "torch.no_grad", "torch.rand", "torch.cuda.is_available", "torch.nn.BatchNorm2d", ...
hannesfelipe/oemof-solph
[ "a29802c73b9f3a1240a9ea6cec28f9d52bf1001c" ]
[ "tests/test_scripts/test_solph/test_simple_model/test_simple_invest.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\" This example shows how to create an energysystem with oemof objects and\nsolve it with the solph module.\n\nData: example_data.csv\n\nThis file is part of project oemof (github.com/oemof/oemof). It's copyrighted\nby the contributors recorded in the version control history of the f...
[ [ "pandas.read_csv", "pandas.date_range" ] ]
BCV-Uniandes/SIMBA
[ "1f25cdd5005ad71918938ea6bef4544a4c24281b" ]
[ "simba/train.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nBone Age Assessment SIMBA train routine.\n\"\"\"\n\n# Standard lib imports\nimport os\nimport csv\nimport glob\nimport time\nimport argparse\nimport warnings\nimport pandas as pd\nimport os.path as osp\n\n# PyTorch imports\nimport torch\nimport torch.nn as nn\nimport torch.optim ...
[ [ "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.utils.data.distributed.DistributedSampler", "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.no_grad", "torch.cuda.is_available", "torch.nn.L1Loss" ] ]
chbehrens/brian2
[ "46b5264caa5375ae13084508b5c1049e0c9e019e" ]
[ "brian2/core/variables.py" ]
[ "from __future__ import absolute_import\n'''\nClasses used to specify the type of a function, variable or common\nsub-expression.\n'''\nimport collections\nimport functools\nimport numbers\n\nimport numpy as np\nimport sympy\nfrom past.builtins import basestring\n\nfrom brian2.units.fundamentalunits import (Quantit...
[ [ "numpy.can_cast", "numpy.issubdtype", "numpy.asanyarray", "numpy.prod", "numpy.array" ] ]
xdralex/pytorch-wheel5
[ "336529e354a45908cf3f8f12cd401a95fb2a5351" ]
[ "wheel5/dataset/functional.py" ]
[ "from typing import Optional, Tuple, List\n\nimport numpy as np\nimport torch\nfrom numpy.random.mtrand import RandomState\n\nfrom wheel5.tricks.heatmap import heatmap_to_selection_mask\n\n\ndef mixup(img_src: torch.Tensor, lb_src: torch.Tensor,\n img_dst: torch.Tensor, lb_dst: torch.Tensor,\n alp...
[ [ "torch.lerp", "numpy.sqrt", "numpy.clip", "numpy.round", "numpy.random.mtrand.RandomState" ] ]
1036225283/Reinforcement-learning-with-tensorflow
[ "0422669b36faccfb1b96581a6345b8f39805ce7e" ]
[ "contents/Double_DQN/run_Pendulum.py" ]
[ "\"\"\"\nDouble DQN & Natural DQN comparison,\nThe Pendulum example.\n\nView more on my tutorial page: https://morvanzhou.github.io/tutorials/\n\nUsing:\nTensorflow: 1.0\ngym: 0.8.0\n\"\"\"\n\n\nimport gym\nfrom contents.Double_DQN.RL_brain import DoubleDQN\nimport numpy as np\nimport matplotlib.pyplot as plt\nimpo...
[ [ "matplotlib.pyplot.legend", "tensorflow.global_variables_initializer", "matplotlib.pyplot.grid", "tensorflow.Session", "tensorflow.variable_scope", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
TeaKatz/AI_Training
[ "881a7176965a267a5d966f1f50edd29b39906c26" ]
[ "utilities/SignalGenerator.py" ]
[ "import numpy as np\n\n\nclass SignalGenerator:\n\tdef __init__(self, period, signal_type=\"sine\", amplitude=1, vertical_shift=0, phase_shift=0):\n\t\tassert signal_type.lower() in [\"sine\", \"cos\", \"half-sine\", \"half-cos\", \"sawtooth\"], \"get unknown signal_type: '{}'\".format(signal_type)\n\t\t\n\t\tself....
[ [ "numpy.mod", "numpy.arange", "numpy.cos", "numpy.sin" ] ]
staoxiao/LibVQ
[ "f844c60055ace872279daa272b0bad1005c02e2b" ]
[ "examples/NQ/learnable_index/train_index.py" ]
[ "import sys\nsys.path.append('./')\nimport os\nimport pickle\nimport gc\n\nimport faiss\nimport numpy as np\nfrom transformers import HfArgumentParser\nfrom torch.optim import AdamW\n\nfrom LibVQ.base_index import FaissIndex\nfrom LibVQ.dataset.dataset import load_rel, write_rel\nfrom LibVQ.learnable_index import L...
[ [ "numpy.memmap" ] ]
AI-Assistant/FEMAG-Python
[ "ff86e8f41485ae9df6034e6b8e810b59f8094c70" ]
[ ".venv/Lib/site-packages/ipopt-0.1.9/setup.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\ncyipopt: Python wrapper for the Ipopt optimization package, written in Cython.\n\nCopyright (C) 2012-2015 Amit Aides\nCopyright (C) 2015-2018 Matthias Kümmerer\n\nAuthor: Matthias Kümmerer <matthias.kuemmerer@bethgelab.org>\n(original Author: Amit Aides <ami...
[ [ "numpy.get_include" ] ]
yuriharrison/ml-algorithms
[ "b69c7e666006d43b10ef8f0d95fe745a430f04f1" ]
[ "mlalgorithms/kMeans.py" ]
[ "\"\"\"K-Means clustering Algorithm\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n\nclass KMeans:\n \"\"\"K-Means clustering\n\n -- Arguments\n k: int, optional, default 2\n The number of clusters to form as well as the number of centroids to generate.\n ...
[ [ "matplotlib.pyplot.scatter", "numpy.linalg.norm", "numpy.average", "numpy.array", "numpy.sum", "matplotlib.pyplot.show" ] ]
felixhao28/oneflow
[ "e558af6ef6c4ed90e4abc7bc1ba895f55795626d" ]
[ "python/oneflow/test/modules/test_deconv2d.py" ]
[ "\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.array" ] ]
Kingsford-Group/polarset
[ "26da7debd5a4c4a456fcf7ac3749f06527db0226" ]
[ "anchor_sets_bit.py" ]
[ "# these are re-implementations of CoverageChecker and KMerChain that\n# uses bitvectors (array in Python) to improve performance.\n\nfrom collections import defaultdict\nfrom anchor_sets import CoverageChecker, KMerChain\nfrom array import array\nimport numpy as np\nimport pickle\nimport logging\nfrom tqdm import ...
[ [ "numpy.argsort" ] ]
kioma/densenet
[ "e03a590aa38159c5099f641b630cb4016e9ab6cf" ]
[ "test_inference.py" ]
[ "\"\"\"Test ImageNet pretrained DenseNet\"\"\"\nimport cv2\nimport numpy as np\nfrom keras.optimizers import SGD\nimport keras.backend as K\n\n# We only test DenseNet-161 in this script for demo purpose\nfrom models.densenet161 import DenseNet\n\nim = cv2.resize(cv2.imread('resources/cat.jpg'), (224, 224)).astype(...
[ [ "numpy.expand_dims", "numpy.argmax" ] ]
debodeepkar/adni_research
[ "d8061d0a68e1aca6517b8f15089a3331dd6819e6" ]
[ "entropy.py" ]
[ "import nibabel as nb\nimport os\nfrom skimage import data\nfrom skimage.measure.entropy import shannon_entropy\nfrom skimage.color import rgb2gray\nimport numpy as np\n\npath = \"/Users/debodeepkar/Documents/ADNI/NORMALIZED/ANTS/CN/\"\nos.chdir(path)\nfile = os.listdir(path) #returns a list with path\n\nslice=[]\n...
[ [ "numpy.append", "numpy.argmax" ] ]
rl-navigation/deployable
[ "c06f0913297069ac2a064124ea591a17552a3d75" ]
[ "src/renderer.py" ]
[ "from __future__ import print_function, division\nimport numpy as np, cv2, networkx as nx\n\n#==============================================================================\n# ENVIRONMENT RENDERER\n#==============================================================================\n\n_render_cache = {}\n_optimal_paths...
[ [ "numpy.hstack", "numpy.pad", "numpy.abs", "numpy.clip", "numpy.cos", "numpy.full", "numpy.sin", "numpy.ceil", "numpy.mean", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
G-arj/qdk-python
[ "4bb4fa371347dc76b0448dfc79c557d468002f74" ]
[ "azure-quantum/tests/unit/test_target.py" ]
[ "import unittest\nimport warnings\nimport pytest\n\nimport numpy as np\n\nfrom azure.core.exceptions import HttpResponseError\nfrom azure.quantum.job.job import Job\nfrom azure.quantum._client.models import CostEstimate, UsageEvent\nfrom azure.quantum.target import IonQ, Honeywell, Quantinuum\n\nfrom common import ...
[ [ "numpy.round" ] ]