inflate: "inflate" a vector by repeating rows or columns

Description Usage Arguments Details

Description

A vector can be tagged with the attribute inflatable by make_inflatable. This is useful when a vector of adjustable parameters needs to be re-used across the rows or columns of a matrix (e.g. if each row of an error distribution has its own standard deviation).

Usage

1
2
3
4
5
6
7
8
9
inflate(x)

## Default S3 method:
inflate(x)

## S3 method for class 'inflatable'
inflate(x)

make_inflatable(x, by, n)

Arguments

x

a vector

by

one of "row" or "col". Should elements be repeated across rows or across columns?

n

number of times to repeat each element

Details

inflatable vectors can be inflated to repeat their elements across the rows or columns in a newly-formed matrix, but are otherwise unchanged. Calling inflate() on a non-inflatable vector will leave the vector unchanged. The derivatives of inflatable vectors are automatically handled separatly by backprop()


davharris/mistnet2 documentation built on May 14, 2019, 9:28 p.m.