bflammers / ANN2

Neural Networks package for R with a fast C++ back-end and special support for unsupervised anomaly detection using autoencoders
GNU Lesser General Public License v3.0
13 stars 3 forks source link

replicator() #10

Closed laermbote2 closed 5 years ago

laermbote2 commented 5 years ago

Hi Bart,

where is the function replicator() gone? It is still part of rdocumentation but not in the package anymore?

Thanks

Karsten

bflammers commented 5 years ago

Hi Karsten,

From release v2.0, the replicator() function is not included anymore. You can get the same functionality with the autoencoder() function with argument activ.functions = c('tanh', 'step', 'tanh'). This will construct an autoencoding neural network with three hidden layers with tanh, step function, and tanh activation functions, in that order. See the example below.

The documentation for the replicator() function has also been removed from this version up.

Best,

Bart


library(ANN2)

# Numerical columns from iris data
X <- iris[,1:4]

# Construct and train replicator neural network
RNN <- autoencoder(X = X, 
                   hidden.layers = c(10, 2, 10), 
                   activ.functions = c('tanh', 'step', 'tanh'), 
                   val.prop = 0, 
                   optim.type = 'adam', 
                   n.epochs = 5000)

# Plotting functions
plot(RNN)
reconstruction_plot(RNN, X)
compression_plot(RNN, X, colors=iris$Species, jitter=TRUE)

# Reconstruction function
reconstruct(RNN, X)
laermbote2 commented 5 years ago

Hi Bart,

thanks for the quick answer. Was my expectation.

Karsten

Von: Bart Lammers notifications@github.com Gesendet: Montag, 26. August 2019 09:39 An: bflammers/ANN2 ANN2@noreply.github.com Cc: laermbote2 karsten_oehler@yahoo.de; Author author@noreply.github.com Betreff: Re: [bflammers/ANN2] replicator() (#10)

Hi Karsten,

From release v2.0, the replicator() function is not included anymore. You can get the same functionality with the autoencoder() function with argument activ.functions = c('tanh', 'step', 'tanh'). This will construct an autoencoding neural network with three hidden layers with tanh, step function, and tanh activation functions, in that order. See the example below.

The documentation for the replicator() function has also been removed from this version up.

Best,

Bart


library(ANN2)

Numerical columns from iris data

X <- iris[,1:4]

Construct and train replicator neural network

RNN <- autoencoder(X = X,

               hidden.layers = c(10, 2, 10),

               activ.functions = c('tanh', 'step', 'tanh'),

               val.prop = 0,

               optim.type = 'adam',

               n.epochs = 5000)

Plotting functions

plot(RNN)

reconstruction_plot(RNN, X)

compression_plot(RNN, X, colors=iris$Species, jitter=TRUE)

Reconstruction function

reconstruct(RNN, X)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbflammers%2FANN2%2Fissues%2F10%3Femail_source%3Dnotifications%26email_token%3DAM4GTKYAJVLXCWZRPTGDRQTQGOB75A5CNFSM4IPHBNMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5DRTHQ%23issuecomment-524753310&data=02%7C01%7Ckarsten.oehler%40wolterskluwer.com%7C4616a13d26d5444e710608d729f86afc%7C8ac76c91e7f141ffa89c3553b2da2c17%7C0%7C0%7C637024019239856046&sdata=ca74uEGronhJD%2BLcqXfM4bsBBeMQAOBXR8YPOQIPZX4%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAM4GTK3NZHZNL4274PT7ZKDQGOB75ANCNFSM4IPHBNMA&data=02%7C01%7Ckarsten.oehler%40wolterskluwer.com%7C4616a13d26d5444e710608d729f86afc%7C8ac76c91e7f141ffa89c3553b2da2c17%7C0%7C0%7C637024019239861044&sdata=%2FhytijcCghhNy5PO6HM0aakGVsoiALtx7TWT%2B9%2BZGzQ%3D&reserved=0.