mirror of
https://github.com/huggingface/deep-rl-class.git
synced 2026-05-16 13:55:52 +08:00
change int to float
This commit is contained in:
@@ -695,9 +695,9 @@
|
||||
"source": [
|
||||
"def epsilon_greedy_policy(Qtable, state, epsilon):\n",
|
||||
" # Randomly generate a number between 0 and 1\n",
|
||||
" random_int = random.uniform(0,1)\n",
|
||||
" # if random_int > greater than epsilon --> exploitation\n",
|
||||
" if random_int > epsilon:\n",
|
||||
" random_float = random.uniform(0,1)\n",
|
||||
" # if random_float > greater than epsilon --> exploitation\n",
|
||||
" if random_float > epsilon:\n",
|
||||
" # Take the action with the highest value given a state\n",
|
||||
" # np.argmax can be useful here\n",
|
||||
" action = greedy_policy(Qtable, state)\n",
|
||||
|
||||
Reference in New Issue
Block a user