liveBook · Manning

Trial and error

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Trial-and-error learning is a strategy that discovers effective actions by repeatedly testing alternatives and retaining those that produce favorable outcomes.

Trial and error discovers effective actions by repeatedly probing an environment, observing rewards, and retaining actions or action sequences that produce better outcomes. section 11.1

A reinforcement-learning loop typically proceeds as follows:

  • Observe the current state and choose an action, initially often at random. section 11.1 section 11.1.1
  • Let the environment return a reward and a new state. section 11.1
  • Accumulate experience until the agent solves the task or the episode ends. section 11.1
  • Estimate action quality so later decisions increasingly favor successful behavior. section 11.1.1

Frozen Lake with Q-learning

A 4-by-4 Frozen Lake environment lets an agent move up, down, left, or right. Falling through a hole ends the episode with negative reward; reaching the bottom-right corner completes it. A Q-table records state-action values, while an epsilon-greedy policy explores randomly before increasingly selecting higher-valued actions. Training repeatedly resets the environment, chooses actions, updates Q-values, and stops each episode when it ends. section 11.1.1

Figure 11.1a A comparison of different forms of learning

Compare trial-and-error learning with other learning forms before examining its reinforcement-learning loop. section 11.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains states, actions, rewards, exploration, Q-values, and training loops, but stops short of advanced planning mechanisms.
Examples
Demonstrates a Frozen Lake grid, Q-table, epsilon-greedy action selection, training episodes, and agent exercises.
What it assumes
Assumes familiarity with states, actions, rewards, and Python notebooks while introducing reinforcement-learning interaction through a simple grid.
What you can do after
Apply it via OpenAI Gym by building, training, and exercising a Q-learning agent in a discrete environment.
How it connects
Connects trial and error with reinforcement learning, Q-learning, dynamic programming, Monte Carlo simulation, and evolutionary optimization.

Also explained in

Compare how 2 books explain trial and error →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.