Class UnsupervisedGraphWiseModel
java.lang.Object
oracle.pgx.api.mllib.Model<UnsupervisedGraphWiseModel>
oracle.pgx.api.mllib.GraphWiseModel<UnsupervisedGraphWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata, UnsupervisedGraphWiseModel>
oracle.pgx.api.mllib.UnsupervisedGraphWiseModel
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
UnsupervisedAnomalyDetectionGraphWiseModel
public class UnsupervisedGraphWiseModel
extends GraphWiseModel<UnsupervisedGraphWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata, UnsupervisedGraphWiseModel>
A variant of Deep Graph Infomax (DGI).
See
UnsupervisedGraphWiseModelBuilder for documentation of the hyperparameters.- Since:
- 21.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnsupervisedGraphWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor) UnsupervisedGraphWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata modelMetadata, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor) This constructor should never be used to get a model. -
Method Summary
Modifier and TypeMethodDescriptionTrains the GraphWise model on the input graph.Trains the GraphWise model on the input graph.Gets the configuration object for the embedding methodGets the loss functionGets the training log that has evaluation results from validation.Get a GnnExplainer object that can explain this model's predictions.inferEmbeddingsAsync(PgxGraph graph, Iterable<PgxVertex<ID>> vertices) Infers the embeddings for the specified vertices.voidBlocking version ofstoreAsync(String, String).voidBlocking version ofstoreAsync(String, String).storeAsync(String path, String key) Stores the GraphWise model in the specified path, with encryption.storeAsync(String path, String key, boolean overwrite) Stores the GraphWise model in the specified path, with encryption.Methods inherited from class GraphWiseModel
destroy, destroyAsync, fit, fit, getBatchSize, getConfig, getConvLayerConfigs, getEdgeInputFeatureDim, getEdgeInputPropertyNames, getEmbeddingDim, getInputFeatureDim, getLearningRate, getNumEpochs, getSeed, getTrainingLog, getTrainingLoss, getVertexInputPropertyNames, inferEmbeddings, isFitted
-
Field Details
-
ALGORITHM_NAME
- See Also:
-
-
Constructor Details
-
UnsupervisedGraphWiseModel
public UnsupervisedGraphWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata modelMetadata, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor) This constructor should never be used to get a model. UseUnsupervisedGraphWiseModelBuilderinstead.- Parameters:
session- PgxSession to which the model is connectedcore- Core to which the model is connectedmodelMetadata- Metadata concerning the different hyper-parameters of the GraphWise Model- Since:
- 21.2
-
UnsupervisedGraphWiseModel
public UnsupervisedGraphWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor)
-
-
Method Details
-
fitAsync
Trains the GraphWise model on the input graph.- Specified by:
fitAsyncin classGraphWiseModel<UnsupervisedGraphWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata, UnsupervisedGraphWiseModel>- Parameters:
graph- input graph to fit on.- Since:
- 21.2
-
fitAsync
Trains the GraphWise model on the input graph.- Specified by:
fitAsyncin classGraphWiseModel<UnsupervisedGraphWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata, UnsupervisedGraphWiseModel>- Parameters:
trainGraph- input train graph to fit on.valGraph- input graph to evaluate on for validation.- Since:
- 24.2
-
getTrainingLogAsync
Gets the training log that has evaluation results from validation. It is available only after the model was trained with validation.- Specified by:
getTrainingLogAsyncin classGraphWiseModel<UnsupervisedGraphWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata, UnsupervisedGraphWiseModel>- Returns:
- training log
- Since:
- 24.2
-
inferEmbeddingsAsync
public <ID> PgxFuture<PgxFrame> inferEmbeddingsAsync(PgxGraph graph, Iterable<PgxVertex<ID>> vertices) Infers the embeddings for the specified vertices.- Specified by:
inferEmbeddingsAsyncin classGraphWiseModel<UnsupervisedGraphWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedGraphWiseModelMetadata, UnsupervisedGraphWiseModel>- Returns:
- PgxFrame containing the embeddings for each vertex.
- Since:
- 21.2
-
gnnExplainer
Get a GnnExplainer object that can explain this model's predictions.- Returns:
- UnsupervisedGnnExplainer object
- Since:
- 22.2
-
storeAsync
public PgxFuture<Void> storeAsync(String path, String key) throws ExecutionException, InterruptedException Stores the GraphWise model in the specified path, with encryption.- Parameters:
path- path to store the modelkey- the encryption key, or null if no encryption should be used.- Throws:
ExecutionExceptionInterruptedException- Since:
- 21.2
-
storeAsync
-
store
Blocking version ofstoreAsync(String, String). CallsstoreAsync(String, String)and waits for the returnedPgxFutureto complete.- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.- Since:
- 21.2
-
store
public void store(String path, String key, boolean overwrite) throws ExecutionException, InterruptedException Blocking version ofstoreAsync(String, String). CallsstoreAsync(String, String)and waits for the returnedPgxFutureto complete.- Throws:
InterruptedException- if the caller thread gets interrupted while waiting for completion.ExecutionException- if any exception occurred during asynchronous execution. The actual exception will be nested.- Since:
- 21.2
-
getLossFunction
Gets the loss function- Returns:
- loss function
- Since:
- 21.2
-
getEmbeddingConfig
Gets the configuration object for the embedding method- Returns:
- configuration
- Since:
- 23.2
-