8.3.3 Advanced Hyperparameter Customization

You can build a Unsupervised GraphWise model with only vertex properties or only edge properties or both using rich hyperparameter customization.

This is implemented using the sub-config class, GraphWiseConvLayerConfig.

The following code describes the implementation of the configuration in a Unsupervised GraphWise model:

opg4j> var weightProperty = analyst.pagerank(trainGraph).getName()
opg4j> var convLayerConfig = analyst.graphWiseConvLayerConfigBuilder().
                setNumSampledNeighbors(25).
                setActivationFunction(ActivationFunction.TANH).
                setWeightInitScheme(WeightInitScheme.XAVIER).
                setWeightedAggregationProperty(weightProperty).
                build()

opg4j> var model = analyst.unsupervisedGraphWiseModelBuilder().
                setVertexInputPropertyNames("features").
                setConvLayerConfigs(convLayerConfig).
                build()
String weightProperty = analyst.pagerank(trainGraph).getName();
GraphWiseConvLayerConfig convLayerConfig = analyst.graphWiseConvLayerConfigBuilder()
    .setNumSampledNeighbors(25)
    .setActivationFunction(ActivationFunction.TANH)
    .setWeightInitScheme(WeightInitScheme.XAVIER)
    .setWeightedAggregationProperty(weightProperty)
    .build();

UnsupervisedGraphWiseModel model = analyst.unsupervisedGraphWiseModelBuilder()
    .setVertexInputPropertyNames("features")
    .setConvLayerConfigs(convLayerConfig)
    .build();
weightProperty = analyst.pagerank(train_graph).name

conv_layer_config = dict(num_sampled_neighbors=25,
                         activation_fn='tanh',
                         weight_init_scheme='xavier',
                         neighbor_weight_property_name=weightProperty)
conv_layer = analyst.graphwise_conv_layer_config(**conv_layer_config)
params = dict(conv_layer_config=[conv_layer],
              vertex_input_property_names=["features"])

model = analyst.unsupervised_graphwise_builder(**params)

See UnsupervisedGraphWiseModelBuilder and GraphWiseConvLayerConfigBuilder in Javadoc for full description of all available hyperparameters and their default values.