knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "tools/" )
Several different sigmoid functions are implemented, including a wrapper function, SoftMax preprocessing and inverse functions.
The stable version can be installed from CRAN using:
The development version, to be used at your peril, can be installed from GitHub using the
if (!require('remotes')) install.packages('remotes') remotes::install_github('bquast/sigmoid')
Following installation, the package can be loaded using:
sigmoid() function returns the sigmoid value of the input(s), by default this is done using the standard logistic function.
Inputs can also be tensors, such as vectors, matrices, or arrays.
sigmoid(-5:5) sigmoid( matrix(-3:5,nrow=3) ) # etc.
sigmoid() function is a wrapper, which by default uses the
logistic() function, it can also use other methods.
sigmoid( -5:5, method='Gompertz' )
These functions can also be accessed directly.
These mappings are similar but not identical.
library(ggplot2) input = -5:5 df = data.frame(input, logistic(input), Gompertz(input)) ggplot(df, aes(input, logistic(input))) + geom_line() + geom_line(aes(input,Gompertz(input)), colour='red')
For inverses, additional parameters, SoftMax, etc. see the vignette.
For general information on using the package, please refer to the help files.
An overview of the changes is available in the NEWS file.
There is a dedicated website with information hosted on my personal website.
Development takes place on the GitHub page.
Bugs can be filed on the issues page on GitHub.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.