text
stringlengths
6.04k
39.5k
from abc import ABC, abstractmethod from math import floor from typing import Tuple, List, Iterable, Dict import numpy as np from .common import Hyperparameter, Candidate from .scaling import Scaling # Epsilon margin to account for numerical errors EPS = 1e-8 class HyperparameterRange(ABC): """ One can argu...
# -*- coding: utf-8 -*- """ Test script for pyvi/separation/methods.py Notes ----- Developed for Python 3.6 @author: <NAME> (<EMAIL>) """ #============================================================================== # Importations #============================================================================== impo...
import numpy as np import multiprocessing import pygame as pg from numba import njit def main(): size = 25 # size of the map posx, posy, posz = (1.5, np.random.uniform(1, size -1), 0.5) rot, rot_v = (np.pi/4, 0) lx, ly, lz = (size/2-0.5, size/2-0.5, 1) mapc, maph, mapr, exitx, exity, ...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2021 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """ This file is to classify the samples from a certain permutation group of classes whose sizes are larger than 1000. There are 12 groups in total. ...
# Copyright (c) 2019 Horizon Robotics. 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 applicab...
""" This file is used to pre-process voxlization and aggregation weights, in order to save training time. Re-project simplified point clouds to multi-plane, 32 planes are used. """ from __future__ import division import numpy as np import os, cv2, time, math, scipy import scipy.io as io def loadfile(ply_path): ...
"""GitLab API module. This module contains the :py:class:`GitLabAPI` class, which is meant to be the prime means of interacting with the GitLab API in RepoBee. The methods of GitLabAPI are mostly high-level bulk operations. .. module:: gitlab :synopsis: Top level interface for interacting with a GitLab instance ...
"""Kernel / covariance function.""" from __future__ import annotations import abc from typing import Optional, Union import numpy as np from probnum import utils as _pn_utils from probnum.typing import ArrayLike, ScalarLike, ShapeLike, ShapeType BinaryOperandType = Union["Kernel", ScalarLike] class Kernel(abc.AB...
""" Alternative method for estimating the canopy inertial properties. Very ugly and hacky, but still useful for checking the much improved mesh-based method. """ import numpy as np from scipy.integrate import simps import pfh.glidersim as gsim # Yanked from from `AirfoilGeometry` def airfoil_mass_properties(airfoil...
import numpy as np import itertools import sys from heapq import heappush, heappop from pysat.solvers import Glucose3 #Map handle part #----------------------------------------------------- from Code.AppData import MapData class Map: def __init__(self): map, agent_pos = readFile() self.map = map ...
# -*- coding: utf-8 -*- from collections import OrderedDict, defaultdict from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType from django.db.models import ProtectedError, FieldDoesNotExist, ObjectDoesNotExist from django.db.models.fields.related impo...
""" @author <NAME> A.I. Engineer & Software developer <EMAIL> Created on 02 November, 2017 @ 11:24 PM. Copyright © 2017. Victor. All rights reserved. """ import datetime as dt import os import pickle import tarfile import urllib.request import zipfile import numpy as np from nltk.tokenize import word_t...
# Copyright 2018 The TensorFlow Probability Authors. # # 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 o...
import queue import subprocess from time import sleep from enum import Enum from classes.MediaLibrary import MediaLibrary from classes.MediaPlayerInfo import MediaPlayerInfo, CurrentTrackInfo, TrackInfo import json import musicbrainzngs as m import libdiscid class MediaPlayer: """ Contains logic for controlli...
import time import pandas as pd import warnings warnings.filterwarnings('ignore') import re import datetime import json import pickle # log import logging LOGGER = logging.getLogger('run-time-adaptive_automl') # LOG_LEVEL = 'INFO' LOG_LEVEL = 'DEBUG' LOGGER.setLevel(getattr(logging, LOG_LEVEL)) simple_formatter = log...
""" Diagnostic tools ================ This module contains several python tools used elsewhere by the ocean diagnostics package. This tool is part of the ocean diagnostic tools package in the ESMValTool. Author: <NAME> (PML) <EMAIL> """ import logging import os import sys import iris import numpy as np import c...
import os import sys import math import json import time import logging import hashlib from PIL import Image from telegram.ext import Updater, CommandHandler, run_async from telegram import Bot, TelegramError, ParseMode, InlineKeyboardMarkup, InlineKeyboardButton import strings as s import database as sql @run_async ...
r"""PEG Parser Implementation of PEG parser as described in paper "Parsing Expression Grammars: A Recognition-Based Syntactic Foundation" (<NAME>, 2004). PEG's grammar itself can be defined by PEG grammar:: # Hierarchical syntax Grammar <- Spacing Definition+ EndOfFile Definition <- Identifier LEFTARRO...
# Copyright 2013-2015 DataStax, Inc. # # 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 writi...
# -*- encoding: utf-8 -*- # Copyright 2013 Red Hat, 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 re...
import torch import torch.nn as nn import torch.nn.functional as F from torchvision.transforms import transforms from torch.utils.data import DataLoader from torch.utils.data.sampler import SubsetRandomSampler from unet import Unet from torch.optim import Adam from torch.optim.lr_scheduler import StepLR import matplo...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- import xml.etree.cElementTree as ET from operator import itemgetter from collections import OrderedDict import sys, getopt import json # Get entityID def getEntityID(EntityDescriptor, namespaces): return EntityDescriptor.get('entityID') # Get MDUI Descriptions de...
#! python3 import os import util import time from io import BytesIO import toolkit_config def GetVGAudioCli(): utilities_path = util.GetUtilitiesPath() VGAudioCli = os.path.join(utilities_path, "Sound", "VGAudioCli.exe") return VGAudioCli def GetxWMAEncode(): utilities_path = util.GetUtilitiesPath() xWMAEncode ...
""" Audio feature extraction. Many functions have been inspired by https://github.com/librosa and https://github.com/kaldi-asr/kaldi. """ import os import wave import miniaudio import numpy as np import tensorflow as tf import webrtcvad import scipy.signal from . import mel_ops @tf.function(input_signature=[tf.Tens...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # ----------- # SPDX-License-Identifier: MIT # Copyright (c) 2020 <NAME> # uuid: 2e5f894a-3322-11eb-8fed-60f262a5770a # author: <NAME> # email: <EMAIL> # date: 2020-11-30 # ----------- """ This module will house code that performs operations on markdown files. Usual...
from __future__ import division from collections import defaultdict from math import ceil from .activesliceitem import ActiveSliceItem from cadnano.gui.controllers.itemcontrollers.partitemcontroller import PartItemController from .prexoveritem import PreXoverItem from .strand.xoveritem import XoverNode3 from cadnano.g...
""" Written by Kushal, modified by Robik """ import argparse import csv import json import os import shutil import sys import h5py import torch import vqa_experiments.configs.config_test as config from vqa_experiments.vqa_dataloader import build_dataloaders, build_rehearsal_dataloader, build_base_init_dataloader, \ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test suite for the response handling. :copyright: <NAME> (<EMAIL>), 2013 :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """ from __future__ import (absolute_import, division, print_function, ...
# This is a modified version of the training script of https://github.com/nii-yamagishilab/mos-finetune-ssl import os import argparse import fairseq import torch import torchaudio import torch.nn as nn import torch.optim as optim import time import json from torch.utils.data.dataset import Dataset from torch.utils.dat...
from enum import Enum import pandas as pd import csv import math import numpy as np import requests import urllib.request as url_req from urllib.error import HTTPError import gzip as gz import shutil as shu import os def Boolean_str(value): if value: return "Yes" elif value is None: return "Un...
import numpy as np import argparse import yaml import json import time from datetime import datetime import os from vowpalwabbit import pyvw from flaml import AutoVW from sklearn.metrics import mean_squared_error, mean_absolute_error from .vw_benchmark.config import LOG_DIR, PLOT_DIR, MAIN_RES_LOG_DIR, RESOURCE_DIR fr...
import copy import logging import math import matplotlib.pyplot as plt import multiprocessing as mp import numpy as np import random import time import torch import torch.multiprocessing as tmp import torch.nn.functional as F import torch.tensor as tt from torchvision.utils import save_image from dist import Master, Wo...
import multiprocessing as mp import os import tempfile import shutil import dask.dataframe as dd import dask.diagnostics import genomepy from gimmemotifs.scanner import scan_regionfile_to_table from gimmemotifs.utils import pfmfile_location from loguru import logger import numpy as np import pandas as pd import pickle...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Unit tests for the handling of physical types in `astropy.units`. """ import pickle import pytest from astropy import units as u from astropy.units import physical from astropy.constants import hbar from astropy.utils.exceptions import AstropyDeprec...
from lexer_rules import tokens import AST #from expressions import * from operator import add, mul my_bool = False result = '' #Parsing rules precedence = ( ('right', 'ASSIGN'), ('right', 'NOT'), ('nonassoc', 'LTEQ', 'LT', 'EQ'), ('left', 'PLUS', 'MINUS'), ('left', 'MULTIPLY', 'DIVIDE'), ('ri...
# BSD-3-Clause License # # Copyright 2017 Orange # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the followi...
# ---------------------------------------------------------------------------- # Copyright (c) 2022, Bokulich Laboratories. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # --------------------------------------------------------...
import logging from collections import defaultdict from datetime import datetime, timedelta, timezone from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast from django.conf import settings from django.db.models.query import QuerySet from django.http import HttpRequest, HttpResponse, HttpResponseNotFou...
from .base import BaseNewsvendor, DataDrivenMixin from ..utils.validation import check_cu_co import pulp import numpy as np from abc import ABC, abstractmethod from sklearn.ensemble import RandomForestRegressor from sklearn.neighbors import NearestNeighbors from sklearn.utils.validation import check_is_fitted, check_ar...
from math import ceil from unittest import TestCase from guitarpractice.models import FretPosition, Beat class TestFretPosition(TestCase): def test_position_on_lower_string_is_less_than_higher_string(self): lower_position = FretPosition(fret=1, string=6) higher_position = FretPosition(fret=1, stri...
import threading import time import cv2 import numpy as np import serial import sys, getopt import paho.mqtt from PIL import Image import paho.mqtt.client as mqtt from paho.mqtt import publish from video import create_capture import Adafruit_CharLCD as LCD import Adafruit_GPIO as GPIO lcd_rs = 25 lcd_en = 24 lcd_d4 = ...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or (at your option) any later version. # # This program is distrib...
# pylint: disable=cell-var-from-loop import os import time import json import errno import queue from typing import Optional, List, Dict, Any, Callable import threading as mt import subprocess as sp from .url import Url from .ids import generate_id, ID_CUSTOM from .shell import sh_callout fro...
# Holds information about an array, struct or union's element definition. class ElementDef: def __init__(self, elementType, name, valueType, dimensions = None): self.elementType = elementType # 'array', 'record' or 'value' self.name = str(name) self.valueType = valueType self.ch...
import gzip import os import sys import time from hashlib import sha1 from functools import partial try: # Python 2 import cPickle as pickle except: # Python 3 import pickle from types import MethodType, FunctionType from ..event_logger import NullEventLogger from ..monitor import NullMonitor from ..p...
import os import warnings import time import gc import torch import torch.nn as nn import torch.nn.functional as F import yaml import numpy as np import copy from sklearn.model_selection import train_test_split from tensorboardX import SummaryWriter from torch.autograd import Variable from torch.nn.functional import pa...
# Copyright (C) 2019 <NAME>, <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 agreed to in...
import time import logging import logging.handlers import threading import os import random import etcd3 import grpc logger = logging.getLogger(__name__) PREFIX_PATH_ENTITY_VIEW = 'entity_view/' PREFIX_PATH_COMMUNICATE = 'communicate/' PREFIX_PATH_COMMU_PUSH = PREFIX_PATH_COMMUNICATE + 'push/' ENTITY_TYPE = 'TYPE' LSP...
import os import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import random import read_bvh Hip_index = read_bvh.joint_index['hip'] Seq_len=100 Hidden_size = 1024 Joints_num = 57 Condition_num=5 Groundtruth_num=5 In_frame_size = Joints_num*3 class acLSTM(nn.Module): def __...
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
# -*- coding: UTF-8 -*- """ dtaidistance.dtw_ndim ~~~~~~~~~~~~~~~~~~~~~ Dynamic Time Warping (DTW) for N-dimensional series. :author: <NAME> :copyright: Copyright 2017-2018 KU Leuven, DTAI Research Group. :license: Apache License, Version 2.0, see LICENSE for details. """ import os import logging import math import ...
import csv import numpy import pandas as pd import numpy as np from core.component import Component from core.power import PowerInterface class Source(Component): def __init__(self, location, power): super().__init__(location) self.power_in = power def get_power_in(self): # TODO Check that t...
import bz2 import json import pandas as pd import pydash from tqdm import tqdm import pathlib import re pathlib.Path('../processed/wikidata/').mkdir(parents=True, exist_ok=True) # Disable chained assignments pd.options.mode.chained_assignment = None languages = ['en', 'cy', 'sco', 'gd', 'ga', 'kw'] # =============...
# -*- coding: utf-8 -*- """ All the code below was hacked together from https://github.com/mvictor212/pyBarcode Which is itself a port of python-barcode which is no longer available """ import gzip import os import xml.dom import string from redbot.core.data_manager import bundled_data_path try: import Image ...
"""ACME protocol client class and helper functions.""" import collections import csv import logging import os import shutil import socket import string import sys import M2Crypto import zope.component from letsencrypt.client import acme from letsencrypt.client import challenge from letsencrypt.client import CONFIG fr...
from datetime import datetime, timezone from enum import Enum from typing import List, Optional, Union from mstrio import config from mstrio.api import objects, schedules from mstrio.connection import Connection from mstrio.distribution_services.schedule import ScheduleEnums, ScheduleTime from mstrio.users_and_groups....
# -*- coding: utf-8 -*- """ @Time:Created on 2019/9/24 15:49 @author: <NAME> @Filename: model.py @Software: PyCharm """ import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import math import numpy as np from sklearn.metrics import roc_auc_score, precision_score, recall_score, ...
import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F # TODO # Implement Marginal Loss def dice_coeff(input: Tensor, target: Tensor, reduce_batch_first: bool = False, epsilon=1e-6, ignore_channel=None): # Average of Dice coefficient for all batches, or for a single mask ...
"""Test operators (basic tests).""" from pytype import file_utils from pytype.tests import test_base from pytype.tests import test_utils class ConcreteTest(test_base.BaseTest, test_utils.OperatorsTestMixin): """Tests for operators on concrete values (no unknowns).""" def test_add(self): s...
#!/usr/bin/env python3 from __future__ import division import time import math from collections import deque import os ######################################################################## ## ## File I/O functions ## ######################################################################## # Function for fast read...
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Microsoft Public License. A # copy of the license can be found in the License.html file at the root of this...
""" Title: English-to-Spanish translation with a sequence-to-sequence Transformer Author: [fchollet](https://twitter.com/fchollet) Date created: 2021/05/26 Last modified: 2021/05/26 Description: Implementing a sequence-to-sequene Transformer and training it on a machine translation task. """ import pathlib import rand...
from shlex import split from sys import stdout from os import remove as os_remove, stat, name as os_name from datetime import datetime, timezone import logging from logging import error, warning, info from conffu import Config from pathlib import Path from asyncio import get_event_loop, sleep, gather from py7za import ...
# Referee for COMP30024: Artificial Intelligence, 2018 # Authors: <NAME> and <NAME> # version: v1.0 import time import argparse import importlib VERSION_INFO = """Referee version 1.1 (released Apr 08 2018) Plays a basic game of Watch Your Back! between two Player classes Run `python referee.py -h` for help and additi...
import random import os import itertools import tensorflow as tf from tensorflow import newaxis as ax from basic.attention_modules import hotpot_biattention, zhong_selfatt from basic.batcher import get_batch_feed_dict from my.tensorflow import get_initializer from my.tensorflow.nn import softsel, get_logits, linear_lo...
# -*- coding: utf-8 -*- """ Tests for _algorithms module. """ import unittest import numpy as np from collections import Counter from itertools import product from supervenn._algorithms import ( get_total_gaps_in_rows, get_chunks_and_composition_array, _get_ordered_chunks_and_composition_array, find_b...
#!/usr/bin/env python import random from random import randrange import sys from time import time from datetime import datetime #import string #from string import * import os from os import system from os import unlink from subprocess import * ##### Path Setting ##### is_win32 = (sys.platform == 'win32') if not is_w...
import os import sys import os.path as path import cv2 import glob import logging import numpy as np import torch import torch.nn as nn from copy import deepcopy from collections import OrderedDict from torch.nn.parallel import DataParallel, DistributedDataParallel from basicsr.data.data_util import generate_frame_i...
import os import json import logging from urllib.parse import urlencode from django.shortcuts import render, redirect, get_object_or_404 from django.core.urlresolvers import reverse from django.http import JsonResponse, HttpResponseRedirect, Http404, StreamingHttpResponse from django.contrib import messages from djang...
"""The tides module defines exposes an API for the NOAA Tides and Currents API.""" from typing import Mapping, Optional, List, Union import datetime import enum import typing import requests class ApiError(Exception): """Exception raised when a well-formed NoaaRequest causes a server error. Not every error...
import os import time import numpy as np import pandas as pd import scanpy as sc import scipy.sparse as ssp from .. import help_functions as hf from .. import logging as logg from .. import plotting as pl from .. import settings from .. import tool as tl def generate_similarity_matrix( adata, file_name, ...
import sys import typing def fbx(filepath: str = "", check_existing: bool = True, filter_glob: str = "*.fbx", use_selection: bool = False, use_active_collection: bool = False, global_scale: float = 1.0, apply_unit_scale: bool = True, apply_scale_options: typing....
#!/usr/bin/env python # coding: utf-8 # ## 딥러닝용 더미 데이터 생성 자동화 프로젝트 # """ 주어진 csv 파일을 본떠서 더미 csv 파일을 만드는 소스를 생성하는 코드이다 """ __author__ = '<NAME>' __copyright__ = 'Copyright 2020, CHONNAM NATIONAL UNIVERSITY' __date__ = '2020/09/11' import os from abc import ABC, abstractmethod from datetime import datetime impo...
import functools import time from time import sleep from typing import Optional, TypeVar, Set, List, NamedTuple, Callable, TYPE_CHECKING from urllib.parse import urlparse from pika import ConnectionParameters, PlainCredentials, BlockingConnection, BasicProperties, spec # type: ignore from pika.adapters.blocking_conne...
from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math from models.submodule import * from models.inverse_warp import * import pdb from lib.config import cfg, cfg_from_file, save_config_to_file impo...
# encoding: utf-8 # (c) 2019 Open Risk (https://www.openriskmanagement.com) # # correlationMatrix is licensed under the Apache 2.0 license a copy of which is included # in the source distribution of correlationMatrix. This is notwithstanding any licenses of # third-party software included in this distribution. You may...
"""v2rss-service 脚手架入口""" __all__ = ["Scaffold"] from gevent import monkey monkey.patch_all() import time import requests import csv import os import shutil import sys from BusinessCentralLayer.middleware.interface_io import SystemInterface from BusinessCentralLayer.middleware.subscribe_io import select_subs_to_admi...
#!/usr/bin/python import click import pandas as pd import datetime import time import os timestr = time.strftime("%Y%m%d-%H%M%S") from click_help_colors import HelpColorsGroup, HelpColorsCommand from pyfiglet import Figlet # DEFAULT URLS FOR DATASOURCE Original Deprecated # confirmed_cases_url_deprecated = "https://...
#!/usr/bin/env python # Import Modules #------------------------------------------------------- # Scipy and Numpy from scipy import * import scipy.special as special # Mesh generator import mesh as tri # Non-symmetric Gaussian Solver import nsymgauss as NSG # Quadrature data import quad as GQD # Shape function mo...
""" Hidden Markov Tree model """ from abc import ABCMeta from collections import namedtuple import os import scipy from config import RES_DIR, CHROM_SIZES from data_provider import SeqLoader from hmm.HMMModel import _ContinuousEmission from hmm.bwiter import bw_iter, IteratorCondition __author__ = 'eranroz' import ...
import argparse import time import torch from datetime import datetime from glob import glob import numpy as np import visdom import build_model import data_loader from utils import * #################################################################################################### # computing the DSC together w...
#!/usr/bin/env python # -*- python -*- #BEGIN_LEGAL # #Copyright (c) 2019 Intel 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-...
import pickle import random import argparse import logging import torch import torch.nn as nn import torch.nn.functional as functional import torch.optim as optim import os import math from tqdm import tqdm from transformers import GPT2Tokenizer, GPT2Model from word_embeddings import * def ll_loss(scores): ""...
import numpy as np import re import itertools from collections import Counter import tensorflow.compat.v1 as tf import csv import dill as pickle import os dataset_name = "movies" tf.flags.DEFINE_string("valid_data", "../data2014/%s/%s_valid.csv" % (dataset_name, dataset_name), " Data for validation") tf.flags.DEFINE_...
""" Simultaneous Machine Translateion """ from .nmt_uni import * from .reward import return_reward import time import sys timer = time.time # utility functions def _seqs2words(caps, idict): capsw = [] for cc in caps: ww = [] for w in cc: if w == 0: break ...
#!/usr/bin/env python # # fastq_utils.py: utility functions for operating on fastq files # Copyright (C) University of Manchester 2016-2020 <NAME> # ######################################################################## # # fastq_utils.py # #####################################################################...
""" Mock test data set for testing OSA. R0 files are in BASE_DIR/R0/YYYYMMDD Calibration files follow the structure: BASE_DIR/monitoring/PixelCalibration/Cat-A/<calibration_product>/YYYYMMDD/<version> Where <calibration_product> can be: drs4_baseline, calibration, drs4_time_sampling_from_FF, ffactor_systematics <vers...
''' steps: load best performed ROI masks for given number of ROIs wanted, combine them and use that as the wanted mask train a new classifier and save the testing accuracy ''' ''' you could try to see whether combining parcels improves performance. That's going to be the most important bit, because we'll...
# https://stackoverflow.com/questions/15853469/putting-current-class-as-return-type-annotation # can't use this while supporting python 3.6 (PyPy 7.3), have to use strings for now # from __future__ import annotations from typing import Any, Dict, Iterable, Optional, List, TYPE_CHECKING, cast from typing_extensions impo...
# Sample Test passing with nose and pytest # This assumes that the system installed version of tf_rmtpp is the development # build. # TODO: Is there a way of importing the active code without having to run: # `python setup.py develop`? import tf_rmtpp import numpy as np import decorated_options as Deco import tensorfl...
import lib import datetime import torch import argparse import sys import utils import logging from tensorboardX import SummaryWriter from lib.model.mpnn import mp_sequential, mp_conv_residual, mp_conv_type, mp_conv_v2, global_pooling import numpy as np import time import os from utils.types import str2bool from tqdm i...
# -*- encoding: utf-8 -*- """Cube logical model""" from __future__ import absolute_import from collections import OrderedDict, defaultdict from ..common import assert_all_instances, get_localizable_attributes # TODO: This should belong here from ..query.statutils import aggregate_calculator_labels from ..errors impo...
## ## File: bunny.py ## ## Author: <NAME> <<EMAIL>> ## ## Description: Python class that provides infrastructure for sending messages ## over RabbitMQ to client devices/users ## # Python libraries import json import pika import sqlite3 # project libraries from datagrams.json_db_encoder import JSON_DB...
# -*- coding: utf-8 -*- # # Copyright 2018 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 requir...
import tensorflow as tf from tensorflow.python.training import moving_averages import math from ...layers import ( Layer, Sequential, Conv2D, sigmoid_focal_loss, smooth_l1_loss ) from ..anchor_generator import build_anchor_generator from ..box_regression import Box2BoxTransform from ..matcher impor...
import torch import torch.nn as nn import torch.nn.functional as F import math import time import numpy as np class criticAttention(nn.Module): """Calculates attention over the input nodes given the current state.""" def __init__(self, hidden_size): super(criticAttention, self).__init__() # ...
# # * This library is free software; you can redistribute it and/or # * modify it under the terms of the GNU Lesser General Public # * License as published by the Free Software Foundation; either # * version 2.1 of the License, or (at your option) any later version. # * # * This library is distributed in the hope that ...
#!/usr/bin/env python3 import argparse import json import sys from typing import List, Optional, Dict, Any import yaml from gen_op_registration_allowlist import ( canonical_name, gen_transitive_closure, load_op_dep_graph, ) from torchgen.selective_build.operator import ( SelectiveBuildOperator, mer...
import numpy as np from numpy.linalg import lstsq as optimizer from scipy.spatial.transform import Rotation as rotation_util median_object_size_map = { 'Cyclist': (1.76, 1.75, 0.6), 'Van': (4.98, 2.13, 1.88), 'Tram': (14.66, 3.61, 2.6), 'Car': (0.25, 0.13, 0.15), 'Misc': (2.52, 1.65, 1.51), 'Pe...
# encoding: utf-8 ''' 🤢 Sickbay: Clinical data model for the Consortium for Molecular and Cellular Characterization of Screen-Detected Lesions. JSON utilities. These are classes that can be passed to ``json.dump(cls=)``. ''' from .model import ( Biospecimen, BreastOrgan, ClinicalCore, Genomics, ...