上传者: 38717843
|
上传时间: 2022-02-09 12:29:50
|
文件大小: 54KB
|
文件类型: -
在2.2.0版本前,
from keras import backend as K
from keras.engine.topology import Layer
class MyLayer(Layer):
def __init__(self, output_dim, **kwargs):
self.output_dim = output_dim
super(MyLayer, self).__init__(**kwargs)
def build(self, input_shape):
# 为该层创建一个可训练的权重
self.kernel = self