Documentation ¶
Overview ¶
Package lstmsc provides an implementation of LSTM enriched with a PolicyGradient to enable Dynamic Skip Connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { nn.BaseModel PolicyGradient *stack.Model Lambda float64 WIn nn.Param `spago:"type:weights"` WInRec nn.Param `spago:"type:weights"` BIn nn.Param `spago:"type:biases"` WOut nn.Param `spago:"type:weights"` WOutRec nn.Param `spago:"type:weights"` BOut nn.Param `spago:"type:biases"` WFor nn.Param `spago:"type:weights"` WForRec nn.Param `spago:"type:weights"` BFor nn.Param `spago:"type:biases"` WCand nn.Param `spago:"type:weights"` WCandRec nn.Param `spago:"type:weights"` BCand nn.Param `spago:"type:biases"` States []*State `spago:"scope:processor"` }
Model contains the serializable parameters.
func New ¶
New returns a new model with parameters initialized to zeros. Lambda is the coefficient used in the equation λa + (1 − λ)b where 'a' is state[t-k] and 'b' is state[t-1].
func (*Model) Forward ¶
Forward performs the forward step for each input node and returns the result.
func (*Model) LastState ¶
LastState returns the last state of the recurrent network. It returns nil if there are no states.
func (*Model) PolicyGradientLogProbActions ¶
PolicyGradientLogProbActions returns the log probabilities for each action estimated by the policy gradient.
func (*Model) SetInitialState ¶
SetInitialState sets the initial state of the recurrent network. It panics if one or more states are already present.