Package oracle.pgx.api.mllib
Class WiseModelBuilder<Config extends GraphWiseBaseModelConfig,Self extends WiseModelBuilder>
- java.lang.Object
-
- oracle.pgx.api.mllib.WiseModelBuilder<Config,Self>
-
- Direct Known Subclasses:
EdgeWiseModelBuilder
,GraphWiseModelBuilder
public abstract class WiseModelBuilder<Config extends GraphWiseBaseModelConfig,Self extends WiseModelBuilder> extends java.lang.Object
Abstract builder class for GraphWise models. UseSupervisedGraphWiseModelBuilder
instead of this.- Since:
- 19.4
-
-
Constructor Summary
Constructors Constructor Description WiseModelBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Self
setBatchSize(int batchSize)
Set the batch size.Self
setConvLayerConfigs(GraphWiseBaseConvLayerConfig... layerConfigs)
Set the convolutional layer configurations (SeeGraphWiseConvLayerConfig
andGraphWiseAttentionLayerConfig
).Self
setEdgeInputPropertyConfigs(InputPropertyConfig... propertyConfigs)
Set edge input property configs.Self
setEdgeInputPropertyNames(java.lang.String... edgeInputPropertyNames)
Set the edges input features for the algorithm in the form of names of properties on the graph.Self
setEdgeInputPropertyNames(java.util.List<java.lang.String> edgeInputPropertyNames)
Set the edge input features for the algorithm in the form of names of properties on the graph.Self
setEmbeddingDim(int embeddingDim)
Set the embedding dimension of the model.Self
setEnableAccelerator(boolean enableAccelerator)
If true, use the accelerator (GPU) if available as the machine learning backend.Self
setLearningRate(double learningRate)
Set the learning rate used for the Adam optimizerSelf
setNormalize(boolean normalize)
Whether to l2 normalize the output of the convolutional layers.Self
setNumEpochs(int numEpochs)
Set the number of training epochs.Self
setSeed(java.lang.Integer seed)
Sets the random seed used for fitting the model.Self
setShuffle(boolean shuffle)
If true, the model will shuffle the order of vertices before each epoch.Self
setStandardize(boolean standardize)
Whether to standardize the batch before passing them through a convolutional layer.Self
setValidationConfig(GraphWiseValidationConfig validationConfig)
Set the validation configuration (SeeGraphWiseValidationConfig
).Self
setVertexInputPropertyConfigs(InputPropertyConfig... propertyConfigs)
Set vertex input property configs.Self
setVertexInputPropertyNames(java.lang.String... vertexInputPropertyNames)
Set the input features for the algorithm in the form of names of properties on the graph.Self
setVertexInputPropertyNames(java.util.List<java.lang.String> vertexInputPropertyNames)
Set the input features for the algorithm in the form of names of properties on the graph.Self
setWeightDecay(double weightDecay)
Set the weight decay used for the Adam optimizer
-
-
-
Method Detail
-
setBatchSize
public Self setBatchSize(int batchSize)
Set the batch size. This batch size will be used for both the training and inference.- Parameters:
batchSize
- batch size- Returns:
- this
- Since:
- 19.4
-
setNumEpochs
public Self setNumEpochs(int numEpochs)
Set the number of training epochs.- Parameters:
numEpochs
- number of epochs- Returns:
- this
- Since:
- 19.4
-
setEnableAccelerator
public Self setEnableAccelerator(boolean enableAccelerator)
If true, use the accelerator (GPU) if available as the machine learning backend.default: {true}
- Parameters:
enableAccelerator
- whether to use the accelerator if available- Returns:
- this
- Since:
- 24.1
-
setLearningRate
public Self setLearningRate(double learningRate)
Set the learning rate used for the Adam optimizer- Parameters:
learningRate
- learning rate- Returns:
- this
- Since:
- 19.4
-
setWeightDecay
public Self setWeightDecay(double weightDecay)
Set the weight decay used for the Adam optimizer- Parameters:
weightDecay
- weight decay- Returns:
- this
- Since:
- 22.2
-
setEmbeddingDim
public Self setEmbeddingDim(int embeddingDim)
Set the embedding dimension of the model. This is the dimension of the embeddings produced by each of the convolutional layers.- Parameters:
embeddingDim
- embedding dimension- Returns:
- this
- Since:
- 19.4
-
setShuffle
public Self setShuffle(boolean shuffle)
If true, the model will shuffle the order of vertices before each epoch.- Parameters:
shuffle
- whether to shuffle- Returns:
- this
- Since:
- 19.4
-
setSeed
public Self setSeed(java.lang.Integer seed)
Sets the random seed used for fitting the model. If null, the random seed will be chosen randomly.- Parameters:
seed
- random seed- Returns:
- this
- Since:
- 19.4
-
setConvLayerConfigs
public Self setConvLayerConfigs(GraphWiseBaseConvLayerConfig... layerConfigs)
Set the convolutional layer configurations (SeeGraphWiseConvLayerConfig
andGraphWiseAttentionLayerConfig
).default:
GraphWiseBaseModelConfig.DEFAULT_CONV_LAYER_CONFIGS
- Parameters:
layerConfigs
- layer configurations- Returns:
- this
- Since:
- 19.4
-
setValidationConfig
public Self setValidationConfig(GraphWiseValidationConfig validationConfig)
Set the validation configuration (SeeGraphWiseValidationConfig
). Setting this will allow users to run validation during training.- Parameters:
validationConfig
- validation configuration- Returns:
- this
- Since:
- 24.2
-
setVertexInputPropertyNames
public Self setVertexInputPropertyNames(java.util.List<java.lang.String> vertexInputPropertyNames)
Set the input features for the algorithm in the form of names of properties on the graph. You can set multiple input properties.Supported property types are given by
GraphWiseBaseModelConfig.SUPPORTED_INPUT_TYPES
. Additionally, float and double vector properties are supported.- Parameters:
vertexInputPropertyNames
- list of property names- Returns:
- this
- Since:
- 19.4
-
setVertexInputPropertyNames
public Self setVertexInputPropertyNames(java.lang.String... vertexInputPropertyNames)
Set the input features for the algorithm in the form of names of properties on the graph. You can set multiple input properties.Supported graph property types are:
- integer
- long
- boolean
- double
- float
- string
- double vectors
- float vectors
- Parameters:
vertexInputPropertyNames
- property names- Returns:
- this
- Since:
- 19.4
-
setEdgeInputPropertyNames
public Self setEdgeInputPropertyNames(java.util.List<java.lang.String> edgeInputPropertyNames)
Set the edge input features for the algorithm in the form of names of properties on the graph. You can set multiple input properties.Supported property types are given by
GraphWiseBaseModelConfig.SUPPORTED_INPUT_TYPES
. Additionally, float and double vector properties are supported.- Parameters:
edgeInputPropertyNames
- list of property names- Returns:
- this
- Since:
- 21.2
-
setEdgeInputPropertyNames
public Self setEdgeInputPropertyNames(java.lang.String... edgeInputPropertyNames)
Set the edges input features for the algorithm in the form of names of properties on the graph. You can set multiple input properties.Supported graph property types are:
- integer
- long
- boolean
- double
- float
- string
- double vectors
- float vectors
- Parameters:
edgeInputPropertyNames
- property names- Returns:
- this
- Since:
- 21.2
-
setVertexInputPropertyConfigs
public Self setVertexInputPropertyConfigs(InputPropertyConfig... propertyConfigs)
Set vertex input property configs. You can set multiple input property configs.Currently only string properties are supported for input property configs.
- Parameters:
propertyConfigs
- list of property configs- Returns:
- this
- Since:
- 23.2
-
setEdgeInputPropertyConfigs
public Self setEdgeInputPropertyConfigs(InputPropertyConfig... propertyConfigs)
Set edge input property configs. You can set multiple input property configs.Currently only string properties are supported for input property configs.
- Parameters:
propertyConfigs
- list of property configs- Returns:
- this
- Since:
- 23.2
-
setStandardize
public Self setStandardize(boolean standardize)
Whether to standardize the batch before passing them through a convolutional layer.- Parameters:
standardize
- whether to standardize- Returns:
- this
- Since:
- 19.4
-
setNormalize
public Self setNormalize(boolean normalize)
Whether to l2 normalize the output of the convolutional layers.- Parameters:
normalize
- whether to normalize- Returns:
- this
- Since:
- 23.2
-
-