R/RcppExports.R

Defines functions cpp_train_network_relu rcpprelu_neg rcpprelu

Documented in cpp_train_network_relu rcpprelu rcpprelu_neg

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Function used as part of other functions
#' @description relu-function
#' @param x input in the relu function
#'
#' @export
rcpprelu <- function(x) {
    .Call(`_CoOL_rcpprelu`, x)
}

#' Function used as part of other functions
#' @description negative relu-function
#' @param x input in the negative relu-function
#'
#' @export
rcpprelu_neg <- function(x) {
    .Call(`_CoOL_rcpprelu_neg`, x)
}

#' Function used as part of other functions
#' @description Non-negative neural network
#' @param x A matrix of predictors for the training dataset of shape (nsamples, nfeatures)
#' @param y A vector of output values for the training data with a length similar to the number of rows of x
#' @param c A vector of the data to adjust the analysis for such as calendar time (training data) with the same number of rows as x.
#' @param testx A matrix of predictors for the test dataset of shape (nsamples, nfeatures)
#' @param testy A vector of output values for the test data with a length similar to the number of rows of x
#' @param testc A vector the data to adjust the analysis for such as calendar time (training data) with the same number of rows as x.
#' @param W1_input Input-hidden layer weights of shape (nfeatuers, hidden) 
#' @param B1_input Biases for the hidden layer of shape (1, hidden) 
#' @param W2_input Hidden-output layer weights of shape (hidden, 1) 
#' @param B2_input Bias for the output layer (the baseline risk) af shape (1, 1)
#' @param C2_input Bias for the data to adjust the analysis for 
#' @param lr Initial learning rate
#' @param maxepochs The maximum number of epochs
#' @param ipw a vector of weights per observation to allow for inverse probability of censoring weighting to correct for selection bias
#' @param input_parameter_reg Regularisation decreasing parameter value at each iteration for the input parameters
#' @param drop_out To drop connections if their weights reaches zero.
#' @param fix_baseline_risk To fix the baseline risk at a value.
#' @return A list of class "SCL" giving the estimated matrices and performance indicators
#' @author Andreas Rieckmann, Piotr Dworzynski, Leila Arras, Claus Ekstrøm
#'
#' @export
cpp_train_network_relu <- function(x, y, c, testx, testy, testc, W1_input, B1_input, W2_input, B2_input, C2_input, ipw, lr = 0.01, maxepochs = 100, input_parameter_reg = 0.000001, drop_out = 0L, fix_baseline_risk = -1) {
    .Call(`_CoOL_cpp_train_network_relu`, x, y, c, testx, testy, testc, W1_input, B1_input, W2_input, B2_input, C2_input, ipw, lr, maxepochs, input_parameter_reg, drop_out, fix_baseline_risk)
}
ekstroem/CoOL documentation built on June 1, 2022, 12:33 p.m.