[1c0e03]: / man / layer_pos_sinusoid_wrapper.Rd

Download this file

40 lines (34 with data), 1.0 kB

 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
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/custom_layers.R
\name{layer_pos_sinusoid_wrapper}
\alias{layer_pos_sinusoid_wrapper}
\title{Layer for positional encoding}
\usage{
layer_pos_sinusoid_wrapper(
maxlen = 100,
vocabulary_size = 4,
n = 10000,
load_r6 = FALSE,
embed_dim = 64
)
}
\arguments{
\item{maxlen}{Length of predictor sequence.}
\item{vocabulary_size}{Number of unique character in vocabulary.}
\item{n}{Frequency of sine waves for positional encoding. Only applied if \code{pos_encoding = "sinusoid"}.}
\item{load_r6}{Whether to load the R6 layer class.}
\item{embed_dim}{Dimension for token embedding. No embedding if set to 0. Should be used when input is not one-hot encoded
(integer sequence).}
}
\value{
A keras layer implementing positional encoding using sine/cosine waves.
}
\description{
Positional encoding layer with sine/cosine matrix of different frequencies.
}
\examples{
\donttest{
library(keras)
l <- layer_pos_sinusoid_wrapper()
}
}