Learn R Programming

SPOTMisc (version 1.19.52)

active2All: Active to all

Description

Recreates the full set of parameters from the subset of active ones.

Usage

active2All(x, a, model)

Value

y full parameters

Arguments

x

subset of parameters

a

names of the active parameters

model

model (char)

Examples

Run this code
model <- "dl"
# indices of active variables
i <- c(1,3)
# names of active variables
a <- getVarNames(model=model,i=i)
x <- getModelConf(model=model)$defaults
# now matrix x has only active variables 1 and 3:
x <- x[1, getIndices(model=model, a=a), drop=FALSE]
# reconstruct the full set of parameters
active2All(x, a, model)
# 2nd example: new values to x (dropout=0.1, units=11):
x <- matrix(c(0.1,11), nrow=1)
a <- c("dropout", "units")
# reconstruct the full set of parameters
active2All(x, a, model)
# matrix
x <- rbind(x,2*x)
active2All(x, a, model)


Run the code above in your browser using DataLab