Class UnsupervisedEdgeWiseModel
java.lang.Object
oracle.pgx.api.mllib.Model<UnsupervisedEdgeWiseModel>
oracle.pgx.api.mllib.EdgeWiseModel<UnsupervisedEdgeWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata, UnsupervisedEdgeWiseModel>
oracle.pgx.api.mllib.UnsupervisedEdgeWiseModel
- All Implemented Interfaces:
AutoCloseable
public class UnsupervisedEdgeWiseModel
extends EdgeWiseModel<UnsupervisedEdgeWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata, UnsupervisedEdgeWiseModel>
A variant of GraphSAGE working on edges.
See
UnsupervisedEdgeWiseModelBuilder for documentation of the hyperparameters.- Since:
- 23.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnsupervisedEdgeWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata) UnsupervisedEdgeWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata modelMetadata) This constructor should never be used to get a model. -
Method Summary
Modifier and TypeMethodDescriptionTrains the EdgeWise model on the input graph.Trains the EdgeWise model on the input graph.Gets the configuration object for the dgi layerGets the loss functionGets the target vertex labelsGets the training log that has evaluation results from validation.inferEmbeddingsAsync(PgxGraph graph, Iterable<PgxEdge> edges) Infers the embeddings for the specified edges.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 EdgeWiseModel
destroy, destroyAsync, fit, fit, getBatchSize, getConfig, getConvLayerConfigs, getEdgeCombinationMethod, getEdgeInputFeatureDim, getEdgeInputPropertyNames, getEmbeddingDim, getInputFeatureDim, getLearningRate, getNumEpochs, getSeed, getTrainingLog, getTrainingLoss, getVertexInputPropertyNames, inferEmbeddings, isFitted
-
Field Details
-
ALGORITHM_NAME
- See Also:
-
-
Constructor Details
-
UnsupervisedEdgeWiseModel
public UnsupervisedEdgeWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata modelMetadata) This constructor should never be used to get a model. UseUnsupervisedEdgeWiseModelBuilderinstead.- Parameters:
session- PgxSession to which the model is connectedcore- Core to which the model is connectedgraphConstructor- Constructor for a PgxGraphmodelMetadata- Metadata concerning the different hyper-parameters of the EdgeWise Model- Since:
- 23.2
-
UnsupervisedEdgeWiseModel
public UnsupervisedEdgeWiseModel(PgxSession session, oracle.pgx.api.internal.Core core, Supplier<String> keystorePathSupplier, Supplier<char[]> keystorePasswordSupplier, BiFunction<PgxSession, oracle.pgx.api.internal.Graph, PgxGraph> graphConstructor, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata)
-
-
Method Details
-
fitAsync
Trains the EdgeWise model on the input graph.- Specified by:
fitAsyncin classEdgeWiseModel<UnsupervisedEdgeWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata, UnsupervisedEdgeWiseModel>- Parameters:
graph- input graph to fit on.- Since:
- 23.2
-
fitAsync
Trains the EdgeWise model on the input graph.- Specified by:
fitAsyncin classEdgeWiseModel<UnsupervisedEdgeWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata, UnsupervisedEdgeWiseModel>- 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 classEdgeWiseModel<UnsupervisedEdgeWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata, UnsupervisedEdgeWiseModel>- Returns:
- training log
- Since:
- 24.2
-
inferEmbeddingsAsync
Infers the embeddings for the specified edges.- Specified by:
inferEmbeddingsAsyncin classEdgeWiseModel<UnsupervisedEdgeWiseModelConfig, oracle.pgx.api.internal.mllib.UnsupervisedEdgeWiseModelMetadata, UnsupervisedEdgeWiseModel>- Parameters:
graph- the input graphedges- the edges to produce embeddings to- Returns:
- PgxFrame containing the embeddings for each edge.
- Since:
- 23.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:
- 23.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:
- 23.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:
- 23.2
-
getLossFunction
Gets the loss function- Returns:
- loss function
- Since:
- 23.2
-
getTargetEdgeLabels
-
getDgiLayerConfigs
Gets the configuration object for the dgi layer- Returns:
- configuration
- Since:
- 23.2
-