Keras Callback for Auralization of Gradient Norms
Inspired heavily by Christian Perone's blog post and Pytorch implementation
Audio samples can be found here
A loop was performed over the parameter space below to further analyze the differences. Notably the most interesting result is when tweaking the activation function and optimizer.
model = [CNN, DNN]
learning_rates = [1.0, 0.1, 0.01,]
optimizers = [SGD, Adam, RMSprop, Adadelta]
activations = ['relu', 'linear', 'sigmoid', 'tanh']
model = Sequential([...])
model.compile(loss='categorical_crossentropy',
optimizer=opt(lr=lr),
metrics=['accuracy'])
from callbacks import GradientSonification
fs = 44100
duration = 0.01
freq = 200.0
grad_son = GradientSonification(path='sample',
model=model,
fs=fs,
duration=duration,
freq=freq,
plot=True)
model.compile(loss='categorical_crossentropy',
optimizer=opt(lr=lr),
metrics=['accuracy'] + grad_son.metrics)
model.fit(X_train, y_train,
batch_size=32,
epochs=5,
callbacks=[grad_son])