def __init__(self, n_hidden, w_x, w_h, bias_filler=0): self.name = "gru" self.n_hidden = n_hidden self.w_x = Parameter.from_any(w_x) self.w_h = Parameter.from_any(w_h) self.b_r = Parameter.from_any(bias_filler) self.b_u = Parameter.from_any(bias_filler) self.b_c = Parameter.from_any(bias_filler) self.act_r = Activation.from_any("sigmoid") self.act_u = Activation.from_any("sigmoid") self.act_c = Activation.from_any("tanh") self.clip = 5 self._tmp_x = None
def __init__(self, n_hidden, w_x, w_h, bias_filler=0): self.name = 'gru' self.n_hidden = n_hidden self.w_x = Parameter.from_any(w_x) self.w_h = Parameter.from_any(w_h) self.b_r = Parameter.from_any(bias_filler) self.b_u = Parameter.from_any(bias_filler) self.b_c = Parameter.from_any(bias_filler) self.act_r = Activation.from_any('sigmoid') self.act_u = Activation.from_any('sigmoid') self.act_c = Activation.from_any('tanh') self.clip = 5 self._tmp_x = None
def __init__(self, n_hidden, n_out, w_xh=0, w_hh=0, w_hy=0, bias_h=0.0, bias_y=0, activation="tanh"): self.name = "recurrent" self.n_hidden = n_hidden self.n_out = n_out self.w_xh = Parameter.from_any(w_xh) self.w_hh = Parameter.from_any(w_hh) self.w_hy = Parameter.from_any(w_hy) self.b_h = Parameter.from_any(bias_h) self.b_y = Parameter.from_any(bias_y) self.activation = Activation.from_any(activation) self._tmp_x = None
def __init__(self, n_hidden, n_out, w_xh=0, w_hh=0, w_hy=0, bias_h=0.0, bias_y=0, activation='tanh'): self.name = 'recurrent' self.n_hidden = n_hidden self.n_out = n_out self.w_xh = Parameter.from_any(w_xh) self.w_hh = Parameter.from_any(w_hh) self.w_hy = Parameter.from_any(w_hy) self.b_h = Parameter.from_any(bias_h) self.b_y = Parameter.from_any(bias_y) self.activation = Activation.from_any(activation) self._tmp_x = None