-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathneuralnet.py
41 lines (34 loc) · 1.9 KB
/
neuralnet.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
from tensorflow.keras.layers import Conv2D, Input
from tensorflow.keras.initializers import RandomNormal
from tensorflow.keras.models import Model
import tensorflow as tf
def SRCNN915():
X_in = Input(shape=(None, None, 3))
X = Conv2D(filters=64, kernel_size=9, padding='valid', activation='relu',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X_in)
X = Conv2D(filters=32, kernel_size=1, padding='valid', activation='relu',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X)
X = Conv2D(filters=3, kernel_size=5, padding='valid',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X)
X_out = tf.clip_by_value(X, 0.0, 1.0)
return Model(X_in, X_out, name="SRCNN915")
def SRCNN935():
X_in = Input(shape=(None, None, 3))
X = Conv2D(filters=64, kernel_size=9, padding='valid', activation='relu',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X_in)
X = Conv2D(filters=32, kernel_size=3, padding='valid', activation='relu',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X)
X = Conv2D(filters=3, kernel_size=5, padding='valid',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X)
X_out = tf.clip_by_value(X, 0.0, 1.0)
return Model(X_in, X_out, name="SRCNN935")
def SRCNN955():
X_in = Input(shape=(None, None, 3))
X = Conv2D(filters=64, kernel_size=9, padding='valid', activation='relu',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X_in)
X = Conv2D(filters=32, kernel_size=5, padding='valid', activation='relu',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X)
X = Conv2D(filters=3, kernel_size=5, padding='valid',
kernel_initializer=RandomNormal(mean=0.0, stddev=0.001))(X)
X_out = tf.clip_by_value(X, 0.0, 1.0)
return Model(X_in, X_out, name="SRCNN955")