repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
iki-taichi/tf-keras-transformer
[ "613122705583c0274b0c9be0993f3bbeb240932d" ]
[ "src/get_kyoto_corpus.py" ]
[ "# coding: utf-8\n\n\n\"\"\"\nDownload Japanese-English Bilingual Corpus of Wikipedia's Kyoto Articles\nAnd make it csv file for transformer fitting\n\nYou can read documents about the license of the corpus at the following url: \nhttps://alaginrc.nict.go.jp/WikiCorpus/index_E.html#license \n\"\"\"\n\n\nimport argp...
[ [ "numpy.random.shuffle" ] ]
google-research/remixmatch
[ "f7061ebf055227cbeb5c6fced1ce054e0ceecfcd" ]
[ "scripts/create_datasets.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ...
[ [ "numpy.concatenate", "tensorflow.train.BytesList", "tensorflow.train.Int64List", "tensorflow.train.Features", "numpy.zeros", "tensorflow.gfile.Open", "tensorflow.Session", "tensorflow.gfile.Exists", "tensorflow.python_io.TFRecordWriter", "tensorflow.gfile.MakeDirs", "te...
ranarango/fuegos-orinoquia
[ "d82941ef0c90fe66162c8678b6f4a4c010d4313b" ]
[ "src/06_fuel/10_plot_rainfall_correlations.py" ]
[ "\"\"\"\n\n\"\"\"\nimport os\n\nimport matplotlib.gridspec as gridspec\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport pandas as pd\nimport seaborn as sns\n\nfrom src.utils.constants import REGIONS\n\n\nif __name__ == \"__main__\":\n\n # Project's root\n os.chdir(\"../..\")\n\n ...
[ [ "matplotlib.gridspec.GridSpecFromSubplotSpec", "pandas.read_excel", "matplotlib.ticker.FormatStrFormatter", "matplotlib.pyplot.figure", "matplotlib.pyplot.Subplot", "matplotlib.gridspec.GridSpec" ] ]
fffasttime/coiltraine
[ "d08e8c5c02219998e2952abff4f50b93969e3736" ]
[ "errorinsert/EI_modules.py" ]
[ "# Copy from reliability\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nimport random\nimport numpy as np\n\n\n__all__ = ['Conv2dEI', 'LinearEI']\n\n\ndef get_default_kwargs(kwargs):\n default = {\n 'tmr': False,\n 'ei_prob': 1e-3,\n 'nbits': 8,\n\n ...
[ [ "torch.zeros", "torch.nn.functional.linear", "torch.sort" ] ]
geeks121/coinbase-exchange-order-book
[ "4eae6025e567dd50ba1ac2b9727e0e75b6bf2e40" ]
[ "main.py" ]
[ "import asyncio\nfrom datetime import datetime\nfrom decimal import Decimal\nimport argparse\n\nimport functools\nimport pytz\nfrom trading import file_logger as trading_file_logger\nfrom orderbook import file_logger as order_book_file_logger\nimport numpy\n\ntry:\n import ujson as json\nexcept ImportError:\n ...
[ [ "numpy.mean", "numpy.diff" ] ]
maple-research-lab/AdCo
[ "a9f25fc18c12df88c732b33700f3bb698454dd3f" ]
[ "training/train.py" ]
[ "import argparse\nimport builtins\nimport math\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.optim\nimport torch.multipr...
[ [ "torch.zeros", "torch.distributed.get_world_size", "torch.cat", "torch.mul", "torch.einsum", "torch.arange", "torch.norm", "torch.no_grad", "torch.distributed.all_gather", "torch.softmax", "torch.distributed.all_reduce", "torch.ones_like", "torch.nn.functional.s...
tkc-morita/seq2seq_abcd-vae
[ "9da0b81a0f15554ed4915f1a4c7a5b770c5197ac" ]
[ "ABCD-VAE/encode_logit.py" ]
[ "# coding: utf-8\n\nimport torch\nfrom modules.data_utils import Compose\nimport numpy as np\nimport pandas as pd\nfrom modules import data_utils\nimport learning\nimport os, argparse, itertools\n\n\nclass Encoder(learning.Learner):\n\tdef __init__(self, model_config_path, device = 'cpu'):\n\t\tself.device = torch....
[ [ "torch.device", "torch.nn.utils.rnn.pack_sequence", "pandas.DataFrame", "torch.no_grad", "numpy.floor" ] ]
dreamfyrian/imitation
[ "682bc4b919baf57bdd959ac646caba21d92cdf71" ]
[ "src/imitation/policies/exploration_wrapper.py" ]
[ "\"\"\"Wrapper to turn a policy into a more exploratory version.\"\"\"\n\nfrom typing import Optional\n\nimport numpy as np\nfrom stable_baselines3.common import vec_env\n\nfrom imitation.data import rollout\n\n\nclass ExplorationWrapper:\n \"\"\"Wraps a PolicyCallable to create a partially randomized version.\n...
[ [ "numpy.stack", "numpy.random.RandomState" ] ]
kernsuite-debian/bifrost
[ "04be6ba3acb59358f9cb4ebecfa154002a2efe39" ]
[ "test/test_reduce.py" ]
[ "\n# Copyright (c) 2016, The Bifrost Authors. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of ...
[ [ "numpy.testing.assert_allclose", "numpy.random.seed", "numpy.sum", "numpy.sqrt", "numpy.random.random" ] ]
leomarkcastro/Image-Enhancer-DPIR
[ "58a99cfd3325dabab29b6f68ad96ae17d090445b" ]
[ "main_dpir_denoising.py" ]
[ "import os.path\nimport logging\n\nimport numpy as np\nfrom collections import OrderedDict\n\nimport torch\n\nfrom utils import utils_logger\nfrom utils import utils_model\nfrom utils import utils_image as util\n\n\n\"\"\"\nSpyder (Python 3.7)\nPyTorch 1.6.0\nWindows 10 or Linux\nKai Zhang (cskaizhang@gmail.com)\ng...
[ [ "numpy.random.normal", "numpy.random.seed", "torch.FloatTensor", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.load" ] ]
Benson0704/MSI_MSS_Prediction
[ "aea880db359f105157de9798c9b01883df0b361c" ]
[ "getRatio.py" ]
[ "import random\nfrom sklearn import linear_model\nfrom sklearn import neighbors\nfrom sklearn import metrics\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn import svm\nimport time\nimport openpyxl\nimport matplotlib.pyplot\nimport numpy\nimport scipy\nDO_RAW = 1\nDO_LR = 1\nDO_SVC = 0\nDO_KNN = ...
[ [ "numpy.array", "sklearn.metrics.precision_recall_curve", "sklearn.neighbors.KNeighborsClassifier", "scipy.stats.norm.interval", "sklearn.svm.SVC", "sklearn.linear_model.LogisticRegression", "sklearn.metrics.auc", "sklearn.model_selection.cross_val_score", "sklearn.metrics.roc_c...
glenrs/WishbuilderData
[ "424511250246fc56f24e2ae7b92330504b113eeb" ]
[ "CompletedDatasets/GSE62944/GSE62944_Normal_TPM/parse.py" ]
[ "import sys, gzip\nimport numpy as np\n\nPatientCancerType = sys.argv[1]\nNormalTPM = sys.argv[2]\ndataOutFile = sys.argv[3]\nmetadataOutFile = sys.argv[4]\nprint(metadataOutFile)\nnamesToAbbreviations = sys.argv[5]\n\n## Read the namesToAbbreviation\nabbvToNamesDict = {}\nwith open(namesToAbbreviations, 'r') as f:...
[ [ "numpy.genfromtxt" ] ]
tarunchy/keras-molecules
[ "f56fbcb92db888a49e62d26144cbf9c47761bffd" ]
[ "molecules/utils.py" ]
[ "import gzip\nimport pandas\nimport h5py\nimport numpy as np\n\ndef one_hot_array(i, n):\n return list( map(int, [ix == i for ix in range(n)]))\n\ndef one_hot_index(vec, charset):\n charset = [str(c) for c in charset]\n return list( map(charset.index, vec))\n\ndef from_one_hot_array(vec):\n oh = np.wher...
[ [ "numpy.where" ] ]
libcell/deconvBench
[ "a9a30f987c4a7b9f7ffca64d90add6d2be44f700" ]
[ "inst/python/rpytools/Autogenges.py" ]
[ "##--------------------------------------------------------------------##\n# Loading library\n##--------------------------------------------------------------------##\nimport numpy as np\nimport scanpy as sc\nimport scipy as sci\nimport pandas as pd\nimport matplotlib as mpl\nimport matp...
[ [ "pandas.DataFrame", "pandas.read_csv", "numpy.mean", "pandas.Series.unique" ] ]
collector-m/ST3D
[ "720e04aa3dc4bb95ac336171b240b6c3130144e5" ]
[ "pcdet/datasets/kitti/kitti_utils.py" ]
[ "import numpy as np\nfrom ...utils import box_utils\n\nfrom ..dataset import DatasetTemplate as Dataset\n\n\ndef transform_annotations_to_kitti_format(annos, map_name_to_kitti=None, info_with_fakelidar=False, **kwargs):\n \"\"\"\n Args:\n annos:\n map_name_to_kitti: dict, map name to KITTI names...
[ [ "numpy.arctan2", "numpy.zeros" ] ]
randrew2636/Visualising_BZ
[ "f73016a3cef3b9d041d60d2484b346d8941e6f96" ]
[ "BZ_ZONES_counting.py" ]
[ "# Richard Andrew 2020\n# \nimport numpy as np\nimport pandas as pd\n\nimport time\nimport os\n#--------------------------------------------------------\n\n# Run f2py compiling the openMP fortran file into a python-callable library\n\nos.system(\"f2py3.7 -c -m ws bzones_lib_counting.f90 --f90flags=-fopenmp -lgomp\"...
[ [ "numpy.sin", "numpy.linalg.norm", "numpy.zeros", "numpy.abs", "numpy.sqrt", "numpy.argsort", "numpy.cos", "pandas.read_csv" ] ]
deepchatterjeevns/Monk_Object_Detection
[ "861c6035e975ecdf3ea07273f7479dbf60fbf9b2" ]
[ "8_pytorch_rfbnet/lib/train_detector.py" ]
[ "import sys\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\nimport torch.nn.init as init\nimport argparse\nimport numpy as np\nfrom torch.autograd import Variable\nimport torch.utils.data as data\nfrom d...
[ [ "torch.nn.init.xavier_uniform", "torch.autograd.Variable", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ] ]
lquirosd/Order_Relation_Operator
[ "28d7cf9f691bc0f98a18bf37dc673bb08a7c2a6f" ]
[ "src/text_line_dataset.py" ]
[ "import os\nimport glob\n\nimport torch\nfrom torch.utils.data import Dataset\nimport numpy as np\nimport cv2\n\nfrom xmlPAGE import pageData\nfrom utils import mkdir, files_exist\n\ndef region_features_from_xml(xml_file, categories):\n \"\"\"\n \"\"\"\n page = pageData(xml_file)\n page.parse()\n img...
[ [ "torch.cat", "torch.save", "numpy.mean", "torch.tensor", "torch.load" ] ]
oviazlo/SparseDistance
[ "077385b26cfb160d756817d9b2e5959270b3f745" ]
[ "sparsedistance/models.py" ]
[ "# BSD 3-Clause License\n\n# Copyright (c) 2020, Joosep Pata\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n\n# * Redistributions of source code must retain the above copyright notice, th...
[ [ "tensorflow.sparse.reorder", "tensorflow.exp", "tensorflow.shape", "tensorflow.range", "tensorflow.concat", "tensorflow.zeros", "tensorflow.gather_nd", "tensorflow.sparse.SparseTensor", "tensorflow.reshape", "tensorflow.map_fn", "tensorflow.transpose", "tensorflow.m...
OddExtension5/repo4U
[ "bfd82ed1ec7489745c198b90d5763119b6f82db6" ]
[ "model/model.py" ]
[ "from sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.neighbors import NearestNeighbors\nimport pandas as pd\nimport dill\n\n# Data Pre-Processing\n\n# load the dataset\ndf = pd.read_csv('../data/stars.csv')\n\n# select top languages from dataset\ndf = df[df.language.isin(['Python', 'Jupyter No...
[ [ "sklearn.neighbors.NearestNeighbors", "pandas.DataFrame", "pandas.read_csv", "sklearn.feature_extraction.text.CountVectorizer" ] ]
osigaud/stable-baselines3
[ "314307c78a173c92b30b56776f96cbe9eb24b27d" ]
[ "stable_baselines3/cem/policies.py" ]
[ "from typing import Any, Dict, List, Optional, Type\n\nimport gym\nimport torch as th\nfrom gym import spaces\nfrom torch import nn\n\nfrom stable_baselines3.common.policies import BasePolicy, register_policy\nfrom stable_baselines3.common.preprocessing import get_action_dim\nfrom stable_baselines3.common.torch_lay...
[ [ "torch.nn.Sequential", "torch.argmax" ] ]
greenwoodms06/raven
[ "ef1372364a2776385931763f2b28fdf2930c77b9" ]
[ "tests/framework/unit_tests/Optimizers/test2pointsCrossover.py" ]
[ "# Copyright 2017 Battelle Energy Alliance, LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ...
[ [ "numpy.arange", "numpy.shape" ] ]
LittleWat/MCD_DA
[ "af10217c5c5451dcd8bc3e975a7d067c285cc029" ]
[ "segmentation/tools/concat_rgb_gt_pred_img.py" ]
[ "\"\"\"\nCompare predicted visualized png.\n\nCreate merged png image that is randomly selected with original RGB image and GT.\n\"\"\"\n\nimport argparse\nimport os\nimport random\n\nimport numpy as np\nfrom PIL import Image\n\nfrom util import mkdir_if_not_exist\n\nVIS_GT_DIR_DIC = {\n \"city\": \"/data/unagi0...
[ [ "numpy.array" ] ]
ShireFolk/tensorflow
[ "ca6ce24f81887c299ab5e9883083380c8e95701e" ]
[ "tensorflow/python/distribute/values_test.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.core.protobuf.config_pb2.ConfigProto", "tensorflow.python.ops.variables.Variable", "tensorflow.python.eager.context.graph_mode", "tensorflow.python.distribute.values.PerReplica", "tensorflow.python.distribute.cluster_resolver.tpu_cluster_resolver.TPUClusterResolver", "tensorflo...
alexandonian/paint-by-word
[ "40213a597f4ecbc8cf95abe5a6cb856dda01baef" ]
[ "paintbyword/utils/dissect.py" ]
[ "import torch\nimport re\nimport copy\nimport numpy\nfrom torch.utils.data.dataloader import default_collate\nfrom netdissect import nethook, imgviz, tally, unravelconv, upsample\n\n\ndef acts_image(model, dataset,\n layer=None, unit=None,\n thumbsize=None,\n cachedir=None,...
[ [ "torch.zeros", "torch.no_grad", "torch.enable_grad", "torch.ones", "torch.nn.Conv2d", "torch.nn.functional.softmax", "torch.zeros_like", "torch.utils.data.dataloader.default_collate" ] ]
fujirock/Reinvent
[ "ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616" ]
[ "unittest_reinvent/scoring_tests/scoring_components/test_qed_score.py" ]
[ "import unittest\n\nfrom rdkit import Chem\n\nfrom scoring.component_parameters import ComponentParameters\nfrom scoring.score_components import QedScore\nfrom unittest_reinvent.scoring_tests.scoring_components import ScoringTest\nfrom utils.enums.scoring_function_component_enum import ScoringFunctionComponentNameE...
[ [ "numpy.testing.assert_almost_equal" ] ]
drmcg/cellsegment
[ "69213a1c232d0ba81639080870593089b212d5d4" ]
[ "cellsegment/json_utils.py" ]
[ "#AUTOGENERATED! DO NOT EDIT! File to edit: dev/94_json_utils.ipynb (unless otherwise specified).\n\n__all__ = ['createjson', 'TEST_JSON_STRING', 'annotate_json', 'create_json_from_CSV', 'csv_to_json_dir',\n 'resize_json_file', 'resize_json_dir', 'prettyjson', 'getsubitems', 'basictype2str', 'indentitems'...
[ [ "pandas.read_csv" ] ]
hargoniX/CNN-for-Sequential-Text
[ "7a44cfbc389f740ffd67468aa2f002d8dd1e04c8" ]
[ "cnn_for_sequential_text_classification.py" ]
[ "# -*- coding: utf-8 -*-\nimport pandas as pd\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom keras.preprocessing import text, sequence\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.layers.embeddings import Embedding\nfrom keras.callbacks import EarlyStopping\nfro...
[ [ "sklearn.preprocessing.LabelBinarizer" ] ]
phantoms158/Mask-rcnn
[ "60db1355747d2c47b3ff70aa6140d16a1504541e" ]
[ "mrcnn/model.py" ]
[ "\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict...
[ [ "tensorflow.exp", "numpy.random.choice", "tensorflow.image.non_max_suppression", "numpy.copy", "tensorflow.unique", "tensorflow.reshape", "numpy.where", "tensorflow.sqrt", "numpy.sort", "tensorflow.stack", "tensorflow.control_dependencies", "numpy.broadcast_to", ...
anjandeepsahni/automatic_speech_recognition
[ "181d6435e1846bb137218e260e2f65584e045bd8" ]
[ "Code/beamsearch.py" ]
[ "import numpy as np\n\n\n# Node class for beam search.\nclass BeamNode(object):\n def __init__(self, parent, state, value, cost, extras):\n super(BeamNode, self).__init__()\n # value/predicted word for current node.\n self.value = value\n # parent Node, None for root\n self.par...
[ [ "numpy.log", "numpy.argsort" ] ]
lmondada/Python-Raytracer
[ "63fc93ced2f4451775c645974e9db979c663abf3" ]
[ "sightpy/scene.py" ]
[ "from PIL import Image\nimport numpy as np\nimport time\nimport copy\nfrom multiprocessing import Pool, cpu_count\nfrom .utils import colour_functions as cf\nfrom .camera import Camera\nfrom .utils.constants import *\nfrom .utils.vector3 import vec3, rgb\nfrom .ray import Ray, get_raycolor, get_distances\nfrom . im...
[ [ "numpy.ceil", "numpy.clip" ] ]
thoolihan/PythonMath
[ "25e1ef092d4bb013a91a4856a255f2a38a9cb46c" ]
[ "tests/calc_tests.py" ]
[ "import unittest\nimport numpy as np\nimport calculus as calc\n\nclass CalcTests(unittest.TestCase):\n def test_euler(self):\n x = np.pi / 4.\n y_est, ys, ds = calc.euler(dy_dx = lambda x,y: np.cos(x),\n y0 = 0,\n h = 1e-4,\n ...
[ [ "numpy.sin", "numpy.cos" ] ]
cjer/gtfstk
[ "7e1573a2fae786f4683cefc3c9d1f0310baa5367" ]
[ "gtfstk/constants.py" ]
[ "\"\"\"\nConstants useful across modules.\n\"\"\"\n\nimport pandas as pd\n\n# Record some data from the GTFS reference at\n# https://developers.google.com/transit/gtfs/reference/\ncolumns = ['table', 'table_required', 'column', 'column_required', 'dtype']\nrows = [\n ['agency', True, 'agency_id', False, 'str'],\...
[ [ "pandas.DataFrame" ] ]
jdsalmonson/mushroom-rl
[ "27557269be5415879e035ff862815d2d5d9fb795" ]
[ "tests/algorithms/test_ddpg.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nimport numpy as np\nfrom datetime import datetime\nfrom helper.utils import TestUtils as tu\n\nfrom mushroom_rl.core import Agent\nfrom mushroom_rl.algorithms.actor_critic import DDPG, TD3\nfrom mushroom_rl.core im...
[ [ "torch.nn.Linear", "numpy.array", "torch.cuda.manual_seed", "numpy.random.seed", "numpy.ones", "torch.manual_seed", "numpy.allclose", "torch.squeeze", "torch.nn.init.calculate_gain" ] ]
PedromfRibeiro/AA2-Embeddings
[ "9d186fe2b8ed7da2cb150dbbf533ed0027aefc6d" ]
[ "DeepMol/src/parameterOptimization/HyperparameterOpt.py" ]
[ "\"\"\"Hyperparameter Optimization Class\"\"\"\n\nimport sklearn\nfrom models.Models import Model\nfrom models.sklearnModels import SklearnModel\nfrom models.kerasModels import KerasModel\nfrom metrics.Metrics import Metric\nfrom Datasets.Datasets import Dataset\nfrom typing import Dict, Any, Optional, Tuple\nfrom ...
[ [ "sklearn.metrics.SCORERS.keys", "sklearn.model_selection.StratifiedKFold", "sklearn.model_selection.RandomizedSearchCV" ] ]
alealv/glow-tts-train
[ "3e16feedffa07d1c4c4a80ac8c4769d17ace48f2" ]
[ "glow_tts_train/export_onnx.py" ]
[ "#!/usr/bin/env python3\nimport argparse\nimport logging\nfrom pathlib import Path\n\nimport torch\n\nfrom .checkpoint import load_checkpoint\nfrom .config import TrainingConfig\n\n_LOGGER = logging.getLogger(\"glow_tts_train.export_onnx\")\n\nOPSET_VERSION = 12\n\n# ------------------------------------------------...
[ [ "torch.randint", "torch.FloatTensor", "torch.no_grad" ] ]
Yulin832/fromage
[ "f6c84d5684ca5abfcc979540bb97cc8f105f963d" ]
[ "fromage/tests/test_mol_cell_operations.py" ]
[ "import numpy as np\nfrom pytest import approx\n\n\ndef test_complete_mol(hc1_cell):\n new_mol, new_cell = hc1_cell.complete_mol(0)\n sel = new_mol.select(0)\n assert len(new_mol) == len(sel)\n\n\ndef test_complete_cell(hc1_cell):\n new_cell, new_mols = hc1_cell.complete_cell()\n assert len(new_mols[...
[ [ "numpy.array" ] ]
jedavis82/scene_labeling
[ "a5e819f801a4fa96a1f4b076fc2049519687b1de" ]
[ "level_two_utils/clothing.py" ]
[ "from skfuzzy import control as ctrl\nimport skfuzzy as fuzz\nimport numpy as np\nfrom fuzzy_utils import create_universes_membership_functions\n\n\nclass ClothingRules:\n def __init__(self, show_sim_result=None):\n prox, over, spat = create_universes_membership_functions()\n self.__show_sim_result...
[ [ "numpy.arange" ] ]
Nilesh6519/Stock-Sentiment-Analysis
[ "935e62a524d62cf9face43b5875a4ab54b3e5bce" ]
[ "Stock Sentiment Analysis.py" ]
[ "# ## Stock Sentiment Analysis using News Headlines\n\nimport pandas as pd\ndf=pd.read_csv('Data.csv', encoding = \"ISO-8859-1\")\ndf.head()\ntrain = df[df['Date'] < '20150101']\ntest = df[df['Date'] > '20141231']\ndata=train.iloc[:,2:27]\ndata.replace(\"[^a-zA-Z]\",\" \",regex=True, inplace=True)\n\n# Renaming col...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.accuracy_score", "sklearn.metrics.classification_report", "sklearn.feature_extraction.text.CountVectorizer", "pandas.read_csv" ] ]
cm-1/2D-External-Visual-Hulls
[ "579e7d18d048d403b636d326840e5cb2a4e3a3e8" ]
[ "visHullTwoD.py" ]
[ "import numpy as np\nimport math\nfrom enum import Enum\nfrom collections import deque\nimport heapq\n\nfrom RedBlackTree.rb_tree import RedBlackTree\n\nEQUAL_THRESHOLD = 0.001 # Threshold for considering certain fp numbers equal below.\nEQUAL_DECIMAL_PLACES = -round(math.log(EQUAL_THRESHOLD, 10))\n\nclass EventTyp...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.empty", "numpy.dot", "numpy.sum", "numpy.copy", "numpy.roll", "numpy.where", "numpy.vstack", "numpy.arange", "numpy.all", "numpy.flip" ] ]
1364354238/PYTORCH_LEARNING
[ "d7ab877512ab41c80b37ab68bd1a42193916f31c" ]
[ "chapter10-图像描述(Image Caption)/utils/beam_search.py" ]
[ "#coding:utf8\n# 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#\...
[ [ "torch.autograd.Variable", "torch.cat", "torch.LongTensor", "torch.nn.functional.log_softmax" ] ]
TACJu/Semantic-Coherence
[ "8b377006a28e09dc0beb283ad3f28ac6ff23020b" ]
[ "han.py" ]
[ "import numpy as np\nimport os\nimport matplotlib.pyplot as plt\n\nimport keras\nfrom keras import backend as K\nfrom keras import initializers,regularizers,constraints\nfrom keras.models import Model\nfrom keras.engine.topology import Layer\nfrom keras.layers import Dense, Input, Embedding, GRU, Bidirectional, Tim...
[ [ "matplotlib.pyplot.switch_backend", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "numpy.expand_dims" ] ]
vishalbelsare/hddm
[ "bf10f05c956a590d93ec8f3b162ce60df668c18a" ]
[ "setup.py" ]
[ "from setuptools import setup\nfrom setuptools import Extension\n\ntry:\n from Cython.Build import cythonize\n ext_modules = cythonize([Extension('wfpt', ['src/wfpt.pyx'], language='c++'), # uncomment for OSX: , extra_compile_args=['-stdlib=libc++'], extra_link_args=['-stdlib=libc++', \"-mmacosx-version-min=1...
[ [ "numpy.get_include" ] ]
GiuseppeTT/HDRBP
[ "5b7a01a345311ed0fbd2b82e64b955a1ee0ae6e6" ]
[ "hdrbp/_step.py" ]
[ "from __future__ import annotations\n\nimport logging\nfrom dataclasses import dataclass\nfrom typing import Optional\n\nimport numpy as np\nimport pandas as pd\n\nfrom hdrbp.covariance import CovarianceEstimator\nfrom hdrbp.weight import WeightOptimizer\n\nlogger = logging.getLogger(__name__)\n\n\n@dataclass\nclas...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
AlvarBer/Persimmon
[ "da08ed854dd0305d7e4684e97ee828acffd76b4d" ]
[ "persimmon/view/blocks/knnblock.py" ]
[ "from persimmon.view.pins import OutputPin\nfrom persimmon.view.blocks.block import Block # MYPY HACK\n\nfrom kivy.properties import ObjectProperty\nfrom kivy.lang import Builder\n\nfrom sklearn.neighbors import KNeighborsClassifier\n\n\nBuilder.load_file('persimmon/view/blocks/knnblock.kv')\n\nclass KNNBlock(Bloc...
[ [ "sklearn.neighbors.KNeighborsClassifier" ] ]
earthinversion/Dynamic-Time-Warping-based-Hierarchical-Agglomerative-Clustering
[ "c8945abdb24f0fbf292ecca753ba7961d08b75b2" ]
[ "example_notebooks/dtwhaclustering/leastSquareModeling.py" ]
[ "\"\"\"\ndtwhaclustering.leastSquareModeling\n------------------------------------\nLeast square modeling of GPS displacements for seasonality, tidal, co-seismic jumps.\n\n:author: Utpal Kumar\n:date: 2021/06\n:copyright: Copyright 2021 Institute of Earth Sciences, Academia Sinica.\n\"\"\"\n\n\nimport pandas as pd\...
[ [ "numpy.array", "numpy.sin", "pandas.DatetimeIndex", "pandas.DataFrame", "matplotlib.pyplot.close", "numpy.mean", "matplotlib.rc", "matplotlib.pyplot.subplots", "numpy.where", "numpy.std", "matplotlib.pyplot.style.use", "numpy.cos", "pandas.read_csv", "scipy....
mjirik/seededitorqt
[ "d20a4e92ed7b462ea571c9d129aa31679d70f63d" ]
[ "tests/widget_test.py" ]
[ "#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\n# import logging\n# logger = logging.getLogger(__name__)\n# from __future__ import print_function\nfrom loguru import logger\nimport pytest\nimport os.path\n\npath_to_script = os.path.dirname(os.path.abspath(__file__))\n\n\n# import funkcí z jiného adresáře\nimport sy...
[ [ "numpy.random.rand" ] ]
tusharkh/PyGEM-Clone
[ "057d276871d398a3e5dcc8cd59226933a98b3be1" ]
[ "download_era5_data.py" ]
[ "\"\"\" Download ERA5 data from the command line \"\"\"\n# You must activate the ERA5_download environment in your command line first\n# Proceed to make sure you have created an account and saved your CDS API key in your home directory\n\n# Built-in libaries\nimport os\n# External libraries\nimport cdsapi\nimport n...
[ [ "numpy.arange" ] ]
ClareTT/Ticket-Checking-System
[ "8d63f4d8663388856b073c8b823b0dfed9489b37" ]
[ "pyfile/stationnamemap.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Oct 7 20:47:48 2018\n\n@author: Administrator\n\"\"\"\n\nimport re\nimport requests\nimport pandas as pd\n\n\nif __name__ == '__main__':\n \n url = 'https://kyfw.12306.cn/otn/resources/js/framework/station_name.js?station_version=1.9066'\n r = requests.get(...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
A-Jacobson/iEEG_Seizure_Prediction
[ "bdee7f4aab72674e01af7ec254b5d6ec7f65e620" ]
[ "predict.py" ]
[ "from sklearn.ensemble import AdaBoostClassifier\nimport cPickle\nfrom data_utils import load_data, preds_to_df, get_skipped\nimport pandas as pd\nimport numpy as np\n\n\nwith open('Ada_1.pkl', 'rb') as f:\n Ada_1 = cPickle.load(f)\nwith open('Ada_3.pkl', 'rb') as f:\n Ada_2 = cPickle.load(f)\nwith open('Ada_...
[ [ "pandas.concat" ] ]
ahesford/pycwp
[ "5fabc9c1f410bf49b674bfb4427fe1f05ad251ed" ]
[ "shell/segmentation.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (c) 2015 Andrew J. Hesford. All rights reserved.\n# Restrictions are listed in the LICENSE file distributed with this package.\n\nimport sys, os, numpy as np, getopt\nfrom pycwp import mio, segmentation, process\n\ndef usage(progname = 'segmentation.py'):\n\tbinfile = os.path.b...
[ [ "numpy.loadtxt" ] ]
SamScholten/stereo_vision
[ "a7e3eb1decc1868d97ffcee7352dce0c08e6bfbb" ]
[ "calibration_tools.py" ]
[ "\"\"\"\n===============================================================================\ncalibration_tools\n- Sam Scholten 2019/04/29\n-------------------------------------------------------------------------------\n\nModule with tools for calibrating a stereo vision system. The core of the\nmodule is kept in the ...
[ [ "numpy.concatenate", "numpy.around", "numpy.array" ] ]
HsunGong/Augmented-Advertisement
[ "ae9d0f5796c13e837a1a547d888647aeb61f0b04" ]
[ "semseg/scripts/eval_multipro.py" ]
[ "# System libs\nimport os\nimport argparse\nfrom distutils.version import LooseVersion\nfrom multiprocessing import Queue, Process\n# Numerical libs\nimport numpy as np\nimport math\nimport torch\nimport torch.nn as nn\nfrom scipy.io import loadmat\n# Our libs\nfrom config import cfg\nfrom dataset import ValDataset...
[ [ "torch.nn.NLLLoss", "numpy.concatenate", "torch.zeros", "torch.max", "torch.no_grad", "scipy.io.loadmat", "torch.cuda.set_device", "torch.utils.data.DataLoader" ] ]
arita37/GP-VAE
[ "cfc90858989425b5787c2063615f9b67f63cc229" ]
[ "train.py" ]
[ "\"\"\"\n\nScript to train the proposed GP-VAE model.\n\n\"\"\"\n\nimport sys\nimport os\nimport time\nfrom datetime import datetime\nimport numpy as np\nimport matplotlib\nmatplotlib.use(\"Agg\")\nfrom matplotlib import pyplot as plt\nimport tensorflow as tf\n\ntf.compat.v1.enable_eager_execution()\n\nfrom sklearn...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "numpy.load", "sklearn.metrics.average_precision_score", "tensorflow.compat.v1.set_random_seed", "tensorflow.compat.v1.data.make_one_shot_iterator", "numpy.nan_to_num", "tensorflow.GradientTape", "tensorflow.compat.v1.train.AdamOptimize...
IMS-Bio2Core-Facility/single_snake_sequencing
[ "dddf8fc8960da8938484f98a4ea94f74a4fd5b18" ]
[ "workflow/scripts/dim_reduc.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Dimensional reduction and batch correction using Harmony.\"\"\"\nif __name__ == \"__main__\":\n import anndata as ad\n import matplotlib.pyplot as plt\n import scanpy as sc\n import scanpy.external as sce\n from helpers.logs.get_logger import get_logger\n from helpe...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.close" ] ]
ekm507/think-python
[ "23aa36e66042fca0512320656513460089e230ec" ]
[ "dft.py" ]
[ "import numpy as np\nfrom numpy import pi\nn = 100\nN = 100\na = np.zeros(n)\nb = np.linspace(-10, 10, n)\n\nc = 4 * np.sin(b) + 5 * np.sin(2 * b)\n\nfor i in range(n):\n d = np.sin(b * 2 * pi * i)\n a[i] = np.sum(d)\n\n\nfor i in range(n):\n if(abs(a[i]) > 0.1):\n print(i, a[i])" ]
[ [ "numpy.sum", "numpy.linspace", "numpy.sin", "numpy.zeros" ] ]
t0kk35/d373c7
[ "7780b97545e581244fb4fb74347bb1b052b9ec3f" ]
[ "test/pytorch/history_tests.py" ]
[ "\"\"\"\nUnit Tests for PyTorch History Package\n(c) 2020 d373c7\n\"\"\"\nimport unittest\nimport torch\nimport torch.utils.data as data\n# noinspection PyProtectedMember\nfrom d373c7.pytorch.common import _History\n# inspection PyProtectedMember\nfrom math import ceil\n\nFILES_DIR = './files/'\n\n\nclass BaseHisto...
[ [ "torch.Tensor", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader" ] ]
prraoo/TrafficMonitoring
[ "d2bb4aca0f7250863e141c58081f96e726960631" ]
[ "WGAN/dataloader_traffic.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nfrom torchvision import datasets, transforms\n\n# Transforming images to with a common size\n\n#transform = transforms.Compose([transforms.Resize(255),\n# transforms.CenterCrop(224),\n# ...
[ [ "torch.utils.data.DataLoader" ] ]
denisov-vlad/socceraction
[ "0b03bc230bebb7e830d65aa231d961b879b828fb" ]
[ "socceraction/vaep/base.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Implements the VAEP framework.\n\nAttributes\n----------\nxfns_default : list(callable)\n The default VAEP features.\n\n\"\"\"\nimport math\nfrom typing import Any, Callable, Dict, List, Optional, Tuple\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.exceptions import Not...
[ [ "pandas.DataFrame", "numpy.random.permutation", "sklearn.metrics.brier_score_loss", "numpy.nonzero", "pandas.concat", "sklearn.exceptions.NotFittedError", "sklearn.metrics.roc_auc_score" ] ]
Bram94/lapjv
[ "98f76102255f81099383a14bc5ce6c2473d12427" ]
[ "lapjv/tests/test_lapmod.py" ]
[ "from pytest import mark, fixture, raises\n\nimport numpy as np\nfrom lapjv import lapjv, lapmod\n\nfrom .test_utils import (\n get_dense_8x8_int,\n get_dense_100x100_int, get_dense_100x100_int_hard, get_sparse_100x100_int,\n get_dense_1kx1k_int, get_dense_1kx1k_int_hard, get_sparse_1kx1k_int,\n get_spa...
[ [ "numpy.all", "numpy.array", "numpy.empty" ] ]
karthiks1701/lio
[ "f80487b73f248f5a3631b92a56f8db42d2c86d8a" ]
[ "lio/env/ssd_discrete_reward.py" ]
[ "\"\"\"Wrapper around Sequential Social Dilemma environment.\n\nThis is used for running baseline methods (e.g., policy gradient and LOLA)\nwhere the new discrete action space is {original actions} X {reward-giving action}.\n\"\"\"\nimport numpy as np\n\nfrom lio.env import ssd\n\n\nclass Env(ssd.Env):\n\n def _...
[ [ "numpy.array" ] ]
wuxiaobai24/DA-RNN
[ "de5ee8699024cb97d1f42ca120dc687b9c7bc2bb" ]
[ "main.py" ]
[ "import time\nfrom torch import mode\nfrom data import NasdaqDataset\nfrom model import DARNN\nimport torch\nfrom torch.utils.data import DataLoader\nimport numpy as np\nfrom tqdm import tqdm\nimport argparse\n\n\n\ndef MAE(pred, target):\n return (pred - target).abs().mean()\n\n\ndef MSE(pred, target):\n ret...
[ [ "torch.cuda.manual_seed", "torch.nn.MSELoss", "numpy.random.seed", "numpy.mean", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.pow" ] ]
matbocz/kurs-python-pwsz-elblag
[ "47a6f02691dfcffe8de346923099d13ffac4ffa4" ]
[ "PythonLab7/PythonLab7Zad1i2.py" ]
[ "from cv2 import cv2\nimport numpy as np\nimport time\n\n\ndef mouse_callback(event, x, y, flags, param):\n mouse_x = int(x / CELL_SIZE)\n mouse_y = int(y / CELL_SIZE)\n\n if event == cv2.EVENT_LBUTTONDOWN:\n CELL_FIELD[mouse_x][mouse_y] = LIVING_CELL\n if event == cv2.EVENT_RBUTTONDOWN:\n ...
[ [ "numpy.full", "numpy.array" ] ]
david-joy/bmi203-final
[ "9735a2e030f0a8294c58629b0bee03a7e54257b3" ]
[ "setup.py" ]
[ "from distutils.core import setup\nfrom Cython.Build import cythonize\nimport numpy as np\n\nsetup(\n name='BMI203-FinalProject',\n ext_modules=cythonize(\"final_project/_alignment.pyx\"),\n include_dirs=[np.get_include()],\n)\n" ]
[ [ "numpy.get_include" ] ]
XTmeng/Object_detection
[ "0441aee2b0e841eb2e44e60d6ba31146ec832f05" ]
[ "lib/nets/network.py" ]
[ "# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __fu...
[ [ "tensorflow.constant_initializer", "tensorflow.contrib.slim.max_pool2d", "tensorflow.reshape", "tensorflow.reverse", "tensorflow.to_float", "tensorflow.control_dependencies", "tensorflow.nn.softmax", "tensorflow.random_normal_initializer", "tensorflow.trainable_variables", ...
MarcoMeter/neroRL
[ "f16c100b9029818e4322f7c1c88dbcc5bbade34b" ]
[ "eval_checkpoints.py" ]
[ "\"\"\"\nThis eval script evaluates all available models inside one directory.\n\nThe shape of the ouput data is as follow:\n(Checkpoint, Seed, Worker)\n\nEach data point is a dictionary given the episode information:\n - reward\n - length\n - seed\n\nDepending on the environment, more information might be...
[ [ "torch.cuda.is_available", "numpy.asarray" ] ]
NoListen/RL-forest
[ "6c43d43cc223a8be02256a60c38d72839b9d3fca" ]
[ "RL_forest/ddpg_plant/multi_ddpg/memory.py" ]
[ "# https://github.com/openai/baselines/baselines/ddpg/memory.py\n\n# I want to use the memory used in mxdqn.\n\nimport numpy as np\n\n# TODO use the same storage space for both the obs0 and obs1. USE HALF Memory.\n# TODO use a dict to save all observation. (Key to key storation)\n\"\"\" I DON'T NEED TO CHANGE THE A...
[ [ "numpy.array", "numpy.random.random_integers", "numpy.zeros" ] ]
Diwakar98/COL380-A2-Crout-Decomposition-Using-OpenMP-And-MPI
[ "11717f64e041a95f82293f230257298b3a37e7c5" ]
[ "checker.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\nimport sys\nimport numpy as np\n\nwith open(sys.argv[1], \"r\") as f:\n\tA = f.read()\n\nwith open(sys.argv[2], \"r\") as f:\n\tL = f.read()\n\nwith open(sys.argv[3], \"r\") as f:\n\tU = f.read()\n\n\ndef convert2numpy(mat):\n\tmat = mat.strip().split(\"\\n\")\n\tmat = [i.st...
[ [ "numpy.array", "numpy.matmul", "numpy.linalg.det", "numpy.triu", "numpy.allclose", "numpy.tril" ] ]
KetanRamesh/Reddit-Text-Analyser
[ "d1cea14b64b6679ec658eddadcbb6955ace731d7" ]
[ "app/keywords/worker_keywords.py" ]
[ "#! usr/bin/env python3\n\nimport os\nimport json\nimport jsonpickle\nimport pandas as pd\n\nfrom gensim.summarization import keywords\n\nimport pika, redis\n\n## RabbitMQ and Redis connection\nrabbitMQHost = os.getenv(\"RABBITMQ_HOST\") or \"localhost\"\nredisHost = os.getenv(\"REDIS_HOST\") or \"localhost\"\n\npr...
[ [ "pandas.DataFrame" ] ]
ameen-khosrowzadeh/MIAProject
[ "9f52d3c01def3f7c6d7ea8fd091d740fcfa8610f" ]
[ "bin/oob.py" ]
[ "\"\"\"A medical image analysis pipeline.\n\nThe pipeline is used for brain tissue segmentation using a decision forest classifier.\n\"\"\"\n\nimport argparse\nimport datetime\nimport os\nimport sys\nimport timeit\nimport warnings\n\nimport SimpleITK as sitk\nimport sklearn.ensemble as sk_ensemble\nfrom sklearn.met...
[ [ "numpy.concatenate", "matplotlib.pyplot.show", "numpy.shape", "sklearn.ensemble.RandomForestClassifier" ] ]
fhalab/SPGen
[ "c16afe0c13501bc1aa2c8cccb10865ae9934aff8" ]
[ "remote_generation/attention-is-all-you-need-pytorch/transformer/SubLayers.py" ]
[ "''' Define the sublayers in encoder/decoder layer '''\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.init as init\r\nfrom transformer.Modules import BottleLinear as Linear\r\nfrom transformer.Modules import ScaledDotProductAttention\r\n#from transformer.Modules import BottleLayerNormalization as L...
[ [ "torch.nn.Dropout", "torch.nn.Conv1d", "torch.nn.init.xavier_normal", "torch.FloatTensor", "torch.split", "torch.bmm", "torch.nn.ReLU" ] ]
ddanielalves/AlphaZero-Checkers
[ "bec24d3bc2011db9159af7355105d6698a30c12c" ]
[ "PV_NN.py" ]
[ "import os.path\n\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.layers import Dense, BatchNormalization, Conv2D, Activation, Dropout, Input, Flatten, Concatenate\nfrom tensorflow.keras.optimizers import Adam\nimport numpy as np\n\nimport config\n\nclass P...
[ [ "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Dropout", "tensorflow.keras.Model", "tensorflow.keras.models.load_model", "tenso...
SausanCantik/descriptive-stats-phenotype-data
[ "04aab439530013b78cdf8f850d2f1c06fa73cbd7" ]
[ "03. Null data treatment/column_expansion.py" ]
[ "'''\r\nA function to add accession_group as a column in phenotype data and\r\nencode the entries\r\n'''\r\n\r\ndef column_expansion (dataframe): \r\n accession_group = string_split(dataframe)\r\n \r\n #encode the entries\r\n from sklearn import preprocessing #input encoder library\r\n \r\n ...
[ [ "sklearn.preprocessing.LabelEncoder" ] ]
hammer-mt/hommmer
[ "a02cb87841395f30911242a019f28f6ac15f27ec" ]
[ "src/hommmer/metrics/rsquared.py" ]
[ "from sklearn import metrics\n\ndef rsquared(y_actual, y_pred):\n # r squared\n value = round(metrics.r2_score(y_actual, y_pred), 3)\n passed = \"✔️\" if value > 0.8 else \"❌\"\n return value, passed" ]
[ [ "sklearn.metrics.r2_score" ] ]
jychoi-hpc/fluctana
[ "a8950c347d422e471a43034e05214e3fec58d428" ]
[ "stats.py" ]
[ "import numpy as np\nfrom scipy import signal\nimport math\nimport itertools\n\nimport pickle \n\nimport matplotlib.pyplot as plt\n\n\ndef skewness(t, x, detrend=1):\n # normalize\n x = x / x[0]\n \n if detrend == 1:\n x = signal.detrend(x, type='linear')\n\n nx = (x - np.mean(x)) / np.std...
[ [ "numpy.tile", "numpy.min", "numpy.mean", "numpy.cumsum", "numpy.gradient", "numpy.concatenate", "numpy.max", "numpy.empty", "numpy.log", "numpy.arange", "numpy.polyfit", "numpy.sqrt", "numpy.poly1d", "numpy.log10", "matplotlib.pyplot.subplots_adjust", ...
Natenumber12/LUDO_QLearning
[ "0878b9bce01d0afc5798bdbf96db253302654f33" ]
[ "LUDOpy-QLearn/test/Mytest.py" ]
[ "import unittest\nimport sys\nimport torch\nfrom torch import autograd, nn, optim\nimport torch.nn.functional as F\n\nsys.path.append(\"../\")\n\nbatch_size = 5\ninput_size = 3\nhidden_size = 4\nnum_classes = 4\nlearning_rate = 0.001\n\ntorch.manual_seed(123)\ninput = autograd.Variable(torch.rand(batch_size, input_...
[ [ "torch.nn.Linear", "torch.rand", "torch.tanh", "torch.manual_seed", "torch.nn.functional.softmax", "torch.nn.functional.nll_loss" ] ]
akakakakakaa/pytorchic-bert
[ "055d72adce9a41c322d23145840f31a94d9ffec4" ]
[ "tifu_prep.py" ]
[ "import fire\nimport tensorflow as tf\nfrom tensor2tensor.data_generators import text_encoder\nimport json\nimport spacy\nfrom spacy.pipeline import Tagger\nimport csv\nimport operator\nimport pickle\nimport re\n\ndef tifu_prep(tifu_path, output_csv_path):\n nlp = spacy.load('en')\n\n\n datasets = []\n wor...
[ [ "tensorflow.gfile.Open" ] ]
hitSongXiao/ripple2vec
[ "90d1887eb1ba693abad93479d558336e69179ec3" ]
[ "src/algorithms.py" ]
[ "# -*- coding: utf-8 -*-\nfrom time import time\nfrom collections import deque\nimport numpy as np\nimport math,random,logging\nfrom concurrent.futures import ProcessPoolExecutor, as_completed\nimport multiprocessing as mp\nfrom collections import defaultdict\n\nfrom utils import *\n\n\ndef generate_parameters_rand...
[ [ "numpy.random.rand" ] ]
rmcaixeta/variography_with_local_directions
[ "4c850440e09953b2bfb1a990ba87e0eee1051aad" ]
[ "03_model_vario.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\nimport PySimpleGUI as sg\r\nimport os\r\nimport lva_vario_funcs as lva\r\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\r\nimport matplotlib\r\nmatplotlib.use('TkAgg')\r\n\r\nsg.theme('DarkGrey3')\r\nsg.SetOptions( button_color=('black','#ff7636') )\r\ndmdir = 'C:'\...
[ [ "matplotlib.use", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ] ]
dongdongdong1217/Detectron2-FC
[ "92356ebbf52b4e39c94537af26abcf46419c8c2f" ]
[ "demo/demo.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport argparse\nimport glob\nimport multiprocessing as mp\nimport numpy as np\nimport os\nimport tempfile\nimport time\nimport warnings\nimport cv2\nimport tqdm\n\nfrom detectron2.config import get_cfg\nfrom detectron2.data.detection_utils import read_image\nfro...
[ [ "numpy.zeros" ] ]
sfu-arch/TensorBricks
[ "c46c60d0939b7deb65f103bf34961d47419ce571" ]
[ "TB-scheduler/deprecated/print_attr_dicts_from_constraints.py" ]
[ "import pandas as pd\nfrom load_model import Net\nimport datetime\nimport argparse\nimport os\n\n# def select_schedule(_net, _model_name, _result_dir, _verbose, val, _hardware_dict):\n# if val == 0:\n# schedule = HWCFSchedule(_net, _model_name, _result_dir, _verbose, hardware_dict=_hardware_dict)\n# ...
[ [ "pandas.read_csv" ] ]
YiqinXiong/HUST-MachineLearning-Lab
[ "1e920e59b58a721f263e0a87a7f98ff2dda3f7c4" ]
[ "3-final/voice_gender/main.py" ]
[ "# -*- coding: utf-8 -*-\n# Author: 熊逸钦\n# Time: 2020/7/25 17:04\n\n\nimport math\n\nimport pandas as pd\nfrom scipy.stats import norm\n\n\n# 拆分训练集和测试集(7:3)\ndef from_csv_to_data_frame(csv_file):\n df = pd.read_csv(csv_file)\n # 分男女,对每一列求非空值的平均\n df_male = df[df['label'] == 'male'].iloc[:, 0:20]\n df_fe...
[ [ "pandas.read_csv", "scipy.stats.norm.cdf" ] ]
peteroconnor-bc/artemis
[ "ad2871fae7d986bf10580eec27aee5b7315adad5" ]
[ "artemis/general/pareto_efficiency.py" ]
[ "from artemis.general.should_be_builtins import all_equal\n\n__author__ = 'peter'\nimport numpy as np\n\n\n# Very slow for many datapoints. Fastest for many costs, most readable\ndef is_pareto_efficient_dumb(costs):\n \"\"\"\n Find the pareto-efficient points\n :param costs: An (n_points, n_costs) array\n...
[ [ "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.unravel_index", "numpy.any", "numpy.arange" ] ]
KangMingHsi/DeepRL_cs294-112
[ "60f9fbb65eaaf444f67acb359aca04097864241f" ]
[ "hw2/train_pg_f18.py" ]
[ "\"\"\"\nOriginal code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017\nAdapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam\nAdapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany\n\"\"\"\nimport numpy as np\nimport tensorflow as tf\nimport gym\nimport logz\nimpo...
[ [ "tensorflow.exp", "tensorflow.multinomial", "numpy.min", "numpy.mean", "numpy.multiply", "tensorflow.global_variables_initializer", "tensorflow.set_random_seed", "numpy.concatenate", "numpy.max", "tensorflow.shape", "tensorflow.ConfigProto", "tensorflow.variable_sco...
JanMatas/baselines
[ "410f51503c2ecb02ac14b723fa5548fd5a41730d" ]
[ "baselines/asym_ddpg/main.py" ]
[ "import argparse\nimport time\nfrom baselines import logger, bench\nfrom baselines.common.misc_util import (\n set_global_seeds,\n boolean_flag,\n)\nimport baselines.asym_ddpg.distributed_train as training\nfrom baselines.asym_ddpg.models import Actor, Critic\nfrom baselines.asym_ddpg.prioritized_memory impor...
[ [ "tensorflow.reset_default_graph" ] ]
charlesccychen/tfx0
[ "6d3e777e15fd7ffe14cc803069db62dfd1fe0008" ]
[ "tfx/components/example_gen/utils_test.py" ]
[ "# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.test.main" ] ]
Mailaender/spectrochempy
[ "d58221afeb9f78e2e3e0079b3fd6c0162a902c04" ]
[ "spectrochempy/application.py" ]
[ "# -*- coding: utf-8 -*-\n\n# ======================================================================================================================\n# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France.\n# =\n# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See full LICENSE agreement ...
[ [ "matplotlib.rcParams.keys", "matplotlib.pyplot.style.use" ] ]
atroyn/pytorch3d
[ "f03aa5803bcdba3b9447a8c2ffdc77e693d51c87" ]
[ "tests/test_blending.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport unittest\n\nimport torch\nfrom common_testing import TestCaseMixin\nfrom pytorch3d.renderer.blending import (\n BlendParams,\n hard_rgb_blend,\n sigmoid_alpha_blend,\n softmax_rgb_blend,\n)\nfrom pytorch3d.renderer.mesh.r...
[ [ "torch.zeros", "torch.sigmoid", "torch.device", "torch.prod", "torch.rand", "torch.cuda.synchronize", "torch.is_tensor", "torch.ones", "torch.manual_seed", "torch.cuda.set_device", "torch.randn_like", "torch.randint", "torch.tensor", "torch.full", "torch...
timoi-Lucypher/npCrypto
[ "10156482d70503fa01880421aba4a4a3d171bd98" ]
[ "benchmark.py" ]
[ "import time\nimport numpy as np\nfrom Crypto.Cipher import AES as pyAES\n\nfrom aes import AES\n\ndef benchmark_encryption(N):\n key = np.array([\n [0x2b, 0x7e, 0x15, 0x16],\n [0x28, 0xae, 0xd2, 0xa6],\n [0xab, 0xf7, 0x15, 0x88],\n [0x09, 0xcf, 0x4f, 0x3c]\n ], dtype=np.uint8)\n ...
[ [ "numpy.array", "numpy.random.randint" ] ]
FlankMe/numpy-neural-net
[ "28de2324377e389fcdcb701979ff0387b9334e75" ]
[ "_optimiser.py" ]
[ "import numpy as np\r\nimport _supportingFunctions as sfs\r\n\r\n\"\"\"\r\nMain optimisation step\r\n\"\"\"\r\ndef optimisationStep(net, perturbation, method='SGD', \r\n LEARNINGRATE=3e-4, L2PENALTY=1e-4, DROPOUT=False): \r\n\r\n activation = net.prediction.pop()\r\n \r\n for layer in rever...
[ [ "numpy.zeros", "numpy.sqrt" ] ]
gpzlx1/dgl
[ "f0fafa2062ccb23bfb996e84aa4758a435db9b1f" ]
[ "tests/distributed/test_dist_graph_store.py" ]
[ "import os\nos.environ['OMP_NUM_THREADS'] = '1'\nimport dgl\nimport sys\nimport numpy as np\nimport time\nimport socket\nfrom scipy import sparse as spsp\nfrom numpy.testing import assert_array_equal\nfrom multiprocessing import Process, Manager, Condition, Value\nimport multiprocessing as mp\nfrom dgl.heterograph_...
[ [ "numpy.random.normal", "scipy.sparse.random", "numpy.sort", "numpy.nonzero" ] ]
hmorimitsu/flow-transforms-pytorch
[ "f01ed22b6f7eab7ee5fd00a3b37a16c424eecc94" ]
[ "tests/test_additive_color.py" ]
[ "import numpy as np\nimport pytest\nimport torch\n\nfrom tests.base import (\n images_list, flows_list, NUM_IMAGES, IMAGE_HEIGHT, IMAGE_WIDTH)\nfrom flow_transforms import ToTensor, RandomAdditiveColor\n\n\n@pytest.fixture\ndef get_tensor_data(images_list, flows_list):\n tt = ToTensor()\n images, flows = t...
[ [ "torch.allclose" ] ]
richardgoater/metaspace
[ "5db6b2fd0170b8d90aabe04b887a2a7c6adefdc4" ]
[ "metaspace/engine/sm/engine/annotation_spark/formula_imager.py" ]
[ "import logging\nimport pickle\nfrom pathlib import Path\nfrom typing import List, Dict, Set\n\nimport numpy as np\nimport pandas as pd\nfrom pyspark.files import SparkFiles\nfrom scipy.sparse import coo_matrix\n\nfrom sm.engine.isocalc_wrapper import IsocalcWrapper\nfrom sm.engine.annotation.formula_validator impo...
[ [ "scipy.sparse.coo_matrix", "numpy.array", "numpy.zeros", "numpy.searchsorted", "pandas.concat", "pandas.DataFrame", "numpy.amax", "numpy.amin", "numpy.around" ] ]
matthiasdiener/loopy
[ "a1e46b6205902f19d541d8abf9f5382ecab9c8ad" ]
[ "test/test_target.py" ]
[ "from __future__ import division, absolute_import, print_function\n\n__copyright__ = \"Copyright (C) 2012 Andreas Kloeckner\"\n\n__license__ = \"\"\"\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...
[ [ "numpy.float32", "numpy.arange", "numpy.dtype" ] ]
jesseddeng/Machine-learning-Final-Project
[ "87284d51e1a968035feae33a1f9f44754a144a00" ]
[ "app/__init__.py" ]
[ "from flask import Flask\nfrom sklearn.externals import joblib\n\n\napp = Flask(__name__)\napp.config.from_object(\"app.config\")\n\n\nestimator = joblib.load('predicted.pkl')\n\n\n\n\n\n\nfrom .views import *\n\n\n# Handle Bad Requests\n@app.errorhandler(404)\ndef page_not_found(e):\n \"\"\"Page Not Found\"\"\"...
[ [ "sklearn.externals.joblib.load" ] ]
basemprince/court_detection
[ "e5fb9549234b0f3c8fd350ea9abc1c7daa1c2306" ]
[ "train.py" ]
[ "#!/usr/bin/env python3\r\n\"\"\"Train L-CNN\r\nUsage:\r\n train.py [options] <yaml-config>\r\n train.py (-h | --help )\r\n\r\nArguments:\r\n <yaml-config> Path to the yaml hyper-parameter file\r\n\r\nOptions:\r\n -h --help Show this screen.\r\n -d --devices <devi...
[ [ "torch.device", "torch.cuda.manual_seed", "numpy.random.seed", "scipy.io.loadmat", "scipy.io.savemat", "torch.manual_seed", "torch.cuda.device_count", "torch.from_numpy", "torch.cuda.is_available" ] ]
qyu6/TAILab
[ "6c3e7a7e2e49f7c673ab46b90c1568a96cce75b7" ]
[ "ML_LinearRegression.py" ]
[ "'''\n@func:linear regression\n@create:2021.10.24\n'''\n\nfrom textwrap import wrap\n\n\ndef linearregx():\n import streamlit as st\n # 线性回归器。为了实现线性输出与实际输出的残差平方和最小(sum of squares of differences),普通最小二乘法 - (OLS:Oridinary Least Squares)\n import sys\n import numpy as np\n\n X = [1,2,3,4,6,7,8,9,11,13,1...
[ [ "numpy.array", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "sklearn.metrics.explained_variance_score", "sklearn.metrics.median_absolute_error", "sklearn.metrics.mean_absolute_error", "sk...
juriwiens/mlflow-example
[ "ccf517d70ec96a3661d586e55bde4915e3329087" ]
[ "train.py" ]
[ "\"\"\"\nKeras model training example, copied from:\nhttps://keras.io/examples/structured_data/structured_data_classification_from_scratch/\nhttps://github.com/keras-team/keras-io/blob/master/examples/structured_data/structured_data_classification_from_scratch.py\n\nOriginal code is under Apache-2.0 License (see LI...
[ [ "tensorflow.keras.layers.Normalization", "tensorflow.keras.Input", "tensorflow.expand_dims", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.Model", "pandas.read_csv", "tensorflow.keras.layers.concatenate" ] ]
Ryogo-san/ivr
[ "0b312df6ec6bde77cae5ce4e957e5f1cd880463c" ]
[ "src/attack/fgsm.py" ]
[ "import torch\nimport torch.nn as nn\n\nimport attack\nfrom attack import Attack\n\n\nclass FGSM(Attack):\n def __init__(self, model, device, cfg, eps=0.007):\n super().__init__(model)\n self.cfg = cfg\n self.eps = self.cfg.pert_eps\n self.device = device\n\n def forward(self, imag...
[ [ "torch.autograd.grad", "torch.nn.CrossEntropyLoss", "torch.clamp" ] ]
c-minz/Python-causets
[ "c19fad74abc9d5ac8a060b3bc9455ce4ae30f735" ]
[ "sprinkledcauset.py" ]
[ "#!/usr/bin/env python\r\n'''\r\nCreated on 22 Jul 2020\r\n\r\n@author: Christoph Minz\r\n@license: BSD 3-Clause\r\n'''\r\nfrom __future__ import annotations\r\nfrom typing import Set, List, Iterable, Union\r\nimport numpy as np\r\nimport math\r\nfrom numpy.random import default_rng\r\nfrom causets.causetevent impo...
[ [ "numpy.square", "numpy.empty", "numpy.random.default_rng" ] ]