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 |
|---|---|---|---|---|---|---|
GraphNOTEARS | GraphNOTEARS-main/GraphNOTEARS_syn_p_1/lbfgsb_scipy.py | import torch
import scipy.optimize as sopt
class LBFGSBScipy(torch.optim.Optimizer):
"""Wrap L-BFGS-B algorithm, using scipy routines.
Courtesy: Arthur Mensch's gist
https://gist.github.com/arthurmensch/c55ac413868550f89225a0b9212aa4cd
"""
def __init__(self, params):
defaults = dict(... | 4,142 | 30.150376 | 80 | py |
GraphNOTEARS | GraphNOTEARS-main/GraphNOTEARS_syn_p_1/notears_torch_version.py | from locally_connected import LocallyConnected
from lbfgsb_scipy import LBFGSBScipy
from trace_expm import trace_expm
import torch
import torch.nn as nn
import numpy as np
class NotearsMLP(nn.Module):
def __init__(self, dims, bias=True):
super(NotearsMLP, self).__init__()
assert len(dims) >= 2
... | 4,145 | 31.645669 | 97 | py |
ABECIS | ABECIS-main/setup.py | import os
import torch
TORCH_VERSION = ".".join(torch.__version__.split(".")[:2])
CUDA_VERSION = torch.__version__.split("+")[-1]
try:
print("Setting up the ABECIS Environment")
command = "pip3 install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/" + \
CUDA_VERSION+"/torch"+TORCH_VERSI... | 479 | 35.923077 | 96 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/training/PHTransTrainer.py | import torch.backends.cudnn as cudnn
from time import time
from _warnings import warn
from tqdm import trange
from collections import OrderedDict
from typing import Tuple
from thop import profile, clever_format
import numpy as np
import torch
import wandb
import os
from nnunet.training.data_augmentation.data_augmentati... | 43,049 | 49.174825 | 157 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/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,326 | 43.406061 | 149 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/network_architecture/swin_unetr.py | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 30,624 | 41.125172 | 158 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/network_architecture/phtrans.py | from audioop import bias
import torch.nn.functional as F
import torch
import numpy as np
import torch.nn as nn
import torch.utils.checkpoint as checkpoint
from timm.models.layers import DropPath, trunc_normal_
from nnunet.network_architecture.neural_network import SegmentationNetwork
from einops import rearrange
from .... | 14,543 | 49.675958 | 158 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/network_architecture/unetr.py | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 8,904 | 38.577778 | 156 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/network_architecture/swin_3D.py | import torch
import torch.nn as nn
from timm.models.layers import DropPath, to_2tuple, to_3tuple, trunc_normal_
from einops import rearrange
class Mlp(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
super().__init__()
out_features =... | 12,470 | 42.003448 | 140 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/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... | 14,718 | 59.32377 | 125 | py |
PHTrans | PHTrans-main/PHTrans/phtrans/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... | 44,871 | 52.546539 | 182 | py |
PHTrans | PHTrans-main/nnUNet/setup.py | from setuptools import setup, find_namespace_packages
setup(name='nnunet',
packages=find_namespace_packages(include=["nnunet", "nnunet.*"]),
version='1.7.0',
description='nnU-Net. Framework for out-of-the box biomedical image segmentation.',
url='https://github.com/MIC-DKFZ/nnUNet',
autho... | 3,065 | 56.849057 | 154 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 34,513 | 49.238719 | 153 | py |
PHTrans | PHTrans-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,617 | 54.418079 | 132 | py |
PHTrans | PHTrans-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... | 22,044 | 48.76298 | 134 | py |
PHTrans | PHTrans-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,638 | 44.464844 | 124 | py |
PHTrans | PHTrans-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... | 31,383 | 41.4682 | 153 | py |
PHTrans | PHTrans-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,757 | 53.092517 | 142 | py |
PHTrans | PHTrans-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,314 | 49.629454 | 124 | py |
PHTrans | PHTrans-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,415 | 52 | 119 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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,489 | 49.449438 | 117 | py |
PHTrans | PHTrans-main/nnUNet/nnunet/training/network_training/nnUNet_variants/benchmarking/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... | 6,509 | 42.986486 | 199 | py |
PHTrans | PHTrans-main/nnUNet/nnunet/training/network_training/nnUNet_variants/benchmarking/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... | 14,098 | 47.119454 | 134 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-main/nnUNet/nnunet/training/network_training/nnUNet_variants/data_augmentation/nnUNetTrainerV2_DA5.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,353 | 46.334884 | 126 | py |
PHTrans | PHTrans-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,727 | 54.2 | 123 | py |
PHTrans | PHTrans-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,811 | 53.25 | 119 | py |
PHTrans | PHTrans-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... | 9,841 | 50.528796 | 119 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 6,082 | 59.83 | 134 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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,236 | 47.726563 | 124 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ResencUNet_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... | 6,085 | 56.961905 | 134 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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,834 | 52.545455 | 124 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-main/nnUNet/nnunet/training/network_training/nnUNet_variants/architectural_variants/nnUNetTrainerV2_ResencUNet_DA3_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,155 | 46.911111 | 116 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 1,469 | 49.689655 | 114 | py |
PHTrans | PHTrans-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,137 | 38.409524 | 132 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 13,960 | 31.849412 | 121 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-main/nnUNet/nnunet/training/loss_functions/focal_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... | 7,847 | 39.246154 | 118 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 44,015 | 51.089941 | 137 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 20,006 | 41.477707 | 136 | py |
PHTrans | PHTrans-main/nnUNet/nnunet/network_architecture/generic_modular_preact_residual_UNet.py | import numpy as np
from copy import deepcopy
import torch
from torch.backends import cudnn
from torch.cuda.amp import GradScaler, autocast
from torch.nn import Identity
from nnunet.network_architecture.generic_UNet import Upsample
from nnunet.network_architecture.generic_modular_UNet import PlainConvUNetDecoder, get_d... | 27,608 | 43.530645 | 157 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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,175 | 35.75 | 114 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-main/nnUNet/nnunet/run/load_pretrained_weights.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,504 | 38.761905 | 114 | py |
PHTrans | PHTrans-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 |
PHTrans | PHTrans-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... | 44,753 | 52.405728 | 182 | py |
FewRel | FewRel-master/train_demo.py | from fewshot_re_kit.data_loader import get_loader, get_loader_pair, get_loader_unsupervised
from fewshot_re_kit.framework import FewShotREFramework
from fewshot_re_kit.sentence_encoder import CNNSentenceEncoder, BERTSentenceEncoder, BERTPAIRSentenceEncoder, RobertaSentenceEncoder, RobertaPAIRSentenceEncoder
import mode... | 10,423 | 40.03937 | 160 | py |
FewRel | FewRel-master/fewshot_re_kit/old_data_loader.py | import json
import os
import multiprocessing
import numpy as np
import random
import torch
from torch.autograd import Variable
class FileDataLoader:
def next_batch(self, B, N, K, Q):
'''
B: batch size.
N: the number of relations for each batch
K: the number of support instances for ... | 14,915 | 50.434483 | 130 | py |
FewRel | FewRel-master/fewshot_re_kit/data_loader.py | import torch
import torch.utils.data as data
import os
import numpy as np
import random
import json
class FewRelDataset(data.Dataset):
"""
FewRel Dataset
"""
def __init__(self, name, encoder, N, K, Q, na_rate, root):
self.root = root
path = os.path.join(root, name + ".json")
if ... | 11,191 | 35.695082 | 98 | py |
FewRel | FewRel-master/fewshot_re_kit/framework.py | import os
import sklearn.metrics
import numpy as np
import sys
import time
from . import sentence_encoder
from . import data_loader
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
# from pytorch_pretrained_bert import BertAdam
from transformers... | 13,715 | 37.206128 | 164 | py |
FewRel | FewRel-master/fewshot_re_kit/sentence_encoder.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
import os
from torch import optim
from . import network
from transformers import BertTokenizer, BertModel, BertForMaskedLM, BertForSequenceClassification, RobertaModel, RobertaTokenizer, RobertaForSequenceClassification
c... | 11,750 | 36.186709 | 163 | py |
FewRel | FewRel-master/fewshot_re_kit/network/embedding.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
class Embedding(nn.Module):
def __init__(self, word_vec_mat, max_length, word_embedding_dim=50, pos_embedding_dim=5):
nn.Module.__init__(self)
self.max_length = max_length
se... | 1,358 | 34.763158 | 129 | py |
FewRel | FewRel-master/fewshot_re_kit/network/encoder.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from torch import optim
class Encoder(nn.Module):
def __init__(self, max_length, word_embedding_dim=50, pos_embedding_dim=5, hidden_size=230):
nn.Module.__init__(self)
self.max_length... | 1,554 | 36.02381 | 110 | py |
FewRel | FewRel-master/models/gnn_iclr.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Pytorch requirements
'''
GNN models implemented by vgsatorras from https://github.com/vgsatorras/few-shot-gnn
'''
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
if torch.cuda.is_available():
dtype = torch.cuda.Fl... | 13,521 | 37.090141 | 154 | py |
FewRel | FewRel-master/models/d.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
class Discriminator(nn.Module):
def __init__(self, hidden_size=230, num_labels=2):
nn.Module.__init__(self)
self.hi... | 698 | 25.884615 | 54 | py |
FewRel | FewRel-master/models/snail.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
import numpy as np
class CausalConv1d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size=2, dilation=2):
sup... | 5,400 | 36.248276 | 133 | py |
FewRel | FewRel-master/models/mtb.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
class Mtb(fewshot_re_kit.framework.FewShotREModel):
"""
Use the same few-shot model as the paper "Matching the Blanks: Distributiona... | 2,314 | 36.95082 | 134 | py |
FewRel | FewRel-master/models/pair.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
class Pair(fewshot_re_kit.framework.FewShotREModel):
def __init__(self, sentence_encoder, hidden_size=230):
fewshot_re_kit.... | 1,236 | 36.484848 | 80 | py |
FewRel | FewRel-master/models/proto.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
class Proto(fewshot_re_kit.framework.FewShotREModel):
def __init__(self, sentence_encoder, dot=False):
fewshot_re_kit.frame... | 1,894 | 34.092593 | 97 | py |
FewRel | FewRel-master/models/proto_norm.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
def l2norm(X):
norm = torch.pow(X, 2).sum(dim=-1, keepdim=True).sqrt()
X = torch.div(X, norm)
return X
class ProtoNorm(fewshot_... | 1,974 | 34.909091 | 93 | py |
FewRel | FewRel-master/models/gnn.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
from . import gnn_iclr
class GNN(fewshot_re_kit.framework.FewShotREModel):
def __init__(self, sentence_encoder, N, hidden_size=230)... | 1,805 | 35.857143 | 118 | py |
FewRel | FewRel-master/models/siamese.py | import sys
sys.path.append('..')
import fewshot_re_kit
import torch
from torch import autograd, optim, nn
from torch.autograd import Variable
from torch.nn import functional as F
class Siamese(fewshot_re_kit.framework.FewShotREModel):
def __init__(self, sentence_encoder, hidden_size=230, dropout=0):
f... | 1,939 | 33.642857 | 93 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.