cg_input {cgraph}R Documentation

Add Input

Description

Add an input node to the active graph.

Usage

cg_input(name = NULL)

Arguments

name

character scalar, name of the node (optional). In case argument name is missing, the node is added to the graph under an automatically generated name.

Value

cg_node object.

Note

Inputs cannot be assigned a fixed value but behave as placeholders. Values can be assigned to inputs when evaluating or differentiating a graph (see cg_graph_run and cg_graph_gradients for more details).

Author(s)

Ron Triepels

Examples

# Initialize a computational graph
x <- cg_graph()

# Add a parameter with name 'a' to the graph.
a <- cg_input(name = "a")


[Package cgraph version 4.0.3 Index]