• Home
  • Raw
  • Download

Lines Matching +full:d3 +full:- +full:shape

8    - Redistributions of source code must retain the above copyright
11 - Redistributions in binary form must reproduce the above copyright
52 #return K.clip(p, -self.c, self.c)
62 #x = x - (.25/np.math.pi)*tf.math.sin(2*np.math.pi*x)
63 #x = x - (.25/np.math.pi)*tf.math.sin(2*np.math.pi*x)
64 #x = x - (.25/np.math.pi)*tf.math.sin(2*np.math.pi*x)
68 return soft_quantize(x + (K.random_uniform((128, 16, 80))-.5) )
73 return x + tf.stop_gradient(quantized - x)
78 y = x - d*tf.math.tanh(x/(.1+d))
83 n = y_pred.shape[-1]
84 C = n - log2_e*np.math.log(np.math.gamma(n))
85 k = K.sum(K.abs(y_pred), axis=-1)
87 #rate = C + (n-1)*log2_e*tf.math.log((k**p + (n/5)**p)**(1/p))
88 rate = C + (n-1)*log2_e*tf.math.log(k + .112*n**2/(n/1.8+k) )
91 eps=1e-6
97 lambda_1 = 1./K.sqrt(y_pred[:,:,:,-1])
98 y_pred = y_pred[:,:,:,:-1]
99 ceps = y_pred[:,:,:,:18] - y_true[:,:,:18]
100 pitch = 2*(y_pred[:,:,:,18:19] - y_true[:,:,18:19])/(y_true[:,:,18:19] + 2)
101 corr = y_pred[:,:,:,19:] - y_true[:,:,19:]
103 …_1*K.mean(K.square(ceps) + 10*(1/18.)*K.abs(pitch)*pitch_weight + (1/18.)*K.square(corr), axis=-1))
106 lambda_val = K.sqrt(y_pred[:,:,-1])
107 y_pred = y_pred[:,:,:-1]
109 n = y_pred.shape[-1]//3
112 p0 = 1-r**(.5+.5*p0)
116 y0 = K.maximum(0., 1. - K.abs(y_pred))**2
117 rate = -y0*safelog2(p0*r**K.abs(y_pred)) - (1-y0)*safelog2(.5*(1-p0)*(1-r)*r**(K.abs(y_pred)-1))
118 rate = -safelog2(-.5*tf.math.log(r)*r**K.abs(y_pred))
119 rate = -safelog2((1-r)/(1+r)*r**K.abs(y_pred))
120 …#rate = -safelog2(- tf.math.sinh(.5*tf.math.log(r))* r**K.abs(y_pred) - tf.math.cosh(K.maximum(0.,…
121 rate = lambda_val*K.sum(rate, axis=-1)
125 lambda_val = K.sqrt(y_pred[:,:,-1])
126 y_pred = y_pred[:,:,:-1]
128 n = y_pred.shape[-1]//3
131 p0 = 1-r**(.5+.5*p0)
132 #theta = K.minimum(1., .5 + 0*p0 - 0.04*tf.math.log(r))
133 #p0 = 1-r**theta
135 y0 = K.maximum(0., 1. - K.abs(y_pred))**2
136 rate = -y0*safelog2(p0*r**K.abs(y_pred)) - (1-y0)*safelog2(.5*(1-p0)*(1-r)*r**(K.abs(y_pred)-1))
137 rate = lambda_val*K.sum(rate, axis=-1)
141 y_pred = y_pred[:,:,:-1]
143 n = y_pred.shape[-1]//3
146 p0 = 1-r**(.5+.5*p0)
147 #theta = K.minimum(1., .5 + 0*p0 - 0.04*tf.math.log(r))
148 #p0 = 1-r**theta
150 y0 = K.maximum(0., 1. - K.abs(y_pred))**2
151 rate = -y0*safelog2(p0*r**K.abs(y_pred)) - (1-y0)*safelog2(.5*(1-p0)*(1-r)*r**(K.abs(y_pred)-1))
152 rate = K.sum(rate, axis=-1)
158 x = x/tf.reduce_sum(tf.abs(x), axis=-1, keepdims=True)
168 kk=tf.reduce_sum(abs_y, axis=-1)
170 plus = 1.000001*tf.reduce_min((abs_y+.5)/(abs_kx+1e-15), axis=-1)
171 minus = .999999*tf.reduce_max((abs_y-.5)/(abs_kx+1e-15), axis=-1)
177 factor = tf.expand_dims(factor, axis=-1)
186 #print(K.mean(K.sum(K.abs(y), axis=-1)))
190 x = x/(1e-15+tf.norm(x, axis=-1,keepdims=True))
192 quantized = quantized/(1e-15+tf.norm(quantized, axis=-1,keepdims=True))
193 return x + tf.stop_gradient(quantized - x)
197 return tf.repeat(tf.expand_dims(x[0], 1), K.shape(x[1])[1], axis=1)
202 feat = Input(shape=(None, nb_used_features), batch_size=batch_size)
218 inputs = Reshape((-1, 2*nb_used_features))(feat)
221 d3 = enc_dense3(d2)
222 d4 = enc_dense4(d3)
227 pre_out = Concatenate()([d1, d2, d3, d4, d5, d6, d7, d8])
237 bits_input = Input(shape=(None, nb_bits), batch_size=batch_size, name="dec_bits")
238 gru_state_input = Input(shape=(nb_state_dim,), batch_size=batch_size, name="dec_state")
270 …output = Reshape((-1, nb_used_features))(dec_final(Concatenate()([dec1, dec2, dec3, dec4, dec5, de…
279 bits_input = Input(shape=(None, nb_bits), name="split_bits")
280 gru_state_input = Input(shape=(None,nb_state_dim), name="split_state")
286 for i in range(len(points)-1):
289 state = elem_select([gru_state_input, end-1])
301 for i in range(n-1):
302 offset = 2 * (n-1-i)
303 tmp = K.concatenate([x[i][:, offset:, :], x[-1][:, -offset:, :]], axis=-2)
305 y.append(tf.expand_dims(x[-1], axis=0))
311 feat = Input(shape=(None, nb_used_features), batch_size=batch_size)
312 quant_id = Input(shape=(None,), batch_size=batch_size)
313 lambda_val = Input(shape=(None, 1), batch_size=batch_size)
315 lambda_up = Lambda(lambda x: K.repeat_elements(x, 2, axis=-2))(lambda_val)