Skip to contents

Compiles the model. The method prepares a neural network for estimation by setting the optimizer, loss function, and other parameters as needed.

DLMatchingModel

The method calls the tf.keras.compile method of the tf.keras.Model class.

NSMatchingModel

Neural symbolic models are fitted using a custom training loop. The method sets the optimizer for model training. The loss (for hybrid neural-symbolic and deep learning models) is set to binary cross-entropy ( tf.keras.losses.BinaryCrossentropy)

RefutationModel

Refutation models, similar to neural-symbolic models (NSMatchingModel), are fitted using a custom. The method sets the optimizer for model training.

Usage

compile(object, ...)

# S4 method for class 'neer_match.matching_model.DLMatchingModel'
compile(object, ...)

# S4 method for class 'neer_match.matching_model.NSMatchingModel'
compile(object, optimizer = tensorflow::tf$keras$optimizers$Adam())

# S4 method for class 'neer_match.reasoning.RefutationModel'
compile(object, optimizer = tensorflow::tf$keras$optimizers$Adam())

Arguments

object

A matching model object.

...

Additional arguments passed to tf.keras.compile.

optimizer

A tf.keras.optimizers optimizer object.

Value

Called for side effects.

Examples

smap <- SimilarityMap(
  instructions = list(
    `movie ~film` = list("jaro_winkler", "damerau_levenshtein"),
    `studio` = list("jaccard", "levenshtein"),
    `reviews~score` = list("euclidean")
  )
)
model <- DLMatchingModel(smap)
compile(model, optimizer = tensorflow::tf$keras$optimizers$Adam())