-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.py
72 lines (65 loc) · 3.51 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import utils
from model import create_model
import torch.nn as nn
def get_default(input_depth=3, output_depth=3, pad='zero'):
return create_model(downsample_channels = [128, 128, 128, 128, 128],
upsample_channels = [128, 128, 128, 128, 128],
skip_channels = [4, 4, 4, 4, 4],
input_channel_size = input_depth,
output_channel_size = output_depth,
upsample_mode='bilinear',
activation_function=nn.LeakyReLU(0.2, inplace=True),
padding_type=pad
)
def get_simple(input_depth=3, output_depth=3, pad='zero'):
return create_model(downsample_channels = [32, 32],
upsample_channels = [32, 32],
skip_channels = [0, 0],
input_channel_size = input_depth,
output_channel_size = output_depth,
upsample_mode='bilinear',
activation_function=nn.LeakyReLU(0.2, inplace=True),
padding_type=pad
)
def get_no_skip(input_depth=3, output_depth=3, pad='zero'):
return create_model(downsample_channels = [128, 128, 128, 128, 128],
upsample_channels = [128, 128, 128, 128, 128],
skip_channels = [0, 0, 0, 0, 0],
input_channel_size = input_depth,
output_channel_size = output_depth,
upsample_mode='bilinear',
activation_function=nn.LeakyReLU(0.2, inplace=True),
padding_type=pad
)
def get_large_skip(input_depth=3, output_depth=3, pad='zero'):
return create_model(downsample_channels = [128, 128, 128, 128, 128],
upsample_channels = [128, 128, 128, 128, 128],
skip_channels = [64, 64, 64, 64, 64],
input_channel_size = input_depth,
output_channel_size = output_depth,
upsample_mode='bilinear',
activation_function=nn.LeakyReLU(0.2, inplace=True),
padding_type=pad
)
def get_inc_no_skip(input_depth=3, output_depth=3, pad='zero'):
return create_model(downsample_channels = [16, 32, 64, 128, 128],
upsample_channels = [16, 32, 64, 128, 128],
skip_channels = [0, 0, 0, 0, 0],
input_channel_size = input_depth,
output_channel_size = output_depth,
upsample_mode='bilinear',
activation_function=nn.LeakyReLU(0.2, inplace=True),
padding_type=pad
)
def get_inc_dec_filter_size(input_depth=3, output_depth=3, pad='zero'):
return create_model(downsample_channels = [16, 32, 64, 128, 128],
upsample_channels = [16, 32, 64, 128, 128],
skip_channels = [0, 0, 0, 0, 0],
filter_size_down = [7, 5, 5, 3, 3],
filter_size_up = [7, 5, 5, 3, 3],
input_channel_size = input_depth,
output_channel_size = output_depth,
upsample_mode='bilinear',
activation_function=nn.LeakyReLU(0.2, inplace=True),
padding_type=pad
)