View source: R/create_model_utils.R
compile_model | R Documentation |
Compile model
compile_model(
model,
solver,
learning_rate,
loss_fn,
label_smoothing = 0,
num_output_layers = 1,
label_noise_matrix = NULL,
bal_acc = FALSE,
f1_metric = FALSE,
auc_metric = FALSE,
layer_dense = NULL
)
model |
A keras model. |
solver |
Optimization method, options are |
learning_rate |
Learning rate for optimizer. |
loss_fn |
Either |
label_smoothing |
Float in [0, 1]. If 0, no smoothing is applied. If > 0, loss between the predicted labels and a smoothed version of the true labels, where the smoothing squeezes the labels towards 0.5. The closer the argument is to 1 the more the labels get smoothed. |
num_output_layers |
Number of output layers. |
label_noise_matrix |
Matrix of label noises. Every row stands for one class and columns for percentage of labels in that class. If first label contains 5 percent wrong labels and second label no noise, then
|
bal_acc |
Whether to add balanced accuracy. |
f1_metric |
Whether to add F1 metric. |
auc_metric |
Whether to add AUC metric. |
layer_dense |
Vector specifying number of neurons per dense layer after last LSTM or CNN layer (if no LSTM used). |
A compiled keras model.
model <- create_model_lstm_cnn(layer_lstm = 8, compile = FALSE)
model <- compile_model(model = model,
solver = 'adam',
learning_rate = 0.01,
loss_fn = 'categorical_crossentropy')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.