repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
junyuchen245/SPECT-Img-Denoising-DIP-Keras
[ "5334c81de364438137a648302b208e58aef82d20" ]
[ "DIPDenoising/image_reading.py" ]
[ "import os\nimport numpy as np\nimport warnings\n#import SimpleITK as sitk\nimport cv2\nfrom scipy import misc\nfrom scipy import ndimage\n\n\ndef load_image_from_folder(folder_path, new_size, HE=False, Truc=False, Aug=False):\n \"\"\"loads images in the folder_path and returns a ndarray and threshold the label ...
[ [ "numpy.concatenate", "numpy.asarray", "scipy.ndimage.rotate", "numpy.load", "numpy.flipud" ] ]
TysonYu/AdaptSum
[ "a4f17060e7a8e6f9b86d33a930804445e4226ba4" ]
[ "src/dapt_pretraining.py" ]
[ "\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom transformers import BartForConditionalGeneration, BartTokenizer, get_linear_schedule_with_warmup\nfrom others.logging import logger\nfrom others.utils import pad_sents, get_mask\nfrom others.optimizer import build_optim\nfrom tqdm import tqdm\n...
[ [ "torch.cuda.manual_seed", "numpy.random.seed", "numpy.random.poisson", "torch.save", "numpy.nonzero", "numpy.mean", "torch.manual_seed", "numpy.random.uniform", "torch.utils.data.DataLoader", "torch.load" ] ]
aasensio/hazel
[ "899c8461324061bacc14da7165b9ac7eed35c96b" ]
[ "pyRoutines/angle_transformation.py" ]
[ "# cdiazbas@iac.es\nimport numpy as np\n\n\n# Return the angles in the plane of the sky given angles with respect\n# to the vertical for observations on the limb (in degrees!)\ndef absolute_to_sky(thetaB, chiB):\n thetaB = np.deg2rad(thetaB)\n chiB = np.deg2rad(chiB)\n\n t1 = np.sin(thetaB) * np.sin(chiB)\...
[ [ "numpy.sin", "numpy.arccos", "numpy.rad2deg", "numpy.sign", "numpy.sqrt", "numpy.cos", "numpy.deg2rad" ] ]
qimw/UACDA
[ "75d8d03786cba009f56cdb1efd2d6d5abe0c5f77" ]
[ "generate_plabel_dark_zurich.py" ]
[ "import argparse\nimport scipy\nfrom scipy import ndimage\nimport numpy as np\nimport sys\nimport re\nfrom packaging import version\n\nimport torch\nfrom torch.autograd import Variable\nimport torchvision.models as models\nimport torch.nn.functional as F\nfrom torch.utils import data, model_zoo\nfrom model.deeplab ...
[ [ "torch.nn.LogSoftmax", "numpy.max", "numpy.array", "numpy.asarray", "torch.nn.Softmax", "torch.nn.DataParallel", "torch.autograd.Variable", "torch.no_grad", "torch.utils.model_zoo.load_url", "numpy.load", "matplotlib.pyplot.figure", "torch.from_numpy", "torch.nn...
haifangong/TNSC-classification-baseline
[ "2fb8696699b44fbeb0512fd60deda792b464a958" ]
[ "model/classifier.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import init\nimport torch.nn.functional as F\n\n\nclass SCNN(nn.Module):\n def __init__(self, in_channels, n_classes):\n super(SCNN, self).__init__()\n self.conv1 = nn.Sequential(\n nn.Conv2d(in_channels, out_channels=16, kernel_size=3),...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.AdaptiveAvgPool2d", "torch.nn.MaxPool2d", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.flatten", "torch.nn.init.xavier_normal_" ] ]
harunpehlivan/pandas
[ "09633b868f2f999599e29d32a326e112fdbbf3ec", "2e38d5552a5c7b2c0091cecddd483f4f08ad1d2c" ]
[ "pandas/io/formats/style.py", "pandas/core/dtypes/common.py" ]
[ "\"\"\"\nModule for applying conditional formatting to\nDataFrames and Series.\n\"\"\"\n\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nimport copy\nfrom functools import partial\nfrom itertools import product\nfrom uuid import uuid1\n\nimport numpy as np\n\nfrom pandas.compat import r...
[ [ "pandas.isna", "pandas.io.formats.excel.ExcelFormatter", "pandas.api.types.is_list_like", "pandas.core.indexing._maybe_numeric_slice", "pandas.core.indexing._non_reducing_slice", "matplotlib.colors.rgb2hex", "pandas.core.common._pipe", "numpy.where", "pandas.core.dtypes.common....
achaiah/pywick
[ "9d663faf0c1660a9b8359a6472c164f658dfc8cb", "9d663faf0c1660a9b8359a6472c164f658dfc8cb" ]
[ "pywick/optimizers/ralamb.py", "pywick/optimizers/madgrad.py" ]
[ "# Source: https://gist.github.com/redknightlois/c4023d393eb8f92bb44b2ab582d7ec20\n\nfrom torch.optim.optimizer import Optimizer\nimport torch\nimport math\n\n\nclass Ralamb(Optimizer):\n\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=1e-4):\n defaults = dict(lr=lr, betas...
[ [ "torch.zeros_like" ], [ "torch.zeros_like", "torch.no_grad", "torch.clone", "torch.enable_grad" ] ]
peimengsui/ml_from_scratch
[ "5f5d276fee8f25ab91fd4342434aa23eb154a405" ]
[ "ml_from_scratch/logistic_regression.py" ]
[ "import numpy as np\nimport math\nfrom ml_from_scratch.activation_functions import Sigmoid\nfrom ml_from_scratch.utils import make_diagonal\n\n\nclass LogisticRegression():\n \"\"\" Logistic Regression classifier.\n Parameters:\n -----------\n n_iters: int\n Number of iterations running gradient ...
[ [ "numpy.random.uniform", "numpy.shape" ] ]
IharBakhanovich/DeepHyperion
[ "f7f696ba95124125dfe967ea4890d944a9958d77" ]
[ "DeepHyperion-BNG/self_driving/beamng_member.py" ]
[ "import hashlib\nimport random\nfrom typing import Tuple, Dict\n\nfrom self_driving.beamng_config import BeamNGConfig\nfrom self_driving.beamng_evaluator import BeamNGEvaluator\nfrom core.member import Member\nfrom self_driving.catmull_rom import catmull_rom\nfrom self_driving.road_bbox import RoadBoundingBox\nfrom...
[ [ "numpy.mean" ] ]
friedrichromstedt/moviemaker3
[ "7941a06d43bbbb63e45496044040a163ab97d78d" ]
[ "moviemaker3/math/angle.py" ]
[ "import numpy\nfrom fframework import asfunction, OpFunction\n\n__all__ = ['Angle']\n\nclass Angle(OpFunction):\n \"\"\"Transforms a mesh into the angle of the mesh to the x axis.\"\"\"\n\n def __init__(self, mesh):\n \"\"\"*mesh* is the mesh Function.\"\"\"\n\n self.mesh = asfunction(mesh)\n\n ...
[ [ "numpy.arctan2" ] ]
motional/polarstream
[ "74af9548cad69a4f546b83dae7b87454bc590c9e" ]
[ "det3d/core/bbox/box_np_ops.py" ]
[ "from pathlib import Path\r\n\r\nimport numba\r\nimport numpy as np\r\nfrom det3d.core.bbox.geometry import (\r\n points_count_convex_polygon_3d_jit,\r\n points_in_convex_polygon_3d_jit,\r\n)\r\ntry:\r\n from spconv.utils import rbbox_intersection, rbbox_iou\r\nexcept:\r\n print(\"Import spconv fail, no...
[ [ "numpy.ones_like", "numpy.minimum", "numpy.tile", "numpy.min", "numpy.linalg.qr", "numpy.where", "numpy.cos", "numpy.concatenate", "numpy.max", "numpy.sin", "numpy.zeros_like", "numpy.prod", "numpy.arange", "numpy.linalg.inv", "numpy.array", "numpy.z...
laphisboy/mvsnerf
[ "ea1aecd7d653b04a7f4bec27ad978f64a038bc92" ]
[ "renderer_blender_src.py" ]
[ "import argparse\nimport re\n\n####\n# # Box 1\n####\n\nimport sys,os,imageio,lpips\nroot = '/home/youngsun/documents/mvs/mvsnerf_timing'\nos.chdir(root)\nsys.path.append(root)\n\nfrom opt_src import config_parser\nfrom data import dataset_dict\nfrom torch.utils.data import DataLoader\nimport matplotlib.pyplot as ...
[ [ "torch.no_grad", "torch.split", "torch.from_numpy", "torch.cuda.set_device", "torch.cuda.empty_cache", "torch.tensor" ] ]
Pandinosaurus/KungFu
[ "80dfa463450330e920b413f65cc49d8e013b84a9" ]
[ "examples/mnist_elastic_docker/mnist_slp_estimator.py" ]
[ "import argparse\nimport functools\nimport operator\nimport os\n\nimport numpy as np\nimport tensorflow as tf\nfrom kungfu.tensorflow.v1.helpers.mnist import load_datasets\nfrom tensorflow.python.util import deprecation\n\ndeprecation._PRINT_DEPRECATION_WARNINGS = False\n\n\ndef parse_args():\n p = argparse.Argu...
[ [ "tensorflow.estimator.EstimatorSpec", "tensorflow.argmax", "tensorflow.reshape", "tensorflow.estimator.inputs.numpy_input_fn", "tensorflow.metrics.accuracy", "tensorflow.estimator.Estimator", "tensorflow.train.get_global_step", "tensorflow.cast", "tensorflow.train.GradientDesce...
JetBrains-Research/pubtrends
[ "5352bec2cca3321f8554d8e60728fe6d8494edcb" ]
[ "pysrc/papers/analysis/topics.py" ]
[ "import logging\nfrom collections import Counter\nfrom itertools import chain\n\nimport numpy as np\nfrom sklearn.cluster import AgglomerativeClustering\nfrom sklearn.metrics import pairwise_distances\n\nfrom pysrc.papers.analysis.text import get_frequent_tokens\n\nlogger = logging.getLogger(__name__)\n\n\ndef comp...
[ [ "sklearn.cluster.AgglomerativeClustering", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.mean", "sklearn.metrics.pairwise_distances", "numpy.argsort", "numpy.diag", "numpy.flatnonzero" ] ]
fanwu8/sf
[ "8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf", "8ce5671a3f8c2e8f3425aabc373fc58954f5bdbf" ]
[ "seisflows/tools/graphics.py", "seisflows/plugins/writers.py" ]
[ "\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import interp1d\n\nfrom obspy.core.stream import Stream\n\n\ndef plot_gll(x, y, z):\n \"\"\" Plots values on 2D unstructured GLL mesh\n \"\"\"\n r = (max(x) - min(x))/(max(y) - min(y))\n rx = r/np.sqrt(1 + r**2)\n ry = 1/n...
[ [ "matplotlib.pyplot.tricontourf", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "numpy.sqrt", "matplotlib.pyplot.show",...
Callidior/semantic-embeddings
[ "0d4177422bafbba685fb6a0f976675864f31e09f", "0d4177422bafbba685fb6a0f976675864f31e09f" ]
[ "sgdr_callback.py", "datasets/cifar.py" ]
[ "import numpy as np\nfrom keras.callbacks import Callback\nfrom keras import backend as K\n\n\nclass SGDR(Callback):\n \"\"\"This callback implements the learning rate schedule for\n Stochastic Gradient Descent with warm Restarts (SGDR),\n as proposed by Loshchilov & Hutter (https://arxiv.org/abs/1608.0398...
[ [ "numpy.cos" ], [ "numpy.concatenate", "numpy.array" ] ]
zhuyuanxiang/tensorflow_cookbook
[ "57d7ee719385ddd249a67c3a85bd336e884a67e5" ]
[ "01_Introduction/C0106_operations.py" ]
[ "# -*- encoding: utf-8 -*- \n\"\"\"\n@Author : zYx.Tom\n@Contact : 526614962@qq.com\n@site : https://github.com/zhuyuanxiang/tensorflow_cookbook\n---------------------------\n@Software : PyCharm\n@Project : TensorFlow_Machine_Learning_Cookbook\n@File : C0106_operations.py\n@Ve...
[ [ "numpy.random.seed", "numpy.set_printoptions", "tensorflow.cross", "tensorflow.Session", "tensorflow.cos", "tensorflow.mod", "tensorflow.truediv", "matplotlib.pyplot.get_fignums", "tensorflow.python.framework.ops.reset_default_graph", "tensorflow.div", "tensorflow.sin",...
kant/GlennOPT
[ "ca816c3708a2db5b98f8f1a7885305a8e18e179e" ]
[ "test/ProbePlacement_multi/parallel/optimization_setup.py" ]
[ "\"\"\"\n Simple, non parallel optimization set up example. \n\"\"\"\nimport sys,os\nsys.path.insert(0,'../../../')\nfrom glennopt.base import Parameter\nfrom glennopt.helpers import mutation_parameters, de_mutation_type\nfrom glennopt.optimizers import NSGA3\nfrom glennopt.DOE import Default,CCD,FullFactorial,L...
[ [ "numpy.zeros" ] ]
eldrin/wmf
[ "7a4d72e47034f4289ea3c73d28886eabd6ab5762" ]
[ "test_batched_inv_mp.py" ]
[ "import numpy as np\nimport wmf\nimport batched_inv\nimport batched_inv_mp\nimport solve_mp\nimport solve_gpu\n\nnp.random.seed(123)\n\nB = np.load(\"test_matrix.pkl\")\n\nS = wmf.log_surplus_confidence_matrix(B, alpha=2.0, epsilon=1e-6)\n\n\nnum_factors = 40 + 1\nnum_iterations = 1\nbatch_size = 1000\n\nsolve = ba...
[ [ "numpy.random.seed", "numpy.load" ] ]
mori97/U-Net_MUSDB18
[ "d452f0e6378c1d74e823dcb1e95d92307f4dea46", "d452f0e6378c1d74e823dcb1e95d92307f4dea46" ]
[ "src/convert_to_wav.py", "src/u_net.py" ]
[ "\"\"\"Convert MUSDB18 dataset to .wav format.\nOutput .wav files contain 5 channels\n- `0` - The mixture,\n- `1` - The drums,\n- `2` - The bass,\n- `3` - The rest of the accompaniment,\n- `4` - The vocals.\n\"\"\"\nimport argparse\nimport os\nimport subprocess\nimport tempfile\n\nimport librosa\nimport numpy as np...
[ [ "numpy.stack" ], [ "torch.cat", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d", "torch.nn.functional.pad", "torch.log", "torch.nn.Dropout2d" ] ]
petercuret/woonfraude
[ "2602464f9b9a8bf901d89590b61205ba18fe697d" ]
[ "codebase/datasets/adres_dataset.py" ]
[ "####################################################################################################\n\"\"\"\nadres_dataset.py\n\nThis module implements several classes to perform dataset-specific downloading, saving and\ndata-transformation operations.\n\nWritten by Swaan Dekkers & Thomas Jongstra\n\"\"\"\n######...
[ [ "pandas.to_datetime", "pandas.merge", "pandas.concat" ] ]
ho-oto/jax
[ "e0f285fd218aa704fa65c47ab6e7695f4a38ddbd" ]
[ "jax/experimental/jax2tf/jax2tf.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.compiler.xla.experimental.xla_sharding.xla_sharding.tile", "tensorflow.ones", "tensorflow.compiler.xla.experimental.xla_sharding.xla_sharding.replicate", "tensorflow.compiler.tf2xla.python.xla.dot_general", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.st...
sh-divya/flare
[ "93219ff03df10528abb8f7a5309f15f7899a3f12" ]
[ "tests/test_flare_io.py" ]
[ "import pytest\n\npmgout = pytest.importorskip(\"pymatgen.io.vasp.outputs\")\nVasprun = pmgout.Vasprun\nimport os\nimport numpy as np\nfrom flare.struc import Structure, get_unique_species\nfrom flare.dft_interface.vasp_util import md_trajectory_from_vasprun\nfrom flare.utils.flare_io import md_trajectory_to_file, ...
[ [ "numpy.isclose" ] ]
neilchristanto/ValDashboard
[ "d62d04020081c114c67d80e52726ad827a180ba0" ]
[ "src/webparse.py" ]
[ "import re\r\nimport pandas as pd\r\n\r\nimport requests\r\nfrom lxml import html as lhtml\r\nfrom fake_useragent import UserAgent\r\n\r\nimport logging\r\n\r\nWS_TO_STR = 0\r\nWS_SRC = 1\r\nWS_PATH = 2\r\nWS_CACHE = 3\r\n\r\nclass WebParse:\r\n\r\n websource = {\r\n # Readable Source...
[ [ "pandas.DataFrame" ] ]
CkiChen/pymindaffectBCI
[ "0119145a8b280c776f4c4e6cd776fed0f0156404" ]
[ "mindaffectBCI/decoder/UtopiaDataInterface.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2019 MindAffect B.V. \n# Author: Jason Farquhar <jason@mindaffect.nl>\n# This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>.\n#\n# pymindaffectBCI is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Gen...
[ [ "numpy.minimum", "numpy.mean", "numpy.cumsum", "numpy.concatenate", "numpy.max", "numpy.random.random_integers", "numpy.log", "numpy.arange", "numpy.sqrt", "numpy.append", "numpy.vstack", "matplotlib.pyplot.subplot", "numpy.flatnonzero", "numpy.array", "...
thejasvibr/batracker
[ "def2ae9a0f18df0b9b95d67a203d2afd8be0f2ce" ]
[ "batracker/signal_detection/detection.py" ]
[ "'''\nDeals with the actual detection of signals in multichannel audio files. \nThere are two problems that need to solved while detecting a signal of interest.\n #. within-channel signal detection\n #. across-channel correspondence matching\n\nWithin-channel signal detection\n-------------------------------\...
[ [ "scipy.ndimage.label", "numpy.ones", "scipy.signal.butter", "scipy.signal.filtfilt", "numpy.arange", "scipy.signal.hilbert", "numpy.int32", "numpy.log10" ] ]
FlorianPfisterer/2D-LSTM-Seq2Seq
[ "1b07273fc73237259ae99eabfc509f54ad233ccf" ]
[ "test/test_lstm2d_cell.py" ]
[ "from unittest import TestCase\nimport torch\nfrom model.lstm2d_cell import LSTM2dCell\n\n\nclass LSTM2dCellTest(TestCase):\n \"\"\"\n Unit tests for the 2D-LSTM cell.\n \"\"\"\n embed_dim = 50\n encoder_state_dim = 20\n input_dim = 2 * encoder_state_dim + embed_dim\n cell_state_dim = 25\n b...
[ [ "torch.manual_seed", "torch.device", "torch.Tensor", "torch.randn" ] ]
colon3ltocard/pythonalgorithms
[ "60e2a46d4e53430570142f79e9930b02c3f89ed0" ]
[ "bidir_dijkstra.py" ]
[ "\"\"\"\nVisualizing bidirectionnal Dijkstra\nusing matplotlib\n\"\"\"\nimport sys\nfrom dataclasses import dataclass\nfrom heapq import heappush, heappop\nfrom itertools import permutations\nfrom collections import defaultdict\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport matplotlib.animation as...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "matplotlib.colors.ListedColormap" ] ]
lu-w/criticality-recognition
[ "5ad2e12699ad4bf2d7f60ce9e30f26110adce436" ]
[ "auto/auto_visualizer/auto_visualizer.py" ]
[ "# Visualizer is for debugging purposes only\nimport logging\nimport math\nimport random\nimport threading\nimport http.server\nimport socketserver\nimport os\nimport re\n\nfrom shapely import wkt\nimport matplotlib.pyplot as plt\nimport mpld3\nimport screeninfo\nimport tempfile\nimport webbrowser\nimport owlready2...
[ [ "matplotlib.pyplot.annotate", "numpy.isclose", "matplotlib.pyplot.arrow", "matplotlib.pyplot.fill", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.axis" ] ]
bamdada/UdacityProj10FinaltfModels
[ "db39ef826193d0802f644ba30397242a7272676e" ]
[ "research/object_detection/metrics/coco_tools.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 requ...
[ [ "numpy.full", "tensorflow.compat.v1.logging.info", "numpy.reshape", "numpy.ones", "numpy.asfortranarray", "numpy.squeeze", "tensorflow.compat.v1.gfile.GFile" ] ]
qilei123/FCOS
[ "53d355456460a2a45830e3953508f41173ddb9bf", "53d355456460a2a45830e3953508f41173ddb9bf" ]
[ "fcos_core/modeling/roi_heads/box_head/inference.py", "fcos_core/data/datasets/coco.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom torch import nn\r\n\r\nfrom fcos_core.structures.bounding_box import BoxList\r\nfrom fcos_core.structures.boxlist_ops import boxlist_nms\r\nfrom fcos_core.structures.boxlist_ops import...
[ [ "torch.nonzero", "torch.cat", "torch.full", "torch.nn.functional.softmax" ], [ "torch.as_tensor", "torch.tensor" ] ]
CurisZhou/bert4keras
[ "216f408b0501a1e6e6903c7a6271213d88f7725c" ]
[ "bert4keras/models.py" ]
[ "#! -*- coding: utf-8 -*-\n# 主要模型\n\nimport numpy as np\nfrom bert4keras.layers import *\nfrom bert4keras.snippets import insert_arguments\nfrom bert4keras.snippets import delete_arguments\nfrom bert4keras.snippets import is_string\nfrom keras.models import Model\nimport json\n\n\nclass Transformer(object):\n \"...
[ [ "numpy.concatenate", "numpy.dot", "numpy.random.randn", "numpy.sqrt", "numpy.average" ] ]
SagarRoy1996/TabularDataExtraction
[ "59b05dde00272e7f04f56b89bd2139e3a4e252e5" ]
[ "examples/eg1/eg1.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport os\nimport re\nfrom math import radians, degrees\n\nimport numpy as np\nimport pandas as pd\nimport cv2\n\nfrom pdftabextract import imgproc\nfrom pdftabextract.geom import pt\nfrom pdftabextract.common import read_xml, parse_pages, save_page_grids\nfrom pdftabextract.textboxes im...
[ [ "pandas.DataFrame", "numpy.array" ] ]
Leonardo-Blanger/detr_tensorflow
[ "38fc3c586b6767deed09bd7ec6c2a2fd7002346e" ]
[ "detr_tensorflow/models/custom_layers.py" ]
[ "import tensorflow as tf\n\n\nclass FrozenBatchNorm2D(tf.keras.layers.Layer):\n def __init__(self, eps=1e-5, **kwargs):\n super().__init__(**kwargs)\n self.eps = eps\n\n def build(self, input_shape):\n self.weight = self.add_weight(name='weight', shape=[input_shape[-1]],\n ...
[ [ "tensorflow.matmul", "tensorflow.math.rsqrt" ] ]
Zenodia/NeMo
[ "3c288d8a7caf667c95444c39434e3ebc5f53d911" ]
[ "nemo/collections/asr/metrics/rnnt_wer.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "torch.no_grad", "torch.tensor" ] ]
nathan-bennett/skellam
[ "8a1fff14ac8c5f6bd415a51befab818f864ab3e5" ]
[ "metrics/__init__.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nimport scipy\nfrom shared_utils import ArrayUtils\n\n\nclass SkellamMetrics:\n def __init__(self, x_metrics, y_metrics, y_hat, model, l0, l1, training_values):\n self._y = y_metrics\n self._y_hat = y_hat\n self.model = model\n self.l0 = Arra...
[ [ "numpy.diagflat", "numpy.dot", "numpy.log", "numpy.squeeze", "numpy.diag" ] ]
fluiddyn/transonic
[ "a460e9f6d1139f79b668cb3306d1e8a7e190b72d" ]
[ "doc/for_dev/scikit-image/setup_codes/cmorph__dilate.py" ]
[ "import numpy as np\nfrom future.cmorph import _dilate\n\nrows = 1024\ncols = 1024\nsrows = 64\nscols = 64\n\nimage = np.random.randint(0, 255, rows * cols, dtype=np.uint8).reshape(\n (rows, cols)\n)\nselem = np.random.randint(0, 1, srows * scols, dtype=np.uint8).reshape(\n (srows, scols)\n)\nout = np.zeros((...
[ [ "numpy.int8", "numpy.random.randint", "numpy.zeros" ] ]
cherisyu/ML_in_Action
[ "8c1019de911e7fb1bbab973067213f5f62ab9dcd" ]
[ "ML-in-Action/MachineLearning-dev/src/py3.x/ML/15.BigData_MapReduce/mrMeanMapper.py" ]
[ "#!/usr/bin/python\n# coding:utf-8\n\n'''\nCreated on 2017-04-06\nUpdate on 2017-11-17\nAuthor: Peter/ApacheCN-xy/片刻\nGitHub: https://github.com/apachecn/MachineLearning\n'''\n\nimport sys\nfrom numpy import mat, mean, power\n\n'''\n 这个mapper文件按行读取所有的输入并创建一组对应的浮点数,然后得到数组的长度并创建NumPy矩阵。\n 再对所有的值进行平方,最后将均值和平方后的...
[ [ "numpy.power", "numpy.mean", "numpy.mat" ] ]
amakropoulos/structural-pipeline-measures
[ "70e22f9ad94cc57e72e510576cfc3129da83f7fc" ]
[ "packages/structural_dhcp_mriqc/structural_dhcp_mriqc/qc/functional.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n# pylint: disable=no-member\n#\n# @Author: oesteban\n# @Date: 2016-02-23 19:25:39\n# @Email: code@oscaresteban.es\n# @Last Modified by: oesteban\n...
[ [ "numpy.zeros_like", "numpy.array", "numpy.savetxt", "numpy.dot", "numpy.zeros", "scipy.stats.mstats.zscore", "numpy.percentile", "numpy.genfromtxt", "numpy.diff", "numpy.eye", "numpy.where", "numpy.apply_along_axis", "numpy.vstack", "numpy.floor" ] ]
artberryx/SAR
[ "e6c79ea271f1033d5ea3c11556aff173adf6d941" ]
[ "sb/stable_baselines_ex/common/wrappers_ex.py" ]
[ "import gym\nimport numpy as np\nfrom gym import spaces\n\nfrom stable_baselines.common.running_mean_std import RunningMeanStd\n\n\nclass ScaleRewardEnv(gym.RewardWrapper):\n def __init__(self, env: gym.Env, scale):\n gym.RewardWrapper.__init__(self, env)\n self.scale = scale\n\n def reward(self...
[ [ "numpy.concatenate", "numpy.linalg.norm", "numpy.random.rand", "numpy.zeros", "numpy.random.randn", "numpy.sqrt", "numpy.clip" ] ]
Mahdi-Asadi/python_thesis
[ "6cb1dbe24fcf9133e971e64c91e1dde234250da9" ]
[ "RK45 - Copy.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.integrate import RK45\nf_out = \"E:\\\\1\\\\P_rk4.txt\" # address file for output\nf2 = open(f_out,\"w+\")\ndef du_dx(x,y):\n wa=1 # atomic frequency \n wp=0.6 # field frequency\n g=0.6 # coupling strength \n n = 1 # number...
[ [ "scipy.integrate.RK45", "numpy.arange", "numpy.sqrt" ] ]
PuffyPuffin/LO_user
[ "c7cafc2045b027aad0098d034cbe2b70126c8379" ]
[ "tracker/tracker/user_tracker.py" ]
[ "\"\"\"\nCode for particle tracking, designed for ROMS output. This new version\nmakes extensive use of nearest-neighbor KDTree algorithms for interpolation.\nThis results is significantly (36x) faster runtimes compared with old version.\n\nPERFORMANCE: about 3 minutes per day for a 3D cas6 experiment with 10k par...
[ [ "numpy.min" ] ]
BryanRacic/pandas
[ "21c299194a2b59a715fa7264bd6b44787deafc7a" ]
[ "pandas/core/base.py" ]
[ "\"\"\"\nBase and utility classes for pandas objects.\n\"\"\"\n\nfrom __future__ import annotations\n\nimport textwrap\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Generic,\n Hashable,\n Literal,\n TypeVar,\n cast,\n final,\n)\n\nimport numpy as np\n\nimport pandas._libs.lib as lib\nfrom ...
[ [ "pandas.core.algorithms.value_counts", "pandas.core.algorithms.factorize", "pandas._libs.lib.memory_usage_of_objects", "pandas.compat.numpy.function.validate_max", "pandas.core.construction.extract_array", "pandas.core.ops.get_op_result_name", "pandas.core.ops.maybe_prepare_scalar_for_...
lukamaletin/multi-gan
[ "53b37c840d74ed0a9db888a03a5bed59ad33bc8e" ]
[ "src/util.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom PIL import Image\n\n\ndef make_trainable(net, val):\n net.trainable = val\n for layer in net.layers:\n layer.trainable = val\n\n\ndef plot_loss(losses):\n plt.figure(figsize=(10, 8))\n plt.plot(losses['g'], label='generative ...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.show", "numpy.squeeze" ] ]
GBR-613/pyod
[ "dfafc57f74dc3d49d0166f21ab2ddb97e3d1d898", "dfafc57f74dc3d49d0166f21ab2ddb97e3d1d898", "bfbb297ac067c47488bcade77669c99de5a4838a" ]
[ "pyod/models/sod.py", "examples/generate_data_categorical_example.py", "pyod/test/test_cof.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Subspace Outlier Detection (SOD)\n\"\"\"\n# Author: Yahya Almardeny <almardeny@gmail.com>\n# License: BSD 2 clause\n\nimport numpy as np\nimport numba as nb\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.utils import check_array\n\nfrom ..utils.utility import check_par...
[ [ "numpy.square", "numpy.empty", "numpy.zeros", "numpy.sum", "numpy.mean", "numpy.argsort", "sklearn.utils.check_array", "numpy.iinfo", "sklearn.neighbors.NearestNeighbors", "numpy.var" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.title", "numpy.ravel", ...
matchms/old-iomega-spec2vec
[ "216b8f8b5e4ffd320b4575326a05fb6c7cd28223" ]
[ "matchms/old/ms_similarity_classical.py" ]
[ "#\n# Spec2Vec\n#\n# Copyright 2019 Netherlands eScience Center\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 req...
[ [ "numpy.max", "numpy.array", "numpy.ceil", "numpy.zeros", "numpy.lexsort", "numpy.round", "numpy.sum", "numpy.ones", "numpy.load", "numpy.min", "numpy.save", "scipy.optimize.linear_sum_assignment", "numpy.where", "numpy.abs", "scipy.spatial.distance.cdist...
rsumner31/pymc3-2
[ "e824294ddfb45610536cad07394b8c290904c38d", "e824294ddfb45610536cad07394b8c290904c38d", "fde52a4a69be1b0887a2f7861801fb48c941bbe6" ]
[ "pymc3/distributions/mixture.py", "pymc3/plots/artists.py", "pymc3/gp/util.py" ]
[ "import numpy as np\nimport theano.tensor as tt\n\nfrom pymc3.util import get_variable_name\nfrom ..math import logsumexp\nfrom .dist_math import bound\nfrom .distribution import Discrete, Distribution, draw_values, generate_samples\nfrom .continuous import get_tau_sd, Normal\n\n\ndef all_discrete(comp_dists):\n ...
[ [ "numpy.arange", "numpy.squeeze", "numpy.random.choice", "numpy.broadcast" ], [ "numpy.max", "numpy.median", "numpy.min", "numpy.exp", "numpy.argmax" ], [ "numpy.max", "numpy.int", "numpy.asarray", "scipy.cluster.vq.kmeans", "numpy.percentile", "m...
zonemercy/Kaggle
[ "35ecb08272b6491f5e6756c97c7dec9c46a13a43" ]
[ "quora/pyfm/generate_interaction.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import OneHotEncoder,LabelEncoder,StandardScaler\nfrom sklearn.decomposition import TruncatedSVD,PCA\nfrom sklearn.metrics.pairwise import cosine_similarity,pairwise_distances\nfrom sklearn.feature_extraction.text import TfidfVectorizer...
[ [ "numpy.random.seed", "pandas.read_csv", "pandas.to_pickle", "pandas.concat" ] ]
menchelab/UMAPanalysis
[ "09f9b4a7823f6eceb6b40e25ee21412f3bf1c7fe" ]
[ "src/classification/predict_with_umap.py" ]
[ "import sys\nimport re\nimport pandas as pd\n\nnetwork_filename = sys.argv[1]\nm = re.match(\"networks/(?P<dataset>.*?)_similarity\", network_filename)\ndataset = m.groupdict()['dataset']\n\n\nG=nx.read_gml(network_filename)\nlabels=pd.read_csv(f\"munged_data/{dataset}/labels.csv\", index_col=0)\nmetadata = pd.read...
[ [ "pandas.read_csv", "pandas.Series" ] ]
SimoneDeGasperis/telluric
[ "2fe4388f4a69a5a939078a876943c5f4620693ca" ]
[ "tests/test_georaster_tiling.py" ]
[ "import os\nimport rasterio\nimport mercantile\nimport numpy as np\n\nimport pytest\nfrom tempfile import NamedTemporaryFile, TemporaryDirectory\n\nfrom affine import Affine\n\nfrom unittest import TestCase\nfrom unittest.mock import patch\nfrom datetime import datetime\nfrom shapely.geometry import Polygon\n\nfrom...
[ [ "numpy.array", "numpy.ma.array", "numpy.arange", "numpy.flip", "numpy.repeat", "numpy.unique" ] ]
vietnamican/Deep-Image-Matting
[ "436487e680027f07387700fb8ee1486635b82335", "436487e680027f07387700fb8ee1486635b82335" ]
[ "segnet_v7.py", "train_segnet_v4_google_colab.py" ]
[ "import tensorflow.keras.backend as K\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Input, Conv2D, UpSampling2D, BatchNormalization, ZeroPadding2D, MaxPooling2D, Reshape, \\\n Concatenate, Lambda\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.utils import multi_gpu_model\nfrom ...
[ [ "tensorflow.keras.backend.int_shape", "tensorflow.keras.layers.Lambda", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Reshape", "tensorflow.keras.utils.multi_gpu_model", "tensorflow.keras.layers.Co...
gar-syn/congo-lab
[ "dc50af4e35903556bc8bc34dc23a7a708c1f5422" ]
[ "src/octopus/image/source.py" ]
[ "# System Imports\nimport cv2\nimport json\nfrom typing import Optional\n\n# Library imports\nimport numpy\n\n# Twisted Import\nfrom twisted.internet import reactor, defer, threads, protocol\nfrom twisted.internet.endpoints import TCP4ClientEndpoint\nfrom twisted.internet.interfaces import IAddress\n\n# Package Imp...
[ [ "numpy.frombuffer" ] ]
Oneflow-Inc/libai
[ "e473bd3962f07b1e37232d2be39c8257df0ec0f3" ]
[ "libai/data/datasets/bert_dataset.py" ]
[ "# coding=utf-8\n# Copyright 2021 The OneFlow 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...
[ [ "numpy.arange", "numpy.random.RandomState" ] ]
neggert/pytorch-lightning
[ "8208c330eb1a4e8cca243ee525882854dd366921" ]
[ "pytorch_lightning/trainer/training_loop.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "numpy.argmax", "torch.isfinite", "numpy.cumsum" ] ]
yeong35/MusicTransformer-Pytorch
[ "5cd5e1bab8dfa0ed605089d7f41430e6e0596dc8" ]
[ "train.py" ]
[ "import os\nimport csv\nimport shutil\nfrom datetime import datetime\nfrom numpy import logspace\n\nimport torch\nimport torch.nn as nn\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom torch.utils.data import DataLoader\nfrom torch.optim import Adam\n\nfrom dataset.e_piano import create_epiano_datasets, create_...
[ [ "torch.utils.data.ConcatDataset", "torch.nn.MSELoss", "torch.nn.CrossEntropyLoss", "torch.Generator", "torch.utils.data.DataLoader", "torch.load", "torch.optim.lr_scheduler.LambdaLR", "torch.utils.tensorboard.SummaryWriter" ] ]
littlewatkins/nepc
[ "3e16e3a9622ca0ebb4484c9e4af253046367773a" ]
[ "tests/test_mysql_build.py" ]
[ "from nepc import nepc\nfrom nepc.util import util\nimport pandas as pd\nimport os\nimport pytest\nimport platform\n# TODO: remove dependence on csv; put function in scraper that uses built-in\n# readlines function\nimport csv\n\n# TODO: test that all values in [nepc]/tests/data are in the nepc database\n\n@p...
[ [ "pandas.read_csv" ] ]
hanhejia/SSD
[ "0c5684ad786768b46b119fb503f4f7174e2c78ed" ]
[ "yassd/testing_utils/videotest.py" ]
[ "\"\"\" A class for testing a SSD model on a video file or webcam \"\"\"\n\nimport cv2\nimport keras\nfrom keras.applications.imagenet_utils import preprocess_input\nfrom keras.backend.tensorflow_backend import set_session\nfrom keras.models import Model\nfrom keras.preprocessing import image \nimport pickle\nimpor...
[ [ "numpy.array", "numpy.zeros" ] ]
WZX1998/facial-recognition
[ "3284445abde438c0ae77807eeaf53bb5d1e06308" ]
[ "src/dataset_creator.py" ]
[ "import logging\nimport pickle\nimport os\nimport sys\nimport json\nimport cv2\nimport numpy as np\nimport glob\nimport tqdm\n\nsys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))\nimport src\nfrom src.__init__ import *\n\n\ndef image_reader(image_path_list):\n \n image = cv2.imread(image_path...
[ [ "numpy.reshape", "numpy.random.shuffle", "numpy.expand_dims" ] ]
RomeroBarata/upt
[ "6f953e7a61c31cf608aef9a77b0af3ae8e1f6594" ]
[ "main.py" ]
[ "\"\"\"\nUtilities for training, testing and caching results\nfor HICO-DET and V-COCO evaluations.\n\nFred Zhang <frederic.zhang@anu.edu.au>\n\nThe Australian National University\nAustralian Centre for Robotic Vision\n\"\"\"\n\nimport os\nimport sys\nimport torch\nimport random\nimport warnings\nimport argparse\nim...
[ [ "torch.nonzero", "torch.optim.AdamW", "torch.optim.lr_scheduler.StepLR", "torch.distributed.init_process_group", "numpy.random.seed", "torch.no_grad", "torch.utils.data.DistributedSampler", "torch.multiprocessing.spawn", "torch.utils.data.SequentialSampler", "torch.manual_s...
Tevien/NNDrone
[ "76dce457324ea03a8757d74f6403fbf60132294b" ]
[ "nndrone/converters.py" ]
[ "import numpy as np\nimport pickle\nimport math\n\ntry:\n from utilities import dot_loss, next_batch\nexcept ImportError:\n from utilities.utilities import dot_loss, next_batch\n\nclass DontCacheRef(Exception):\n pass\n\nclass BasicConverter(object):\n def __init__(self, learning_rate = 0.05, batch_size...
[ [ "numpy.array", "numpy.asarray", "numpy.exp", "numpy.average", "numpy.random.ranint", "numpy.expand_dims" ] ]
ucgmsim/gmhazard
[ "d3d90b4c94b3d9605597a3efeccc8523a1e50c0e", "d3d90b4c94b3d9605597a3efeccc8523a1e50c0e" ]
[ "calculation/gmhazard_calc/gmhazard_calc/nz_code/nzs1170p5/nzs_zfactor_2016/ll2z.py", "calculation/spatial_hazard/spatial_hazard/scripts/generate_realisations.py" ]
[ "#!/usr/bin/env python\n\nimport os\n\nfrom matplotlib.path import Path\nimport numpy as np\nimport pandas as pd\nfrom scipy.interpolate import griddata\n\nfrom qcore import geo\n\nDATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), \"zdata\")\n\n# constant regions and max bounds for faster processing\n...
[ [ "numpy.concatenate", "numpy.isnan", "numpy.where", "numpy.any", "numpy.loadtxt", "numpy.repeat" ], [ "numpy.all", "pandas.DataFrame", "pandas.read_csv" ] ]
Pavan-Samtani/CGP-CNN-v2
[ "2eede8297542b7551d5ef5bf11aeeaba34bf4f3f" ]
[ "cgp.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport csv\nimport time\nimport numpy as np\nimport math\nimport os\n\n\n# gene[f][c] f:function type, c:connection (nodeID)\nclass Individual(object):\n\n def __init__(self, net_info, init):\n self.net_info = net_info\n self.gene = np.zeros((self....
[ [ "numpy.array", "numpy.empty", "numpy.random.rand", "numpy.zeros", "numpy.where", "numpy.arange", "numpy.random.randint", "numpy.argsort", "numpy.cumsum" ] ]
oesst/HRTF_neural_model
[ "494d29c514eaad3aee575f77d08a59a9d011a415" ]
[ "src/data/generateData.py" ]
[ "# -*- coding: utf-8 -*-\nimport click\nimport logging\nfrom pathlib import Path\n\nfrom os import listdir\nfrom os.path import isfile, join\n\nimport numpy as np\nimport soundfile as sf\nfrom scipy import io\nimport scipy.signal as sp\nfrom src.features import gtgram\n\nROOT = Path(__file__).resolve().parents[2]\n...
[ [ "numpy.array", "numpy.load", "numpy.mean", "numpy.arange", "scipy.signal.lfilter", "numpy.random.random", "numpy.log10", "numpy.squeeze" ] ]
manoil/Deep_VoiceChanger
[ "5cd3d6ff2a8a9eea3b8fae1c0e6ed2d00012b771" ]
[ "nets/block.py" ]
[ "import math\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\nimport numpy as np\nfrom .sn_convolution_2d import SNConvolution2D, SNDeconvolution2D\nfrom .sn_linear import SNLinear\n\ndef _upsample(x):\n h, w = x.shape[2:]\n return F.unpooling_2d(x, 2, outsize=(h * 2, w * 2))\n\ndef ...
[ [ "numpy.prod" ] ]
etmwb/cvsegmentation
[ "c283a79f4cf4e78d057f598944b1c252f6533f00" ]
[ "cvss/datasets/nyuv2.py" ]
[ "import os\r\nimport sys\r\nimport numpy as np\r\nimport random\r\nimport math\r\nfrom PIL import Image, ImageOps, ImageFilter\r\n\r\nimport torch\r\nimport torch.utils.data as data\r\nimport torchvision.transforms as transform\r\n\r\nfrom .base import BaseDataset\r\n\r\nclass NYUv2Segmentation(BaseDataset):\r\n ...
[ [ "numpy.array", "numpy.random.uniform", "torch.from_numpy" ] ]
nehz/librosa
[ "0dcd53f462db124ed3f54edf2334f28738d2ecc6" ]
[ "librosa/decompose.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nSpectrogram decomposition\n=========================\n.. autosummary::\n :toctree: generated/\n\n decompose\n hpss\n nn_filter\n\"\"\"\n\nimport numpy as np\n\nimport scipy.sparse\nfrom scipy.ndimage import median_filter\n\nimport sklearn.decompos...
[ [ "numpy.take", "numpy.iscomplexobj", "scipy.ndimage.median_filter", "numpy.isscalar", "numpy.empty_like" ] ]
enricoros/glow
[ "49cf6972ce0cb25cea66f9ed39d32add5eeef130" ]
[ "torch_glow/tests/nodes/conv2d_test.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport torch_glow\nfrom collections import namedtuple\n\nfrom tests.utils import jitVsGlow\n\n# Basic test of the PyTorch conv2d Node on Glow.\ndef test_conv2d_basic():\n\n def conv2d_basic(inputs, filters):\n conv = F.conv2d(inputs, filters, padding=1)\n ...
[ [ "torch.nn.functional.relu", "torch.nn.functional.conv2d", "torch.randn" ] ]
MatthewGong/DiffractionClassification
[ "68be6cf3960f09388253c79bab13cbd9dc07edbb" ]
[ "DiffractionClassifierCombinatorial2.0.py" ]
[ "import ClientSide2 #custom package\n\nimport numpy as np\nimport argparse\nimport json\nimport os\nimport ClassifierFunctions2 as cf\nimport random\nimport logging\n\nfrom matplotlib import pyplot as plt\nfrom builtins import input\n\nfrom Notation import SpaceGroupsDict as spgs\nSpGr = spgs.spacegroups()\n\n\n\nf...
[ [ "numpy.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "numpy.prod", "numpy.vstack", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf", "matplotlib.pyplot.bar", "mat...
edupooch/cxr-domain-shift
[ "9e88f82e3d42f660e9f79723adb8a733d0a0e5e3" ]
[ "nih/loader.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom torch.utils.data import Dataset\nimport os\nfrom PIL import Image\n\n\nclass CXRDataset(Dataset):\n\n def __init__(\n self,\n path_to_images,\n fold,\n transform=None,\n sample=0,\n finding=\"any\",):...
[ [ "pandas.read_csv" ] ]
ITMO-NSS-team/LightObjRecEnsembler
[ "1375400f0a681aefdd3ab484e828257fd7aed318" ]
[ "baseline/fast_rcnn/trainer.py" ]
[ "from __future__ import absolute_import\nimport os\nfrom collections import namedtuple\nimport time\nfrom torch.nn import functional as F\nfrom baseline.fast_rcnn.model.utils.creator_tool import AnchorTargetCreator, ProposalTargetCreator\n\nfrom torch import nn\nimport torch as t\nfrom baseline.fast_rcnn.utils impo...
[ [ "torch.zeros", "torch.device", "torch.arange", "torch.save", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
jeremycward/ipp-core
[ "c3dbebaf997b045da8385cb3dfab46820e40afda" ]
[ "venv/Scripts/f2py.py" ]
[ "#!c:\\users\\jerem\\dev\\ipp-core\\venv\\scripts\\python.exe\n# See http://cens.ioc.ee/projects/f2py2e/\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfor mode in [\"g3-numpy\", \"2e-numeric\", \"2e-numarray\", \"2e-numpy\"]:\n try:\n i = sys.argv.index(\"--\" + mode)\n ...
[ [ "numpy.f2py.main" ] ]
lyhue1991/Hypernets
[ "d726bd297869eacb0cba84376fbac30206bbb60a" ]
[ "hypernets/tests/tabular/tb_cuml/drift_detection_test.py" ]
[ "# -*- coding:utf-8 -*-\n\"\"\"\n\n\"\"\"\nimport pandas as pd\nfrom pandas.util import hash_pandas_object\n\nfrom hypernets.tabular.datasets.dsutils import load_bank\nfrom . import if_cuml_ready, is_cuml_installed\n\nif is_cuml_installed:\n import cudf\n from hypernets.tabular.cuml_ex import CumlToolBox\n\n ...
[ [ "pandas.util.hash_pandas_object", "pandas.concat" ] ]
mariodoebler/byol-pytorch
[ "4c1b6d27d86e0a9a39ecef6f6888038355943cd0" ]
[ "byol_pytorch/byol_pytorch.py" ]
[ "import copy\n\nfrom functools import wraps\n\nimport numpy as np\n\nimport wandb\nimport torchvision\nimport torch\nimport torch.nn.functional as F\n\nfrom kornia import enhance, filters\nfrom torchvision.transforms import RandomApply, RandomChoice\nfrom atariari.methods.utils import EarlyStopping\n\nfrom torch im...
[ [ "torch.nn.Linear", "torch.nn.functional.normalize", "torch.rand", "torch.stack", "torch.no_grad", "torch.nn.ReLU", "numpy.random.uniform", "torch.nn.BatchNorm1d", "torch.cuda.is_available" ] ]
Hacker-007/E2
[ "efb829da84734abfc6ac10e1ea20b5dcfd99c7f1" ]
[ "prepare_datasets_DRIVE.py" ]
[ "#==========================================================\n#\n# This prepare the hdf5 datasets of the DRIVE database\n#\n#============================================================\n\nimport os\nimport h5py\nimport numpy as np\nfrom PIL import Image\n\n#content/add2/E2/DRIVE_datasets_training_testing\n\ndef w...
[ [ "numpy.max", "numpy.empty", "numpy.reshape", "numpy.asarray", "numpy.min", "numpy.transpose" ] ]
afard/VerticaPy
[ "ecbee0027a208ba53b31438e5b2f4577af95a07e" ]
[ "verticapy/learn/tsa.py" ]
[ "# (c) Copyright [2018-2021] Micro Focus or one of its affiliates.\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 require...
[ [ "matplotlib.pyplot.subplots" ] ]
jiachengxu/io
[ "0ef0f21193d7a48c50f8cddeaa1f0fb3056040ea" ]
[ "tensorflow_io/hadoop/python/ops/hadoop_dataset_ops.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.convert_to_tensor", "tensorflow.TensorShape" ] ]
chrisroadmap/Near_term_warming
[ "7fc712fdcbf135bc3a73027b1c7b5a3504c5ea5e" ]
[ "analysis_figure_code/SuppFig2/SuppFig2.py" ]
[ "import numpy as np\nimport numpy.ma as npma\nfrom scipy import stats\nimport matplotlib.pyplot as plt\nimport baspy as bp\nimport fnmatch\n\n\"\"\"\nCreated on Wed Nov 27 18:34 2019\n\n@author: Christine McKenna\n\n========================================================================\nPurpose: Plots Supp Fig 2,...
[ [ "numpy.zeros", "numpy.ones", "numpy.load", "scipy.stats.linregress", "matplotlib.pyplot.subplots", "numpy.save", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.subplots_adjust", "numpy.unique" ] ]
zbzhu99/SMARTS
[ "652aa23e71bd4e2732e2742140cfcd0ec082a7da" ]
[ "smarts/core/tests/test_sensors.py" ]
[ "# MIT License\n#\n# Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without ...
[ [ "numpy.array" ] ]
ultimus11/Foreground-Detection-OpenCV
[ "910d6ffa2d37b999ed746ebc69da289d9b48bdf1" ]
[ "code/grab_foreground.py" ]
[ "import numpy as np\r\nimport cv2\r\nimport matplotlib.pyplot as plt\r\n\r\n#read image\r\nimg = np.array(cv2.imread('1.jpg'))\r\n\r\n#this is mask\r\nmask = np.zeros(img.shape[:2],np.uint8)\r\n\r\n#this bgdModel and fgdModel is used in background\r\nbgdModel = np.zeros((1,65),np.float64)\r\nfgdModel = np.zeros((1,...
[ [ "matplotlib.pyplot.colorbar", "numpy.zeros", "numpy.where", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
xuhongzuo/Outlier-Interpretation
[ "9bc2dbedcb7b89d0e4ecf7cea2a60612ab19ae4a" ]
[ "model_aton/datasets.py" ]
[ "\"\"\"\nThis script implements an outlier interpretation method of the following paper:\n\"Beyond Outlier Detection: Outlier Interpretation by Attention-Guided Triplet Deviation Network\". in WWW'21.\n@ Author: Hongzuo Xu\n@ email: hongzuo.xu@gmail.com or leogarcia@126.com or xuhongzuo13@nudt.edu.cn\n\"\"\"\n\n\ni...
[ [ "numpy.array", "numpy.random.choice", "numpy.setdiff1d", "torch.FloatTensor", "numpy.ones", "numpy.where", "torch.LongTensor", "numpy.arange", "numpy.hstack", "sklearn.neighbors.NearestNeighbors" ] ]
adammichaelwood/agents
[ "66ad01b9ae909bc6c344b8f0cb356758cae95236", "66ad01b9ae909bc6c344b8f0cb356758cae95236", "66ad01b9ae909bc6c344b8f0cb356758cae95236", "66ad01b9ae909bc6c344b8f0cb356758cae95236" ]
[ "tf_agents/environments/random_py_environment_test.py", "tf_agents/utils/composite_test.py", "tf_agents/agents/ddpg/critic_rnn_network.py", "tf_agents/networks/value_rnn_network.py" ]
[ "# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b...
[ [ "numpy.all", "numpy.array", "numpy.ones" ], [ "tensorflow.random.uniform", "tensorflow.test.main", "tensorflow.scatter_nd" ], [ "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.equal", "tensorflow.reshape", "tensorflow.nest.flatten", "tensorflow.ke...
s-scherrer/qa4sm-preprocessing
[ "dbb6dea8e4d34b69ee4d5f82f0a0028294d45170" ]
[ "src/qa4sm_preprocessing/nc_image_reader/transpose.py" ]
[ "import copy\nimport dask\nimport dask.array as da\nfrom dask.distributed import Client\nimport datetime\nimport logging\nimport math\nfrom multiprocessing.pool import ThreadPool\nimport numpy as np\nfrom pathlib import Path\nfrom tqdm.auto import tqdm\nfrom typing import Union, TypeVar, Tuple\nimport xarray as xr\...
[ [ "numpy.prod" ] ]
skylarch/Paddle
[ "d58d8df6f5f7aa6fd2f0780f87475055db57a80d" ]
[ "python/paddle/fluid/tests/unittests/test_while_op.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.sum", "numpy.random.random" ] ]
CFD-lab-ZJU/PetIBM
[ "59c9ddd7373c2f4659761ca425db05491069c601" ]
[ "examples/decoupledibpm/flatplate3dRe100AoA30_GPU/scripts/createBody.py" ]
[ "\"\"\"\nCreate a flat plate of length 1.0 with aspect ratio 2.0 and a 30-degree\ninclination.\nThe plate is discretized with spacing 0.04 in the x-y plane and with spacing\n0.04 along the z-direction.\n\"\"\"\n\nimport math\nimport pathlib\nimport numpy\n\n\n# Flat-plate's parameters.\nL = 1.0 # chord length\nAR ...
[ [ "numpy.radians", "numpy.linspace", "numpy.ones" ] ]
Singular-Brain/ProjectBrain
[ "2d22d45c13a86825c0dcaf517a59e02f2c4f6164", "2d22d45c13a86825c0dcaf517a59e02f2c4f6164" ]
[ "bindsnet_master/examples/breakout/random_network_baseline.py", "bindsnet_master/test/network/test_monitors.py" ]
[ "import torch\nimport argparse\n\nfrom bindsnet.network import Network\nfrom bindsnet.learning import Hebbian\nfrom bindsnet.pipeline import EnvironmentPipeline\nfrom bindsnet.encoding import bernoulli\nfrom bindsnet.network.monitors import Monitor\nfrom bindsnet.environment import GymEnvironment\nfrom bindsnet.net...
[ [ "torch.manual_seed", "torch.rand", "torch.set_default_tensor_type", "torch.cuda.manual_seed_all" ], [ "torch.Size", "torch.rand" ] ]
rcmalli/polimi-dl-project
[ "5bf26a8e930dc98fe59a74bc473ddc74ff7dd201", "5bf26a8e930dc98fe59a74bc473ddc74ff7dd201" ]
[ "tools/unpool_test.py", "tools/create_output_images.py" ]
[ "from src.model import unpool_resize,unpool_deconv, unpool_checkerboard, unpool_simple\nfrom tensorflow.keras.layers import Input, UpSampling2D\nfrom tensorflow.keras.models import Model\n\ninput = Input(shape=(20, 20, 3))\n\nout1 = unpool_resize(input)\nmodel1 = Model(inputs=input, outputs=out1)\nprint(\"\")\n\nou...
[ [ "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.layers.Input", "tensorflow.keras.models.Model" ], [ "numpy.array", "numpy.reshape", "tensorflow.keras.applications.resnet50.preprocess_input", "tensorflow.keras.preprocessing.image.img_to_array", "tensorflow.keras.backen...
ria-ee/monitor
[ "d5cb9384abf38394b35e760729649136cbbc7548" ]
[ "analysis_module/analyzer/AnalyzerDatabaseManager_tmp.py" ]
[ "# _tmp_\nimport datetime\nfrom copy import deepcopy\n# _tmp_\nfrom pymongo import MongoClient\nimport pymongo\nimport pandas as pd\nimport numpy as np\nimport sys\n\npd.options.mode.chained_assignment = None\n\n\nclass AnalyzerDatabaseManager(object):\n\n def __init__(self, db_config, config):\n self._db...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.isnull", "pandas.concat" ] ]
BRAINSia/MONAI
[ "04e1c345fc840f5a1b6504ee5857d5a9feb27d84" ]
[ "monai/handlers/checkpoint_loader.py" ]
[ "# Copyright 2020 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to i...
[ [ "torch.load" ] ]
DeniseMak/ner-neuron
[ "d7ca8a2b1f5652b42892b4bda9b07a2e4edd09db" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: Jie\n# @Date: 2017-06-15 14:11:08\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2019-02-13 12:41:44\n\nfrom __future__ import print_function\nimport time\nimport sys\nimport argparse\nimport random\nimport torch\nimport gc\nimport tor...
[ [ "torch.cuda.is_available", "torch.LongTensor", "torch.load", "numpy.save", "torch.manual_seed", "numpy.transpose", "numpy.argmax", "torch.Tensor", "numpy.vstack", "torch.zeros", "numpy.delete", "numpy.zeros", "matplotlib.pyplot.title", "numpy.stack", "ma...
0reza/mne-python
[ "da02a256423404a81929d6de278bc63d3192a280", "da02a256423404a81929d6de278bc63d3192a280" ]
[ "mne/forward/tests/test_field_interpolation.py", "mne/viz/tests/test_topo.py" ]
[ "from os import path as op\n\nimport numpy as np\nfrom numpy.polynomial import legendre\nfrom numpy.testing import (assert_allclose, assert_array_equal, assert_equal,\n assert_array_almost_equal)\nfrom scipy.interpolate import interp1d\n\nimport pytest\n\nimport mne\nfrom mne.forward impor...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.empty", "numpy.cumprod", "numpy.zeros", "numpy.testing.assert_equal", "numpy.random.RandomState", "numpy.sum", "numpy.testing.assert_array_equal", "numpy.polynomial.legendre.legvander", "numpy.testing.assert_array_a...
sczyz/radioxenon_ml
[ "73398f0060e88616c7652a72bdedf7f93ea17a20" ]
[ "ml_rxe.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 9 14:25:47 2018\n\n@author: Steven\n\"\"\"\nimport sys\nimport argparse\n\nfrom radioxenon_ml.read_in import ml_matrix_composition as mlmc\nfrom radioxenon_ml.solve import iterate\nimport numpy as np\n\"\"\"\nimport radioxenon_ml.read_in.ml_matrix_composition\ni...
[ [ "numpy.array", "numpy.shape" ] ]
JGoldstone/colour
[ "6829b363d5f0682bff0f4826995e7ceac189ff28", "6829b363d5f0682bff0f4826995e7ceac189ff28", "6829b363d5f0682bff0f4826995e7ceac189ff28" ]
[ "colour/recovery/tests/test__init__.py", "colour/geometry/tests/test_section.py", "colour/algebra/regression.py" ]
[ "# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nDefines the unit tests for the :mod:`colour.recovery` module.\n\"\"\"\n\nimport numpy as np\nimport unittest\n\nfrom colour.colorimetry import (\n MSDS_CMFS,\n SDS_ILLUMINANTS,\n SpectralShape,\n reshape_msds,\n reshape_sd,\n sd_to_XYZ_inte...
[ [ "numpy.array" ], [ "numpy.array" ], [ "numpy.transpose", "numpy.atleast_2d" ] ]
3DAlgoLab/pyqtgraph
[ "6b4385ce0d0f9078aa22e2e27aa5307271e95ae1", "6b4385ce0d0f9078aa22e2e27aa5307271e95ae1" ]
[ "examples/VideoSpeedTest.py", "examples/multiplePlotSpeedTest.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTests the speed of image updates for an ImageItem and RawImageWidget.\nThe speed will generally depend on the type of data being shown, whether\nit is being scaled and/or converted by lookup table, and whether OpenGL\nis used by the view widget\n\"\"\"\n\n## Add path to library (ju...
[ [ "numpy.clip" ], [ "numpy.empty", "numpy.ones", "numpy.arange", "numpy.random.random", "numpy.linspace" ] ]
brittwitham/brexit-word-freq
[ "943c9c83aee30d2866571a6b07ad1895a73c02de" ]
[ "brexit-word-freq/app.py" ]
[ "import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\nimport plotly.graph_objs as go\nfrom pymongo import MongoClient\nimport json\nimport os\n \nclient = MongoClient(os.environ.get(\"DATABASE\"))\ndb = client.politics.brexit\n\n\nexternal_stylesheets = ['https:...
[ [ "pandas.json_normalize" ] ]
okotaku/pet_finder
[ "380e4f19172e06e92b5b752f59e2902efa6aee1f" ]
[ "code/exp/v18.py" ]
[ "# -*- coding: utf-8 -*-\n'''\nfeature: v1, 2, 3, 4, 10, 11\nfeature: v1, 2, 3, 4, 11, 13, 14, 17, 18, 19, 22, 23\nmodel: v10\n'''\nimport itertools\nimport json\nimport gc\nimport glob\nimport os\nimport time\nimport cv2\nimport re\nimport nltk\nimport torch\nimport imagehash\nimport lightgbm as lgb\nimport xgboos...
[ [ "numpy.median", "numpy.min", "numpy.mean", "numpy.where", "sklearn.feature_extraction.text.CountVectorizer", "pandas.concat", "pandas.read_csv", "scipy.stats.rankdata", "numpy.issubdtype", "numpy.max", "sklearn.feature_extraction.text._document_frequency", "numpy.em...
navivokaj/segmentation_models.pytorch
[ "5dbb5f6733515097cecc93f078c09e59ccbeb0c0" ]
[ "segmentation_models_pytorch/decoders/unet/decoder.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom segmentation_models_pytorch.base import modules as md\n\n\nclass DecoderBlock(nn.Module):\n def __init__(\n self,\n in_channels,\n skip_channels,\n out_channels,\n use_batchnorm=True,\n attenti...
[ [ "torch.nn.functional.interpolate", "torch.cat", "torch.nn.Identity", "torch.nn.ModuleList" ] ]
DidierRLopes/timeseries-cv
[ "c886670ba0c8c347b12639ec4a6fb549457c1ef1" ]
[ "tsxv/splitTrainVal.py" ]
[ "\"\"\"\nForward Chaining, K-Fold and Group K-Fold algorithms to split a given training dataset into train (X, y) and validation (Xcv, ycv) sets\n\"\"\"\n\nimport numpy as np\n\ndef split_train_val_forwardChaining(sequence, numInputs, numOutputs, numJumps):\n \"\"\" Returns sets to train and cross-validate a mod...
[ [ "numpy.array", "numpy.arange" ] ]
aricsanders/pyMez3
[ "13e2b9900af2287db0cc42a0190d31da165ce174" ]
[ "Code/DataHandlers/GraphModels.py" ]
[ "#-----------------------------------------------------------------------------\n# Name: GraphModels\n# Purpose: To store graphs used in network translations\n# Author: Aric Sanders\n# Created: 4/6/2016\n# License: MIT License\n#---------------------------------------------------------------...
[ [ "numpy.concatenate", "numpy.matrix" ] ]
mdietrichstein/skpredict
[ "f15416b61f5fc2693b4c85c690d664fbbb008f8b" ]
[ "tests/svm/conftest.py" ]
[ "import pytest\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\nTEST_SIZE = 0.33\nRANDOM_STATE = 42\n\n\n@pytest.fixture(scope=\"module\")\ndef binary_dataset():\n df = pd.read_csv(\"./resources/heart.csv\")\n features = df.iloc[0:, :-1]\n labels = df.iloc[0:, -1].values.ravel(...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
Michellemingxuan/stanford_cs231n
[ "b1d0a5a4a3b2fe5d685e34a4ebd810cbc56ec143", "b1d0a5a4a3b2fe5d685e34a4ebd810cbc56ec143" ]
[ "assignments/2021/assignment1/cs231n/classifiers/k_nearest_neighbor.py", "assignments/2021/assignment1/cs231n/classifiers/softmax.py" ]
[ "from builtins import range\nfrom builtins import object\nimport numpy as np\nfrom past.builtins import xrange\n\n\nclass KNearestNeighbor(object):\n \"\"\" a kNN classifier with L2 distance \"\"\"\n\n def __init__(self):\n pass\n\n def train(self, X, y):\n \"\"\"\n Train the classifie...
[ [ "numpy.sum", "numpy.argmax", "numpy.zeros", "numpy.unique" ], [ "numpy.sum", "numpy.zeros_like", "numpy.arange", "numpy.exp" ] ]