sub add_output { #Create an unconnected named output my $self = shift; my $graph = $self->{graph}; my $name = shift; my %params = @_; #Check for valid options foreach my $p ( keys %params ) { if ( !exists $valid_userconfigurable_vertex_params->{$p} ) { Carp::confess(sprintf "Unknown Option : $p"); } } #Set the activation function my $activation; if ( exists $params{activation} ) { $activation = $params{activation}; } else { $activation = "SIGMOID"; } #Create the vertex $graph->set_vertex_attributes($name, { id => GetNewVertexNumber($self), added_a_vertex => 1, allow_inputs => "Yes", allow_outputs => "No", activation => $activation, value => 0 }); #Connect vertex to the bias vertex $graph->add_edge("BIAS", $name); #An update to the layout is required $graph->set_graph_attribute("update_layout", 1); }