repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
kajal-puri/point-normals-upsampling
[ "5248c0d1b2b26ec9e002eb9520a204cdd186ab1d" ]
[ "code/utils/knn_patch.py" ]
[ "from sklearn.neighbors import NearestNeighbors\nimport numpy as np\n\ndef extract_knn_patch(queries, pc, k):\n \"\"\"\n queries [M, C]\n pc [P, C]\n \"\"\"\n #print(queries.shape)\n #print(pc.shape)\n knn_search = NearestNeighbors(n_neighbors=k, algorithm='auto')\n knn_search.fit(pc[:, 0:3]...
[ [ "sklearn.neighbors.NearestNeighbors", "numpy.take" ] ]
andrewk1/Recycle-GAN
[ "390d3b3c2492a27e38d9b3a0b69bb95865dda7ea" ]
[ "models/recycle_gan_model.py" ]
[ "import numpy as np\nimport torch\nimport os\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nimport itertools\nimport util.util as util\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom . import networks\nimport sys\n\n\nclass RecycleGANModel(BaseModel):\n ...
[ [ "torch.autograd.Variable", "torch.cat", "torch.nn.L1Loss" ] ]
saimsalman36/tools
[ "0b4aeaa9203335b3eb8462b5bff5de021e1d77af" ]
[ "perf/benchmark/runner/graph.py" ]
[ "from bokeh.plotting import figure, output_file, show\nimport pandas as pd\nimport os\nimport numpy as np\nfrom bokeh.io import output_notebook\nfrom bokeh.models import ColumnDataSource, HoverTool\nfrom bokeh.models.tools import CustomJSHover\nfrom bokeh.palettes import Dark2_5 as palette\nimport itertools # for ...
[ [ "pandas.read_csv" ] ]
williammora1984/UMAT_GTN
[ "69a73295afdebb5e8003c058d9666375faf2fe38" ]
[ "1_Test_tensor_op/generate_values_test.py" ]
[ "import numpy as np\nimport csv\nfrom random import seed\nfrom random import random\nfrom numpy import random\n\n\n#Linspace without include the end point\nn_test=2\nend=np.random.rand(n_test)\ndifference_start_end=np.random.rand(n_test)\nmax_n_steps=20\nsteps=(random.rand(n_test)*max_n_steps)//1\nexport=np.zeros((...
[ [ "numpy.append", "numpy.random.rand", "numpy.zeros", "numpy.einsum", "numpy.arange", "numpy.int_", "numpy.linspace", "numpy.linalg.inv" ] ]
Curli-quan/fewshot-select
[ "34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe" ]
[ "utils/tester/tester_hand_ssl.py" ]
[ "\r\nfrom eval import Evaluater\r\nfrom utils import to_Image, pred_landmarks, visualize, make_dir\r\nfrom datasets.hand_basic import TestHandXray\r\nimport torch\r\nimport numpy as np\r\nfrom torch.utils.data import DataLoader\r\nimport json\r\nfrom PIL import Image, ImageDraw, ImageFont\r\nfrom .eval_hand import ...
[ [ "numpy.array", "torch.cat", "torch.norm", "torch.clamp", "numpy.stack", "torch.tensor", "torch.utils.data.DataLoader", "torch.ones_like" ] ]
joeljosephjin/pytorch-maml
[ "8e76bfa8b672edc42285897ace17cdc618e353ea" ]
[ "train.py" ]
[ "import torch\nimport math\nimport os\nimport time\nimport json\nimport logging\n\nfrom torchmeta.utils.data import BatchMetaDataLoader\n\nfrom maml.datasets import get_benchmark_by_name\nfrom maml.metalearners import ModelAgnosticMetaLearning\n\ndef main(args):\n logging.basicConfig(level=logging.DEBUG if args....
[ [ "torch.cuda.is_available" ] ]
StephenC19/dublinbikes
[ "7b6de29e291f158ded4f068cf820897a50c1e115" ]
[ "dublinbikes/app/views.py" ]
[ "\"\"\"\nFlask file to create web page using information read from a database\n\"\"\"\nfrom flask import render_template, jsonify, json, g, Flask\nfrom sqlalchemy import create_engine\nfrom app import app\nimport pandas as pd\nimport requests\nimport datetime\nfrom datetime import date\n\n\ndef connect_to_database(...
[ [ "pandas.read_sql_query" ] ]
geoyee/PdRSCD
[ "612976225201d78adc7ff99529ada17b41fedc5d" ]
[ "ppcd/metrics/metrics.py" ]
[ "import numpy as np\nimport paddle\nimport paddle.nn.functional as F\n\n\ndef calculate_area(pred, label, num_classes, ignore_index=255):\n \"\"\"\n Calculate intersect, prediction and label area\n Args:\n pred (Tensor): The prediction by model.\n label (Tensor): The ground truth of image.\n ...
[ [ "numpy.sum", "numpy.array", "numpy.mean" ] ]
synapticarbors/sk-dist
[ "e5729e62fbdb7b8513be1c4fd0d463d8aec5b837" ]
[ "examples/search/nested.py" ]
[ "\"\"\"\n===================================================================\nNest sk-dist estimators to fit models on `make_classification` data\n===================================================================\n\nIn this example, we show nesting of sk-dist estimator. An important\nnote with nesting: sk-dist me...
[ [ "sklearn.linear_model.LogisticRegression", "pandas.DataFrame", "sklearn.datasets.make_classification" ] ]
phschiele/diffcp
[ "4cca038ddb4242150ebfacc6b0e2ae9261ed3c1a" ]
[ "tests/test_ecos.py" ]
[ "import cvxpy as cp\nimport numpy as np\nimport pytest\nfrom scipy import sparse\n\nimport diffcp.cone_program as cone_prog\nimport diffcp.cones as cone_lib\nimport diffcp.utils as utils\n\n\ndef test_ecos_solve():\n np.random.seed(0)\n m = 20\n n = 10\n\n A, b, c, cone_dims = utils.least_squares_eq_scs...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.seed", "numpy.ones", "numpy.random.randn" ] ]
daveredrum/meshed-memory-transformer
[ "6dfbc2ba241b7c1c8deac6114d66542190a77619" ]
[ "bottom-up-attention/lib/roi_data_layer/layer.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"The data layer used during training to train a Fast R...
[ [ "numpy.logical_not", "numpy.array", "numpy.reshape", "numpy.random.seed", "numpy.random.permutation", "numpy.where", "numpy.arange" ] ]
Zarty55/manim
[ "9d38c7b277ed905887374aa60f15187393e3e1d7" ]
[ "manim/camera/three_d_camera.py" ]
[ "\"\"\"A camera that can be positioned and oriented in three-dimensional space.\"\"\"\n\n__all__ = [\"ThreeDCamera\"]\n\n\nimport numpy as np\n\nfrom .. import config\nfrom ..camera.camera import Camera\nfrom ..constants import *\nfrom ..mobject.three_d_utils import get_3d_vmob_end_corner\nfrom ..mobject.three_d_ut...
[ [ "numpy.identity", "numpy.array", "numpy.dot", "numpy.exp" ] ]
zuxfoucault/DoctorBot_demo
[ "6be98bbf380d14bb789d30a137ded3b51b3f31fd" ]
[ "brain/brain_libs/slot_model/slot_model.py" ]
[ "import tensorflow as tf\nimport data_helper\nimport numpy as np\nimport jieba\nimport os\nimport re\nfrom keras.models import load_model\nfrom metrics.accuracy import conlleval\n\nif not os.path.exists(\"data\"):\n os.makedirs(\"data\")\n\nsentence_file = \"data/training_sentence.txt\"\nslot_file = \"data/train...
[ [ "tensorflow.compat.as_str", "tensorflow.compat.as_bytes", "numpy.array", "numpy.argmax" ] ]
nmichlo/msc-research
[ "625e57eca77bbfbc4728ccebdb0733e1613bd258" ]
[ "disent/util/visualize/vis_util.py" ]
[ "# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~\n# MIT License\n#\n# Copyright (c) 2021 Nathan Juraj Michlo\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# ...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "numpy.nan_to_num", "numpy.minimum", "numpy.maximum", "numpy.all", "numpy.around", "numpy.linspace", "numpy.dtype", "numpy.full_like" ] ]
snelliott/automol
[ "19d9b0402568170ae5ca0adecb460d36f258a9bd" ]
[ "automol/pot/_fitter.py" ]
[ "\"\"\"\n Handle fits to potentials\n\"\"\"\n\n\nimport numpy\nfrom scipy.interpolate import interp1d\n\n\ndef spline_fit(pot_dct, min_thresh=-0.0001, max_thresh=50.0):\n \"\"\" Get a physical hindered rotor potential via a series of spline fits\n \"\"\"\n\n pot = list(pot_dct.values())\n\n # Initialize...
[ [ "numpy.array", "scipy.interpolate.interp1d" ] ]
ZeliangSu/tomobank
[ "ca34f040f426841b9bd71344fa2f0c248eedd875" ]
[ "docs/demo/phantom_00002.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Dec 3 15:35:30 2016\n\n@author: decarlo\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n \nfrom xdesign import *\n\nimport os\nimport time\nimport pytz\nimport datetime\ni...
[ [ "numpy.expand_dims", "numpy.ones", "numpy.arange", "numpy.zeros" ] ]
ryanlevy/pennylane
[ "fb03b09d17267ebd0b9050432f9eeb84b5dff200", "fb03b09d17267ebd0b9050432f9eeb84b5dff200" ]
[ "pennylane/numpy/random.py", "tests/collections/test_qnode_collection.py" ]
[ "# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\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# Unles...
[ [ "numpy.random.PCG64" ], [ "tensorflow.enable_eager_execution", "tensorflow.Variable", "tensorflow.GradientTape", "torch.tensor" ] ]
rfelixmg/util
[ "899360382f8b097b0f3faf70e9b3e7abcdd0b255" ]
[ "experiments.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2018 Rafael Felix Alves\n\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 rights\nto use, copy, ...
[ [ "numpy.max", "numpy.array", "numpy.int", "numpy.random.permutation", "numpy.eye" ] ]
Qwaz/tacotron-ksss
[ "e0428fef02175e5b52caeb02468ddf2975c3c2e7" ]
[ "tacotron/utils/plot.py" ]
[ "import matplotlib\nfrom jamo import h2j, j2hcj\n\nmatplotlib.use('Agg')\nmatplotlib.rc('font', family=\"NanumBarunGothic\")\nimport matplotlib.pyplot as plt\n\nfrom ..text import PAD, EOS\nfrom ..text.korean import normalize\n\ndef plot(alignment, info, text, isKorean=True):\n char_len, audio_len = alignment.sh...
[ [ "matplotlib.use", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.rc", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel" ] ]
MsLimon/bert-sklearn
[ "050a7b0dc75d8a2d7fd526002c4642d5329a0c27" ]
[ "bert_sklearn/model/pytorch_pretrained/optimization.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/...
[ [ "torch.zeros_like", "torch.nn.utils.clip_grad_norm_" ] ]
rmrmg/SuzukiConditions
[ "5ea0b816607d022e4815447cd803fc6de02b8f08" ]
[ "classification/keras_embedlig_v3new.py" ]
[ "seedNum=10\nimport random, statistics\nrandom.seed(seedNum)\nimport numpy\nnumpy.random.seed(seedNum)\nimport os\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"-1\"\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' \nimport tensorflow as tf\ntf.random.set_seed(seedNum)\n\n\nimport sklearn, numpy, sys\nfrom sklearn import preproc...
[ [ "numpy.zeros", "numpy.random.seed", "tensorflow.random.set_seed", "tensorflow.keras.initializers.RandomNormal", "numpy.loadtxt", "sklearn.model_selection.KFold" ] ]
LucFrachon/advanced_lane_lines_detection
[ "2d509167b4106b414d2db25c2f972ad5ff6fc422" ]
[ "line_fitting.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport cv2\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nfrom camera_calibration import display_images\nfrom binary_map_pipeline import get_warp_matrix, binary_map_pipeline\nfrom...
[ [ "matplotlib.use", "numpy.float32", "matplotlib.image.imread" ] ]
aiueola/d3rlpy
[ "6058d4dab7484d1d38103210081711f6e05b0c1e" ]
[ "d3rlpy/models/torch/dynamics.py" ]
[ "# pylint: disable=protected-access\n\nfrom typing import List, Optional, Tuple, cast\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom torch.distributions import Normal\nfrom torch.nn.utils import spectral_norm\n\nfrom .encoders import EncoderWithAction\n\n\ndef _compute_ensemble_varianc...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.softplus", "torch.nn.ModuleList", "torch.arange", "torch.nn.Parameter", "torch.randint", "torch.tensor", "torch.nn.utils.spectral_norm", "torch.empty", "torch.exp" ] ]
tetsuzawa/research-tools
[ "0c6a820469dbf143fefe5898b01346f493af8a1e" ]
[ "pyresearch/plot_waves_from_wav_multi.py" ]
[ "# encording: utf-8\r\n\r\nimport argparse\r\nimport pathlib\r\nimport signal\r\n\r\nimport matplotlib\r\nmatplotlib.use('Agg')\r\nimport matplotlib.pyplot as plt\r\nimport soundfile as sf\r\n\r\nplt.rcParams['font.family'] = 'IPAPGothic'\r\nplt.rcParams['xtick.direction'] = 'in'\r\nplt.rcParams['ytick.direction'] ...
[ [ "matplotlib.use", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout" ] ]
WamdamProject/WaMDaM_Wizard
[ "f8f5a830464f3c8f45e4eb0557833eefb267d7b2" ]
[ "src/controller/WASH/Query_WaMDaM_for_WASH/QueryMultiAttributes.py" ]
[ "\n#\n# query Multi Attributes data:\n# Input paramters: ObjectTypeCV,InstanceNameCV,AttributeNameCV\n# return: df_MultiAttributes\n\nimport pandas as pd\nimport csv\nimport datetime\nfrom collections import OrderedDict\nimport os\n\ndef MultiAttributes_query(conn,multi_AttributeSeries):\n total_df_MultiColumns ...
[ [ "pandas.read_sql_query" ] ]
yalhariri/twitter_collector_gui
[ "653eab9a6eb710bebd650d1d6234790e7354b7ff" ]
[ "crawler/solr_util.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport requests\n\ndef init_schema(url):\n scehma_contents = [{\"name\":\"id\",\"type\":\"string\",\"stored\":True},\n {\"name\":\"created_at\",\"type\":\"pdates\",\"stored\":True},\n {\"name\":\"user_screen_name\",\"type\":\"string\",\"s...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
Karagul/bsm-model
[ "dada0c9cb5b5178abee705ea4015f571673f9fd3" ]
[ "graphplot.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Feb 11 21:50:20 2020\r\n\r\n@author: Wei_X\r\n\"\"\"\r\n\r\n# Import necesary libraries\r\nimport matplotlib.pyplot as plt\r\n\r\np = print\r\n\r\n#periods = [df1['period90'], df1['period180'], df1['period252'], df1['period360'], df1['period504'], df1['period600'...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
amccarte/branduniv
[ "08bab72ccfeb75532c62c493bdf1a22df31e070f" ]
[ "brandelion/cli/report.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Generate reports to summarize the results.\n\nusage:\n brandelion report --scores <file> --output <directory> [--validation <file>]\n\nOptions\n -h, --help\n -o, --output <directory> Path to write results.\n -v, --validation <file> File containin...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "scipy.stats.pearsonr", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
Smasher-z/UniverseNet
[ "794e7d3d2c7a8f2f6601a60b67366d93a3f30a1f" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# Copyright (c) OpenMMLab. All rights reserved.\nimport os\nimport os.path as osp\nimport platform\nimport shutil\nimport sys\nimport warnings\nfrom setuptools import find_packages, setup\n\nimport torch\nfrom torch.utils.cpp_extension import (BuildExtension, CppExtension,\n ...
[ [ "torch.cuda.is_available" ] ]
shikajiro/picosdk-python-wrappers
[ "c441870e1d39aa6a85b3cfd5acb1b3968669a7cf" ]
[ "ps5000aExamples/ps5000aBlockExample.py" ]
[ "#\n# Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms.\n#\n# PS5000A BLOCK MODE EXAMPLE\n# This example opens a 5000a driver device, sets up two channels and a trigger then collects a block of data.\n# This data is then plotted as mV against time in ns.\n\nimport ctypes\nimport numpy as np\nfrom ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace" ] ]
vertexclique/orkhon
[ "4d9d4590c80a389aedd2b3ee16f5866bdef406c4" ]
[ "tests/pymodels/tf_model.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport tensorflow as tf\nimport cv2\n\nwith tf.gfile.FastGFile(\"tests/protobuf/mobilenet_v2_1.4_224_frozen.pb\", 'rb') as f:\n graph_def = tf.GraphDef()\n graph_def.ParseFromString(f.read())\n tf.import_graph_def(graph_def, name='')\n\nwriter = tf.summary.Fi...
[ [ "numpy.zeros", "tensorflow.get_default_graph", "tensorflow.GraphDef", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.ConfigProto", "tensorflow.gfile.FastGFile", "numpy.expand_dims" ] ]
shishehchi/AstroUnsupervisedDeepClustering
[ "9d0293c1200e42b0748709e9624da686d758119b" ]
[ "helpers/utilities.py" ]
[ "# -*- coding: utf-8 -*-\n\n\n\nfrom timeit import default_timer as timer\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\n\n\n#Random sampling\nfrom random import sample\n\n\n#-----------------------------Global Variables(used in plenty of places throughout co...
[ [ "numpy.histogram", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "numpy.min", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.logical_and", "numpy.where", "matplotlib.patches.Patch", "numpy.around", "numpy.log10", "matp...
maisonhai3/Japanese_HWR_OCR
[ "8cbe2a27e9f97e2d0188971f3f18c7fe5ff50014" ]
[ "textrenderer/liner.py" ]
[ "import random\nimport cv2\nimport numpy as np\n\n\nclass LineState(object):\n tableline_x_offsets = range(8, 40)\n tableline_y_offsets = range(3, 10)\n tableline_thickness = [1, 2]\n\n # 0/1/2/3: 仅单边(左上右下)\n # 4/5/6/7: 两边都有线(左上,右上,右下,左下)\n tableline_options = range(0, 8)\n\n middleline_thickne...
[ [ "numpy.random.randint", "numpy.random.choice" ] ]
KirillShmilovich/backmap_pi
[ "37277cd93bfc64c104692226188d0d452dcfba32" ]
[ "backmap/utils.py" ]
[ "import numpy as np\nimport mdtraj as md\n\n__all__ = [\"parse_pdb\", \"join_trjs\", \"rigid_transform\", \"get_beads\"]\n\n\ndef parse_pdb(pdb_fname):\n \"\"\"Parses PDB file\"\"\"\n bead = list()\n with open(pdb_fname) as f:\n for line in f:\n split_line = line.split()\n if (...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.linalg.det", "numpy.arange", "numpy.linalg.svd" ] ]
faustomorales/mira
[ "9fa85579c98c739b6bc7aa29d82496a772abacd7" ]
[ "mira/detectors/efficientdet.py" ]
[ "import typing\n\nimport torch\nimport omegaconf\nimport numpy as np\nimport pkg_resources\n\nfrom ..thirdparty import effdet\nfrom .. import datasets as mds\nfrom .. import core as mc\nfrom . import detector\n\n\nclass EfficientDet(detector.Detector):\n \"\"\"A wrapper for EfficientDet as implemented in the eff...
[ [ "numpy.array", "torch.tensor", "numpy.float32" ] ]
Erlemar/kekas
[ "6fd8413f15390bf079bdb57a38a7094a5c53ab0f" ]
[ "kekas/keker.py" ]
[ "from collections import defaultdict\nfrom pathlib import Path\nfrom typing import Any, Callable, List, Tuple, Type, Dict, Union, Optional\n\nimport numpy as np\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.optim import SGD\nfrom torch.nn.parallel import DistributedDataParallel\n\nfrom .callb...
[ [ "numpy.ceil", "torch.cat", "torch.cuda.device_count", "torch.from_numpy", "torch.cuda.is_available", "torch.load", "torch.set_grad_enabled" ] ]
jhona-09/K-lo-Smart-Keylogger
[ "600a53452860d4ea659f509a1163dcf178c1052e" ]
[ "python/passwords.py" ]
[ "import sqlite3 \r\nimport pandas.io.sql\r\nimport pandas \r\nimport os \r\nimport win32crypt\r\nimport shutil, getpass\r\nfrom shutil import copyfile \r\nimport time, threading\r\nimport csv \r\n\r\ndef contrachrome():\r\n\r\n##copia archivo de login data de chrome a carpeta local \r\n\tsrc =\"C:\\\\Users\\\\%s\\...
[ [ "pandas.io.sql.read_sql" ] ]
Oizys18/IMG_CAPTION
[ "1a4a5b733bda5976915be4482dd204fcb4319567" ]
[ "predict.py" ]
[ "import tensorflow as tf\nimport os\nimport numpy as np\nfrom data.preprocess import load_image\nfrom models.encoder import CNN_Encoder\nfrom models.decoder import RNN_Decoder\nimport pickle\nfrom train import embedding_dim, units, vocab_size, img_name_train, img_name_val, max_length, cap_val\nimport matplotlib.pyp...
[ [ "tensorflow.random.categorical", "numpy.zeros", "tensorflow.expand_dims", "tensorflow.reshape", "matplotlib.pyplot.figure", "tensorflow.keras.applications.InceptionV3", "numpy.resize", "tensorflow.keras.Model", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", ...
oleg96/facenet
[ "ec1decb90784b8e480f81b388961e5a9ec3cf58d" ]
[ "contributed/export_embeddings.py" ]
[ "\"\"\"\nExports the embeddings and labels of a directory of images as numpy arrays.\n\nTypicall usage expect the image directory to be of the openface/facenet form and\nthe images to be aligned. Simply point to your model and your image directory:\n python facenet/contributed/export_embeddings.py ~/models/facen...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.minimum", "tensorflow.get_default_graph", "tensorflow.Graph", "tensorflow.Session", "scipy.misc.imresize", "numpy.save", "tensorflow.ConfigProto", "numpy.stack", "tensorflow.device", "numpy.squeeze", "ten...
Nephys222/ONNX-HITNET-Stereo-Depth-estimation
[ "9e1172c8e975809ede76166151a2e31865284fea" ]
[ "drivingStereoTest.py" ]
[ "import cv2\nimport pafy\nimport numpy as np\nimport glob\nfrom hitnet import HitNet, ModelType, draw_disparity, draw_depth, CameraConfig, load_img\n\nout = cv2.VideoWriter('outpy2.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 60, (879*3,400))\n\n# Get image list\nleft_images = glob.glob('DrivingStereo images/left/...
[ [ "numpy.hstack" ] ]
LUX23/lab3_web
[ "6cb0bfb0138ca672ca0584c8698bb4f6b1f0a1cc" ]
[ "flaskapp/net.py" ]
[ "import random\nimport keras\nfrom keras.layers import Input\nfrom keras.models import Model\n\nfrom keras.applications.resnet50 import preprocess_input, decode_predictions\nimport os\nfrom PIL import Image\nimport numpy as np\n\nfrom tensorflow.compat.v1 import ConfigProto\nfrom tensorflow.compat.v1 import Interac...
[ [ "numpy.array", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.InteractiveSession" ] ]
sherry30/ivy
[ "1907fa691030c1a77d25d468aa24be3e6f3fd9e9" ]
[ "ivy_tests/test_ivy/test_functional/test_core/test_elementwise.py" ]
[ "\"\"\"Collection of tests for elementwise functions.\"\"\"\n\n# global\nimport numpy as np\nfrom hypothesis import given, assume, strategies as st\nfrom numbers import Number\n\n# local\nimport ivy\nimport ivy_tests.test_ivy.helpers as helpers\nimport ivy.functional.backends.numpy as ivy_np\n\n\n# abs\n@given(\n ...
[ [ "numpy.asarray" ] ]
crawfordsm/pyhrs
[ "b1eeca635a41791e17ce0c5529b427245bded341" ]
[ "pyhrs/tests/test_hrstools.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# This module tests the hrstools\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nfrom astropy.tests.helper import pyte...
[ [ "numpy.random.normal" ] ]
luca-ant/deep_comedy
[ "c7bc2c564eaa4980f2be6be569e123c4343fe163" ]
[ "generating_scripts/generate_by_word.py" ]
[ "import os\nimport sys\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport numpy as np\nimport tensorflow as tf\ntf.get_logger().setLevel('ERROR')\n\nfrom dante_by_word.data_preparation import build_vocab\nfrom dante_by_word.text_processi...
[ [ "tensorflow.keras.models.load_model", "numpy.random.choice", "tensorflow.get_logger" ] ]
peterdt713/Programming_Scripting_Project
[ "a9c41d96d8f6bd709099923723584bca30e619d5" ]
[ "Invest.py" ]
[ "# Peter Thornton, 14 Apr 18\n\n# Initial Investigation into the Iris Data Set\n\n# Below is adapted from https://www.kaggle.com/abhishekkrg/python-iris-data-visualization-and-explanation\n# The following site details a machine learning project in a step-by-step format. This was followed. https://machinelearningmas...
[ [ "sklearn.metrics.confusion_matrix", "pandas.read_csv", "sklearn.model_selection.cross_val_score", "matplotlib.pyplot.subplots", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", "pandas.tools.plotting.scatter_matrix", "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", ...
quqixun/ECG-MLC
[ "582d68200b79e3b2ac322c1ed17630727e283605" ]
[ "round1/code/train/ecg_loader.py" ]
[ "import os\nimport torch\nimport numpy as np\n\nfrom torch.utils.data import Dataset, DataLoader\n\n\n# Mean and Std of train set\nECG_MEAN = np.array(\n [0.618, 0.974, 0.080, 1.172, 1.415, 1.419,\n 1.187, 0.954, 0.356, -0.796, 0.131, 0.665]\n).reshape((-1, 1))\nECG_STD = np.array(\n [24.862, 33.086, 39.4...
[ [ "numpy.concatenate", "numpy.random.normal", "numpy.array", "numpy.copy", "torch.FloatTensor", "numpy.random.randn", "numpy.ones", "torch.utils.data.DataLoader", "numpy.expand_dims" ] ]
jigargandhi/UdemyMachineLearning
[ "e01b0cba28ad75d0cb5a284dc9c9665645f31771" ]
[ "Machine Learning A-Z Template Folder/Part 9 - Dimensionality Reduction/Section 44 - Linear Discriminant Analysis (LDA)/j_lda.py" ]
[ "# -*- coding: utf-8 -*-\n#Note: LDA considers dependent variable and hence it is supervised\n# This should be used for Linear models \nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n#importing libraries\ndataset= pd.read_csv(\"Wine.csv\")\nX= dataset.iloc[:,0:13].values\ny = dataset.ilo...
[ [ "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.colors.ListedColormap", "sklearn.linear_model.Logis...
ProbabilisticNumerics/backpack
[ "05f9a41603ec670d8a34d057e8670c09be0ac516" ]
[ "test/extensions/firstorder/firstorder_settings.py" ]
[ "\"\"\"Test configurations for `backpack.core.extensions.firstorder`\nthat is shared among the following firstorder methods:\n- batch_grad\n- batch_l2_grad\n- sum_grad_sqaured\n- variance\n\n\nRequired entries:\n \"module_fn\" (callable): Contains a model constructed from `torch.nn` layers\n \"input_fn\" (cal...
[ [ "torch.nn.Linear", "torch.rand", "torch.device", "torch.nn.MSELoss", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.nn.CrossEntropyLoss" ] ]
enthought/sandia-data-archive
[ "5923798f61c80771d69ff7500446b711921159a7" ]
[ "sdafile/character_inserter.py" ]
[ "import numpy as np\n\nfrom .record_inserter import SimpleRecordInserter, inserter\n\n\n@inserter\nclass ArrayInserter(SimpleRecordInserter):\n \"\"\" Inserter for character arrays. \"\"\"\n\n record_type = 'character'\n\n @staticmethod\n def can_insert(data):\n \"\"\" Insert boolean arrays. \"\"...
[ [ "numpy.frombuffer", "numpy.dtype", "numpy.atleast_2d" ] ]
mbonyani/uavSim
[ "3b09f9239642309ade595eed4bdbc460ee8024a8" ]
[ "src/ModelStats.py" ]
[ "import collections\nimport datetime\nimport os\nimport shutil\n\nimport tensorflow as tf\nimport numpy as np\nimport progressbar\nimport distutils.util\n\n\nclass ModelStatsParams:\n def __init__(self,\n save_model='models/save_model',\n moving_average_length=50):\n self.s...
[ [ "tensorflow.keras.callbacks.TensorBoard", "tensorflow.summary.create_file_writer", "tensorflow.summary.image", "numpy.mean" ] ]
TheDeMuZ/SignalGenerator
[ "8140af5d99e34428b8aade47d208f5eb29c257dc" ]
[ "cps/converter/adc.py" ]
[ "import math\n\nfrom numpy import arange\n\nimport cps.converter.measures\nfrom ..signal.signal import Signal\n\n\ndef __floor(a):\n return complex(math.floor(a.real), math.floor(a.imag))\n\n\ndef __distance(a, b):\n return ((a.real - b.real) ** 2 + (a.imag - b.imag) ** 2) ** 0.5\n\n\ndef __range(start, stop,...
[ [ "numpy.arange" ] ]
cakiki/transformers
[ "c16d6e3632107d2750ca125634668a6f64585f49" ]
[ "src/transformers/models/wav2vec2/modeling_wav2vec2.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. 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...
[ [ "torch.nn.Linear", "torch.cat", "numpy.random.rand", "torch.stack", "torch.nn.ModuleList", "torch.nn.init.kaiming_normal_", "torch.bmm", "torch.ones", "numpy.broadcast_to", "torch.nn.CrossEntropyLoss", "torch.nn.functional.ctc_loss", "torch.nn.LayerNorm", "torch...
Comp-Sound-Music/interactive_piano
[ "780b18c7b6ccfde016677696fc13428a209c9efb" ]
[ "tests/test_create_harmonies.py" ]
[ "import unittest\nimport numpy as np\nfrom scipy import fftpack\nfrom piano import create_harmonies\nfrom conversion_table import name_to_key as table\n\nclass CreateHarmonies(unittest.TestCase):\n def test_create_harmonies(self):\n # reference (with permission): https://cs510sound-spring2021.zulip.cs.pdx...
[ [ "scipy.fftpack.fft", "numpy.sort", "numpy.abs" ] ]
Edouard87ljt5s/DisyInformationssysteme0
[ "082d7bc429a809c2aca8459cfc93c00ed41a340f" ]
[ "models/treebased/builder/tree_index_builder.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.concatenate", "numpy.array", "sklearn.cluster.KMeans", "numpy.where", "numpy.argsort" ] ]
JohnReid/pybool
[ "7ee0ec1b669ec0259405d3c120ec3fc2827ba397" ]
[ "python/pybool/io.py" ]
[ "#\n# Copyright John Reid 2010, 2011, 2012, 2013\n#\n\n\n\"\"\"\nI/O for boolean regulatory networks.\n\"\"\"\n\n\nimport numpy as N, matplotlib as M, pylab as P, logging, subprocess, os\nfrom cookbook.pylab_utils import layout_sub_plot, pylab_ioff\nfrom . import network, chow_liu_trees\nfrom .analysis import aggre...
[ [ "numpy.ones", "numpy.empty", "numpy.asarray", "numpy.sqrt" ] ]
bioidiap/bob.pipelines
[ "cbefdaf3b384ee11cb26a279281f007adc2d8f19" ]
[ "doc/python/pipeline_example_dask_sge_adaptive.py" ]
[ "import os\nimport shutil\n\nimport numpy\n\nfrom dask.distributed import Client\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.pipeline import make_pipeline\n\nimport bob.pipelines\n\nfrom bob.pipelines.distributed.sge import (\n SGEMultipleQueuesCluster,\n get_resource_requirements,...
[ [ "numpy.array", "numpy.zeros" ] ]
intel/numpy
[ "1147490663d36b05fad8dcce1e104601c2724560" ]
[ "numpy/distutils/cpuinfo.py" ]
[ "#!/usr/bin/env python\n\"\"\"\ncpuinfo\n\nCopyright 2002 Pearu Peterson all rights reserved,\nPearu Peterson <pearu@cens.ioc.ee>\nPermission to use, modify, and distribute this software is given under the\nterms of the NumPy (BSD style) license. See LICENSE.txt that came with\nthis distribution for specifics.\n\n...
[ [ "numpy.distutils.compat.get_exception" ] ]
Parnidadu/manim-1
[ "3287c5d7d4482e5e168941ced042794b7d7e046e" ]
[ "game_of_coins.py" ]
[ "import random\nfrom manimlib.imports import *\nfrom manimlib.mobject.three_dimensions import Cube, Prism\nfrom manimlib.mobject.types.vectorized_mobject import VMobject\nfrom math import sqrt\n\n\n\nclass Coin(VGroup):\n CONFIG = {\n \"fill_opacity\": 0.45,\n \"fill_color\": YELLOW_D,\n \"s...
[ [ "numpy.matrix", "numpy.array", "numpy.dot", "numpy.sin", "numpy.arange", "numpy.cos" ] ]
clvrai/mopa-pd
[ "ac55f568149d8e79c28326bcd9b63336ed065a61" ]
[ "rl/policies/image_actor_critic.py" ]
[ "from collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nfrom gym import spaces\n\nfrom rl.policies.utils import MLP, BC_Visual_Policy\nfrom rl.policies.actor_critic import Actor, Critic\nfrom util.gym import observation_size, action_size, goal_size, box_size, robot_state_size, image_size\nimpo...
[ [ "torch.reshape", "torch.cat", "torch.nn.functional.softplus", "numpy.log", "torch.nn.ModuleDict", "numpy.load", "torch.clamp", "torch.tensor", "torch.zeros_like", "torch.tanh", "torch.clip" ] ]
km1562/AdelaiDet2
[ "293cd6410631d36145f9ae4eb06a63520c66b92d" ]
[ "AdelaiDet/adet/modeling/roi_heads/multi_path_fuse_module.py" ]
[ "import torch\r\nfrom torch import nn\r\nfrom detectron2.structures import Boxes\r\n\r\ndef get_selfarea_and_interarea(boxes1: Boxes, boxes2: Boxes) -> torch.Tensor:\r\n \"\"\"\r\n Given two lists of boxes of size N and M,\r\n compute self_area and inter_area\r\n between __all__ N features M pairs of bo...
[ [ "torch.min", "torch.max", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
maggie0830/segan
[ "c88a08d3299fe6b3627550a4fdb036b179a6537a" ]
[ "data_loader.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\nfrom ops import *\nimport numpy as np\n\n\ndef pre_emph(x, coeff=0.95):\n x0 = tf.reshape(x[0], [1,])\n diff = x[1:] - coeff * x[:-1]\n concat = tf.concat(0, [x0, diff])\n return concat\n\ndef de_emph(y, coeff=0.95):\n if coeff <= 0:\n ...
[ [ "tensorflow.decode_raw", "tensorflow.concat", "numpy.zeros", "tensorflow.FixedLenFeature", "tensorflow.reshape", "tensorflow.TFRecordReader", "tensorflow.cast" ] ]
willu47/otoole
[ "061217567e72cfa37741333f1832eb5d2e11a570" ]
[ "src/otoole/results/result_package.py" ]
[ "import logging\nfrom collections.abc import Mapping\nfrom datetime import datetime\nfrom typing import Dict, Iterable, List, Optional, Tuple\n\nimport pandas as pd\n\nLOGGER = logging.getLogger(__name__)\n\n\nclass ResultsPackage(Mapping):\n \"\"\"A package of OSeMOSYS results\n\n Internal data structure is ...
[ [ "pandas.DataFrame", "pandas.MultiIndex.from_product" ] ]
eribean/girth
[ "d56958921d16dc535aceec2d6d47d341ff418036" ]
[ "src/test/test_classical_test.py" ]
[ "import unittest\n\nimport numpy as np\n\nfrom girth import create_synthetic_irt_polytomous\nfrom girth.classical import classical_test_statistics\n\n\nclass TestClassicalStatistics(unittest.TestCase):\n \"\"\"Test Fixture for classical test statistics.\"\"\"\n\n def setUp(self):\n \"\"\"Testing classi...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.default_rng" ] ]
UtsavVanodiya7/Neural-Netowork-From-Scratch
[ "01a5bba6b8a80981f8d686a8eecad0bc59b1b81f" ]
[ "NeuralNetwork.py" ]
[ "import numpy as np\r\n\r\n\r\nclass NeuralNetwork:\r\n def __init__(self, layers, lr=0.01):\r\n # By default we are going to use sigmoid activation function and bias too.\r\n self._layers = layers\r\n self._lr = lr\r\n\r\n self._layer_size = len(layers)\r\n\r\n # Right now did...
[ [ "numpy.square", "numpy.array", "numpy.dot", "numpy.random.randn", "numpy.exp" ] ]
HughKelley/osmnx
[ "bdf4c5374c5c91ccc63f90b4ae16cbaa41220af7" ]
[ "osmnx/core.py" ]
[ "################################################################################\n# Module: core.py\n# Description: Retrieve and construct spatial geometries and street networks\n# from OpenStreetMap\n# License: MIT, see full license in LICENSE.txt\n# Web: https://github.com/gboeing/osmnx\n###########...
[ [ "pandas.DataFrame" ] ]
ovaar/Qcodes
[ "c03029a6968e16379155aadc8b083a02e01876a6" ]
[ "qcodes/tests/dataset/test_doNd.py" ]
[ "\"\"\"\nThese are the basic black box tests for the doNd functions.\n\"\"\"\nimport hypothesis.strategies as hst\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport numpy as np\nimport pytest\nfrom hypothesis import HealthCheck, given, settings\n\nfrom qcodes import config\nfrom qcodes.dataset.data_set imp...
[ [ "numpy.testing.assert_array_equal", "numpy.ones", "matplotlib.pyplot.close", "numpy.linspace" ] ]
adam2392/dnn-unsupervised
[ "445b472b1e239f7dee15cb97c6351c86ec84e5e6" ]
[ "dnn/model/train/traincnnaux.py" ]
[ "from .basetrain import BaseTrain\nimport numpy as np\nimport os\nfrom sklearn.model_selection import train_test_split\n\nimport keras\nfrom keras.optimizers import Adam\nfrom keras.callbacks import ModelCheckpoint, ReduceLROnPlateau\nfrom keras.callbacks import Callback\nfrom keras.preprocessing.image import Image...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "numpy.std", "numpy.argmax", "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.roc_auc_score", "sklearn.metrics.recall_score" ] ]
rapidrabbit76/Classification-For-Everyone
[ "efb6a696b6085496eee6522a3f3af074be6d112b" ]
[ "main.py" ]
[ "import os\nfrom argparse import ArgumentParser\nfrom typing import *\nfrom unicodedata import name\n\nimport pytorch_lightning as pl\nimport torch\nfrom pytorch_lightning.callbacks import (\n EarlyStopping,\n LearningRateMonitor,\n ModelCheckpoint,\n TQDMProgressBar,\n)\nfrom pytorch_lightning.loggers ...
[ [ "torch.rand" ] ]
jtLiBrain/spark
[ "5b4816cfc8e290d6f56e57227cb397eebf6a030e" ]
[ "python/pyspark/pandas/generic.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.api.types.is_list_like" ] ]
conor-horgan/spectrai
[ "121dc677f161dbe85f62febc295909d1fb1825af" ]
[ "spectrai/transforms/spectral_transforms.py" ]
[ "import numpy as np\nfrom scipy import sparse, ndimage\nfrom scipy.sparse.linalg import spsolve\nimport torch\nfrom torch import nn\n\nclass Transform(object):\n \"\"\"Base class defining a spectral transform.\"\"\"\n def __init__(self):\n pass\n\n def apply_transform(self, sample):\n return ...
[ [ "torch.amax", "torch.rot90", "torch.squeeze", "numpy.random.random", "torch.flip", "torch.sum", "scipy.sparse.linalg.spsolve", "scipy.sparse.diags", "torch.randint", "numpy.arange", "numpy.polyfit", "torch.nn.ReflectionPad2d", "numpy.poly1d", "torch.div", ...
ray-g/FormulaCooker
[ "ff2d781a675a60638ff3e16e146e30a2da847d24" ]
[ "formulacooker/data/preprocessors/image_preprocessor.py" ]
[ "import cv2\nimport numpy as np\n\ndef randomHueSaturationValue(image,\n hue_shift_limit=(-180, 180),\n sat_shift_limit=(-255, 255),\n val_shift_limit=(-255, 255), u=0.5):\n if np.random.random() < u:\n image = cv2.cvtColo...
[ [ "numpy.array", "numpy.dot", "numpy.random.uniform", "numpy.math.cos", "numpy.math.sin", "numpy.random.random" ] ]
energyinpython/pyREPO
[ "dddae9ffa34d4f7624e5471a7ae53ce794938e0b" ]
[ "src/pyrepo_mcda/mcda_methods/vikor.py" ]
[ "import numpy as np\n\nfrom .mcda_method import MCDA_method\n\n\nclass VIKOR(MCDA_method):\n def __init__(self, normalization_method = None, v = 0.5):\n \"\"\"Create the VIKOR method object.\n\n Parameters\n -----------\n normalization_method : function\n VIKOR does...
[ [ "numpy.max", "numpy.zeros", "numpy.sum", "numpy.min", "numpy.amax", "numpy.amin" ] ]
mafried/pycsg
[ "b5b47b0dba96ae62a8b38606c2b38e8bdf3496bf" ]
[ "pycsg/primitives.py" ]
[ "from pycsg.csg_node import CSGNode, register_node_type\nimport numpy as np\n\n\nclass Sphere(CSGNode):\n def __init__(self, radius, name):\n super().__init__(name)\n\n self.radius = radius\n\n def signed_distance(self, p):\n return np.linalg.norm(p, axis=1) - self.radius\n\n def to_di...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.abs" ] ]
dataholiks/deeplearning_part2
[ "f7802407a215b63e5aab833673890721e66e80d6" ]
[ "kmeans.py" ]
[ "import tensorflow as tf\nimport math, numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef plot_data(centroids, data, n_samples):\n colour = plt.cm.rainbow(np.linspace(0,1,len(centroids)))\n for i, centroid in enumerate(centroids):\n samples = data[i*n_samples:(i+1)*n_samples]\n plt.scatter(sa...
[ [ "tensorflow.reduce_min", "tensorflow.shape", "tensorflow.range", "tensorflow.expand_dims", "tensorflow.random_uniform", "matplotlib.pyplot.plot", "tensorflow.Variable", "numpy.allclose", "tensorflow.squeeze", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow....
gilwoolee/bpo_baselines
[ "2fbd39be8e79d69f2d2b23b4e5b8e6dfd372a58a" ]
[ "baselines/ddpg/ddpg_learner.py" ]
[ "from functools import reduce\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom baselines import logger\nfrom baselines.ddpg.models import Actor, Critic\nfrom baselines.common.mpi_running_mean_std import RunningMeanStd\ntry:\n from mpi4py import MPI\n from baselines.common.mpi_adam_optimizer import MpiAd...
[ [ "numpy.array", "tensorflow.shape", "tensorflow.GradientTape", "tensorflow.reshape", "tensorflow.constant", "tensorflow.clip_by_norm", "tensorflow.clip_by_value", "tensorflow.name_scope", "tensorflow.keras.optimizers.Adam", "tensorflow.reduce_mean", "tensorflow.square" ...
imxian/FlexTensor
[ "311af3362856ea1b0073404fffad42c54585c205" ]
[ "flextensor/test/test_tvm_expr/grad/te-conv2d-case2.py" ]
[ "import tvm\nimport numpy as np \nimport torch\n\n\nN = 3\nnC = 16\nH = 15\nW = 15\nK = 16\nR = 3\nS = 3\n\nst = 2\ngroup = 2\n\nOG = K // group\nIG = nC // group\n\nP = (H - R + 1) // st + 1\nQ = (W - S + 1) // st + 1\n\ndtype = \"float32\"\n\nA = tvm.te.placeholder([N, nC, H, W], dtype=dtype, name=\"A\")\nB = tvm...
[ [ "torch.nn.functional.conv_transpose2d", "numpy.random.uniform", "torch.tensor", "numpy.zeros" ] ]
bknorris/Postdoc
[ "cdcee0fda40b99e2990077ef4567f25193b8a672" ]
[ "Paper2_OptimizingRestoration/Figures/Plot_eps_norm_vs_lambda_D_V3.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nEps_norm vs waveLength/D (colored by Tw) for Paper2_optimizingRestoration\n\nBKN - USGS 2022\n\"\"\"\n\nimport pickle\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom pathlib import Path\nfrom scipy import stats\n\nplt.close('all')\...
[ [ "numpy.median", "matplotlib.pyplot.close", "numpy.mean", "matplotlib.pyplot.figure", "numpy.where", "numpy.stack", "matplotlib.pyplot.style.use", "numpy.intersect1d", "scipy.stats.binned_statistic", "numpy.unique" ] ]
tapnx/tapnx
[ "5c1d21345ccd499939e35702526a4e2b7160ca4e" ]
[ "test_scripts/nq_example_grid_edge.py" ]
[ "import pandas as pd\nimport tapnx as tapnx\nimport networkx as nx\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\n\n\ndef importance_computation(G,E,u,v):\n H = tapnx.remove_edge(G, u,v)\n H, data = tapnx.gradient_projection(H,edge_func=edge_func, edge_func_derivative=edge_f...
[ [ "matplotlib.pyplot.show", "matplotlib.cm.ScalarMappable" ] ]
open-data-toronto/tool-data-validation
[ "b264a80056de01243b31716bbc5340b0d4038641" ]
[ "app/validate_data.py" ]
[ "from datetime import datetime\nfrom shapely.geometry import shape, MultiPolygon, MultiPoint, MultiLineString\n\nimport json\nimport sys\nimport traceback\n\nimport geopandas as gpd\nimport numpy as np\nimport pandas as pd\nimport requests\nimport utils\n\nclass DataFrameComparison:\n def __init__(self, src, new...
[ [ "pandas.to_datetime", "numpy.setdiff1d", "numpy.union1d", "pandas.DataFrame.from_dict", "pandas.DataFrame", "numpy.intersect1d", "pandas.to_numeric" ] ]
kinimod0/differentiable_sparse_eigen
[ "f5a66e94799003ee7604ff995e347e39160a9313" ]
[ "nnmodule.py" ]
[ "from torch import nn\nimport torch\nfrom hamiltonian import ham_total\nfrom xitorch import linalg\nfrom test_sparse_eigen import CsrLinOp\nimport numpy as np\n\n\nclass HamModule(nn.Module):\n\n pi = np.pi\n\n def __init__(self, L, J_1, B_0, B_ext, phi_i, device='cuda',dtype=torch.double):\n \"\"\"\n...
[ [ "torch.zeros", "torch.stack", "numpy.log", "torch.square", "numpy.diff", "torch.full", "torch.tensor", "torch.flip", "torch.cumsum" ] ]
bowenl2016/ResidualNetworkDesign
[ "b5b75126f9499053e929ed0d5d9c5f0ac176d5d4" ]
[ "test.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nimport torchvision\r\nimport torchvision.transforms as transforms\r\nfrom project1_model import project1_model\r\n\r\nprint(\"This is the testing script\")\r\ndevice = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\r\nmodel = p...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
davidadrianrg/startup-success-prediction
[ "1b49907dd5c8864add55b4cb2d5fe8188937fc56" ]
[ "preprocessing/detect_anomalies.py" ]
[ "\"\"\"Module to implement the anomalies detection methodes.\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.ensemble import IsolationForest\nfrom sklearn.neighbors import LocalOutlierFactor\nfrom tensorflow import keras\nfrom tensorflow.keras import layers, models\nf...
[ [ "numpy.max", "sklearn.preprocessing.StandardScaler", "numpy.ones", "matplotlib.pyplot.subplots", "tensorflow.keras.layers.Dense", "sklearn.metrics.classification_report", "sklearn.ensemble.IsolationForest", "tensorflow.keras.models.Sequential", "numpy.power", "tensorflow.ke...
thesmarthomeninja/Tensorflow_Census_Example
[ "09de7d23e665996d21db3e13eb8f7abe752db018" ]
[ "workshop_sections/mnist_series/mnist_cnn_custom_estimator/cnn_mnist_keras_vgg_like.py" ]
[ "# Copyright 2016 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 r...
[ [ "tensorflow.reshape", "tensorflow.estimator.export.ServingInputReceiver", "tensorflow.nn.softmax", "tensorflow.cast", "tensorflow.summary.histogram", "tensorflow.argmax", "tensorflow.constant", "tensorflow.app.run", "tensorflow.train.get_global_step", "tensorflow.logging.se...
kiroSamirI/K-cnn
[ "709643934a4ed546052b6a8369837ed7f0e25491" ]
[ "examples/recon_img_from_true_feature_icnn_gd.py" ]
[ "'''Demonstration code for icnn_gd\n\nThis script will do the followings:\n\n1. extract cnn features from a test image,\n2. reconstruct the test image from the CNN features.\n'''\n\n\nimport os\nimport pickle\nfrom datetime import datetime\n\nimport numpy as np\nimport PIL.Image\nimport scipy.io as sio\nfrom scipy....
[ [ "numpy.linalg.norm", "numpy.load", "scipy.misc.imresize" ] ]
UXARRAY/uxarray
[ "6fc6af993c4d10194fbb6d7fbcae804bad4b1ad7" ]
[ "uxarray/_exodus.py" ]
[ "import xarray as xr\nimport numpy as np\nfrom pathlib import PurePath\nfrom datetime import datetime\n\n\n# Exodus Number is one-based.\ndef _read_exodus(filepath, ds_var_names):\n \"\"\"Exodus file reader.\n\n Parameters\n ----------\n\n filepath : str, optional\n Path of the file to be read in...
[ [ "numpy.concatenate", "numpy.count_nonzero", "numpy.array", "numpy.empty", "numpy.zeros", "numpy.ones", "numpy.nonzero", "numpy.where", "numpy.float32", "numpy.arange", "numpy.int32" ] ]
bbrito/malib
[ "f6e6c3a48cf62fe7a2b288ebfefa9a4146d92db5" ]
[ "malib/agents/ddpg/maddpg.py" ]
[ "# Created by yingwen at 2019-03-15\nimport numpy as np\nimport tensorflow as tf\n\nfrom malib.agents.base_agent import OffPolicyAgent\nfrom malib.core import Serializable\nfrom malib.utils import tf_utils\n\n\nclass MADDPGAgent(OffPolicyAgent):\n def __init__(self, env_specs, policy, qf, replay_buffer, policy_o...
[ [ "numpy.array", "tensorflow.concat", "tensorflow.debugging.check_numerics", "tensorflow.GradientTape", "tensorflow.optimizers.Adam", "tensorflow.reshape", "tensorflow.squeeze", "tensorflow.reduce_mean", "tensorflow.stop_gradient" ] ]
alanland/ml-pratice
[ "b1e7c753d347d8d97c4a463980f41a8252833f01" ]
[ "plot/impshow_ex.py" ]
[ "# -----------------------------------------------------------------------------\n# Copyright (c) 2015, Nicolas P. Rougier. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n# -----------------------------------------------------------------------------\nimport numpy a...
[ [ "matplotlib.pyplot.colorbar", "numpy.exp", "matplotlib.pyplot.yticks", "matplotlib.pyplot.axes", "matplotlib.pyplot.show", "numpy.linspace", "numpy.meshgrid", "matplotlib.pyplot.xticks", "matplotlib.pyplot.imshow" ] ]
simonefinelli/ASL-Real-time-Recognition
[ "3576051d3aa8ca3935ee5aeb3275ec5dec711821" ]
[ "web app/server.py" ]
[ "import base64\nimport io\n\nimport cv2\nimport numpy as np\nfrom PIL import Image\nfrom flask import Flask, render_template\nfrom flask_socketio import SocketIO, emit\nfrom tensorflow.keras.models import load_model\n\n# global variables\nlabels = {\n 0: 'book',\n 1: 'chair',\n 2: 'clothes',\n 3: 'compu...
[ [ "numpy.array", "numpy.empty", "numpy.reshape", "tensorflow.keras.models.load_model", "numpy.argmax", "numpy.append" ] ]
LeadingIndiaAI/Convolutional-Neural-Network-based-approach-for-Landmark-Recognition
[ "d180b1754200c10b824d75c08322051b949c85ea" ]
[ "landmark.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom keras.models import Model\nfrom keras.layers import Dense,Conv2D,MaxPooling2D,Flatten,Dropout\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.preprocessing import image\nfrom keras.applications import VGG16\nfrom keras.optimizers import Adam\nimpo...
[ [ "pandas.DataFrame", "numpy.array", "numpy.argmax", "numpy.amax" ] ]
elina-israyelyan/thompson-sampling
[ "784dd09b56f933f9aa8d7b3555a65b1762bfb7e4" ]
[ "thompson_sampling/model/normal_distribution.py" ]
[ "import logging\nimport pickle\nimport random\nfrom statistics import mode\n\nimport numpy as np\nimport pandas as pd\nimport plotly.graph_objects as go\nfrom scipy.stats import norm\n\nfrom thompson_sampling.model.base import BaseModel\n\n\nclass NormalDistributionModel(BaseModel):\n \"\"\"\n Model for imple...
[ [ "numpy.random.normal", "numpy.linspace", "scipy.stats.norm" ] ]
florischabert/models
[ "add588d68888e8ba869ffce17d214c48e41ca019" ]
[ "official/transformer/translate.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.gfile.IsDirectory", "tensorflow.logging.set_verbosity", "tensorflow.logging.warn", "tensorflow.gfile.Open", "tensorflow.TensorShape", "tensorflow.gfile.Exists", "tensorflow.logging.info", "tensorflow.estimator.Estimator", "tensorflow.data.Dataset.from_tensors" ] ]
janjagusch/sklearn-onnx
[ "cac2081b5c20695941631bb0342899b6887c106b" ]
[ "tests/test_sklearn_decision_tree_converters.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\n\nimport unittest\nfrom distutils.version import StrictVersion\nimport numpy as np\nfrom numpy.testing import assert_almost_equal\nfrom pandas import DataFrame\nfrom sklearn.tree import (\n DecisionTreeClassifier, DecisionTreeRegressor,\n ExtraTreeClassifier, ExtraTre...
[ [ "sklearn.tree.ExtraTreeClassifier", "numpy.testing.assert_almost_equal", "pandas.DataFrame", "sklearn.tree.ExtraTreeRegressor", "sklearn.tree.DecisionTreeClassifier", "sklearn.tree.DecisionTreeRegressor", "sklearn.datasets.make_classification" ] ]
flamingrickpat/genopt
[ "c2f34332e844039479ea8b4603ed7aa1c717a1aa" ]
[ "api/backtest_simple.py" ]
[ "import sys\nsys.path.append(\"../shared\")\nsys.path.append(\"\")\nimport logging\nimport numpy as np\nimport df_utils\nimport file_utils\nimport time\nimport pandas as pd\nfrom plotly.subplots import make_subplots\nfrom plotly.offline import plot\nimport plotly.graph_objects as go\nfrom sklearn.linear_model impor...
[ [ "numpy.max", "numpy.array", "numpy.minimum.accumulate", "sklearn.linear_model.LinearRegression", "numpy.median", "numpy.sum", "numpy.mean", "numpy.std", "numpy.where", "numpy.abs", "numpy.var" ] ]
jantrienes/ecir2019-qac
[ "7d6dea5af85fc97d115cbf804365e04c8eed1111" ]
[ "qac/simq/simq_majority.py" ]
[ "import argparse\nimport logging\nimport logging.config\nimport os\nfrom os.path import dirname, exists, join\n\nimport numpy as np\nimport pandas as pd\n\nimport simq_features\nfrom qac.evaluation import evaluation\nfrom qac.experiments import preprocessing\n\nlogger = logging.getLogger(__name__) # pylint: disabl...
[ [ "pandas.DataFrame.from_dict", "numpy.stack", "pandas.concat" ] ]
cuarti/python-artificial-intelligence-tests
[ "f9454b812ceadcabd7976ddb0a28229bc9db2b23" ]
[ "neural_networks/math/__init__.py" ]
[ "\nfrom numpy import array, random, dot\n\n\nclass NeuralNetwork:\n\n def __init__(self):\n random.seed(1)\n self.weights = 2 * random.random((2, 1)) - 1\n\n def train(self, inputs, outputs, num):\n for iteration in range(num):\n output = self.think(inputs)\n error =...
[ [ "numpy.random.seed", "numpy.random.random", "numpy.array", "numpy.dot" ] ]
mmabadal/shellnet
[ "6ab324c702b33542dc1a5c1ae86b7c53e3d1db76" ]
[ "utils/pointfly.py" ]
[ "import math\nimport random\nimport itertools\nimport numpy as np\nimport tensorflow as tf\nfrom numpy import linalg as LA\nfrom transforms3d.euler import euler2mat\n\n# the returned indices will be used by tf.gather_nd\ndef get_indices(batch_size, sample_num, point_num, pool_setting=None):\n if not isinstance(p...
[ [ "tensorflow.reduce_min", "numpy.random.choice", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.py_function", "tensorflow.sqrt", "tensorflow.clip_by_value", "tensorflow.stack", "tensorflow.cast", "numpy.full_like", "tensorflow.square", "numpy.full", "tens...
YupengGao/malmo-challenge
[ "5ff93364bccb6d3b1dbf7aaa22eb052c669bc7ff" ]
[ "malmopy/environment/malmo/malmo.py" ]
[ "# Copyright (c) 2017 Microsoft Corporation.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, me...
[ [ "numpy.log", "numpy.array", "numpy.zeros" ] ]
SambaranRepo/VectorNet_Waymo
[ "454016a5020444e78943786c14e4e12a75ce052e" ]
[ "utils/MTP_loss.py" ]
[ "import torch\n\n\n# pos_preds is (N_actors, N_modes, T, 2)\n# probs is (N_modes)\n# GT is (N_actors, T, 2)\ndef multi_mode_loss_L2(pos_preds, probs, GT):\n pred_size = list(pos_preds.size())\n T = pred_size[2]\n \n GT = GT[:,None,:,:]\n \n # shape (N_actors, N_modes, T, 2)\n sq_dif = torch.squ...
[ [ "torch.square", "torch.argmin", "torch.index_select", "torch.log", "torch.sum" ] ]
bagheria/Prep
[ "e7bff974cc0c3bee8121283901828c37e16fab27" ]
[ "negation/structure2/varObject.py" ]
[ "from abc import ABC, abstractmethod\nimport re\nimport pandas as pd\nfrom pprint import pprint\nfrom collections import abc\n\nfrom negation.structure2 import batch, constants, factory, modObject, patientObject\n\n\n# Master Class\nclass varObject(abc.Collection):\n def __init__(self):\n self.objects = [...
[ [ "pandas.DataFrame", "pandas.Series", "pandas.concat" ] ]
BjarkePedersen/simpletransformers
[ "1a2fecdba5485c6d31c646ef83734389796c0f4b" ]
[ "simpletransformers/seq2seq/seq2seq_model.py" ]
[ "import json\nimport logging\nimport math\nimport os\nimport random\nimport warnings\nfrom multiprocessing import cpu_count\nfrom pathlib import Path\n\nimport numpy as np\nfrom tqdm.auto import tqdm, trange\n\nimport pandas as pd\nimport torch\nfrom simpletransformers.config.global_args import global_args\nfrom si...
[ [ "torch.device", "torch.utils.data.RandomSampler", "torch.cuda.manual_seed_all", "numpy.random.seed", "pandas.DataFrame", "torch.no_grad", "torch.utils.data.SequentialSampler", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.DataP...