python创建自己的函数

from keras.engine import Layer, InputSpec
try:
    from keras import initializations
except ImportError:
    from keras import initializers as initializations
import keras.backend as K

class Scale(Layer):
    def __init__(self, **kwargs):
        self.bianyang = biangliang
    def build(self, input_shape):
        self.input_spec = [InputSpec(shape=input_shape)]
         canshu
    def call(self, x):
        out = F(x)
        return out
    def get_config(self):
       

看了一下定义自己层的例子,这个是减缩基本上是每个模块的功能,感觉要自己编写的话还要再努力一点,每天进步一点点。

猜你喜欢

转载自blog.csdn.net/haoyu_does/article/details/84310444