text stringlengths 3.07k 22.1k |
|---|
# Copyright 2016-2021 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... |
# For building the model_2
import tensorflow as tf
import keras as keras
from keras.models import Model, load_model
from tensorflow.python.keras import backend as K
from sklearn.model_selection import train_test_split
from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose
from keras.layer... |
"""
Copyright 2019-present NAVER Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
"""
Functions for processing grasps in different representations.
"""
import numpy as np
import matplotlib.pyplot as plt
from skimage.draw import polygon
from skimage.feature import peak_local_max
# convert from the text to the number
def _bb_text_to_no(l, offset=(0, 0)):
# Read Cornell grasping dataset.
x,... |
import cvxpy as cvx
import numpy as np
from scipy.optimize import linprog
from typing import Tuple, List, Optional
from snc.agents.hedgehog.strategic_idling.strategic_idling_hedging import StrategicIdlingHedging
from snc.agents.hedgehog.workload.workload import compute_vertexes_cdd
from snc.environments.controlled_ran... |
import argparse
import builtins
import os
import os.path as osp
import time
import mmcv
import numpy as np
import torch
from got10k.experiments import ExperimentOTB
from mmcv import Config, DictAction
from mmcv.runner import set_random_seed
from siamfc import TrackerSiamFC, default_cfg
from mmaction.utils import get_... |
"""
This file is used for the functional tests related to grid operations,
using the python selenium module. These will pass when you run:
manage.py test RGT.functional_tests.tests.GridTests
This file also includes the base test for the grids which includes general functions needed
by the test cases.
"""
from RG... |
# -*- coding: utf-8 -*-
"""
Connector manager handles mqtt connections and
restarts mqtt service when connections are failing
:copyright: © 2018 by <NAME>
:license: MIT, see LICENSE for more details.
"""
from datetime import datetime
from os import getpid
from signal import signal, SIGTERM, SIGINT
from ... |
import json
import re
import requests
from bs4 import BeautifulSoup as bs
from codeforces.models import organization, country
def get_atcoder_profile(handle):
url = "https://atcoder.jp/users/" + handle
data = {
'status': 'FAILED',
'handle': handle,
'url': url,
'rating': 'Unrate... |
#MIT License
#Copyright (c) 2022 <NAME>, King's College London
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modif... |
import os, fnmatch, sys
import dill as pickle
import scipy.interpolate as interp
import scipy.optimize as opti
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import bead_util as bu
import configuration as config
import transfer_func_util as tf
#dirs = ['/data/20180625/bead1/tf_... |
"""
English :
University of Guanajuato
Science and Engineering Faculty
Research group : DCI-Net
Chief researcher : Dr. <NAME>
Student : <NAME>
MultiResUNet
Implementation based on the following research paper :
https://arxiv.org/abs/1902.04049
Español :
Universidad de ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random, string, re
from django.shortcuts import render, get_object_or_404
# Create your views here.
from rest_framework import viewsets, generics
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_fram... |
#!/usr/bin/env python3
################################################################################
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),... |
from itertools import product
from ...utils import pairwise
from ..tensor_2d_tebd import (
SimpleUpdate,
conditioner,
LocalHam2D)
from ..tensor_2d import (
gen_long_range_path,
nearest_neighbors,
gen_long_range_swap_path,
swap_path_to_long_range_path,
gen_2d_bonds
)
from .block_in... |
import os
import tarfile
import urllib
DOWNLOAD_ROOT = "http://spamassassin.apache.org/old/publiccorpus/"
HAM_URL = DOWNLOAD_ROOT + "20030228_easy_ham.tar.bz2"
SPAM_URL = DOWNLOAD_ROOT + "20030228_spam.tar.bz2"
SPAM_PATH = os.path.join("datasets", "spam")
def fetch_spam_data (spam_url=SPAM_URL, spam_path=SPAM_PATH):
... |
#!/usr/bin/env python
#
# runwindow.py - Run a process, display its output in a wx window.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides classes and functions for running a non-interactive
process, and displaying its output.
This module provides the :class:`RunPanel` and :class:`ProcessManager`
classes, and ... |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by... |
"""
Utilities for the GaussianCopulaProcess class.
"""
# Author: <NAME>
# for ALFA Group, CSAIL, MIT
# The MIT License (MIT)
# Copyright (c) 2015 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
import numpy as np
from numpy.random import default_rng
from beast.tools.read_beast_data import read_lnp_data
from beast.physicsmodel.grid_weights_stars import compute_bin_boundaries
__all__ = [
"get_likelihoods",
"precompute_mass_multipliers",
"get_predicted_num_stars",
"get_predicted_num_stars_simul... |
#!/usr/bin/python3
import discord
from discord import Intents
import random
import time
import os
from discord.ext import commands
from cogs.usefullTools.dbIntegration import *
# Get prefix
def get_prefix(bot, message):
return fetch_prefix(message.guild.id)["prefix"]
intents = Intents.default()
intents.members = ... |
# MIT License
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... |
import torch
import torch.nn as nn
import torch
import torch.nn.functional as F
from torch import nn as nn
from torch.autograd import Variable
from torch.nn import MSELoss, SmoothL1Loss, L1Loss
def flatten(tensor):
"""Flattens a given tensor such that the channel axis is first.
The shapes are transformed as f... |
import torch.nn as nn
import os
import models
import models_continuous
import torch
import math
import logging
from pathlib import Path
import collections
import pprint
import subprocess
import getpass
import sys
import matplotlib.pyplot as plt
import random
import numpy as np
logging.basicConfig(
level=logging.IN... |
import unittest
import pytest
from iptree.iptree import (
BaseTree, IPTree, IPv4Tree, IPv6Tree, RemoveNonLeafException,
RemoveRootException,
)
from . import debug
debug.init()
class TestIPTree(unittest.TestCase):
def test_tree_base(self):
tree = BaseTree(
net_all='127.0.0.1/32',
... |
import argparse
cmd_parser = argparse.ArgumentParser(prog="EP Model",
description="Command-Line interface for quick usage of "
"a custom EP Predictive Model.",
epilog="This is still an initial in... |
# coding: utf-8
"""
weasyprint.pdf
--------------
Post-process the PDF files created by cairo and add metadata such as
hyperlinks and bookmarks.
:copyright: Copyright 2011-2014 <NAME> and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, ... |
import butterfree
from caterpie import CSV, Writer
from caterpie.postgres_utils import clean
import pandas as pd
import os
import math
import numpy as np
from butterfree.data.upload.preprocess import preprocess_all
dataset_dir = butterfree.raw_dir
interim_dir = butterfree.interim_dir
datasets = butterfree.datasets
ph... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
NER tagger for building a LSTM based NER tagging model.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals # compatible with python3 unicode coding
import time
import nump... |
import enum
from enum import Enum
import numpy as np
class ConfigFile(object):
def __init__(self, filepath=None):
self.fields = {}
self.paths = []
if filepath is not None:
self.load(filepath)
def load(self, filepath, overwrite=False, reload=False, virtual=False): # set rel... |
from .redis_manager import RedisManager
from .user_instance import UserInstance
from .consts import WAITING_CHANNEL, SERVER_CODES, USER_RCODES, USER_SCODES
from . import api_requests
def build_dict(data_type, data):
to_return = {
't': data_type,
'd': data
}
return to_return
class ServerM... |
import librosa
import glob
from hyperparameter import Hyperparameter as hp
import pyworld
import numpy as np
import pickle
import matplotlib.pyplot as plt
from librosa import display
from tqdm import tqdm
def load_wavs(wav_dir):
wavs = []
for i, file in enumerate(glob.glob(wav_dir + '/*.wav')):
wav, _... |
from flask import Flask, render_template, request, redirect, url_for, session, flash
from functools import wraps
from numpy import double
from utils import example_util
import os, json
from utils.category_help import *
from utils.config import config
from utils.cook_recipes import *
from utils.login import insert_us... |
import os
import pathtrees as pt
import pathlib
import pytest
ROOT = os.path.join(os.path.dirname(__file__), 'data')
@pytest.fixture
def base_paths():
return pt.tree('logs', {
'': 'root',
'{log_id}': {
'model.h5': 'model',
'model_spec.pkl': 'model_spec',
'plots'... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of https://github.com/facebookresearch/AdversarialAndDimensionality
#
import math
import time
import numpy as np
import scipy.stats as st
impo... |
"""
Bruker / Prairie View plugin.
https://github.com/ClandininLab/visanalysis
<EMAIL>
"""
import os
import xml.etree.ElementTree as ET
import numpy as np
import pandas as pd
import h5py
import skimage.io as io
import functools
import nibabel as nib
from visanalysis.plugin import base as base_plugin
from visanalysis.u... |
"""Módulo 'process' de georef-ar-etl.
Define las clases 'Process', 'Step' y sus derivados, que son utilizados para
construir los pasos de cada proceso del ETL.
"""
from abc import ABC, abstractmethod
from .exceptions import ProcessException
class Step(ABC):
"""Representa una acción a ejecutar dentro de un cont... |
"""
Created by <NAME> at 13/11/2018
University of Bern
This file is subject to the terms and conditions defined in
file 'LICENSE.txt', which is part of this source code package.
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .util import build_base_matrix_1d, build... |
import torchvision.transforms as transforms
import numpy as np
import torch
from torch import nn
from torch import optim
from collections import OrderedDict
from torchvision import datasets, transforms, models
import argparse
import os
import sys
def get_args():
parser = argparse.ArgumentParser()
parser.add_... |
#!/usr/bin/env python
import io
import os
import subprocess
import linecache
import numpy as np
import soundfile as sf
import scipy.signal as ss
import random
import time
import librosa
import argparse
def get_line_context(file_path, line_number):
return linecache.getline(file_path, line_number).strip()
def sfr... |
__author__ = 'Todd.Hay'
# -----------------------------------------------------------------------------
# Name: Settings.py
# Purpose: Global settings
#
# Author: <NAME> <<EMAIL>>
#
# Created: Dec 12, 2016
# License: MIT
# -------------------------------------------------------------------------... |
import json
import os
import pathlib
import pickle
import numpy as np
import pandas as pd
import dotenv as de
de.load_dotenv(de.find_dotenv(usecwd=True))
from collections import OrderedDict
from Bio.PDB.Polypeptide import PPBuilder
from rdkit import Chem
import atom3d.shard.shard as sh
import atom3d.util.file as fi... |
from typing import Union
import numpy as np
import pandas as pd
import scipy.interpolate
import scipy.signal
import scipy.stats
import sklearn.cluster
import sklearn.preprocessing
from .data import OutlierDetectionSettings, Signal
DATA_COLUMNS = ["BPM", "RMSSD", "SDNN", "SDSD", "pNN20", "pNN50", "HF"]
DATAFRAME_COLU... |
"""Test functionality of the imager profile module."""
from imager_images.models import Album, Photo
from django.contrib.auth.models import User
from django.test import TestCase
import datetime
from django.test import Client
from django.urls import reverse_lazy
from django.conf import settings
from django.core.files.u... |
from __future__ import unicode_literals
from datetime import datetime
import functools
from django.db.models import Q
from django.conf import settings
from modeltree.tree import trees, MODELTREE_DEFAULT_ALIAS
from preserialize.serialize import serialize
from restlib2.http import codes
from restlib2.params import Param... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Seaky
# @Date: 2019/8/20 14:57
import re
from decimal import Decimal
def qround(n, digit=2, retf=False):
'''
比round更高的精度
:param n:
:param digit:
:param retf:
:return:
'''
r = Decimal(n).quantize(Decimal('0.{}'.format('0' * dig... |
import unittest
import os
import sys
import site
ai4_dir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
site.addsitedir(ai4_dir)
from ai4water.tf_attributes import tf
if 230 <= int(''.join(tf.__version__.split('.')[0:2]).ljust(3, '0')) < 250:
from ai4water.functional import Model
print(f"Sw... |
import warnings
import numpy as np
import pandas as pd
from copy import deepcopy
from imblearn.over_sampling import RandomOverSampler
from dcptree.data import check_data, has_validation_set, has_test_set, has_intercept, add_intercept, remove_intercept, remove_variable, add_variable, get_partition_names, get_index_of, g... |
#/usr/bin/env python
#-*-conding:utf-8-*-
"""
新词发现,左右熵+互信息
"""
# 需要发现的词或字的长度
import re
import math
import pickle
import json
import jieba
class Node(object):
"""
trie node
"""
def __init__(self, word, count=0, deepth=0):
self.word = word
self.count = count
self.deepth = deept... |
import copy
from lxml import etree
from . import serialization,escape_mfstring
class X3DSerialization(serialization):
NSPRE=None
spatialnde_NSPRE=None
NSMAP=None
tree=None
root=None
scene=None # Scene is what the various IndexedFaceSets get appended to
buf=None
def __init__(self,... |
# encoding: utf-8
# author: xiongyuanpeng
# day: 2018-11-14
# day: 2019-1-2
from tensorlayer.layers.core import Layer
#import tensorflow.keras.backend as K
import tensorflow as tf
import tensorlayer as tl
from attention_tf import *
class MultiTasking:
computing_type = {'L1':tf.abs, 'L2':tf.square}
def __init__(... |
import os
import numpy as np
import torch, copy
import time, datetime
import q_learning.config as dqnconfig
from q_learning.model import MyNetwork, DQN
from tensorboardX import SummaryWriter
from q_learning import utils
from q_learning.QLearning import QLEARNING
from coinrun import make
import coinrun.main_utils as coi... |
from pymogilefs.request import Request
from pymogilefs.connection import Connection
import re
"""
Backend manages a pool of trackers and balances load between them.
"""
# TODO: mark tracker as dead
MAX_RETRIES = 5
class Backend:
def __init__(self, trackers):
self._trackers = [tracker.split(':') for tr... |
import logging
from collections import namedtuple
from copy import deepcopy
from dataclasses import dataclass
from pathlib import Path
from typing import Union, List, Tuple, Dict, Set
import inflect
import jsonlines
from sacremoses import MosesTokenizer
from tqdm import tqdm
from translation_models import ScoringMode... |
"""Main functions for user interaction. All of these are imported into the
top-level namespace."""
import flavio
import numpy as np
from collections import defaultdict
from multiprocessing import Pool
def np_prediction(obs_name, wc_obj, *args, **kwargs):
"""Get the central value of the new physics prediction of a... |
'''
This module contains RTSPSpyGlass and RTSPServer. These two classes allow serving a sequence of
OpenCV images as video streams using the RTSP protocol.
To use this class you MUST have the following dependencies correctly configured on your system:
- `GStreamer 1.0`_ installed with standard plugins pack, libav, t... |
# -*- coding: utf-8 -*-
"""Module for reading and parsing obtained filters
"""
import json
import re
from datetime import datetime as dt
from .errors import UnknownFilterMatchError, WrongFilterFormatError, WrongFilterFieldError
def _op_like(a, b, ignore_case=False):
key = f"like_{b}"
if ignore_case:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 by <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
... |
#!/usr/bin/python
# encoding: utf-8
import torch
import yaml
import os
import cv2
import numpy as np
from freetype import *
class LabelEncoder(object):
def __init__(self, labels, is_ignore_case=True):
self.is_ignore_case = is_ignore_case
if self.is_ignore_case:
labels = labels.lower()
... |
""" Time series module
Helpers for creating regular and irregular time series, transforming irregular to regular
and analyzing gaps.
"""
import sys
from vtools.data.vtime import *
import datetime as _datetime
import numpy as np
all = ["gap_size","rts","rts_formula","extrapolate_ts","datetime_elapsed","elapsed_datetime... |
########################################################################
# Author: <NAME>, <NAME>
# License: Apache 2.0
# source code snippets from: Tensorflow
########################################################################
'''
Resnet18 functions
'''
import math
import tensorflow as tf
import numpy as np
fro... |
# -*- coding: utf-8 -*-
# TODO: evaluate.py is disables and should be remove once equivalent functions developed
"""Functions for making plots"""
import logging
import math
import numpy as np
from hepynet.data_io import array_utils, feed_box, numpy_io
from hepynet.train import train_utils
try:
import ROOT
... |
"""Hamiltonian Monte Carlo Integrators
Notes
-----
The code in this module is considered EXPERIMENTAL until further notice.
"""
import time
import logging
import pandas as pd
import numpy as np
import simtk.unit as u
import simtk.openmm as mm
from .constants import kB
logging.basicConfig(level=logging.INFO)
logger =... |
#!/usr/bin/python3
import argparse
import datetime
import json
import logging
import sys
import traceback
import deuceclient.auth.nonauth as noauth
import deuceclient.auth.openstackauth as openstackauth
import deuceclient.auth.rackspaceauth as rackspaceauth
import swiftclient.client as swift_client
def __api_operati... |
# -*- coding: utf-8 -*-
"""
+----------------+
| BasePackageRef |
+-------+--------+
|
+------------+ | +-----------------+
| PackageRef <-----+-----> IndexJsonRecord |
... |
"""
Copyright (C) 2018 MuadDib
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
@tantrumdev wrote this file. As long as you retain this notice you can do
whatever you want with this stuff. Just Ask first when not released through... |
# Emoji Dictionary
# -----------------------------------------------------------------------------------------------------
import io # used for dealing with input and output
from tkinter import * # importing the necessary libraries
import tkinter.messagebox as mbox
import tkinter as tk # imported tkinter as tk
impo... |
# The code is based on the template from Monte Carlo lab (LGBIO2070)
import matplotlib.pyplot as plt
import numpy as np
from get_voxel_index import get_voxel_index
# stopping power database (water, bone)
SP_water = np.loadtxt("data/SP_water.txt", 'float', '#', None, None, 8)
SP_bone = np.loadtxt("data/SP_bone.txt", '... |
import re, math
class Int(int):
# def __repr__(self):
# return hex(self)
def __str__(self):
return hex(self)
def __add__(self, other):
return Int(super().__add__(other))
def __sub__(self, other):
return Int(super().__sub__(other))
def __lshift__(self, other):
... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python
import re
import time
import os
from sqlalchemy import create_engine
import pandas as pd
import requests
__author__ = 'berniey'
re_limit = re.compile(r"^[0-9]*:[0-9]*")
re_ip = re.compile(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$")
re_time = re.compile(r"^\d{4}\-\d{2}\-\... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import cv2
import configparser
import numpy as np
import math
from inna.runtime import _runtime
import argparse
import pdb
def check_equal(tname, test, real):
"""
Parameters
----------
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
class _DenseLayer(nn.Sequential):
def __init__(self, num_input_features, growth_rate, bn_size, drop_rate):
super(_DenseLayer, self).__init__()
self.add_m... |
import torch.nn as nn
import torchvision.models as models
from models.layers import SqueezeExcitation
'''
RefineNet: Multi-Path Refinement Networks for High-Resolution
Semantic Segmentation
https://arxiv.org/abs/1611.06612
Based on this implementation of the paper:
https://github.com/thomasjpfan/pytorch_refinenet
'... |
import torch
import torch.nn as nn
from numbers import Number
from xvision.ops.boxes import bbox2cbox, cbox2bbox, box_iou_pairwise
def _canonical_anchor(anchor):
x, y, r = 0, 0, 0
if isinstance(anchor, Number):
w, h = anchor, anchor
elif isinstance(anchor, (list, tuple)) and len(anchor) == 1:
... |
#!/usr/bin/env python3
import argparse
import sys
import logging
from pathlib import Path
from vfj import Font
from fontTools.misc.fixedTools import otRound
from fontTools.voltLib import ast
def _attachment_lookup(name):
return ast.LookupDefinition(
name,
True,
True,
None,
... |
import re
import pandas as pd
import pytest
import woodwork as ww
from woodwork import DataTable
from woodwork.logical_types import (
Boolean,
Categorical,
Datetime,
Double,
EmailAddress,
FullName,
Integer,
LogicalType,
NaturalLanguage,
PhoneNumber,
ZIPCode
)
from woodwork.... |
import os
import sys
from functools import partial
import csv
from statistics import mean, stdev
import numpy as np
import scipy
from conch.analysis.praat import PraatAnalysisFunction
from conch.analysis.formants import PraatSegmentFormantTrackFunction, FormantTrackFunction, \
PraatSegmentFormantPointFunction
fr... |
import numpy as np
def gen_map(shape, res):
def f(t):
return 6*t**5 - 15*t**4 + 10*t**3
delta = (res[0] / shape[0], res[1] / shape[1])
d = (shape[0] // res[0], shape[1] // res[1])
grid = np.mgrid[0:res[0]:delta[0],0:res[1]:delta[1]].transpose(1, 2, 0) % 1
# Gradients
angles = 2*np.pi*n... |
from collections import OrderedDict
import csv
from sys import platform
from functools import partial
import time
if __debug__:
from traceback import print_exc
import Tkinter as tk
import ttk
import myNotebook as nb
import companion
from companion import ship_map
from l10n import Locale
from monitor import monito... |
#!/usr/bin/env python3
#
# Copyright (c) 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import psrqpy
import logging
from os.path import join
import yaml
import subprocess
import numpy as np
from dpp.helper_source_info import bin_sampling_limit, is_binary, required_bin_folds
from dpp.helper_obs_info import find_fold_times
from dpp.helper_files import file_precursor
from vcstools.metadb_utils import get_c... |
""" Bayesian model selection for group studies.
Adapted from VBA-toolbox (https://github.com/MBB-team/VBA-toolbox) by <NAME>.
References:
[1] <NAME>., <NAME>., <NAME>., & <NAME>. (2014).
Bayesian model selection for group studies—revisited. NeuroImage, 84, 971-985.
https://www.tnu.ethz.ch/fileadmin/user_upload/document... |
import torch.nn as nn
from rfvision.components import ResLayer
import torch
def rifeat(points_r, points_s):
"""generate rotation invariant features
Args:
points_r (B x N x K x 3):
points_s (B x N x 1 x 3):
"""
# [*, 3] -> [*, 8] with compatible intra-shapes
if points_r.shape[1] !=... |
#------------------------------------#
# Author: <NAME> #
# Update: 7/14/2019 #
# E-mail: <EMAIL> #
#------------------------------------#
"""------------------------------------
Canny Edge Detection Implementation
-------------------------------------"""
import pylab as pl # imoprt ... |
#!/usr/bin/env python
#
# Copyright 2020 NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# Copyright (c) 2018, NVIDIA CORPORATION.
import numpy as np
import collections
from pandas.api.types import is_categorical_dtype
from cudf.dataframe.dataframe import DataFrame
from cudf.dataframe.series import Series
from cudf.dataframe.buffer import Buffer
from cudf.dataframe.categorical import CategoricalColumn
f... |
# from PIL import Image
import matplotlib.pyplot as plt
from torchvision import models, transforms
from torch.autograd import Variable
from torch.nn import functional as F
# from torch import topk
import numpy as np
import skimage.transform
import torch
import os
# from model.resnet50_attention import AttnResNet50
# fr... |
from ndstructs import Point5D, Shape5D, Slice5D
import numpy
def test_from_start_stop():
start = Point5D(x=10, y=20, z=30, t=40, c=50)
stop = start + 10
slc = Slice5D.create_from_start_stop(start, stop)
assert slc == Slice5D(x=slice(10, 20), y=slice(20, 30), z=slice(30, 40), t=slice(40, 50), c=slice(5... |
from fastquant.strategies.buy_and_hold import BuyAndHoldStrategy
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import backtrader as bt
from fastquant.backtest.backtest_indicators import get_indicators_as_dict
from fastquant.config import GLOBAL_PARAMS
"""
Post backtest functionalities
- Retri... |
import sublime, sublime_plugin
import urllib, tarfile, os, json, shutil
from subprocess import call
from os import listdir
from os.path import join, exists
from random import choice
try:
import winsound
except Exception:
pass
from .libs.decorators import thread
STATUS_KEY = "SUBLIMESOUND"
SETTING_NAME = "Sou... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2017 beyond-blockchain.org.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... |
"""Basis Model for object detection with tensorflow and distance calculation."""
__version__ = "2.0.0"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__credits__ = "Special thanks to The Anh Vuong who came up with the original idea." \
"This code is also based off of code from Evan Juras"
# Description:
# ... |
from collections import defaultdict
import scipy.integrate as integrate
import scipy.special as special
import numpy as np
import pandas as pd
import math
import re
import random
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
from wordcloud import WordCloud
import functools
import op... |
import sys
import numpy as np
import math
import random
import time
import matplotlib.pyplot as plt
import pickle
import gym
from gym import spaces
from gym.utils import seeding
"""
Implementation of semi-gradient sarsa method with state aggregation representation
for the mountain car's Gym environment.
"""
#Simulat... |
# -*- coding: utf-8 -*-
import numpy as np
import cv2
def mosic(image, bboxes, labels,
image2, bboxes2, labels2,
image3, bboxes3, labels3,
image4, bboxes4, labels4,
min_offset=0.3):
h, w = image.shape[0], image.shape[1]
mix_img = np.zeros(shape=(h, w, 3), dtype='uint8'... |
from flask import Flask, request, send_file
import os
import io
from tacotron.hparams import create_hparams
from tacotron.inference import infer, model
import librosa.display
import numpy as np
import torch
from dotenv import load_dotenv
APP_ROOT = os.path.dirname(__file__)
dotenv_path = os.path.join(APP_ROOT, '.env... |
from __future__ import absolute_import
import os
import sys
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__))+os.path.sep+'..')
from models.aligned.local_dist import *
import torch
from torch import nn
def DeepSupervision(criterion, xs, y):
"""
Args:
criterion: loss function
xs: t... |
""" A plot of rise time (Rest frame days)
vs observer-frame peak abs mag in g-band
"""
import matplotlib.pyplot as plt
plt.rc("font", family="serif")
plt.rc("text", usetex=True)
import numpy as np
import sys
sys.path.append("/Users/annaho/Dropbox/Projects/Research/ZTF18abukavn/code")
from load_lc import get_uv_lc, ge... |
"""
basic support for running library as script
"""
import os
import time
import os.path as op
import glob
import sys
import pandas as pd
from schnablelab.apps.Tools import eprint
from optparse import OptionParser as OptionP, OptionGroup, SUPPRESS_HELP
from schnablelab import __copyright__, __version__
from schnablela... |
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404, render
# from django.template import RequestContext
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from enable_disable.models import Job, ValidationRule, WorkflowRule,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.