Learn R Programming

ruta (version 1.2.0)

autoencoder: Create an autoencoder learner

Description

Represents a generic autoencoder network.

Usage

autoencoder(network, loss = "mean_squared_error")

Value

A construct of class "ruta_autoencoder"

Arguments

network

Layer construct of class "ruta_network" or coercible

loss

A "ruta_loss" object or a character string specifying a loss function

References

See Also

train.ruta_autoencoder

Other autoencoder variants: autoencoder_contractive(), autoencoder_denoising(), autoencoder_robust(), autoencoder_sparse(), autoencoder_variational()

Examples

Run this code

# Basic autoencoder with a network of [input]-256-36-256-[input] and
# no nonlinearities
autoencoder(c(256, 36), loss = "binary_crossentropy")

# Customizing the activation functions in the same network
network <-
  input() +
  dense(256, "relu") +
  dense(36, "tanh") +
  dense(256, "relu") +
  output("sigmoid")

learner <- autoencoder(
  network,
  loss = "binary_crossentropy"
)

Run the code above in your browser using DataLab