seq_gen3: RNN action sequence generator

Description Usage Arguments Value See Also

View source: R/seq_generator.R

Description

seq_gen3 generates action sequences according to a recurrent neural network

Usage

1
2
3
4
seq_gen3(n, events = letters, rnn_type = "lstm", K = 10,
  weights = NULL, max_len = 100, initial_state = NULL,
  start_index = 1, end_index = length(events), include_time = FALSE,
  time_intv_dist = list("exp", 1))

Arguments

n

An integer. The number of action sequences to be generated.

events

A character vector specifying the set of N possible actions. Default is letters.

rnn_type

the type of recurrent unit to be used for generating sequences. "lstm" for the long-short term memory unit. "gru" for the gated recurrent unit.

K

the latent dimension of the recurrent unit.

weights

a list containing the weights in the embedding layer, the recurrent unit, the fully connected layer. If not (properly) specified, randomly generated weights are used.

max_len

Maximum length of generated sequences.

initial_state

a list containing the initial state of the recurrent neural network. If rnn_type="lstm", it contains two 1 by K matrices. If rnn_type="gru", it contains one 1 by K matrix. If not specified, all the elements are set to zero.

start_index

Index of the action indicating the start of an item in events.

end_index

Index of the action indicating the end of an item in events.

include_time

logical. Indicate if timestamp sequences should be generated. Default is FALSE.

time_intv_dist

A list specifying the distribution of the inter-arrival time.

Value

A list containing the following elements

seqs

an object of class "proc" with time_seqs=NULL.

weights

a list containing the weights used for generating sequences.

See Also

Other sequence generators: seq_gen2, seq_gen


ProcData documentation built on April 1, 2021, 5:07 p.m.