@@ -48,6 +48,8 @@ def __init__(self, sess, config):
48
48
# Different model layer counts and filter sizes for FSRCNN vs FSRCNN-s (fast), (d, s, m) in paper
49
49
model_params = [[56 , 12 , 4 ], [32 , 8 , 1 ]]
50
50
self .model_params = model_params [self .fast ]
51
+
52
+ self .deconv_radius = [3 , 5 , 7 ][self .scale - 2 ]
51
53
52
54
self .checkpoint_dir = config .checkpoint_dir
53
55
self .output_dir = config .output_dir
@@ -65,11 +67,12 @@ def build_model(self):
65
67
d , s , m = self .model_params
66
68
67
69
expand_weight , deconv_weight = 'w{}' .format (m + 3 ), 'w{}' .format (m + 4 )
70
+ deconv_size = self .deconv_radius * 2 + 1
68
71
self .weights = {
69
72
'w1' : tf .Variable (tf .random_normal ([5 , 5 , 1 , d ], stddev = 0.0378 , dtype = tf .float32 ), name = 'w1' ),
70
73
'w2' : tf .Variable (tf .random_normal ([1 , 1 , d , s ], stddev = 0.3536 , dtype = tf .float32 ), name = 'w2' ),
71
74
expand_weight : tf .Variable (tf .random_normal ([1 , 1 , s , d ], stddev = 0.189 , dtype = tf .float32 ), name = expand_weight ),
72
- deconv_weight : tf .Variable (tf .random_normal ([9 , 9 , 1 , d ], stddev = 0.0001 , dtype = tf .float32 ), name = deconv_weight )
75
+ deconv_weight : tf .Variable (tf .random_normal ([deconv_size , deconv_size , 1 , d ], stddev = 0.0001 , dtype = tf .float32 ), name = deconv_weight )
73
76
}
74
77
75
78
expand_bias , deconv_bias = 'b{}' .format (m + 3 ), 'b{}' .format (m + 4 )
0 commit comments