Skip to content

Commit

Permalink
adjustments to facilitate packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
drscotthawley committed Jul 24, 2019
1 parent b12c7f4 commit 3d5c824
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 47 deletions.
115 changes: 83 additions & 32 deletions demo/SliderDemo.ipynb

Large diffs are not rendered by default.

Binary file modified demo/modelcheckpoint_4c.tar
Binary file not shown.
30 changes: 15 additions & 15 deletions signaltrain/io_methods.py
Expand Up @@ -8,7 +8,7 @@
from scipy.io.wavfile import write, read
from sys import platform
import matplotlib.pylab as plt
from .nn_modules import nn_proc
#from signaltrain.nn_modules import nn_proc

class AudioIO:
""" Class for handling audio input/output operations.
Expand Down Expand Up @@ -480,21 +480,21 @@ def plot_spectrograms(model, mag_val, mag_val_hat):
plt.title('Processed magnitude')
savefig('mag_hat.png')

if isinstance(model, nn_proc.AsymMPAEC): # Plot the spectrograms
plt.matshow(model.dft_analysis.conv_analysis_real.weight.data.cpu().numpy()[:, 0, :] + 1)
plt.title('Conv-Analysis Real')
savefig('conv_anal_real.png')
plt.matshow(model.dft_analysis.conv_analysis_imag.weight.data.cpu().numpy()[:, 0, :])
plt.title('Conv-Analysis Imag')
savefig('conv_anal_imag.png')
plt.matshow(model.dft_synthesis.conv_synthesis_real.weight.data.cpu().numpy()[:, 0, :])
plt.title('Conv-Synthesis Real')
savefig('conv_synth_real.png')
plt.matshow(model.dft_synthesis.conv_synthesis_imag.weight.data.cpu().numpy()[:, 0, :])
plt.title('Conv-Synthesis Imag')
savefig('conv_synth_imag.png')
return
#if isinstance(model, nn_proc.AsymMPAEC): # Plot the spectrograms
plt.matshow(model.dft_analysis.conv_analysis_real.weight.data.cpu().numpy()[:, 0, :] + 1)
plt.title('Conv-Analysis Real')
savefig('conv_anal_real.png')
plt.matshow(model.dft_analysis.conv_analysis_imag.weight.data.cpu().numpy()[:, 0, :])
plt.title('Conv-Analysis Imag')
savefig('conv_anal_imag.png')
plt.matshow(model.dft_synthesis.conv_synthesis_real.weight.data.cpu().numpy()[:, 0, :])
plt.title('Conv-Synthesis Real')
savefig('conv_synth_real.png')
plt.matshow(model.dft_synthesis.conv_synthesis_imag.weight.data.cpu().numpy()[:, 0, :])
plt.title('Conv-Synthesis Imag')
savefig('conv_synth_imag.png')

return



Expand Down

0 comments on commit 3d5c824

Please sign in to comment.