Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Automatic Hyperparameter Tuning | Conclusion
Introduction to Neural Networks
course content

Kursinhalt

Introduction to Neural Networks

Introduction to Neural Networks

1. Concept of Neural Network
2. Neural Network from Scratch
3. Conclusion

book
Challenge: Automatic Hyperparameter Tuning

Rather than manually selecting specific values for our model's hyperparameters, randomized search (RandomizedSearchCV) offers a more efficient way to find an optimal configuration. Unlike grid search (GridSearchCV), which systematically evaluates all possible combinations of hyperparameters, randomized search selects a random subset of these combinations. This approach significantly reduces computational cost while still yielding strong results.

For neural networks, where the number of possible hyperparameter combinations can be immense, exhaustively testing every option is often impractical. Randomized search circumvents this issue by randomly sampling a defined number of hyperparameter sets, balancing exploration and efficiency.

  • estimator: the model to optimize (e.g., MLPClassifier);
  • param_distributions: a dictionary where keys are hyperparameter names and values are lists which to sample;
  • n_iter: specifies how many random combinations should be tested. A higher value increases the chances of finding an optimal combination but requires more computation;
  • scoring: defines the evaluation metric (e.g., 'accuracy' for classification).
Aufgabe

Swipe to start coding

  1. In param_distributions, generate values for two hidden layers, where each layer has the same number of neurons, ranging from 20 to 30 (exclusive) with a step of 2.
  2. In param_distributions, set the learning rate values to 0.02, 0.01, and 0.005.
  3. In param_distributions, generate 10 random values for the number of training epochs, ensuring they are within the range 10 to 50 (inclusive).
  4. Apply randomized search with 4 iterations (number of hyperparameter combinations to evaluate) and use accuracy as the evaluation metric.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 3
toggle bottom row

book
Challenge: Automatic Hyperparameter Tuning

Rather than manually selecting specific values for our model's hyperparameters, randomized search (RandomizedSearchCV) offers a more efficient way to find an optimal configuration. Unlike grid search (GridSearchCV), which systematically evaluates all possible combinations of hyperparameters, randomized search selects a random subset of these combinations. This approach significantly reduces computational cost while still yielding strong results.

For neural networks, where the number of possible hyperparameter combinations can be immense, exhaustively testing every option is often impractical. Randomized search circumvents this issue by randomly sampling a defined number of hyperparameter sets, balancing exploration and efficiency.

  • estimator: the model to optimize (e.g., MLPClassifier);
  • param_distributions: a dictionary where keys are hyperparameter names and values are lists which to sample;
  • n_iter: specifies how many random combinations should be tested. A higher value increases the chances of finding an optimal combination but requires more computation;
  • scoring: defines the evaluation metric (e.g., 'accuracy' for classification).
Aufgabe

Swipe to start coding

  1. In param_distributions, generate values for two hidden layers, where each layer has the same number of neurons, ranging from 20 to 30 (exclusive) with a step of 2.
  2. In param_distributions, set the learning rate values to 0.02, 0.01, and 0.005.
  3. In param_distributions, generate 10 random values for the number of training epochs, ensuring they are within the range 10 to 50 (inclusive).
  4. Apply randomized search with 4 iterations (number of hyperparameter combinations to evaluate) and use accuracy as the evaluation metric.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 3
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
We're sorry to hear that something went wrong. What happened?
some-alt