当我创建一个简单的Keras模型
model = Sequential()
model.add(Dense(10, activation='tanh', input_dim=1))
model.add(Dense(1, activation='linear'))
model.compile(loss='mean_squared_error', optimizer='adam', metrics=['mean_squared_error'])
并对Tensorboard进行回调
tensorboard = TensorBoard(log_dir='c:/temp/tensorboard/run1', histogram_freq=1, write_graph=True, write_images=False)
model.fit(x, y, epochs=1000, batch_size=1, callbacks=[tensorboard])
换句话说,这是一个完整的混乱。
答案 0 :(得分:4)
您可以使用import AVKit
class AudioManager {
static var sharedInstance = AudioManager()
private var player: AVPlayer?
func play() {
// TODO: Initialize AVPlayer with desired audio track & start playing
// player = AVPlayer(...)
player?.play()
// Register for the did play to end time notification to loop audio
if let item = player?.currentItem {
NotificationCenter.default.addObserver(self, selector: #selector(onPlaybackFinished), name: .AVPlayerItemDidPlayToEndTime, object: item)
}
}
@objc private func onPlaybackFinished() {
player?.seek(to: kCMTimeZero)
player?.play()
}
}
// to start playback from anywhere in your app
AudioManager.sharedInstance.play()
创建名称范围,以便对模型中的图层进行分组。
示例:
K.name_scope('name_scope')
谢谢 https://github.com/fchollet/keras/pull/4233#issuecomment-316954784