MCPcopy Create free account
hub / github.com/conflow-dev/ConFlow / Res_layer

Class Res_layer

model_demo/DeepCrossing/layer.py:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58class Res_layer(Layer):
59 def __init__(self, hidden_units):
60 super(Res_layer, self).__init__()
61 self.dense_layer = [MyDense(i, activation="relu") for i in hidden_units]
62
63 def build(self, input_shape):
64 self.output_layer = MyDense(input_shape[-1], activation=None)
65
66 def call(self, inputs, **kwargs):
67 if K.ndim(inputs) != 2:
68 raise ValueError("The dim of inputs should be 2, not %d" % (K.ndim(inputs)))
69 x = inputs
70 for layer in self.dense_layer:
71 x = layer(x)
72 x = self.output_layer(x)
73 output = inputs + x
74 return sgx.e_relu(output)

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected