python_code stringlengths 0 679k | repo_name stringlengths 9 41 | file_path stringlengths 6 149 |
|---|---|---|
import ipyvuetify as v
import traitlets as tr
from .common import load_template, reload_module
import ipywidgets as ipw
import time
class AppLoader(v.VuetifyTemplate):
template = tr.Unicode(load_template("vue-templates/app-loader.vue")).tag(sync=True)
apps = tr.List(["widget1", "widget2"]).tag(sync=True)
... | energy-sdk-l2rpn-master | nvgridui/nvapp/appLoader.py |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import ipywidgets as ipw
import ipyvuetify as v
import traitlets as tr
from .common import load_template
import matplotlib
# matplotlib.use("WebAgg")
class PlotsComponent(v.VuetifyTemplate):
template = tr.Unicode(load_template("vue-templa... | energy-sdk-l2rpn-master | nvgridui/nvgrid/plotscomponent.py |
import ipywidgets as ipw
import ipyvuetify as v
import time
import traitlets as tr
import numpy as np
from .common import load_template, rho2color, AllTopoActions
import heapq
def list_els_from_action(a):
topo = a.impact_on_objects()["topology"]["bus_switch"]
subs = set()
gens = set()
loads = set()
... | energy-sdk-l2rpn-master | nvgridui/nvgrid/actionrecommender.py |
import ipywidgets as ipw
import ipyvuetify as v
import time
import traitlets as tr
import ipyleaflet as ipl
import numpy as np
from .common import load_template, rho2color
from grid2op.MakeEnv import make
from lightsim2grid import LightSimBackend as BACKEND
PATH2ICONS = "/nvgrid/assets/"
def rho2delay(rho):
d... | energy-sdk-l2rpn-master | nvgridui/nvgrid/gridmap.py |
from .app import new
| energy-sdk-l2rpn-master | nvgridui/nvgrid/__init__.py |
import os
def load_template(filename):
with open(os.path.join(os.path.dirname(__file__), filename)) as f:
return f.read()
def rho2color(rho):
color = "black"
color = "green"
if rho > 0.70:
color = "#888800"
if rho > 0.80:
color = "orange"
if rho > 0.99:
color ... | energy-sdk-l2rpn-master | nvgridui/nvgrid/common.py |
import ipywidgets as ipw
import ipyvuetify as v
import time
import traitlets as tr
import ipyleaflet as ipl
from .common import load_template
from .gridmap import GridMap
from .gridcontrol import GridControl
class App(v.VuetifyTemplate):
template = tr.Unicode(load_template("vue-templates/app.vue")).tag(sync=Tru... | energy-sdk-l2rpn-master | nvgridui/nvgrid/app.py |
import ipywidgets as ipw
import ipyvuetify as v
import time
import traitlets as tr
import numpy as np
import grid2op
from .common import load_template, rho2color, dict2pretty_string
from .actionrecommender import ActionRecommender
from .plotscomponent import PlotsComponent
class GridControl(v.VuetifyTemplate):
... | energy-sdk-l2rpn-master | nvgridui/nvgrid/gridcontrol.py |
#!/usr/bin/env python3
#
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
# Author: John Linford <jlinford@nvidia.com>
#
import sys
import argparse
KERNEL_FILE_TEMPLATE = """
//
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2023, NVIDIA CORPORATION. A... | arm-kernels-main | kgen.py |
#!/usr/bin/python3
import os, re, sys
from io import open
def list_whence():
with open('WHENCE', encoding='utf-8') as whence:
for line in whence:
match = re.match(r'(?:File|Source):\s*"(.*)"', line)
if match:
yield match.group(1)
continue
... | linux-firmware-nouveau | check_whence.py |
#!/usr/bin/env python3
import argparse
import os
import platform
import subprocess
# This list contains symbols that _might_ be exported for some platforms
PLATFORM_SYMBOLS = [
'__bss_end__',
'__bss_start__',
'__bss_start',
'__cxa_guard_abort',
'__cxa_guard_acquire',
'__cxa_guard_release',
... | libglvnd-master | bin/symbols-check.py |
#!/usr/bin/env python
# (C) Copyright 2015, 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"),
# to deal in the Software without restriction, including without limitation
# o... | libglvnd-master | src/generate/gen_libgl_glxstubs.py |
#!/usr/bin/env python
# (C) Copyright 2015, 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"),
# to deal in the Software without restriction, including without limitation
# o... | libglvnd-master | src/generate/genCommon.py |
#!/usr/bin/env python
"""
Generates dispatch functions for EGL.
The list of functions and arguments is read from the Khronos's XML files, with
additional information defined in the module eglFunctionList.
"""
import argparse
import collections
import sys
import textwrap
import eglFunctionList
import genCommon
def ... | libglvnd-master | src/generate/gen_egl_dispatch.py |
#!/usr/bin/env python
# (C) Copyright 2015, 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"),
# to deal in the Software without restriction, including without limitation
# o... | libglvnd-master | src/generate/gen_libOpenGL_exports.py |
"""
Contains a list of EGL functions to generate dispatch functions for.
This is used from gen_egl_dispatch.py.
EGL_FUNCTIONS is a sequence of (name, eglData) pairs, where name is the name
of the function, and eglData is a dictionary containing data about that
function.
The values in the eglData dictionary are:
- me... | libglvnd-master | src/generate/eglFunctionList.py |
#!/usr/bin/env python
# Copyright (C) 2010 LunarG Inc.
# (C) Copyright 2015, NVIDIA CORPORATION.
#
# 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 limi... | libglvnd-master | src/generate/gen_gldispatch_mapi.py |
#!/usr/bin/env python
import sys
GENERATED_ENTRYPOINT_MAX = 4096
def main():
text = ""
text += "#if defined(GLX_STUBS_COUNT)\n"
text += "#define GENERATED_ENTRYPOINT_MAX %d\n" % (GENERATED_ENTRYPOINT_MAX)
text += "#undef GLX_STUBS_COUNT\n"
text += "#endif\n\n"
text += "#if defined(GLX_STUBS... | libglvnd-master | src/GLX/gen_glx_stubs.py |
"""
This is an object detection finetuning example. We finetune a Faster R-CNN
model pretrained on COCO to detect pedestrians in the relatively small PennFudan
dataset.
Useful References:
https://docs.determined.ai/latest/reference/api/pytorch.html
https://www.cis.upenn.edu/~jshi/ped_html/
Based on: https://... | data-science-stack-master | examples/object_detection/experiments/model_def.py |
import torch
from determined.experimental import Determined
from .data import load_and_transform_image, draw_example
def predict(experiment_id, file, det_master=None):
if det_master:
checkpoint = Determined(master=det_master).get_experiment(experiment_id).top_checkpoint()
else:
checkpoint = De... | data-science-stack-master | examples/object_detection/experiments/support/helper.py |
import os
import shutil
from typing import Any, Dict
from urllib.parse import urlparse
from urllib.request import urlretrieve
import numpy as np
import torch
from torchvision.transforms import Compose, ToTensor
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from PIL import Image
def download_da... | data-science-stack-master | examples/object_detection/experiments/support/data.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | setup.py |
# Version: 0.20
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/python-versioneer/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible with: Python 3.6, 3.7, 3.8, 3.9 and pypy3
* [![Latest Version][pyp... | cuda-python-main | versioneer.py |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | cuda-python-main | cuda/_version.py |
from . import _version
__version__ = _version.get_versions()['version']
| cuda-python-main | cuda/__init__.py |
cuda-python-main | cuda/_cuda/__init__.py | |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/tests/test_nvrtc.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/tests/test_interoperability.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/tests/test_kernelParams.py |
cuda-python-main | cuda/tests/__init__.py | |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/tests/test_cython.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/tests/test_cudart.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/tests/test_cuda.py |
cuda-python-main | cuda/_lib/__init__.py | |
cuda-python-main | cuda/_lib/ccudart/__init__.py | |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/benchmarks/test_pointer_attributes.py |
cuda-python-main | cuda/benchmarks/__init__.py | |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/benchmarks/kernels.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/benchmarks/test_cupy.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/benchmarks/test_numba.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/benchmarks/test_launch_latency.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | cuda/benchmarks/perf_test_utils.py |
cuda-python-main | examples/__init__.py | |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/3_CUDA_Features/simpleCudaGraphs_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/common/helper_string.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/common/common.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/common/helper_cuda.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/extra/isoFDModelling_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/extra/jit_program_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/extra/numba_emm_plugin.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/simpleZeroCopy_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/clock_nvrtc_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/vectorAddDrv_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/simpleCubemapTexture_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/systemWideAtomics_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/simpleP2P_test.py |
# Copyright 2021-2023 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related document... | cuda-python-main | examples/0_Introduction/vectorAddMMAP_test.py |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | cuda-python-main | docs_src/source/conf.py |
#!/bin/bash
# Apache License, Version 2.0
# Copyright 2019-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
#
# Unles... | clara-dicom-adapter-main | test/dicom-test-pipeline/main.py |
import torch
import numpy as np
import argparse
from Networks.FlowNet2 import FlowNet2 # the path is depended on where you create this module
from frame_utils import read_gen # the path is depended on where you create this module
if __name__ == '__main__':
# obtain the necessary args for construct the flownet f... | flownet2-pytorch-master | run_a_pair.py |
import torch
import torch.nn as nn
from torch.nn import init
import math
import numpy as np
try:
from networks.resample2d_package.resample2d import Resample2d
from networks.channelnorm_package.channelnorm import ChannelNorm
from networks import FlowNetC
from networks import FlowNetS
from networks... | flownet2-pytorch-master | models.py |
#!/usr/bin/env python2.7
import caffe
from caffe.proto import caffe_pb2
import sys, os
import torch
import torch.nn as nn
import argparse, tempfile
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('caffe_model', help='input model in hdf5 or caffemodel format')
parser.add_argument('prototxt_... | flownet2-pytorch-master | convert.py |
import torch
import torch.utils.data as data
import os, math, random
from os.path import *
import numpy as np
from glob import glob
import utils.frame_utils as frame_utils
from scipy.misc import imread, imresize
class StaticRandomCrop(object):
def __init__(self, image_size, crop_size):
self.th, self.tw ... | flownet2-pytorch-master | datasets.py |
flownet2-pytorch-master | __init__.py | |
'''
Portions of this code copyright 2017, Clement Pinard
'''
# freda (todo) : adversarial loss
import torch
import torch.nn as nn
import math
def EPE(input_flow, target_flow):
return torch.norm(target_flow-input_flow,p=2,dim=1).mean()
class L1(nn.Module):
def __init__(self):
super(L1, self).__init_... | flownet2-pytorch-master | losses.py |
#!/usr/bin/env python
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.autograd import Variable
from tensorboardX import SummaryWriter
import argparse, os, sys, subprocess
import setproctitle, colorama
import numpy as np
from tqdm import tqdm
from glob import glob
from os.path imp... | flownet2-pytorch-master | main.py |
import numpy as np
import matplotlib.pyplot as plt
import os.path
TAG_CHAR = np.array([202021.25], np.float32)
def readFlow(fn):
""" Read .flo file in Middlebury format"""
# Code adapted from:
# http://stackoverflow.com/questions/28013200/reading-middlebury-flow-files-with-python-bytes-array-numpy
# ... | flownet2-pytorch-master | utils/flow_utils.py |
# freda (todo) :
import os, time, sys, math
import subprocess, shutil
from os.path import *
import numpy as np
from inspect import isclass
from pytz import timezone
from datetime import datetime
import inspect
import torch
def datestr():
pacific = timezone('US/Pacific')
now = datetime.now(pacific)
return... | flownet2-pytorch-master | utils/tools.py |
flownet2-pytorch-master | utils/__init__.py | |
import torch
import torch.nn as nn
import numpy as np
def parse_flownetc(modules, weights, biases):
keys = [
'conv1',
'conv2',
'conv3',
'conv_redir',
'conv3_1',
'conv4',
'conv4_1',
'conv5',
'conv5_1',
'conv6',
'conv6_1',
'deconv5',
'deconv4',
'deconv3',
... | flownet2-pytorch-master | utils/param_utils.py |
import numpy as np
from os.path import *
from scipy.misc import imread
from . import flow_utils
def read_gen(file_name):
ext = splitext(file_name)[-1]
if ext == '.png' or ext == '.jpeg' or ext == '.ppm' or ext == '.jpg':
im = imread(file_name)
if im.shape[2] > 3:
return im[:,:,:3]
... | flownet2-pytorch-master | utils/frame_utils.py |
'''
Portions of this code copyright 2017, Clement Pinard
'''
import torch
import torch.nn as nn
from torch.nn import init
import math
import numpy as np
from .submodules import *
'Parameter count : 38,676,504 '
class FlowNetS(nn.Module):
def __init__(self, args, input_channels = 12, batchNorm=True):
sup... | flownet2-pytorch-master | networks/FlowNetS.py |
import torch
import torch.nn as nn
from torch.nn import init
import math
import numpy as np
from .submodules import *
'Parameter count = 581,226'
class FlowNetFusion(nn.Module):
def __init__(self,args, batchNorm=True):
super(FlowNetFusion,self).__init__()
self.batchNorm = batchNorm
self.... | flownet2-pytorch-master | networks/FlowNetFusion.py |
# freda (todo) :
import torch.nn as nn
import torch
import numpy as np
def conv(batchNorm, in_planes, out_planes, kernel_size=3, stride=1):
if batchNorm:
return nn.Sequential(
nn.Conv2d(in_planes, out_planes, kernel_size=kernel_size, stride=stride, padding=(kernel_size-1)//2, bias=False),
... | flownet2-pytorch-master | networks/submodules.py |
flownet2-pytorch-master | networks/__init__.py | |
import torch
import torch.nn as nn
from torch.nn import init
import math
import numpy as np
from .correlation_package.correlation import Correlation
from .submodules import *
'Parameter count , 39,175,298 '
class FlowNetC(nn.Module):
def __init__(self,args, batchNorm=True, div_flow = 20):
super(FlowNetC... | flownet2-pytorch-master | networks/FlowNetC.py |
import torch
import torch.nn as nn
from torch.nn import init
import math
import numpy as np
from .submodules import *
'Parameter count = 45,371,666'
class FlowNetSD(nn.Module):
def __init__(self, args, batchNorm=True):
super(FlowNetSD,self).__init__()
self.batchNorm = batchNorm
self.conv... | flownet2-pytorch-master | networks/FlowNetSD.py |
from torch.autograd import Function, Variable
from torch.nn.modules.module import Module
import channelnorm_cuda
class ChannelNormFunction(Function):
@staticmethod
def forward(ctx, input1, norm_deg=2):
assert input1.is_contiguous()
b, _, h, w = input1.size()
output = input1.new(b, 1, h... | flownet2-pytorch-master | networks/channelnorm_package/channelnorm.py |
flownet2-pytorch-master | networks/channelnorm_package/__init__.py | |
#!/usr/bin/env python3
import os
import torch
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
cxx_args = ['-std=c++11']
nvcc_args = [
'-gencode', 'arch=compute_52,code=sm_52',
'-gencode', 'arch=compute_60,code=sm_60',
'-gencode', 'arch=compute_61,code=sm_6... | flownet2-pytorch-master | networks/channelnorm_package/setup.py |
flownet2-pytorch-master | networks/correlation_package/__init__.py | |
#!/usr/bin/env python3
import os
import torch
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
cxx_args = ['-std=c++11']
nvcc_args = [
'-gencode', 'arch=compute_50,code=sm_50',
'-gencode', 'arch=compute_52,code=sm_52',
'-gencode', 'arch=compu... | flownet2-pytorch-master | networks/correlation_package/setup.py |
import torch
from torch.nn.modules.module import Module
from torch.autograd import Function
import correlation_cuda
class CorrelationFunction(Function):
@staticmethod
def forward(ctx, input1, input2, pad_size=3, kernel_size=3, max_displacement=20, stride1=1, stride2=2, corr_multiply=1):
ctx.save_for_b... | flownet2-pytorch-master | networks/correlation_package/correlation.py |
from torch.nn.modules.module import Module
from torch.autograd import Function, Variable
import resample2d_cuda
class Resample2dFunction(Function):
@staticmethod
def forward(ctx, input1, input2, kernel_size=1, bilinear= True):
assert input1.is_contiguous()
assert input2.is_contiguous()
... | flownet2-pytorch-master | networks/resample2d_package/resample2d.py |
flownet2-pytorch-master | networks/resample2d_package/__init__.py | |
#!/usr/bin/env python3
import os
import torch
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
cxx_args = ['-std=c++11']
nvcc_args = [
'-gencode', 'arch=compute_50,code=sm_50',
'-gencode', 'arch=compute_52,code=sm_52',
'-gencode', 'arch=compute_60,code=sm_6... | flownet2-pytorch-master | networks/resample2d_package/setup.py |
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | dllogger-master | setup.py |
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | dllogger-master | dllogger/__init__.py |
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | dllogger-master | dllogger/logger.py |
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | dllogger-master | examples/dllogger_singleton_example.py |
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | dllogger-master | examples/dllogger_example.py |
import matplotlib
matplotlib.use("Agg")
import matplotlib.pylab as plt
import numpy as np
def save_figure_to_numpy(fig):
# save it to a numpy array.
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
return data
def... | tacotron2-master | plotting_utils.py |
import tensorflow as tf
from text import symbols
def create_hparams(hparams_string=None, verbose=False):
"""Create model hyperparameters. Parse nondefault from given string."""
hparams = tf.contrib.training.HParams(
################################
# Experiment Parameters #
###... | tacotron2-master | hparams.py |
import torch
import numpy as np
from scipy.signal import get_window
import librosa.util as librosa_util
def window_sumsquare(window, n_frames, hop_length=200, win_length=800,
n_fft=800, dtype=np.float32, norm=None):
"""
# from librosa 0.6
Compute the sum-square envelope of a window fu... | tacotron2-master | audio_processing.py |
import random
import torch
from torch.utils.tensorboard import SummaryWriter
from plotting_utils import plot_alignment_to_numpy, plot_spectrogram_to_numpy
from plotting_utils import plot_gate_outputs_to_numpy
class Tacotron2Logger(SummaryWriter):
def __init__(self, logdir):
super(Tacotron2Logger, self).__... | tacotron2-master | logger.py |
from math import sqrt
import torch
from torch.autograd import Variable
from torch import nn
from torch.nn import functional as F
from layers import ConvNorm, LinearNorm
from utils import to_gpu, get_mask_from_lengths
class LocationLayer(nn.Module):
def __init__(self, attention_n_filters, attention_kernel_size,
... | tacotron2-master | model.py |
"""
BSD 3-Clause License
Copyright (c) 2017, Prem Seetharaman
All rights reserved.
* Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of... | tacotron2-master | stft.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.