repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Eric3911/miniDetection | [
"6fb6e1bce3ab6e4adb832b37e78325803c7424b6"
] | [
"slim/export_inference_graph.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required... | [
[
"tensorflow.Graph",
"tensorflow.python.platform.gfile.GFile",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.placeholder",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.logging.set_verbosity",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.app.run"
]
] |
Mueldavc/Python-Projs | [
"3ac9e5ca20e98e8af1adf9dd711848e276ad530d"
] | [
"Modelo/Test_2.py"
] | [
"from Data_treatment.DT_1 import StockData\n\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error\nfrom keras.models import Sequential\nfrom deap import base, creator, tools, algorithms\nfrom scipy.stats import bernoulli\nfrom bitstring import BitArray\nfrom datetime import datetime\nfrom keras.utils... | [
[
"numpy.argmax",
"numpy.random.seed",
"sklearn.metrics.mean_squared_error"
]
] |
kene111/ivy | [
"17be67499d02594a94f05016539cf89b294acbb7"
] | [
"ivy/functional/backends/numpy/array_api/linear_algebra_extension.py"
] | [
"# global\nimport numpy as np\nfrom typing import Union, Optional, Tuple, Literal\n\n# local\nfrom ivy import inf\n\n\ndef vector_norm(x: np.ndarray, \n p: Union[int, float, Literal[inf, - inf]] = 2, \n axis: Optional[Union[int, Tuple[int]]] = None, \n keepdims: bool = ... | [
[
"numpy.expand_dims",
"numpy.linalg.norm"
]
] |
rpatil524/mlrun | [
"bb2259a959f871d7a479834ddc55ad1470e6c2c0"
] | [
"tests/feature-store/test_infer.py"
] | [
"import pandas as pd\n\nimport mlrun.feature_store as fs\nfrom mlrun.data_types import InferOptions\nfrom mlrun.feature_store.api import infer_from_static_df\nfrom tests.conftest import tests_root_directory\n\nthis_dir = f\"{tests_root_directory}/feature-store/\"\n\nexpected_schema = [\n {\"name\": \"bad\", \"va... | [
[
"pandas.read_csv"
]
] |
Molin-L/RLRC | [
"b2f0593d997696e1d1acd33edf0f3c44bbf8dd10"
] | [
"format_data.py"
] | [
"# !/usr/bin/env python\n# --------------------------------------------------------------\n# File: format_data.py\n# Project: RLRC\n# Created: Sunday, 5th July 2020 9:31:26 am\n# @Author: Molin Liu, MSc in Data Science, University of Glasgow\n# Contact: molin@live.cn\n# Last Modifie... | [
[
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"pandas.DataFrame.from_dict"
]
] |
smh-hosseiny/ConvTract | [
"dc42978a9db99480feacd18b7ba21c7e7cbac829"
] | [
"utils/Network.py"
] | [
"import tensorflow as tf\r\nfrom tensorflow import keras\r\nfrom tensorflow.keras import layers\r\nfrom keras.layers import Dropout\r\n\r\n\r\ndef residual_block(y, nb_channels, _strides=(1, 1, 1), _kernel_size=(1, 1, 1), _project_shortcut=True):\r\n shortcut = y\r\n\r\n y = layers.Conv3D(nb_channels, kernel_... | [
[
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.Input",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Conv3D",
... |
eayumba/CS221Project | [
"9aca2e4a0051296ba95cefac7cc611b61effbbff"
] | [
"predict.py"
] | [
"from tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import LSTM, Activation, Dropout, Dense, Lambda\nfrom tensorflow.keras.layers import BatchNormalization as BatchNorm\nfrom tensorflow.keras.callbacks import ModelCheckpoint\nfrom tensorflow.keras.utils import to_categorical\nfrom Data_Par... | [
[
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.models.Sequential"
]
] |
banditbandito/TopographicVAE | [
"690d845123da633eb2a997e1df76766446e50307"
] | [
"tvae/experiments/bubbles_dsprites.py"
] | [
"import os\nimport torch\nfrom torch import optim\nfrom torch.optim.lr_scheduler import StepLR\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom tvae.data.dsprites import get_dataloader\nfrom tvae.containers.tvae import TVAE\nfrom tvae.models.mlp import MLP_Encoder, MLP_Decoder\nfrom tvae.containe... | [
[
"torch.nn.ConvTranspose3d",
"torch.nn.functional.pad",
"torch.optim.lr_scheduler.StepLR"
]
] |
hokmund/mmdetection | [
"7d49b7b535456929333d71a543159a00d7ae2faf"
] | [
"mmdet/models/detectors/two_stage.py"
] | [
"import torch\n\nfrom ..builder import DETECTORS, build_backbone, build_head, build_neck\nfrom .base import BaseDetector\n\n\n@DETECTORS.register_module()\nclass TwoStageDetector(BaseDetector):\n \"\"\"Base class for two-stage detectors.\n\n Two-stage detectors typically consisting of a region proposal networ... | [
[
"torch.randn",
"torch.onnx.is_in_onnx_export",
"torch._shape_as_tensor"
]
] |
EricGustin/SmartRedis | [
"42c42fb4312c0822a58e3c869f60b7e51d4bdd05"
] | [
"tests/python/test_errors.py"
] | [
"import os\n\nimport numpy as np\nimport pytest\nfrom smartredis import Client, Dataset\nfrom smartredis.error import RedisConnectionError, RedisReplyError\n\n\ndef test_SSDB_not_set(use_cluster):\n ssdb = os.environ[\"SSDB\"]\n del os.environ[\"SSDB\"]\n with pytest.raises(RedisConnectionError):\n ... | [
[
"numpy.array"
]
] |
jngaravitoc/nba | [
"d2a64a69fd743e066fe3e0bad9c9bc109763ff97"
] | [
"nba/orbits/nbody_orbit_extractor.py"
] | [
"\"\"\"\nScript to extract a particle orbit from a N-body halo simulation\n\n\"\"\"\n\nimport numpy as np\n#import pygadgetreader \nimport sys\nfrom gadget_reader import read_snap \n\n\n# This function is not used in this script, but it is helpful to build the particle ids file. \n\ndef get_particle_id(pos, vel, id... | [
[
"numpy.ascontiguousarray",
"numpy.zeros",
"numpy.array",
"numpy.where",
"numpy.sum",
"numpy.loadtxt"
]
] |
jorgenwh/npstructures | [
"0eab421f1ddde159b2450e3e8b3cadbdaad00ba9"
] | [
"profiling/hashtable.py"
] | [
"from npstructures.hashtable import HashTable, IHashTable, Counter\nimport timeit\nimport cProfile\nimport pstats\nimport numpy as np\nnp.random.seed(10000)\ndef get_random_data(n_keys, key_space, n_samples):\n keys = np.cumsum(np.random.randint(1, key_space, n_keys))\n samples = np.random.choice(keys, size=n... | [
[
"numpy.arange",
"numpy.random.randint",
"numpy.random.seed",
"numpy.random.choice"
]
] |
awen1988/yry | [
"b65ccd7062d60f605fc978a87e060d0015cf1d4c"
] | [
"core/triangulation.py"
] | [
"import cv2\nimport numpy as np\n\n\ndef draw_point(img, p, color):\n cv2.circle(img, (p[0], p[1]), 2, color, cv2.FILLED, cv2.LINE_AA, 0)\n\n\ndef rect_contains(rect, point):\n if point[0] < rect[0]:\n return False\n elif point[1] < rect[1]:\n return False\n elif point[0] > rect[2]:\n ... | [
[
"numpy.int32",
"numpy.zeros",
"numpy.float32"
]
] |
tkc-morita/secl | [
"d0156cea4fd95ea5071126dbf076a6da69752a37"
] | [
"modules/sparsemax.py"
] | [
"\"\"\"Sparsemax activation function.\n\nPytorch implementation of Sparsemax function from:\n-- \"From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification\"\n-- André F. T. Martins, Ramón Fernandez Astudillo (http://arxiv.org/abs/1602.02068)\n\nModified implementation by Kris Korrel.\nh... | [
[
"torch.max",
"torch.zeros_like",
"torch.sum",
"torch.sort",
"torch.arange",
"torch.gt",
"torch.cumsum",
"torch.ne"
]
] |
J-Massey/lotus_docs | [
"a855b7d5e44872dc2969b69a76bb8d1b57aaf2a0"
] | [
"Examples/sphere/postproc/stat.py"
] | [
"#!/usr/bin/env python3\n# ----------------------------------------- #\n# stat.py\n# ----------------------------------------- #\n#\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_pdf import PdfPages\n#\n# read data and drop unwanted rows and columns\ntry:... | [
[
"matplotlib.backends.backend_pdf.PdfPages",
"pandas.read_csv",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.text",
"matplotlib.pyplot.ylabel"
]
] |
Efekurdoglu/T-Rex-Runner-via-OpenCV-and-CNN | [
"b9ed78043632fb3f64677c96644ba2772db6a6b7"
] | [
"func.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Dec 14 01:09:46 2021\r\n\r\n@author: Efe Kurdoğlu\r\n\"\"\"\r\n\r\nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder\r\nfrom PIL import Image\r\nfrom mss import mss\r\n\r\ndef onehot_labels(values):\r\n label_encoder = LabelEncoder()\r\n integer... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.OneHotEncoder"
]
] |
juntang-zhuang/pytorch-image-models | [
"fb896c0b264d5a48dea62e5001405574170e4cbb"
] | [
"timm/models/pit.py"
] | [
"\"\"\" Pooling-based Vision Transformer (PiT) in PyTorch\n\nA PyTorch implement of Pooling-based Vision Transformers as described in\n'Rethinking Spatial Dimensions of Vision Transformers' - https://arxiv.org/abs/2103.16302\n\nThis code was adapted from the original version at https://github.com/naver-ai/pit, orig... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.nn.init.constant_",
"torch.randn",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.jit.is_scripting"
]
] |
lumstery/maskrcnn | [
"dd5008fcfdbaf46a61167214759b90dce0a3efd6"
] | [
"model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implemenetation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport glob\nimport random\nimport math\nimport datetime\nimport itertools\nimport json\nimpor... | [
[
"numpy.amax",
"numpy.expand_dims",
"tensorflow.concat",
"numpy.minimum",
"tensorflow.control_dependencies",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.minimum",
"tensorflow.cast",
"tensorflow.image.non_max_suppression",
"tensorflow.equal",
"tensorflow.... |
jamebs/ki67 | [
"2de6d6ce08cd0a90a5f0c6f50dc9ca058a6fa3d1"
] | [
"ki67/modules/markers/markers_preview.py"
] | [
"from dataclasses import dataclass\nfrom typing import Optional\n\nimport numpy as np\nfrom skimage import draw\nfrom magda.module import Module\nfrom magda.decorators import finalize, accept, produce, register\n\nfrom ki67.interfaces.slide import Slide\nfrom ki67.interfaces.markers import Markers\nfrom ki67.interf... | [
[
"numpy.max"
]
] |
fengjixuchui/EmbeddedSystem | [
"972a8378760c40ab513523bd05abffe58e367039"
] | [
"MachineLearning/project/07_minist/script_reference/resize_image_and_to_array.py"
] | [
"import sys\nfrom PIL import Image, ImageOps\nimport numpy as np\n\nnp.set_printoptions(threshold=np.inf)\n\ndef resize_image(image, _width=32, _height=32):\n new_image = Image.open(image)\n new_image = ImageOps.fit(new_image , (_width, _height), Image.ANTIALIAS)\n new_image_rgb = new_image.convert('RGB')\... | [
[
"numpy.asarray",
"numpy.set_printoptions"
]
] |
devilishBurrito/AppsFlyer-GDPR-Deletion-Script | [
"fb8c7e546ac0e878f253b0390d30f0303b577242"
] | [
"GDPR_delete (v1.0).py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport requests\nimport json\nimport pandas as pd\nfrom tqdm import tqdm\nfrom datetime import *\nimport uuid\nimport warnings\nfrom math import isnan\nimport time\n\n\n## throttling based on AF's 80 request per 2 minute rule\ndef throttle(tm):\n i = 0\n while i ... | [
[
"pandas.read_csv"
]
] |
markolalovic/metric-graph-reconstruction | [
"c250f910feb6cd87658aa210fa002de7141f5a38"
] | [
"src/metric_graph_reconstruction.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\"\"\" metric_graph_reconstruction.py: Implementation of algorithm for\nreconstructing the topology of a metric graph that represents intersecting\nor branching filamentary paths embedded in d-dimensional space.\n\nTODO: metric should be more implicit so it's easy to sw... | [
[
"numpy.dot",
"numpy.linspace",
"matplotlib.pyplot.axes",
"numpy.round",
"numpy.mean",
"numpy.unique",
"numpy.sin",
"numpy.size",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.min",
"matplotlib.patches.Circle",
"numpy.array",
"matplotlib.pyplo... |
mircean/torchvision | [
"148bac23afa21ae4df67aeb07a6f0c3bd3b15276"
] | [
"test/test_models.py"
] | [
"from common_utils import TestCase, map_nested_tensor_object, freeze_rng_state\nfrom collections import OrderedDict\nfrom itertools import product\nimport torch\nimport torch.nn as nn\nimport numpy as np\nfrom torchvision import models\nimport unittest\nimport traceback\nimport random\n\n\ndef set_rng_seed(seed):\n... | [
[
"torch.jit.script",
"torch.nn.Sequential",
"torch.mean",
"numpy.random.seed",
"torch.manual_seed",
"torch.tensor",
"torch.std",
"torch.rand",
"torch.cuda.is_available",
"torch.nn.GroupNorm"
]
] |
gagolews/clustering_results_v1 | [
"f3007018a195124433a4bbb5b15259cf8e838334"
] | [
"do_benchmark_sklearn.py"
] | [
"\"\"\"\nCopyright (C) 2020, Marek Gagolewski, https://www.gagolewski.com\n\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\n... | [
[
"numpy.unique"
]
] |
Aclau99/api-offres-emploi | [
"abeaf74b22431613fc5fa4b280ad4de4a331b447"
] | [
"utils.py"
] | [
"import datetime\nimport pandas as pd\n\ndef dt_to_str_iso(dt):\n \"\"\"\n Convert a datetime.datetime object to a string respecting the ISO-8601 format \n Will raise ValueError if type not appropriate\n :param dt: The datetime object to convert\n :type dt: datetime.datetime \n \n :returns: ISO... | [
[
"pandas.DataFrame"
]
] |
syncrosim/pysyncrosim | [
"20c0005674b7dbcef19c233dfa7db95e0d9d451e"
] | [
"tests/test_pysyncrosim.py"
] | [
"import pysyncrosim as ps\nimport pytest\nimport pandas as pd\nimport math\nimport numpy as np\nimport os\nimport rasterio\n# import re\n\ndef test_session_attributes():\n \n mySession = ps.Session()\n \n # Test init\n assert isinstance(mySession, ps.Session)\n \n with pytest.raises(ValueError,... | [
[
"pandas.DataFrame"
]
] |
giserh/book-python | [
"ebd4e70cea1dd56986aa8efbae3629ba3f1ba087"
] | [
"data-vizualization/src/plotly-timeseries-rangeslider.py"
] | [
"import plotly.offline as py\nimport plotly.graph_objs as go\n\nimport pandas as pd\n\ndf = pd.read_csv(\"https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv\")\n\ntrace_high = go.Scatter(\n x=df.Date,\n y=df['AAPL.High'],\n name=\"AAPL High\",\n line=dict(color='#17BECF'),... | [
[
"pandas.read_csv"
]
] |
PeterZZQ/scDART_test | [
"61371fa653a585ccc3a981d8d429b7dbd4d89dfc"
] | [
"test/bmk_snare.py"
] | [
"# In[]\nimport sys, os\nsys.path.append('../')\nsys.path.append('../src/')\n\n\nimport numpy as np\nimport pandas as pd\nfrom scipy import sparse\nimport networkx as nx\n\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\nfrom torch.... | [
[
"numpy.nanmax",
"sklearn.cluster.KMeans",
"numpy.squeeze",
"torch.utils.data.DataLoader",
"scipy.stats.zscore",
"pandas.DataFrame",
"matplotlib.pyplot.get_cmap",
"numpy.concatenate",
"numpy.max",
"torch.FloatTensor",
"torch.no_grad",
"torch.cuda.is_available",
"... |
mjgm97/opengamedata-core | [
"b6b2aa6e7c80d1bf50f71ffba917672f80f7f948"
] | [
"models/FeatSeqPercent.py"
] | [
"## @module FeatSeqPercentModel\n# Feature to output the percentile that a session is at along a progression of gameplay timestamp features. Depends\n# heavily on the logic used to produce the quantiles file. The following exemplifies current implementation:\n#\n# Example: A game has 10 checkpoints. Joey has reache... | [
[
"numpy.arange",
"pandas.read_csv"
]
] |
clembou/rasterio | [
"57169c31dae04e1319b4c4b607345475a7122910"
] | [
"examples/concurrent-cpu-bound.py"
] | [
"\"\"\"concurrent-cpu-bound.py\n\nOperate on a raster dataset window-by-window using a ThreadPoolExecutor.\n\nSimulates a CPU-bound thread situation where multiple threads can improve performance.\n\nWith -j 4, the program returns in about 1/4 the time as with -j 1.\n\"\"\"\n\nimport concurrent.futures\nimport mult... | [
[
"numpy.zeros"
]
] |
bturner1273/HeathHackathon2018Winner | [
"87990299a2f0d168f6b33aa4c912419e89be853d"
] | [
"venv/lib/python3.6/site-packages/folium/utilities.py"
] | [
"from __future__ import (absolute_import, division, print_function)\n\nimport base64\nimport io\nimport json\nimport math\nimport os\nimport struct\nimport zlib\n\nfrom six import binary_type, text_type\n\ntry:\n import numpy as np\nexcept ImportError:\n np = None\n\ntry:\n from urllib.parse import uses_re... | [
[
"numpy.linspace",
"numpy.isfinite",
"numpy.ones",
"numpy.tan",
"numpy.atleast_3d",
"numpy.errstate",
"numpy.zeros"
]
] |
yjs1224/TextSteg | [
"ba5847d6835d35f3b08fa2dc598933c5db821478"
] | [
"utils.py"
] | [
"import collections\r\nimport random\r\nimport numpy as np\r\nimport configparser\r\nimport json\r\nimport datasets\r\n#\r\nclass MyConfigParser(configparser.ConfigParser):\r\n\tdef optionxform(self, optionstr):\r\n\t\treturn optionstr\r\n\r\nclass MyDict(dict):\r\n\t__setattr__ = dict.__setitem__\r\n\t__getattr__ ... | [
[
"numpy.random.seed",
"numpy.random.choice",
"numpy.random.shuffle",
"numpy.argwhere",
"numpy.zeros_like",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
Taosheng-ty/ULTRA | [
"2541982cb21e0acccbe66cd4437194e40e0828ef"
] | [
"ultra/learning_algorithm/dla_attention.py"
] | [
"\"\"\"Training and testing the dual learning algorithm for unbiased learning to rank.\n\nSee the following paper for more information on the dual learning algorithm.\n \n * Qingyao Ai, Keping Bi, Cheng Luo, Jiafeng Guo, W. Bruce Croft. 2018. Unbiased Learning to Rank with Unbiased Propensity Estimation. In P... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.math.sign",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.global_variables",
"tensorflow.cast",
"tensorflow.nn.l2_loss",... |
lh-astro/RM-Tools | [
"ac64cc41b2f696f21ee7dd001303cbad1ff71114"
] | [
"RMtools_3D/do_RMsynth_3D.py"
] | [
"#!/usr/bin/env python\n#=============================================================================#\n# #\n# NAME: do_RMsynth_3D.py #\n# ... | [
[
"numpy.nanmax",
"numpy.true_divide",
"numpy.expand_dims",
"numpy.abs",
"numpy.isfinite",
"numpy.power",
"numpy.reshape",
"numpy.squeeze",
"numpy.nanmin",
"numpy.ones",
"numpy.max",
"numpy.diff",
"numpy.moveaxis",
"numpy.errstate",
"numpy.loadtxt"
]
] |
ChiamYu/cameo | [
"13571b93bdd195d6d39a9ec43180916a1ff4490a"
] | [
"cameo/strain_design/heuristic/evolutionary_based.py"
] | [
"# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.\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# Unle... | [
[
"pandas.DataFrame"
]
] |
saketkc/moca_web | [
"38dfbdd9eeb739322ff3722727e43f1f4da07d3f"
] | [
"src/bedoperations/model.py"
] | [
"import os\nfrom ..helpers import MocaException\nimport pandas\nfrom pybedtools import BedTool\n\n__NARROWPEAK_COLUMNS__ = ['chrom', 'chromStart', 'chromEnd',\n 'name', 'score', 'strand',\n 'signalValue', 'p-value', 'q-value']\n\n__BROADPEAK_COLUMNS__ = ['chrom', 'chr... | [
[
"pandas.read_table",
"pandas.concat"
]
] |
Spaceenter/OpenFermion | [
"c1bf76582ec94373333d95fc27d1b92248ba3efd"
] | [
"src/openfermion/transforms/_projection.py"
] | [
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software... | [
[
"numpy.sqrt"
]
] |
Samsomyajit/s-atmech | [
"65e937294a498c2e7c46a825d98e8edd015dd7d5"
] | [
"s-atmech/bahdanau.py"
] | [
"import tensorflow as tf\nimport os\nfrom tensorflow.python.keras.layers import Layer\nfrom tensorflow.python.keras import backend as K\n\n\nclass AttentionLayer(Layer):\n \"\"\"\n There are three sets of weights introduced W_a, U_a, and V_a\n \"\"\"\n\n def __init__(self, **kwargs):\n super(Att... | [
[
"tensorflow.python.keras.backend.rnn",
"tensorflow.python.keras.backend.softmax",
"tensorflow.TensorShape",
"tensorflow.python.keras.backend.tile",
"tensorflow.python.keras.backend.sum",
"tensorflow.python.keras.backend.reshape",
"tensorflow.python.keras.backend.zeros_like",
"tenso... |
firaschaabani/fairseq | [
"425c36eafff535fe7337f8bdd5ace22ebacc78cb"
] | [
"fairseq/data/audio/raw_audio_dataset.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport logging\nimport os\nimport sys\nimport io\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom .. i... | [
[
"torch.nn.functional.layer_norm",
"torch.BoolTensor",
"torch.LongTensor",
"torch.from_numpy",
"numpy.lexsort",
"torch.no_grad",
"numpy.array",
"torch.nn.functional.pad",
"numpy.random.randint"
]
] |
bridgeland/minnetonka | [
"0e114a613d931e1a2bedc501d508e7fb00abb306"
] | [
"test/test_minnetonka.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"test_minnetonka.py: test the minnetonka language for value modeling\"\"\"\n\n__author__ = \"Dave Bridgeland\"\n__copyright__ = \"Copyright 2017-2020, Hanging Steel Productions LLC\"\n__credits__ = [\"Dave Bridgeland\"]\n\n__version__ = \"0.0.1\"\n__maintainer__ = \"Dave Bridgeland\"... | [
[
"numpy.testing.assert_array_equal",
"numpy.testing.assert_allclose",
"numpy.ndindex",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.empty"
]
] |
Narcissuscyn/neural-motifs | [
"3b92237a305b4ad054851f81f48f6610707dbda7"
] | [
"data/stanford_filtered/vg_to_roidb.py"
] | [
"# coding=utf8\n# --------------------------------------------------------\n# Scene Graph Generation by Iterative Message Passing\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Danfei Xu\n# --------------------------------------------------------\n\nimport argparse, json, string\nfrom col... | [
[
"numpy.min",
"numpy.asarray",
"numpy.random.shuffle",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
shukali/dimensionality-reduction-comparison | [
"3c2de0d7c48516dc5af6cfd9ec58307a1ed2e417"
] | [
"Datasets/AutoMpgLoader.py"
] | [
"import pandas as pd\nfrom sklearn import datasets\n\ndef load_autompg():\n ''' Gets the Auto MPG dataset. Returns a tuple (data, target) containing the dataset and the labels.\n\n data: The 392 x 8 data matrix containing the features. (n_samples = 392, n_features = 8)\n Order: (mpg, cyli... | [
[
"pandas.read_csv"
]
] |
Similarities/shot_discriminator-pandas | [
"c893d92c92e30a34a5ac55dc9f1d66e0546f3922"
] | [
"Search_mean_single_sorted03.py"
] | [
"__author__ = 'similarities'\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pylab\n\n\noriginal_df = pd.read_excel(\"fundamentalshifts9_selection.xlsx\")\n\nclass Sort_and_Copy_Dataframe:\n\n def __init__(self, database):\n self.orginal = database\n self.copy =... | [
[
"matplotlib.pyplot.legend",
"pandas.read_excel",
"matplotlib.pyplot.scatter",
"numpy.isnan",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show"... |
lsdace30095/model_server | [
"43862a61935d0798ed6908ac84b20192287933f1"
] | [
"example_client/face_detection.py"
] | [
"#\n# Copyright (c) 2019-2020 Intel Corporation\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 applic... | [
[
"numpy.dtype",
"numpy.append",
"tensorflow.make_tensor_proto",
"tensorflow.make_ndarray",
"numpy.average",
"numpy.zeros"
]
] |
bluemoo/lifelines | [
"972278d17910edf9285da88f9946f36785eb89b5"
] | [
"lifelines/tests/test_estimation.py"
] | [
"# -*- coding: utf-8 -*-\nimport warnings\n\n# pylint: disable=wrong-import-position\nwarnings.simplefilter(action=\"ignore\", category=DeprecationWarning)\n\nfrom collections import Counter\nfrom collections.abc import Iterable\nimport os\nimport pickle\nfrom itertools import combinations\n\nfrom io import StringI... | [
[
"scipy.stats.invgamma",
"pandas.to_datetime",
"numpy.minimum",
"pandas.testing.assert_series_equal",
"numpy.linspace",
"pandas.Series",
"numpy.random.weibull",
"numpy.asarray",
"numpy.linalg.norm.cdf",
"numpy.sqrt",
"pandas.DataFrame",
"numpy.dtype",
"numpy.lina... |
wiseodd/rgpr | [
"263923dd160d40d64894e85190a7341aaa1e4080"
] | [
"aggregate_OOD.py"
] | [
"import numpy as np\nimport pickle\nimport os, sys, argparse\nfrom util.tables import *\nfrom collections import defaultdict, namedtuple\nimport pandas as pd\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--mean_only', default=False, action='store_true')\nparser.add_argument('--metrics', default='mmc... | [
[
"numpy.isnan",
"pandas.concat",
"pandas.DataFrame"
]
] |
asthajn/robotics | [
"727ab3ee5450054687c5637d399c7b5aabd48672"
] | [
"Assignment/graph.py"
] | [
"from matplotlib import pyplot\n\ndef plotGraph(x, y):\n\tpyplot.figure(1)\n\tpyplot.plot(x,y,'ro-',label='Robot motion path')\n\tpyplot.grid(axis='both')\n\tpyplot.xlabel('x coordinate')\n\tpyplot.ylabel('y coordinate')\n\tpyplot.axis([0, 1, 0, 1])\n\tpyplot.title('Plot of Robot Motion')\n\tpyplot.legend(loc=2)\n\... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
MarcosSalib/Cocktail_MOOC | [
"46279c2ec642554537c639702ed8e540ea49afdf"
] | [
"Preliminaries/Mathematics For ML - ICL/1. Linear Algebra/readonly/bearNecessities.py"
] | [
"import matplotlib\n\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport numpy.linalg as la\n\nbear_black = (0.141, 0.11, 0.11)\nbear_white = (0.89, 0.856, 0.856)\nmagenta = (0xfc / 255, 0x75 / 255, 0xdb / 255) # Brighter magenta\norange = (218 / 255, 171 / 255, 115 / 255)\ngreen = ... | [
[
"matplotlib.use",
"numpy.linalg.norm",
"matplotlib.pyplot.subplots",
"numpy.zeros_like",
"numpy.array"
]
] |
schnur/oss-repo-template | [
"d9e3ea7cae43dd1dd1ff7acef8b1249f3a95a848"
] | [
"labs/lab-06/example1.py"
] | [
"import networkx as nx\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nG = nx.gnp_random_graph(100, 0.02, seed=10374196)\n\ndegree_sequence = sorted((d for n, d in G.degree()), reverse=True)\ndmax = max(degree_sequence)\n\nfig = plt.figure(\"Degree of a random graph\", figsize=(8, 8))\n# Create a gridspec f... | [
[
"matplotlib.pyplot.show",
"numpy.unique",
"matplotlib.pyplot.figure"
]
] |
SimonBoothroyd/surrogates | [
"a53bee444b4587d0290e8dcacd8be3ff6011fd02"
] | [
"studies/mcmc/gaussian/run_3d.py"
] | [
"import numpy\nfrom matplotlib import pyplot\n\nfrom surrogates.kernels import MCMCSimulation\nfrom surrogates.kernels.samplers.hmc import Hamiltonian\nfrom surrogates.models.simple import UnconditionedModel\nfrom surrogates.utils.distributions import Normal\nfrom surrogates.utils.file import change_directory\nfrom... | [
[
"numpy.std",
"numpy.array",
"numpy.mean",
"matplotlib.pyplot.close"
]
] |
terryli710/SIIM-ACR-Pneumothorax-Classification | [
"8b278a9885b71c919d7064b2df42863b53f7adf3"
] | [
"transfer_learning_discussion.py"
] | [
"# Adapted from .ipynb file\nimport numpy as np\nimport pandas as pd\nfrom glob import glob\nfrom imblearn.under_sampling import RandomUnderSampler\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import OneHotEncoder\nfrom skle... | [
[
"numpy.expand_dims",
"tensorflow.keras.applications.InceptionV3",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.matshow",
"tensorflow.keras.regularizers.l1_l2",
"pandas.read_csv",
"tensorflow.keras.Input",
"numpy.arange",
"tensorflow.keras.layers.Flatten",
"tensorf... |
amichalski2/WBC-SHAP | [
"b69a4a8746aaf7a8dfacfdb4dbd85b4868d73ad0"
] | [
"scripts/data_extract.py"
] | [
"import os\nimport cv2\nimport random\nimport numpy as np\nfrom tensorflow.keras.utils import to_categorical\nfrom scripts.consts import class_dict\n\n\ndef get_data(path, split=0.2):\n\n X, y = [], []\n\n for directory in os.listdir(path):\n\n dirpath = os.path.join(path, directory)\n print(dir... | [
[
"numpy.array",
"tensorflow.keras.utils.to_categorical"
]
] |
Virinas-code/GobyChess | [
"dc6129a4d5a5e061714714402d9cd472efc599f8"
] | [
"gobychess/train.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nTry to train evaluation in supervised fashion with engineered loss function\n\"\"\"\n\nimport sys\n\nimport chess\nimport h5py\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.math import log, sigmoid, pow\n\n\nmodel = tf.keras.Sequential([\n tf.keras.layers.Dense(10... | [
[
"numpy.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.cast",
"tensorflow.reshape",
"tensorflow.math.sigmoid",
"tensorflow.GradientTape",
"tensorflow.math.pow",
"tensorflow.keras.metrics.Mean",
"tensorflow.keras.optimizers.SGD"
]
] |
xu-hong-/scipy | [
"f737001cf0a75654efe09a1de5cdf5d1895bda59"
] | [
"scipy/spatial/tests/test_spherical_voronoi.py"
] | [
"from __future__ import print_function\nimport numpy as np\nfrom numpy.testing import (TestCase,\n assert_almost_equal,\n assert_array_equal,\n assert_array_almost_equal)\nfrom scipy.spatial import SphericalVoronoi, distance\nfrom scipy.s... | [
[
"scipy.spatial._spherical_voronoi.project_to_sphere",
"numpy.testing.assert_array_equal",
"scipy.spatial._spherical_voronoi.SphericalVoronoi",
"scipy.spatial._spherical_voronoi.calc_circumcenters",
"numpy.array",
"scipy.spatial.SphericalVoronoi",
"numpy.testing.assert_array_almost_equa... |
WrathTitan/twentyone | [
"22665214b2e7699d9c785b22174bdab8992cbb7d"
] | [
"Files/timeseries.py"
] | [
"from pmdarima import auto_arima\n#from fbprophet import Prophet\nimport json\n#from fbprophet.serialize import model_to_json, model_from_json\nimport os\nimport yaml\nfrom yaml.loader import FullLoader\nimport plotly\nimport pandas as pd\nimport plotly.express as ex\nimport shutil\n#import kaleido\nimport plotly.e... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
1170300521/RCCF | [
"561b567350c6d172402166b67fe1891f8ec127c8"
] | [
"lib/datasets/sample/refdet.py"
] | [
"from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport torch.utils.data as data\r\nimport numpy as np\r\nimport torch\r\nimport json\r\nimport cv2\r\nimport os\r\nfrom utils.image import flip, color_aug\r\nfrom utils.image import get_affine_... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.clip"
]
] |
mohanksriram/acme | [
"d6e102156dca77e0001f262d255ca01bceff10ea"
] | [
"examples/control/eval_lift_dmpo.py"
] | [
"# Include all the imports here\nfrom typing import Dict, Sequence\n\nfrom absl import app\nfrom absl import flags\nimport acme\nfrom acme import specs\nfrom acme import types\nfrom acme import wrappers\nfrom acme.agents.tf import dmpo\nfrom acme.tf import networks\nfrom acme.tf import utils as tf2_utils\nimport te... | [
[
"tensorflow.compat.v1.logging.set_verbosity",
"numpy.concatenate",
"numpy.float32",
"numpy.prod",
"numpy.flip"
]
] |
persianyagami90xs/darwin-py | [
"f8a0d8d806831b9e418800b7aae5c7b70c03580e"
] | [
"darwin/importer/formats/coco.py"
] | [
"import json\nfrom pathlib import Path\nfrom typing import List, Optional\n\nimport numpy as np\nfrom upolygon import find_contours\n\nimport darwin.datatypes as dt\n\n\ndef parse_file(path: Path) -> Optional[List[dt.AnnotationFile]]:\n if path.suffix != \".json\":\n return\n\n with path.open() as f:\n... | [
[
"numpy.zeros"
]
] |
JizhiziLi/P3M | [
"d66b8a46ae017ffc64c04f05e551158db635a083"
] | [
"core/network/P3mNet.py"
] | [
"\"\"\"\nPrivacy-Preserving Portrait Matting [ACM MM-21]\nMain test file.\n\nCopyright (c) 2021, Jizhizi Li (jili8515@uni.sydney.edu.au) and Sihan Ma (sima7436@uni.sydney.edu.au)\nLicensed under the MIT License (see LICENSE for details)\nGithub repo: https://github.com/JizhiziLi/P3M\nPaper link : https://dl.acm.org... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.sigmoid",
"torch.nn.Upsample",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.max_unpool2d"
]
] |
padam56/Data-Analysis-and-Visualization-Projects | [
"d11cf8f1df7ab7d560bbe12b50b4da76ccb84048"
] | [
"Neural Network Visualizer Web App with Python/ml_server.py"
] | [
"\nimport json\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport random\nimport string\n\nfrom flask import Flask, request\n\napp = Flask(__name__)\n\nmodel = tf.keras.models.load_model('model.h5')\nfeature_model = tf.keras.models.Model( #Give us output of all layers\n model.inputs,\n [layer.out... | [
[
"tensorflow.keras.models.load_model",
"numpy.random.choice",
"numpy.reshape",
"tensorflow.keras.models.Model",
"tensorflow.keras.datasets.mnist.load_data"
]
] |
Miro-Astore/mdanalysis_scripts | [
"faf59c7b3b63ab103a709941e5cc2e5d7c1d0b23"
] | [
"graph_occ.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt \n\n\n\nwt=np.load('_scratch_r16_ma2374_gmx_cftr_2nd_round_310K_wt_2_occ.npy')\nR352Q=np.load('_scratch_r16_ma2374_gmx_cftr_2nd_round_310K_R352Q_1_occ.npy')\ninds=range(int(wt[0][-1]))\nwidth=0.4\n\nprop_wt=wt[1][0:-1]/(wt[1][-1])\n#print(wt[1][0:-1][-1])\n#print... | [
[
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.bar",
"numpy.load",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplo... |
mathandy/handwritten_digit_recognition | [
"37ca5cadfaa0b2554873b2a1bf9fb7b729776eac"
] | [
"utils/diagnostic_tools.py"
] | [
"\"\"\"Some diagnostic tools.\"\"\"\n\nfrom __future__ import division, print_function, absolute_import\nfrom collections import OrderedDict\nimport numpy as np\n\n\nfrom .display_tools import printmat\n\n\ndef getbinarydiagnostic(labels, predictions):\n \"\"\"returns a dictionary of various ratios used for diag... | [
[
"numpy.seterr",
"numpy.sqrt",
"numpy.float32"
]
] |
srivastavashobhit/Semantic-Segmentation-Identifying-Drivable-Path-for-Autonomous-Vehicles | [
"372904d5be7b00abb1de215515c86bd16fa411a4"
] | [
"src/utils/image_utils.py"
] | [
"import tensorflow as tf\n\n\ndef read_image(image_url):\n image = tf.io.read_file(image_url)\n image = tf.image.decode_png(image, channels=3)\n image = tf.image.convert_image_dtype(image, tf.float32) # this also set the value between 0 and 1\n\n return image\n\n\ndef read_mask(mask_url):\n mask = t... | [
[
"tensorflow.math.reduce_max",
"tensorflow.image.decode_png",
"tensorflow.image.resize",
"tensorflow.image.convert_image_dtype",
"tensorflow.io.read_file",
"tensorflow.keras.preprocessing.image.array_to_img"
]
] |
Basvdbrink1998/Influencing-social-networks | [
"7b512edc4127680a37115c7e1434b06ebfa67e8a"
] | [
"Code/Simple_plots/Adjecency.py"
] | [
"import networkx as nx\nimport matplotlib.pyplot as plt\n\n\"\"\"\n Adjecency.py: Plots a house graph for Figure 2.1.\n\"\"\"\n\nnode_color = 'red'\nnode_border_color = 'black'\nnode_border_width = .6\nedge_color = 'black'\n\n\ndef draw(G, pos, ax):\n nodes1 = nx.draw_networkx_nodes(G, pos=pos, node_size=500,... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
jrosebr1/mxnet | [
"f0fe522cfd91b50ed1ef31d22ff412a1295e16a7"
] | [
"python/mxnet/test_utils.py"
] | [
"# coding: utf-8\n\"\"\"Tools for testing.\"\"\"\n# pylint: disable=invalid-name, no-member, too-many-arguments, too-many-locals, too-many-branches, too-many-statements, broad-except, line-too-long, unused-import\nfrom __future__ import absolute_import, print_function, division\nimport time\nimport traceback\nimpor... | [
[
"numpy.abs",
"numpy.array_equal",
"numpy.isnan",
"numpy.ascontiguousarray",
"numpy.set_printoptions",
"numpy.dtype",
"numpy.copy",
"numpy.argmax",
"numpy.random.normal",
"numpy.random.randn",
"numpy.prod",
"numpy.testing.build_err_msg",
"numpy.testing.assert_all... |
bcajes/glow | [
"5da50d7eb87e9e6bbc101f87598f2f5121d8927d"
] | [
"python/glow/wgr/ridge_reduction.py"
] | [
"# Copyright 2019 The Glow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ag... | [
[
"pandas.DataFrame"
]
] |
TheBuoys/neuropy | [
"387a5eaa31629c726b5de1e71090b0d644f675b2"
] | [
"test/mock_objects/simple_data_loader.py"
] | [
"import sys\nimport tensorflow as tf\nimport numpy as np\nimport neuropy\n\n# tf.enable_eager_execution()\n\n#Simple example data loader for testing.\nclass DataLoader(neuropy.base.BaseDataLoader):\n def __init__(self, configuration, model_parameters):\n super(DataLoader, self).__init__(configuration, mod... | [
[
"tensorflow.data.Dataset.zip",
"numpy.array"
]
] |
biomedia-mira/deepscm | [
"2dbfcde0d1fed63553c993d4abe4a74a59dc05d0"
] | [
"deepscm/experiments/medical/ukbb/sem_vi/base_sem_experiment.py"
] | [
"import pyro\n\nfrom typing import Mapping\n\nfrom pyro.infer import SVI, TraceGraph_ELBO\nfrom pyro.nn import pyro_method\nfrom pyro.optim import Adam\nfrom torch.distributions import Independent\n\nimport torch\nfrom pyro.distributions.torch_transform import ComposeTransformModule\nfrom pyro.distributions.transfo... | [
[
"torch.ones",
"torch.Tensor",
"torch.zeros",
"numpy.isnan",
"torch.nn.init.constant_",
"torch.rand_like",
"torch.isnan",
"torch.nn.Linear",
"torch.no_grad",
"torch.nn.init.normal_",
"numpy.prod",
"torch.nn.init.zeros_",
"torch.stack",
"torch.nn.ReLU"
]
] |
junan146/Distributed-Deep-Learning | [
"5cdb624b91a44d0a7eb339d07a19b1f7fe64ab4a"
] | [
"mnist_async_sharding_greedy/worker.py"
] | [
"from model import Model\nfrom mpi4py import MPI\nfrom typing import List\nimport numpy as np\nimport tensorflow as tf\nimport time,sys\nfrom functools import reduce\n\nclass SyncWorker(Model):\n def __init__(self, batch_size, rank, num_ps, num_workers):\n super().__init__()\n\n ''' Modify var_buck... | [
[
"tensorflow.compat.v1.assign",
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.variable_scope",
"numpy.empty"
]
] |
ducviet00/HMER | [
"0fa322ed35412737a24ec3955c9a3d96d1989bd4"
] | [
"Train.py"
] | [
"'''\nPython 3.6 \nPytorch >= 0.4\nWritten by Hongyu Wang in Beihang university\n'''\nimport torch\nimport math\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport numpy\nimport torch.utils.data as data\nfrom data_iterator import dataIterator\nfrom Densenet_torchvisi... | [
[
"torch.nn.ZeroPad2d",
"torch.mean",
"torch.nn.NLLLoss",
"torch.LongTensor",
"torch.ones",
"torch.max",
"torch.load",
"torch.cat",
"torch.randn",
"torch.zeros",
"torch.utils.data.DataLoader",
"torch.sum",
"torch.tanh",
"torch.nn.init.xavier_uniform_",
"to... |
FrauBluher/PMSM | [
"acb806ea23705ecc8ea29d8a23c3fb10c3b61e19"
] | [
"Config Tool/matplottest.py"
] | [
"#!/usr/bin/env python\n# Plot a graph of Data which is comming in on the fly\n# uses pylab\n# Author: Norbert Feurle\n# Date: 12.1.2012\n# License: if you get any profit from this then please share it with me and only use it for good\nimport pylab\nfrom pylab import *\nimport tkinter\nfrom matplotlib.backends.bac... | [
[
"matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
canard0328/malss | [
"976ebdb6e4bee52a0dbb65e0ddeed767cfe39591"
] | [
"malss/app/analyzer.py"
] | [
"# coding: utf-8\r\n\r\nfrom PyQt5.QtWidgets import QScrollArea\r\nfrom PyQt5.QtCore import QThread, pyqtSignal\r\nfrom .content import Content\r\nfrom multiprocessing import Process, Manager\r\nfrom threading import Condition\r\nimport sys\r\nfrom .waiting_animation import WaitingAnimation\r\n\r\n\r\nclass Analyze... | [
[
"sklearn.ensemble.RandomForestRegressor",
"sklearn.tree.DecisionTreeRegressor",
"sklearn.linear_model.LogisticRegression",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.linear_model.SGDRegressor",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.svm.SVR",
"sklearn.tree.Deci... |
ssabzzz/BERT-NER | [
"ab60d6afee2b5b4200149c6270823872fd8efecd"
] | [
"interactive.py"
] | [
"\"Evaluate the model\"\"\"\nimport os\nimport nltk\nimport torch\nimport random\nimport logging\nimport argparse\nimport numpy as np\nimport utils as utils\nfrom metrics import get_entities\nfrom data_loader import DataLoader\nfrom SequenceTagger import BertForSequenceTagging\n\nparser = argparse.ArgumentParser()\... | [
[
"torch.manual_seed",
"numpy.argmax",
"torch.cuda.is_available"
]
] |
Dheer08/Workflow | [
"041d01d2014e7bf0ff8d5cf400f1cd7b75911cbf"
] | [
"Ensemble.py"
] | [
"import csv\r\nimport math\r\nimport random \r\nimport pandas as pd\r\nfrom sklearn.naive_bayes import GaussianNB ,BernoulliNB\r\nfrom sklearn import preprocessing,linear_model\r\nimport sklearn\r\nimport numpy as np\r\n#from sklearn.utils import shuffle\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nfro... | [
[
"pandas.read_csv",
"sklearn.naive_bayes.GaussianNB",
"sklearn.linear_model.LogisticRegression",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.VotingClassifier",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.tree.Decisi... |
lucasxlu/FGVC | [
"c1ac2d49d77d4069ecee0b2c97dbd7cd16b3f700"
] | [
"main/run_resnet.py"
] | [
"import copy\nimport os\nimport sys\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom sklearn.metrics import confusion_matrix\nfrom torch.optim import lr_scheduler\nfrom torchvision import models\n\nsys.pa... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.max",
"torch.sum",
"sklearn.metrics.confusion_matrix",
"torch.nn.Linear",
"torch.nn.DataParallel",
"torch.set_grad_enabled",
"torch.no_grad",
"torch.cuda.is_available",
"torch.topk",
"torch.cuda.devi... |
Cather-learner/Social-Bias-Finance | [
"ac98b2ea3ecb6c5dd7f29afa004d8ffa833b9bdf"
] | [
"utils.py"
] | [
"# coding: UTF-8\nimport torch\nfrom tqdm import tqdm\nimport time\nfrom datetime import timedelta\nimport re\nimport pandas as pd\nimport numpy as np\n\nPAD, CLS = '[PAD]', '[CLS]' # padding符号, bert中综合信息符号\n\ndef build_dataset(config):\n def load_dataset(path, pad_size=32):\n contents = []\n #dat... | [
[
"torch.LongTensor"
]
] |
dgehringer/pyiron_atomistics | [
"2c8052b082f2c4fb6f6291ac2b1f801ea7ab1567"
] | [
"pyiron_atomistics/atomistics/structure/sparse_list.py"
] | [
"# coding: utf-8\n# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department\n# Distributed under the terms of \"New BSD License\", see the LICENSE file.\n\nfrom __future__ import print_function\n\n# import os\nimport sys\nimport copy\nimport numpy as np\nfrom colle... | [
[
"numpy.copy",
"numpy.delete",
"numpy.append",
"numpy.equal",
"numpy.array"
]
] |
aimakerspace/synergos_algorithm | [
"9d07fa10ae78c0da5ad0415c58230b9712642134"
] | [
"synalgo/interfaces/model.py"
] | [
"#!/usr/bin/env python\r\n\r\n####################\r\n# Required Modules #\r\n####################\r\n\r\n# Generic\r\nfrom collections import OrderedDict\r\nfrom typing import Tuple\r\n\r\n# Libs\r\nimport syft as sy\r\nimport torch as th\r\nfrom torch import nn\r\n\r\n# Custom\r\nfrom synalgo.utils import TorchPa... | [
[
"torch.rand"
]
] |
Gregory-Eales/ml-reimplementations | [
"ef2652224cc31ca3b569c9ccd9089a4053eb2b2f"
] | [
"trpo/trpo/policy_network.py"
] | [
"import torch\nimport numpy as np\n\n\nclass PolicyNetwork(torch.nn.Module):\n\n def __init__(self, alpha, input_size, output_size):\n\n super(PolicyNetwork, self).__init__()\n\n self.input_size = input_size\n self.output_size = output_size\n\n self.fc1 = torch.nn.Linear(input_size, 1... | [
[
"torch.nn.KLDivLoss",
"torch.Tensor",
"torch.sum",
"torch.nn.Sigmoid",
"torch.nn.Tanh",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.cuda.is_available",
"torch.device"
]
] |
ryo-ma/covid19-japan-web-api | [
"7e17fabac7c56b5e5a4547078a3e77fc96e88e1f"
] | [
"project/src/script/create_positive_detail.py"
] | [
"import pandas as pd\nimport json\nimport os\nfrom ..const import (PREFECTURES, POSITIVE_DETAIL_JSON_PATH,\n POSITIVE_DETAIL_DATA_PATH, POSITIVE_DEITAL_PREFECTURE_JSON_PATH_FORMAT)\n\n\ndef create_json_file():\n header = ('code', 'announcement_date', 'src', 'prefecture', 'residence_prefecture... | [
[
"pandas.read_csv"
]
] |
edgchen1/onnxruntime | [
"60bbdf14035014d94d525c402d3d6404ac32ad3d"
] | [
"orttraining/orttraining/python/training/ortmodule/_utils.py"
] | [
"# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# --------------------------------------------------------------------------\n\nfrom onnxruntime.capi.onnxruntime_inference_collection import ... | [
[
"torch.utils.dlpack.to_dlpack",
"torch.cuda.current_device",
"torch.nn.Module",
"torch.utils.dlpack.from_dlpack",
"torch.device"
]
] |
harunpehlivan/ParlAI | [
"5507d4745ca23b23af311673a6b0d1b7e72eb5cd"
] | [
"projects/wizard_of_wikipedia/wizard_transformer_ranker/wizard_transformer_ranker.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom parlai.agents.transformer.transformer import TransformerRankerAgent\nfrom .wizard_dict import WizardDictAgent\n\nimport numpy as n... | [
[
"numpy.random.binomial",
"torch.LongTensor",
"torch.cat",
"torch.load"
]
] |
hanzhiwangchn/SynthSR | [
"35c2483f1da272855bbeea3e76140845106b623d"
] | [
"SynthSR/metrics_model.py"
] | [
"\"\"\"\nIf you use this code, please the SynthSR paper in:\nhttps://github.com/BBillot/SynthSR/blob/master/bibtex.bib\n\nCopyright 2020 Benjamin Billot\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.transpose",
"tensorflow.reduce_mean",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.expand_dims",
"tensorflow.exp",
"tensorflow.math.log",
"tensorflow.debugging.check_numerics",
"tensorflow.image.ssim... |
arbab97/IIC-1 | [
"2bbfe4cb82b01714864f06aa3a890b5eb640be25"
] | [
"data.py"
] | [
"import numpy as np\nimport os\nimport warnings\n\nimport tensorflow as tf\n#tf.enable_eager_execution()## ADded to visualize the dataset values !!!! TURN OFF FOR FASTER TRAINING\n\nimport tensorflow_datasets as tfds\n\ndef mnist_x(x_orig, mdl_input_dims, is_training):\n\n # rescale to [0, 1]\n x_orig = tf.ca... | [
[
"tensorflow.device",
"tensorflow.image.random_brightness",
"tensorflow.transpose",
"tensorflow.image.random_contrast",
"tensorflow.image.random_hue",
"tensorflow.zeros",
"tensorflow.shape",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.image.random_saturation",
"te... |
juanhenao21/exact_distributions_financial | [
"02eb058e5f963fbccb9029aae3fb6e15def7a93a"
] | [
"project/exact_distributions_correlation/exact_distributions_correlation_analysis.py"
] | [
"\"\"\"Exact distributions correlation analysis module.\n\nThe functions in the module compute the returns and the aggregated returns of\nfinancial time series.\n\nThis script requires the following modules:\n * pickle\n * typing\n * numpy\n * pandas\n * exact_distributions_correlation_tools\n\nThe m... | [
[
"numpy.linalg.eig",
"pandas.concat",
"numpy.sqrt"
]
] |
ns-rse/spym | [
"5356d97d6baf774a3bdd8c03b436052b8d74dbd0"
] | [
"spym/process/level.py"
] | [
"import numpy as np\n\nclass Level():\n ''' Level.\n\n '''\n\n def __init__(self, spym_instance):\n self._spym = spym_instance\n\n def fixzero(self, **kwargs):\n ''' Add a constant to all the data to move the minimum (or the mean value) to zero.\n\n Args:\n to_mean: bool,... | [
[
"numpy.polyfit",
"numpy.linspace",
"numpy.median",
"numpy.apply_along_axis",
"numpy.polyval"
]
] |
ford442/oglplu2 | [
"abf1e28d9bcd0d2348121e8640d9611a94112a83"
] | [
"assets/scripts/voronoi-svg.py"
] | [
"#!/usr/bin/python3\n# coding: UTF-8\n# Copyright Matus Chochlik.\n# Distributed under the Boost Software License, Version 1.0.\n# See accompanying file LICENSE_1_0.txt or copy at\n# http://www.boost.org/LICENSE_1_0.txt\n\nimport os\nimport sys\nimport math\nimport numpy\nimport random\nimport argparse\nimport mul... | [
[
"numpy.empty_like",
"numpy.dot",
"numpy.array"
]
] |
cocoaaa/TileMani | [
"ca006f201be530af32d7c5dcae03df5daa08359a"
] | [
"tilemani/compute/features.py"
] | [
"import osmnx as ox\nfrom typing import Tuple, Dict\nimport matplotlib.pyplot as plt\nfrom matplotlib.gridspec import GridSpec\n\n\ndef get_total_area(G) -> float:\n \"\"\"Computes the total area (in square meters) of the square maptile of the graph (when it's rasterized)\n G: unprojected (ie.e in lat,lng deg... | [
[
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.figure"
]
] |
alvarosanz/loadit | [
"dee6b68397040a3c16d9a83ee6cbbadbfd5bff76"
] | [
"loadit/queries.py"
] | [
"from numba import guvectorize\nimport numpy as np\n\n\nnp.seterr(invalid='ignore') # Ignore nan warnings\n\n\n@guvectorize(['(int32[:], int32[:], int32[:, :], int32[:, :])'],\n '(n), (m) -> (n, m), (n, m)',\n target='cpu', nopython=True)\ndef set_index(index0, index1, out0, out1):\n \"\"... | [
[
"numpy.isnan",
"numpy.seterr"
]
] |
mohazahran/Detecting-anomalies-in-user-trajectories | [
"e1513905c2ef7b87a5050b36060c4a49006e8b87"
] | [
"scripts/paper-data/plot_figure_mem.py"
] | [
"#-*- coding: utf8\nfrom __future__ import division, print_function\nimport matplotlib\nmatplotlib.use('Agg')\n\nfrom matplotlib import rc\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndef initialize_matplotlib():\n inches_per_pt = 1.0 / 72.27\n fig_width = 240 * inches_per_pt # width in inches\... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.legend",
"pandas.read_excel",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.minorticks_off",
"matplotlib.pyplot.ylim",
"matplotlib.use",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"... |
tomtuamnuq/qiskit-optimization | [
"04adb4952f3f42b39d4809338d3ee6e1900f2dfe"
] | [
"qiskit_optimization/algorithms/goemans_williamson_optimizer.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ... | [
[
"numpy.dot",
"numpy.random.seed",
"numpy.ones",
"numpy.random.normal",
"numpy.linalg.eigh",
"numpy.identity",
"numpy.linalg.cholesky",
"numpy.outer",
"numpy.array",
"numpy.sum"
]
] |
Neharika2089/minerva_analysis | [
"25215a17219070b1433b58439040e2f4fdb715b4"
] | [
"minerva_analysis/server/utils/pre_normalization.py"
] | [
"import numpy as np\n\n\ndef preNormalize(input_csvPath, output_csvPath, skip_columns=[]):\n RAW_DATA = np.genfromtxt(input_csvPath, names=True, dtype=float, delimiter=',')\n marker_list = RAW_DATA.dtype.names\n norm_data = RAW_DATA.view((np.float, len(marker_list)))\n\n # A list of markers to skip norm... | [
[
"numpy.maximum",
"numpy.minimum",
"numpy.percentile",
"numpy.genfromtxt",
"numpy.log10"
]
] |
TheoViel/kaggle_birdcall_identification | [
"2de708b9871cf388f91b9b0a33e738a24cca565d"
] | [
"src/model_zoo/models.py"
] | [
"import torch\nimport torchvision\nimport torch.nn as nn\nimport pretrainedmodels\nimport resnest.torch as resnest_torch\n\nfrom efficientnet_pytorch import EfficientNet\n\nfrom params import DEVICE\n\n\ndef get_model(name, num_classes=1):\n \"\"\"\n Loads a pretrained model. \n Supports ResNest, ResNext-w... | [
[
"torch.nn.Linear",
"torch.hub.load"
]
] |
wbrandenburger/MTPIA | [
"02c773ce60b7efd5b15f270f047a6da5a8f00b7e"
] | [
"dl_multi/archive/train_single_task_classification.py"
] | [
"# ===========================================================================\n# train.py ----------------------------------------------------------------\n# ===========================================================================\n\n# import -----------------------------------------------------------------... | [
[
"tensorflow.control_dependencies",
"tensorflow.summary.scalar",
"tensorflow.greater",
"tensorflow.get_collection",
"tensorflow.to_float",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.train.shuffle_batch",
"tensorflow.train.Coordinator",
"tensorflow.global_var... |
HuthLab/ContactPose | [
"722c755fb66032875fe08a3a3fd5fd78fbb69073"
] | [
"utilities/dataset.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# Code by Samarth Brahmbhatt\n\"\"\"\nContactPose dataset loading utilities\n\"\"\"\nimport os\nimport json\nimport numpy as np\nimport pickle\n\nfrom . import misc as mutils\n\nosp = os.path\n\n\ndef get_object_names(p_num, intent, ignore_hp=True):\n \"\"\"\n ... | [
[
"numpy.asarray",
"numpy.eye",
"numpy.array",
"numpy.linalg.inv"
]
] |
AguaClara/AguaClara-Design-code | [
"cc40815dfed5c4043daede0aabb23a1c13f6dca1"
] | [
"aguaclara/design/sed_tank.py"
] | [
"\"\"\" A sedimentation tank of an AguaClara water treatment plant\n\nExample:\n >>> from aguaclara.design.sed_tank import *\n >>> sed_tank = SedimentationTank(q = 60 * u.L / u.s)\n >>> round(sed_tank.diffuser_hl, 5)\n <Quantity(0.00926, 'centimeter')>\n\"\"\"\nfrom aguaclara.core.units import u\nimport... | [
[
"numpy.tan",
"numpy.cos",
"numpy.sqrt",
"numpy.sin"
]
] |
qenett/pandas-intro-clone | [
"b79d5383f37faf797eb443165fd4e3f3546f41a8"
] | [
"lekce01_zakladni_dotazy/05_dotazy_jako_v_sql.py"
] | [
"import pandas\n\n# ## 5. Dotazy jako v SQL\n\n# Srovnáním DataFrame s tabulkou podobnost s databázemi nekončí. Pandas umožňují dotazovat se nad daty podobným způsobem jako SQL.\n#\n# Vrátíme názvy měst jako index pro lepší srozumitelnost.\n\nmesta = pandas.read_csv(\"mesta.csv\", index_col=\"mesto\", encoding=\"ut... | [
[
"pandas.read_csv"
]
] |
Yotsuyubi/drumgan | [
"eb6a9aa8b5c0d64bad65e4dbd14d444b7a859a29"
] | [
"tests/test_basic.py"
] | [
"# -*- coding: utf-8 -*-\nimport unittest\nimport numpy as np\nfrom .context import drumgan\ngan = drumgan.DrumGAN()\n\n\nclass BasicTestSuite(unittest.TestCase):\n\n def test_generate(self):\n z = np.random.rand(1, 128)\n sample, z_out = gan.generate(z)\n self.assertEqual(sample.shape, (163... | [
[
"numpy.random.rand"
]
] |
camilosalazar98/sunpy | [
"085093e2407874d41604b870627873bbba0c5f8d"
] | [
"examples/maps/map_data_histogram.py"
] | [
"\"\"\"\n=============\nMap Histogram\n=============\n\nHow to inspect the histogram of the data of a map.\n\"\"\"\nfrom __future__ import print_function, division\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport astropy.units as u\n\nimport sunpy.map\nfrom astropy.coordinates import SkyCoord\nfrom ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.axvline",
"numpy.linspace",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
Lee-Gihun/MixCo-Mixup-Contrast | [
"1d8eacce057d385f187ee07b0365c9e4e1670981"
] | [
"simclr/data_aug/data_loader.py"
] | [
"import os\n\nimport torch\nimport torchvision.transforms as transforms\n\nfrom torchvision.datasets import CIFAR10, CIFAR100, ImageFolder\nfrom .tinyimagenet import TinyImageNet\nfrom .augmentation import *\n\n# Data loader\nDATASETS = {'cifar10': CIFAR10, 'cifar100': CIFAR100, 'tiny-imagenet': TinyImageNet, 'imag... | [
[
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.