You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: assets/recipes_generation.ru.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1644,20 +1644,19 @@ _<small>➔ вывод:</small>_
1644
1644
> (1, None)
1645
1645
> ```
1646
1646
1647
-
### Петля прогнозирования
1647
+
### Цикл прогнозирования
1648
1648
1649
-
To use our trained model for recipe generation we need to implement a so-called prediction loop. The following code block generates the text using the loop:
1649
+
Чтобы использовать нашу обученную модель для генерации рецептов, нам необходимо реализовать так называемый цикл прогнозирования. Следующий блок кода генерирует текст с помощью цикла:
1650
1650
1651
-
- It starts by choosing a start string, initializing the RNN state and setting the number of characters to generate.
1652
-
- It gets the prediction distribution of the next character using the start string, and the RNN state.
1653
-
- Then, it uses a categorical distribution to calculate the index of the predicted character. It uses this predicted character as the next input to the model.
1654
-
- The RNN state returned by the model is fed back into the model so that it now has more context, instead of only one character. After predicting the next character, the modified RNN states are again fed back into the model, which is how it learns as it gets more context from the previously predicted characters.
1651
+
- Начинаем с выбора входящей строки, инициализации состояния RNN и установки количества генерируемых символов.
1652
+
- Получаем предсказания для каждого символа из словаря.
1653
+
- С помощью семплинга выбираем следующий символ. Используем его в качестве следующей входящей в модель строки.
> Image source: [Text generation with an RNN](https://www.tensorflow.org/tutorials/text/text_generation) notebook.
1657
+
> Источник изображения [Text generation with an RNN](https://www.tensorflow.org/tutorials/text/text_generation) .
1659
1658
1660
-
The `temperature` parameter here defines how fuzzy or how unexpected the generated recipe is going to be. Low temperatures results in more predictable text. Higher temperatures result in more surprising text. You need to experiment to find the best setting. We will do some experimentation with different temperatures below.
1659
+
Параметр `temperature` здесь определяет, насколько нечетким или насколько неожиданным будет сгенерированный рецепт. Низкие значения `temperature` приводят к более предсказуемому тексту. Более высокие значения `temperature` приводят к более неожиданному тексту. Мы проведем некоторые эксперименты с различными значениями `temperature` ниже.
### Figuring out proper temperature for prediction loop
1698
+
### Экспериментируем с параметром `temperature`
1700
1699
1701
-
Now, let's use `generate_text()`to actually generate some new recipes. The`generate_combinations()`function goes through all possible combinations of the first recipe letters and temperatures. It generates `56`different combinations to help us figure out how the model performs and what temperature is better to use.
1700
+
Воспользуемся функцией `generate_text()`для генерации рецептов. Функция`generate_combinations()`генерирует `56`различных комбинаций входящего текста и параметра `temperature`. Это должно помочь нам определиться с подходящим значением для `temperature`.
To avoid making this article too long only some of those `56`combinations will be printed below.
1723
+
Чтобы не делать эту статью слишком длинной, ниже будут напечатаны только некоторые из этих `56`комбинаций.
1725
1724
1726
1725
```python
1727
1726
generate_combinations(model_simplified)
@@ -2057,9 +2056,9 @@ _<small>➔ вывод:</small>_
2057
2056
> ▪︎ Meanwhile, heat the olive oil in a large skillet over medium-high heat. Add the shallots and saute until tender, about 3 minutes. Add the garlic and cook for 1 minute. Add the sausage and cook until the shallots are tender, about 3 minutes. Add the sausage and cook until tender, about 2 minutes. Add the garlic and cook, stirring, until the garlic is lightly browned, about 1 minute. Add the sausage and cook until the s
2058
2057
> ```
2059
2058
2060
-
## Interactive model demo
2059
+
## Интерактивная демонстрация модели
2061
2060
2062
-
You may use 🎨 [**Cooking recipes generator demo**](https://trekhleb.github.io/machine-learning-experiments/#/experiments/RecipeGenerationRNN) to play around with this model, input text, and temperature parameters to generate some random recipes right in your browser.
2061
+
Вы можете воспользоватья 🎨 [**Cooking recipes generator demo**](https://trekhleb.github.io/machine-learning-experiments/#/experiments/RecipeGenerationRNN) to play around with this model, input text, and temperature parameters to generate some random recipes right in your browser.
0 commit comments