captcha_transform_label | R Documentation |
This function performs a one-hot encoding of the label, transform a label
with N
letters in a matrix of dimensions N
xlength(vocab)
. All the
labels must have the same length.
captcha_transform_label(all_letters, vocab)
all_letters |
list of tokens for all files |
vocab |
unique tokens |
torch tensor with dimensions length(all_letters)
xlength(vocab)
containing only zeros and ones. All rows sum exactly one.
if (torch::torch_is_installed()) {
vocab <- letters
resp <- captcha_transform_label(c("a","b","c","d","e"), vocab)
class(resp)
dim(resp)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.