Skip to content

Commit

Permalink
better chunk pattern to R code
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrecenti committed Feb 22, 2023
1 parent 5b54053 commit dbed84e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions vignettes/advanced.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ To customize the model, the user must create a new module, modifying the `initia
By default, the template code is as described below. The parameters `input_dim=`, `output_ndigits=`, `output_vocab_size=` and `vocab=` describe, respectively, the dimensions of the image, the length of the response, the length of the alphabet and the elements of the alphabet. The `transform=`, `dropout=` and `dense_units=` parameters control, respectively, the image transformation function, the *dropout* hyperparameters and the number of units in the dense layer. Notice that the parameters of the convolutions are fixed, already prepared to work well with an image of dimensions `32x192`.


```{r}
#| echo: true
#| eval: false
```{{r}}
initialize = function(input_dim,
output_ndigits,
output_vocab_size,
Expand Down Expand Up @@ -109,10 +106,7 @@ initialize = function(input_dim,

The *feed forward* function is described below. The function applies the step-by-step procedure of a convolutional neural network, with an image `x` as input and returning a logit matrix giving the model weights for each letter of the answer. The model returns the logits, not the probabilities, because the loss function takes the logits as input. If the user decides to modify the `forward` method to return probabilities, she will also need to adapt the used loss function.

```{r}
#| echo: true
#| eval: false
```{{r}}
forward = function(x) {
out <- x |>
Expand Down

0 comments on commit dbed84e

Please sign in to comment.