repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
Tangent-Bundle-Neural-Networks | Tangent-Bundle-Neural-Networks-main/Journal_repo/mainWindSampling.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Claudio Battiloro
"""
#import warnings
#warnings.filterwarnings("ignore") to suppress warnings
import sys
import pytorch_lightning as pl
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
import torch
from architecture import TNN,MNN
from dat... | 9,380 | 46.619289 | 171 | py |
Tangent-Bundle-Neural-Networks | Tangent-Bundle-Neural-Networks-main/Journal_repo/data_util.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Clabat
"""
import torch
import pickle
import pandas as pd
import numpy as np
from collections import defaultdict
import torch.nn.functional as F
class WindSampling(torch.utils.data.Dataset):
def __init__(self, data_proj_numpy, mask, step_per_epoch, dev... | 1,956 | 30.063492 | 71 | py |
Tangent-Bundle-Neural-Networks | Tangent-Bundle-Neural-Networks-main/Journal_repo/layers.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Claudio Battiloro
"""
import torch
import torch.nn as nn
# Graph Convolutional Neural Network Layer
class GNNLayer(nn.Module):
def __init__(self, F_in, F_out, L, kappa,device, sigma):
"""
Parameters
----------
F_in: ... | 4,752 | 37.959016 | 135 | py |
Tangent-Bundle-Neural-Networks | Tangent-Bundle-Neural-Networks-main/Journal_repo/mainTorusDenoising.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Claudio Battiloro
"""
#import warnings
#warnings.filterwarnings("ignore") to suppress warnings
import sys
import pickle as pkl
import numpy.ma as ma
import pytorch_lightning as pl
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
import torc... | 9,188 | 45.64467 | 172 | py |
Tangent-Bundle-Neural-Networks | Tangent-Bundle-Neural-Networks-main/Journal_repo/mainWindPrediction.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Claudio Battiloro
"""
import warnings
#warnings.filterwarnings("ignore") to suppress warnings
import sys
import pytorch_lightning as pl
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
import torch
from architecture import RTNN, RMNN
device... | 9,072 | 47.518717 | 191 | py |
AP-BSN | AP-BSN-master/test.py | import argparse, os
import torch
from src.util.config_parse import ConfigParser
from src.trainer import get_trainer_class
def main():
# parsing configuration
args = argparse.ArgumentParser()
args.add_argument('-s', '--session_name', default=None, type=str)
args.add_argument('-c', '--config', ... | 1,335 | 30.069767 | 78 | py |
AP-BSN | AP-BSN-master/train.py | import argparse, os
from importlib import import_module
import torch
from src.util.config_parse import ConfigParser
from src.trainer import get_trainer_class
def main():
# parsing configuration
args = argparse.ArgumentParser()
args.add_argument('-s', '--session_name', default=None, type=str)
args.a... | 1,089 | 26.25 | 78 | py |
AP-BSN | AP-BSN-master/src/trainer/base.py | import os
import math
import time, datetime
import cv2
import numpy as np
import torch
from torch import nn
from torch import optim
import torch.autograd as autograd
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
from ..util.dnd_submission.bundle_submissions import bundle_su... | 27,989 | 37.767313 | 155 | py |
AP-BSN | AP-BSN-master/src/trainer/trainer.py | import os
import datetime
import torch
from . import regist_trainer
from .base import BaseTrainer
from ..model import get_model_class
@regist_trainer
class Trainer(BaseTrainer):
def __init__(self, cfg):
super().__init__(cfg)
@torch.no_grad()
def test(self):
''' initialization test setti... | 4,319 | 44 | 184 | py |
AP-BSN | AP-BSN-master/src/util/summary_logging.py |
import time
from torch.utils.tensorboard import SummaryWriter
import numpy as np
class LossWriter(SummaryWriter):
def __init__(self, log_dir=None, comment=''):
if log_dir == None:
log_dir = './logs/tensorboard/' + time.strftime('%Y-%m-%d--%H-%M-%S', time.localtime(time.time()))
super(... | 640 | 28.136364 | 110 | py |
AP-BSN | AP-BSN-master/src/util/util.py | from math import exp
import cv2
import numpy as np
import torch
import torch.nn.functional as F
from skimage.metrics import peak_signal_noise_ratio, structural_similarity
def np2tensor(n:np.array):
'''
transform numpy array (image) to torch Tensor
BGR -> RGB
(h,w,c) -> (c,h,w)
'''
# gray
... | 7,961 | 31.765432 | 132 | py |
AP-BSN | AP-BSN-master/src/util/file_manager.py | import os
import cv2
import numpy as np
import torch
from .util import tensor2np
class FileManager:
def __init__(self, session_name:str):
self.output_folder = "./output"
if not os.path.isdir(self.output_folder):
os.makedirs(self.output_folder)
print("[WARNING] output folde... | 1,563 | 35.372093 | 98 | py |
AP-BSN | AP-BSN-master/src/util/dnd_submission/pytorch_wrapper.py | # Author: Tobias Plötz, TU Darmstadt (tobias.ploetz@visinf.tu-darmstadt.de)
# This file is part of the implementation as described in the CVPR 2017 paper:
# Tobias Plötz and Stefan Roth, Benchmarking Denoising Algorithms with Real Photographs.
# Please see the file LICENSE.txt for the license governing this code.
... | 984 | 31.833333 | 89 | py |
AP-BSN | AP-BSN-master/src/datahandler/DND.py | import os
import torch
import h5py
from src.datahandler.denoise_dataset import DenoiseDataSet
from . import regist_dataset
@regist_dataset
class DND(DenoiseDataSet):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def _scan(self):
dataset_path = os.path.join(self.data... | 1,988 | 31.080645 | 92 | py |
AP-BSN | AP-BSN-master/src/datahandler/denoise_dataset.py | import random, os
import cv2
import numpy as np
from scipy.io import savemat
import torch
from torch.utils.data import Dataset
from ..util.util import rot_hflip_img, tensor2np, np2tensor, mean_conv2d
class DenoiseDataSet(Dataset):
def __init__(self, add_noise:str=None, crop_size:list=None, aug:list=None, n... | 17,823 | 41.539379 | 198 | py |
AP-BSN | AP-BSN-master/src/loss/recon.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
from . import regist_loss
eps = 1e-6
# ============================ #
# Reconstruction loss #
# ============================ #
@regist_loss
class L1():
def __call__(self, input_data, model_output, data, module):
output = model... | 563 | 20.692308 | 63 | py |
AP-BSN | AP-BSN-master/src/loss/__init__.py | import os
from importlib import import_module
import torch
import torch.nn as nn
loss_class_dict = {}
def regist_loss(loss_class):
loss_name = loss_class.__name__
assert not loss_name in loss_class_dict, 'there is already registered loss name: %s in loss_class_dict.' % loss_name
loss_class_dict[loss_nam... | 4,173 | 36.267857 | 120 | py |
AP-BSN | AP-BSN-master/src/loss/recon_self.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from . import regist_loss
eps = 1e-6
# ============================ #
# Self-reconstruction loss #
# ============================ #
@regist_loss
class self_L1():
def __call__(self, input_data, model_output, data, module):
output = m... | 750 | 24.896552 | 87 | py |
AP-BSN | AP-BSN-master/src/model/DBSNl.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from . import regist_model
@regist_model
class DBSNl(nn.Module):
'''
Dilated Blind-Spot Network (cutomized light version)
self-implemented version of the network from "Unpaired Learning of Deep Image Denoising (ECCV 2020)"
and severa... | 3,510 | 30.630631 | 104 | py |
AP-BSN | AP-BSN-master/src/model/APBSN.py |
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..util.util import pixel_shuffle_down_sampling, pixel_shuffle_up_sampling
from . import regist_model
from .DBSNl import DBSNl
@regist_model
class APBSN(nn.Module):
'''
Asymmetric PD Blind-Spot Network (AP-BSN)
'''
def __init__(s... | 4,559 | 34.625 | 101 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/model_restore.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 7,125 | 44.679487 | 149 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNetTrainerV2_DDP.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 30,456 | 50.447635 | 132 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNetTrainerV2_CascadeFullRes.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 19,421 | 54.176136 | 128 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNetTrainerV2.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 21,273 | 48.018433 | 134 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNetTrainerV2_DP.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 11,682 | 44.459144 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/network_trainer.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 30,849 | 41.376374 | 150 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNetTrainer.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 39,650 | 53.094134 | 142 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/competitions_with_custom_Trainers/BraTS2020/nnUNetTrainerV2BraTSRegions.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 21,055 | 49.252983 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/competitions_with_custom_Trainers/BraTS2020/nnUNetTrainerV2BraTSRegions_moreDA.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 14,362 | 51.805147 | 119 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/competitions_with_custom_Trainers/MMS/nnUNetTrainerV2_MMS.py | import torch
from nnunet.network_architecture.generic_UNet import Generic_UNet
from nnunet.network_architecture.initialization import InitWeights_He
from nnunet.training.network_training.nnUNet_variants.data_augmentation.nnUNetTrainerV2_insaneDA import \
nnUNetTrainerV2_insaneDA
from nnunet.utilities.nd_softmax imp... | 2,662 | 42.655738 | 117 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/nnUNetTrainerNoDA.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 4,742 | 50.554348 | 117 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/profiling/nnUNetTrainerV2_dummyLoad.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 5,758 | 42.300752 | 199 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/profiling/nnUNetTrainerV2_2epochs.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 13,888 | 46.40273 | 134 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_momentum09.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,192 | 43.185185 | 116 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_reduceMomentumDuringTraining.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,947 | 40.446809 | 120 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_SGD_ReduceOnPlateau.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,707 | 52.098039 | 116 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_momentum09in2D.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,293 | 42.133333 | 116 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_momentum095.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,194 | 43.259259 | 116 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_Adam_ReduceOnPlateau.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,899 | 50.785714 | 117 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_momentum098.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,194 | 43.259259 | 116 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/optimizer_and_lr/nnUNetTrainerV2_Adam.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,245 | 39.193548 | 131 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/data_augmentation/nnUNetTrainerV2_insaneDA.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 7,799 | 54.319149 | 123 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/data_augmentation/nnUNetTrainerV2_noDA.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 7,886 | 53.770833 | 121 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/data_augmentation/nnUNetTrainerV2_DA3.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 19,740 | 55.402857 | 120 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_lReLU_biasInSegOutput.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,288 | 47.702128 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_allConv3x3.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,727 | 43.721311 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_lReLU_convlReLUIN.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,318 | 48.340426 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_NoNormalization.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,256 | 47.021277 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_BN.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,473 | 43.178571 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ReLU.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,180 | 46.413043 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ResencUNet.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 5,977 | 57.038835 | 134 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ReLU_convReLUIN.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,285 | 47.638298 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_GN.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,379 | 45.666667 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_softDeepSupervision.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 6,237 | 47.734375 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_GeLU.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,829 | 37.767123 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ReLU_biasInSegOutput.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,258 | 47.06383 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_3ConvPerStage.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,271 | 47.340426 | 117 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_noDeepSupervision.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 8,908 | 52.668675 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_LReLU_slope_2en1.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,221 | 47.304348 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_Mish.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,228 | 45.4375 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_3ConvPerStage_samefilters.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,214 | 47.152174 | 117 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_FRN.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 2,430 | 43.2 | 124 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/miscellaneous/nnUNetTrainerV2_fullEvals.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 9,982 | 49.933673 | 132 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/network_training/nnUNet_variants/loss_function/nnUNetTrainerV2_focalLoss.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 6,748 | 30.834906 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/data_augmentation/downsampling.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 4,164 | 38.292453 | 132 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/optimizer/ranger.py | ############
# https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer
# This code was taken from the repo above and was not created by me (Fabian)! Full credit goes to the original authors
############
import math
import torch
from torch.optim.optimizer import Optimizer
class Ranger(Optimizer):
def __init_... | 6,465 | 41.261438 | 132 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/loss_functions/dice_loss.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 14,049 | 31.903981 | 121 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/loss_functions/TopK_loss.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,364 | 39.147059 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/loss_functions/crossentropy.py | from torch import nn, Tensor
class RobustCrossEntropyLoss(nn.CrossEntropyLoss):
"""
this is just a compatibility layer because my target tensor is float and has an extra dimension
"""
def forward(self, input: Tensor, target: Tensor) -> Tensor:
if len(target.shape) == len(input.shape):
... | 438 | 35.583333 | 99 | py |
CoTr | CoTr-main/nnUNet/nnunet/training/loss_functions/deep_supervision.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,679 | 37.181818 | 117 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/generic_UNet_DP.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 6,839 | 53.72 | 131 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/neural_network.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 43,801 | 51.964933 | 137 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/initialization.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,673 | 41.923077 | 158 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/generic_UNet.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 20,989 | 45.644444 | 180 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/generic_modular_residual_UNet.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 24,392 | 46.829412 | 125 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/generic_modular_UNet.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 19,951 | 41.451064 | 136 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/custom_modules/helperModules.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,051 | 34.066667 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/custom_modules/conv_blocks.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 9,127 | 38.860262 | 143 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/custom_modules/feature_response_normalization.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,547 | 34.181818 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/network_architecture/custom_modules/mish.py | ############
# https://github.com/lessw2020/mish/blob/master/mish.py
# This code was taken from the repo above and was not created by me (Fabian)! Full credit goes to the original authors
############
import torch
import torch.nn as nn
import torch.nn.functional as F
# Mish - "Mish: A Self Regularized Non-Monotonic... | 730 | 29.458333 | 118 | py |
CoTr | CoTr-main/nnUNet/nnunet/utilities/nd_softmax.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 801 | 35.454545 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/utilities/tensor_utilities.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,624 | 28.545455 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/utilities/to_torch.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 1,167 | 35.5 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/utilities/distributed.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 3,172 | 34.255556 | 114 | py |
CoTr | CoTr-main/nnUNet/nnunet/inference/predict_simple.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 13,593 | 59.150442 | 125 | py |
CoTr | CoTr-main/nnUNet/nnunet/inference/predict.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 42,543 | 51.98132 | 182 | py |
CoTr | CoTr-main/CoTr_package/CoTr/training/model_restore.py | import CoTr
import torch
from batchgenerators.utilities.file_and_folder_operations import *
import importlib
import pkgutil
from nnunet.training.network_training.nnUNetTrainer import nnUNetTrainer
def recursive_find_python_class(folder, trainer_name, current_module):
tr = None
for importer, modname, ispkg in ... | 4,979 | 43.070796 | 130 | py |
CoTr | CoTr-main/CoTr_package/CoTr/training/network_training/nnUNetTrainerV2_ResTrans.py | from collections import OrderedDict
from typing import Tuple
import numpy as np
import torch
import shutil
from nnunet.training.loss_functions.deep_supervision import MultipleOutputLoss2
from nnunet.utilities.to_torch import maybe_to_torch, to_cuda
from nnunet.training.data_augmentation.default_data_augmentation impor... | 18,610 | 46.843188 | 151 | py |
CoTr | CoTr-main/CoTr_package/CoTr/training/network_training/network_trainer.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 30,846 | 41.372253 | 150 | py |
CoTr | CoTr-main/CoTr_package/CoTr/training/network_training/nnUNetTrainer.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 39,572 | 53.061475 | 142 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/neural_network.py | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 44,025 | 52.107358 | 137 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/CNNBackbone.py | # ------------------------------------------------------------------------
# CNN encoder
# ------------------------------------------------------------------------
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
class Co... | 6,314 | 37.272727 | 152 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/ResTranUnet.py | # ------------------------------------------------------------------------
# CoTr
# ------------------------------------------------------------------------
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from CoTr.network_architecture import CNNBackbone
from CoTr.network_architec... | 9,009 | 41.701422 | 191 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/DeTrans/position_encoding.py | """
Positional encodings for the transformer.
"""
import math
import torch
from torch import nn
from typing import Optional
from torch import Tensor
class PositionEmbeddingSine(nn.Module):
"""
This is a more standard version of the position embedding, very similar to the one
used by the Attention is all yo... | 3,032 | 39.986486 | 109 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/DeTrans/DeformableTrans.py | # ------------------------------------------------------------------------
# 3D Deformable Transformer
# ------------------------------------------------------------------------
# Modified from Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LI... | 7,149 | 38.502762 | 132 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/DeTrans/ops/functions/ms_deform_attn_func.py | # ------------------------------------------------------------------------
# 3D Deformable Self-attention
# ------------------------------------------------------------------------
# Modified from Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see ... | 1,798 | 55.21875 | 161 | py |
CoTr | CoTr-main/CoTr_package/CoTr/network_architecture/DeTrans/ops/modules/ms_deform_attn.py | # ------------------------------------------------------------------------
# 3D Deformable Self-attention
# ------------------------------------------------------------------------
# Modified from Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see ... | 5,082 | 51.402062 | 193 | py |
Pytorch-implementation-of-SRNet | Pytorch-implementation-of-SRNet-master/test.py | """This module is used to test the Srnet model."""
from glob import glob
import torch
import numpy as np
import imageio as io
from model import Srnet
TEST_BATCH_SIZE = 40
COVER_PATH = "/path/to/cover/images/"
STEGO_PATH = "/path/to/stego/images/"
CHKPT = "./checkpoints/Srnet_model_weights.pt"
cover_image_names = glob... | 1,824 | 27.968254 | 71 | py |
Pytorch-implementation-of-SRNet | Pytorch-implementation-of-SRNet-master/train.py | """This module is use to train the Srnet model."""
import logging
import os
import sys
import time
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision import transforms
from dataset import dataset
from opts.options import arguments
from model.model import Srnet
from utils.utils... | 5,885 | 29.816754 | 80 | py |
Pytorch-implementation-of-SRNet | Pytorch-implementation-of-SRNet-master/dataset/dataset.py | """This module provide the data sample for training."""
import os
from typing import Tuple
import torch
from torch import Tensor
from torch.utils.data import Dataset
import imageio as io
from opts.options import arguments
opt = arguments()
# pylint: disable=E1101
device = torch.device("cuda:0" if torch.cuda.is_avai... | 2,091 | 29.318841 | 77 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.