R/computeOutput1.R

computeOutput1 <- function(x,weights) {
  
  H <- length(weights@alpha_h)
  
  # calculate interim vector r
  r <- c(1:H)
  r <- vapply(r, function(h) weights@alpha_h[h] + sum(weights@w_ih[ ,h]*x),1)
  
  # calculate interim value z
  z <- weights@alpha + sum(weights@w_h*logistic(r))
  
  return(logistic(z))
}

Try the TeachNet package in your browser

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

TeachNet documentation built on May 2, 2019, 7 a.m.