knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "tools/"
)

sigmoid

License CRAN Version R build status Coverage Status Total RStudio Cloud Downloads RStudio Cloud Downloads

Several different sigmoid functions are implemented, including a wrapper function, SoftMax preprocessing and inverse functions.

Demonstration

sigmoid demonstration

Installation

The stable version can be installed from CRAN using:

install.packages('sigmoid')

The development version, to be used at your peril, can be installed from GitHub using the remotes package.

if (!require('remotes')) install.packages('remotes')
remotes::install_github('bquast/sigmoid')

Usage

Following installation, the package can be loaded using:

The sigmoid() function returns the sigmoid value of the input(s), by default this is done using the standard logistic function.

library(sigmoid)
sigmoid(3)

Inputs can also be tensors, such as vectors, matrices, or arrays.

sigmoid(-5:5)
sigmoid( matrix(-3:5,nrow=3) ) # etc.

The 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.

logistic(1:5)
Gompertz(-1:-5)

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.

vignette('sigmoid')

For general information on using the package, please refer to the help files.

help('sigmoid')
help(package='sigmoid')

Additional Information

An overview of the changes is available in the NEWS file.

news(package='sigmoid')

Development

Development takes place on the GitHub page.

https://github.com/bquast/sigmoid

Bugs can be filed on the issues page on GitHub.

https://github.com/bquast/sigmoid/issues



bquast/sigmoid documentation built on Nov. 16, 2023, 3:30 a.m.