'Context weights'

def init_params(self):

    if self.disable_dialogue_encoder:
        return
    if self.bidirectional_utterance_encoder:
        input_dim = (self.qdim_encoder * 2)
    else:
        input_dim = self.qdim_encoder
    transformed_input_dim = input_dim
    if self.deep_dialogue_encoder_input:
        transformed_input_dim = self.sdim
        self.input_mlp = TwoLayerMLP(self.state, self.rng, input_dim, self.sdim, self.sdim, self, ('_input_mlp_' + self.name))
        self.params += self.input_mlp.params
    self.Ws_in = add_to_params(self.params, theano.shared(value=NormalInit(self.rng, transformed_input_dim, self.sdim), name=('Ws_in' + self.name)))
    self.Ws_hh = add_to_params(self.params, theano.shared(value=OrthogonalInit(self.rng, self.sdim, self.sdim), name=('Ws_hh' + self.name)))
    self.bs_hh = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('bs_hh' + self.name)))
    if (self.dialogue_encoder_gating == 'GRU'):
        self.Ws_in_r = add_to_params(self.params, theano.shared(value=NormalInit(self.rng, transformed_input_dim, self.sdim), name=('Ws_in_r' + self.name)))
        self.Ws_in_z = add_to_params(self.params, theano.shared(value=NormalInit(self.rng, transformed_input_dim, self.sdim), name=('Ws_in_z' + self.name)))
        self.Ws_hh_r = add_to_params(self.params, theano.shared(value=OrthogonalInit(self.rng, self.sdim, self.sdim), name=('Ws_hh_r' + self.name)))
        self.Ws_hh_z = add_to_params(self.params, theano.shared(value=OrthogonalInit(self.rng, self.sdim, self.sdim), name=('Ws_hh_z' + self.name)))
        self.bs_z = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('bs_z' + self.name)))
        self.bs_r = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('bs_r' + self.name)))
        self.Ws_in_overwrite = add_to_params(self.params, theano.shared(value=NormalInit(self.rng, transformed_input_dim, self.sdim), name=('Ws_in_overwrite' + self.name)))
        self.bs_overwrite = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('bs_overwrite' + self.name)))
        self.Ws_in_o = add_to_params(self.params, theano.shared(value=NormalInit(self.rng, transformed_input_dim, self.sdim), name=('Ws_in_o' + self.name)))
        self.Ws_hh_o = add_to_params(self.params, theano.shared(value=OrthogonalInit(self.rng, self.sdim, self.sdim), name=('Ws_hh_o' + self.name)))
        self.bs_o = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('bs_o' + self.name)))
        self.normop_in_hs_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_in_hs_gamma' + self.name)))
        self.normop_in_hs_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_in_hs_mean' + self.name)))
        self.normop_in_hs_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_in_hs_var' + self.name)))
        self.normop_in_h_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_in_h_gamma' + self.name)))
        self.normop_in_h_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_in_h_mean' + self.name)))
        self.normop_in_h_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_in_h_var' + self.name)))
        self.normop_rs_hs_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_rs_hs_gamma' + self.name)))
        self.normop_rs_hs_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_rs_hs_mean' + self.name)))
        self.normop_rs_hs_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_rs_hs_var' + self.name)))
        self.normop_rs_h_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_rs_h_gamma' + self.name)))
        self.normop_rs_h_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_rs_h_mean' + self.name)))
        self.normop_rs_h_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_rs_h_var' + self.name)))
        self.normop_zs_hs_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_zs_hs_gamma' + self.name)))
        self.normop_zs_hs_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_zs_hs_mean' + self.name)))
        self.normop_zs_hs_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_zs_hs_var' + self.name)))
        self.normop_zs_h_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_zs_h_gamma' + self.name)))
        self.normop_zs_h_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_zs_h_mean' + self.name)))
        self.normop_zs_h_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_zs_h_var' + self.name)))
        self.normop_os_hs_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_os_hs_gamma' + self.name)))
        self.normop_os_hs_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_os_hs_mean' + self.name)))
        self.normop_os_hs_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_os_hs_var' + self.name)))
        self.normop_os_h_gamma = add_to_params(self.params, theano.shared(value=(self.normop_gamma_init * np.ones((self.sdim,), dtype='float32')), name=('normop_os_h_gamma' + self.name)))
        self.normop_os_h_mean = add_to_params(self.params, theano.shared(value=np.zeros((self.sdim,), dtype='float32'), name=('normop_os_h_mean' + self.name)))
        self.normop_os_h_var = add_to_params(self.params, theano.shared(value=(1e-07 * np.ones((self.sdim,), dtype='float32')), name=('normop_os_h_var' + self.name)))
