View source: R/approach_vaeac_torch_modules.R
categorical_to_one_hot_layer | R Documentation |
torch::nn_module()
Representing a categorical_to_one_hot_layer
The categorical_to_one_hot_layer
module/layer expands categorical features into one-hot vectors,
because multi-layer perceptrons are known to work better with this data representation.
It also replaces NaNs with zeros in order so that further layers may work correctly.
categorical_to_one_hot_layer(
one_hot_max_sizes,
add_nans_map_for_columns = NULL
)
one_hot_max_sizes |
A torch tensor of dimension |
add_nans_map_for_columns |
Optional list which contains indices of columns which is_nan masks are to be appended to the result tensor. This option is necessary for the full encoder to distinguish whether value is to be reconstructed or not. |
Note that the module works with mixed data represented as 2-dimensional inputs and it
works correctly with missing values in groundtruth
as long as they are represented by NaNs.
Lars Henry Berge Olsen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.