Description Details Methods Author(s) Examples
R6 class representign a data loader for sequence datasets.
R6 class representign a data loader for sequence datasets.
It loads the data from a R array
new()
Initialisation method
DataLoader.Seq$new(ds, bz)
ds
sequence datast
bz
integer, batch size
length()
Returns the length of teh data loader object
DataLoader.Seq$length()
ds = DataSet.Seq$new(matrix(rnorm(100), 20), 5, 1) dl = DataLoader.Seq$new(ds, 5) ds$length() dl$length()
has.next()
Returns TRUE if the data loader has still batches available
DataLoader.Seq$has.next()
ds = DataSet.Seq$new(matrix(rnorm(100), 20), 5, 1) dl = DataLoader.Seq$new(ds, 5) ds$has.next() # TRUE
reset()
Resets the data loader to its initial state
DataLoader.Seq$reset()
feed()
Feeds the data into a sequence of batches of sequences or it creates a new one
DataLoader.Seq$feed(SEQ, mode = "head")
SEQ
batch of sequences. If NULL it creates a new one
mode
feeding mode
modello.init(100, 100, 100, 100) ds = DataSet.Seq$new(matrix(rnorm(100), 20), 5, 1) dl = DataLoader.Seq$new(ds, 5) SEQ = dl$feed(NULL) print(SEQ) print(SEQ$X[[1]][[1]]$v) dl$feed(SEQ) print(SEQ$X[[1]][[1]]$v) modello.close()
clone()
The objects of this class are cloneable with this method.
DataLoader.Seq$clone(deep = FALSE)
deep
Whether to make a deep clone.
Filippo Monari
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## ------------------------------------------------
## Method `DataLoader.Seq$length`
## ------------------------------------------------
ds = DataSet.Seq$new(matrix(rnorm(100), 20), 5, 1)
dl = DataLoader.Seq$new(ds, 5)
ds$length()
dl$length()
## ------------------------------------------------
## Method `DataLoader.Seq$has.next`
## ------------------------------------------------
ds = DataSet.Seq$new(matrix(rnorm(100), 20), 5, 1)
dl = DataLoader.Seq$new(ds, 5)
ds$has.next() # TRUE
## ------------------------------------------------
## Method `DataLoader.Seq$feed`
## ------------------------------------------------
modello.init(100, 100, 100, 100)
ds = DataSet.Seq$new(matrix(rnorm(100), 20), 5, 1)
dl = DataLoader.Seq$new(ds, 5)
SEQ = dl$feed(NULL)
print(SEQ)
print(SEQ$X[[1]][[1]]$v)
dl$feed(SEQ)
print(SEQ$X[[1]][[1]]$v)
modello.close()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.