This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# directly listing all the midpoints of the interval using np.linspace | |
midpoints = np.linspace(5, 95, 10) | |
# frequency of each interval | |
freq = np.array([0, 5, 315, 1606, 3105, 2935, 1500, 324, 21, 0]) | |
# elementwise product to get midpoint*frequency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def initi(var_shape): | |
real_part = nprand.rand(var_shape[0], var_shape[1], var_shape[2], var_shape[3]) | |
imag_part = nprand.rand(var_shape[0], var_shape[1], var_shape[2], var_shape[3]) | |
return tf.constant_initializer(real_part + imag_part*1.0j) | |
def lrelu(tensor_in): # this is not leaky-relu | |
temp_real = tf.real(tensor_in) | |
temp_imag = tf.imag(tensor_in) | |
return tf.complex(temp_real, temp_imag) |