R/math_helpers.R

Defines functions sigmoid

Documented in sigmoid

#' @title Calculates the sigmoid function of the input
#'
#' @param float A float number
#'
#' @returns A float number which is the result of the sigmoid function
#' 
#' @examples
#' sigmoid(0)
#' sigmoid(2)
#' 
#' @export
sigmoid <- function(float) {
  return (1.0 / (1 + exp(-float)))
}

Try the profrep package in your browser

Any scripts or data that you put into this service are public.

profrep documentation built on May 29, 2024, 6:25 a.m.