Learn R Programming

decryptr (version 0.2.2)

train_model: Craete a model to break image captchas using keras

Description

This function tries to adjust an automatic model for breaking captchas using the rstudio/keras package. It creates a keras::keras_model_sequential() and learns from the inputed labeled data.

Usage

train_model(
  data,
  frac_test = 0.1,
  n_epochs = 30,
  n_units = 256,
  batch_size = 64,
  path = "./model.hdf5",
  verbose = TRUE
)

Arguments

data

A list of previously-classified captchas read with read_captcha(..., ans_in_path = TRUE) (see classify())

frac_test

Fraction of data used for testing

n_epochs

Maximum number of epochs

n_units

Number of units to consider in dense layer

batch_size

Number of observations to consider in each iteration

path

Path where to save model (if NULL won't save it)

verbose

Print model specification