def __init__(self, dim_in, dim_out, name, priors=(0., 0., 0.), N=1, nonlin='relu', type_init='he2', n_inducing=50, noise_lvl=0.01): sigma_in = 0.01 params = [nnu.randmat(dim_in, dim_out, 'mu_' + name, type_init=type_init, type_dist='normal'), nnu.randvector(dim_in, 'sigma_row_mgauss_' + name, sigma=sigma_in), nnu.randvector(dim_out, 'sigma_col_mgauss_' + name, sigma=sigma_in), nnu.randmat2(n_inducing, dim_in, 'inducing_x_' + name, sigma=sigma_in, type_dist='uniform'), nnu.randmat2(n_inducing, dim_out, 'inducing_y_' + name, sigma=sigma_in, type_dist='uniform'), nnu.multvector(dim_in, np.log(np.sqrt(noise_lvl)), name='dropout_alpha_ffdrop_x_' + name), nnu.multvector(dim_out, np.log(np.sqrt(noise_lvl)), name='dropout_alpha_ffdrop_y_' + name), nnu.multvector(n_inducing, np.log(np.sqrt(noise_lvl)), name='dropout_alpha_ffdrop_pd_' + name)] self.dim_in = dim_in self.dim_out = dim_out self.name = name self.type_init = type_init self.n_inducing = n_inducing self.noise_lvl = noise_lvl super(MatrixGaussDiagLayerFF, self).__init__(params, N=N, nonlin=nonlin, priors=priors)
def __init__(self, dim_in, dim_out, name, priors=(0., 1., 1.), N=1, nonlin='relu', type_init='he2', n_inducing=50, noise_lvl=0.01): sigma_in = 0.01 self.a0, self.b0 = 1., .5 params = [nnu.randmat(dim_in, dim_out, 'mu_' + name, type_init=type_init), nnu.randvector(dim_in, 'sigma_row_mgauss_' + name, sigma=sigma_in), nnu.randvector(dim_out, 'sigma_col_mgauss_' + name, sigma=sigma_in), nnu.randmat2(n_inducing, dim_in, 'inducing_x_' + name, sigma=sigma_in, type_dist='uniform'), nnu.randmat2(n_inducing, dim_out, 'inducing_y_' + name, sigma=sigma_in, type_dist='uniform'), nnu.multvector(1, np.log(self.a0), 'row_a_' + name), nnu.multvector(1, np.log(self.b0), 'row_b_' + name), nnu.multvector(1, np.log(self.a0), 'col_a_' + name), nnu.multvector(1, np.log(self.b0), 'col_b_' + name), nnu.tscalar(np.log(np.sqrt(noise_lvl)), 'scalar_dropout_alpha_x_' + name), nnu.tscalar(np.log(np.sqrt(noise_lvl)), 'scalar_dropout_alpha_y_' + name)] self.dim_in = dim_in self.dim_out = dim_out self.name = name self.type_init = type_init self.n_inducing = n_inducing self.noise_lvl = noise_lvl super(MatrixGaussDiagLayerLearnP, self).__init__(params, N=N, nonlin=nonlin, priors=priors)