Package oracle.pgx.api.mllib
Class SupervisedEdgeWiseModelBuilder
java.lang.Object
oracle.pgx.api.mllib.WiseModelBuilder<Config,Self>
oracle.pgx.api.mllib.EdgeWiseModelBuilder<SupervisedEdgeWiseModel,SupervisedEdgeWiseModelConfig,SupervisedEdgeWiseModelBuilder>
oracle.pgx.api.mllib.SupervisedEdgeWiseModelBuilder
public class SupervisedEdgeWiseModelBuilder
extends EdgeWiseModelBuilder<SupervisedEdgeWiseModel,SupervisedEdgeWiseModelConfig,SupervisedEdgeWiseModelBuilder>
Builder for
SupervisedEdgeWiseModel
The builder can be used to set the configuration of the model and create the model object.- Since:
- 23.1
-
Constructor Summary
ConstructorsConstructorDescriptionSupervisedEdgeWiseModelBuilder(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the SupervisedEdgeWise model with the specified parameters.setBatchGenerator(BatchGenerator batchGenerator) Sets the batch generator.setClassWeights(Map<?, Float> classWeights) Set the class weights to be used in the loss function.setEdgeTargetPropertyName(String propertyName) Set the target (labels) for the algorithm in the form of a property name of the graph.setLossFunction(LossFunction lossFunction) Sets the loss function for the algorithm.setPredictionLayerConfigs(GraphWisePredictionLayerConfig... layerConfigs) Set the prediction layer configurations (SeeGraphWisePredictionLayerConfig.Methods inherited from class oracle.pgx.api.mllib.EdgeWiseModelBuilder
setEdgeCombinationMethod, setTargetEdgeLabels, setTargetEdgeLabelsMethods inherited from class oracle.pgx.api.mllib.WiseModelBuilder
setBatchSize, setConvLayerConfigs, setEdgeInputPropertyConfigs, setEdgeInputPropertyNames, setEdgeInputPropertyNames, setEmbeddingDim, setEnableAccelerator, setLearningRate, setNormalize, setNumEpochs, setSeed, setShuffle, setStandardize, setValidationConfig, setVertexInputPropertyConfigs, setVertexInputPropertyNames, setVertexInputPropertyNames, setWeightDecay
-
Constructor Details
-
SupervisedEdgeWiseModelBuilder
public SupervisedEdgeWiseModelBuilder(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor)
-
-
Method Details
-
setEdgeTargetPropertyName
Set the target (labels) for the algorithm in the form of a property name of the graph.Supported property types are given by
SupervisedEdgeWiseModelConfig.SUPPORTED_LABEL_TYPES.- Parameters:
propertyName- property name- Returns:
- this
- Since:
- 23.1
-
setPredictionLayerConfigs
public SupervisedEdgeWiseModelBuilder setPredictionLayerConfigs(GraphWisePredictionLayerConfig... layerConfigs) Set the prediction layer configurations (SeeGraphWisePredictionLayerConfig. You must pass at least one prediction layer config (or leave it as default).Note that for the last layer:
- the activation function will be ignored (and replaced with the activation function of the loss function, e.g. softmax or sigmoid).
- the hidden dimension will be ignored (and replaced with the number of classes)
default:
SupervisedEdgeWiseModelConfig.DEFAULT_PREDICTION_LAYER_CONFIGS- Parameters:
layerConfigs- layer configs- Returns:
- this
- Since:
- 23.1
-
setClassWeights
Set the class weights to be used in the loss function. The loss for the corresponding class will be multiplied by the factor given in this map. If null, uniform class weights will be used.- Parameters:
classWeights- map from classes to weights- Returns:
- this
- Since:
- 23.1
-
setLossFunction
Sets the loss function for the algorithm. SeeLossFunctiondefault:
SoftmaxCrossEntropyLoss- Parameters:
lossFunction- loss function- Returns:
- this
- Since:
- 23.1
-
setBatchGenerator
Sets the batch generator. SeeBatchGeneratordefault:
StandardBatchGenerator- Parameters:
batchGenerator- batch generator- Returns:
- this
- Since:
- 23.1
-
build
Builds the SupervisedEdgeWise model with the specified parameters.- Specified by:
buildin classEdgeWiseModelBuilder<SupervisedEdgeWiseModel,SupervisedEdgeWiseModelConfig, SupervisedEdgeWiseModelBuilder> - Returns:
- SupervisedEdgeWise model
- Throws:
InterruptedExceptionExecutionException- Since:
- 23.1
-