这是我的模型的定义方式: 我正在尝试使用tensorboad可视化体重变化。
def model():
model = keras.models.Sequential()
model.add(keras.layers.Dense(3, input_dim= 8 ,use_bias= True, activation= "sigmoid", name= 'l1'))
model.add(keras.layers.Dense(3,use_bias= True, activation="sigmoid", name='l2'))
model.add(keras.layers.Dense(10,use_bias= True, activation="sigmoid", name='l3'))
sft = keras.optimizers.SGD(lr=0.01)
model.compile(optimizer= sft,
loss='categorical_crossentropy',
metrics=['accuracy'])
model.summary()
return model
models = model()
#filepath = "/Users/atharvachalke/Desktop/UCD/Fall 2019/Ecs171/Hw2/Weights/w{epoch:02d}.hdf5"
#checkpoint = ModelCheckpoint(filepath, save_weights_only=True)
#callbacks_list = [checkpoint]
tensorboard = keras.callbacks.TensorBoard(log_dir='./Graph', histogram_freq=1, write_graph=True, write_images=True,write_grads= True, batch_size= 1)
history = models.fit(x = X, y = Y, batch_size= 1, epochs = 100, validation_split= 0.3,callbacks = [tensorboard] )
当我输入的是尺寸标注时,图形上如何有6条线 (1,8)而我对l1的权重是(8,3)??