-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestmodel.py
More file actions
30 lines (24 loc) · 1.07 KB
/
Copy pathtestmodel.py
File metadata and controls
30 lines (24 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import tensorflow as tf
from AudioModel.util import override_model_attrs
import EncDecModel
import supervisedModel
from AudioModel.model import Model, Modes
ckpt = 16384
a = tf.placeholder('float32', (32, 16384, 1, 1))
b = tf.placeholder('float32', (32, 16384, 1, 1))
model = supervisedModel.WaveAE(mode = Modes.TRAIN)
oberrides = "objective=l1,batchnorm=False,train_batch_size=32,alpha=100.0,enc_length=16,stride=4,kernel_len=25,subseq_len=16384"
model, summary = override_model_attrs(model, oberrides)
model(a, b)
# with tf.variable_scope('AE'):
# with tf.variable_scope('E'):
# enc = waveAE.WaveEncoderFactor256(batchnorm=False)
# E_x = enc(a, training=False)
# e_flat = tf.reshape(E_x, [32, -1])
# rd_tensor = tf.layers.dense(e_flat, 5)
# model_dir_path = "/data2/paarth/TrainDir/WaveAE/WaveAEsc09_l1batchnormFalse/eval_sc09_valid"
# e_vars = tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='AE/E')
# print (e_vars)
# saver = tf.train.Saver(var_list=e_vars)
# sess = tf.InteractiveSession()
# saver.restore(sess, '{}/best_valid_l2-{}'.format(model_dir_path, ckpt))