-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to fix issues associated with Flux 0.14 (#76)
* updates to fix issues associated with Flux 0.14 * version bump
- Loading branch information
1 parent
bdaa6cb
commit 5449310
Showing
7 changed files
with
73 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ log* | |
*.bson | ||
events.out.tfevents* | ||
.vscode | ||
Manifest.toml | ||
Manifest.toml | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using DeepQLearning | ||
using POMDPs | ||
using Flux | ||
using POMDPModels | ||
using POMDPTools | ||
|
||
@testset "README Example 1" begin | ||
# load MDP model from POMDPModels or define your own! | ||
mdp = SimpleGridWorld(); | ||
|
||
# Define the Q network (see Flux.jl documentation) | ||
# the gridworld state is represented by a 2 dimensional vector. | ||
model = Chain(Dense(2, 32), Dense(32, length(actions(mdp)))) | ||
|
||
exploration = EpsGreedyPolicy(mdp, LinearDecaySchedule(start=1.0, stop=0.01, steps=10000/2)); | ||
|
||
solver = DeepQLearningSolver(qnetwork = model, max_steps=10000, | ||
exploration_policy = exploration, | ||
learning_rate=0.005,log_freq=500, | ||
recurrence=false,double_q=true, dueling=true, prioritized_replay=true) | ||
policy = solve(solver, mdp) | ||
|
||
sim = RolloutSimulator(max_steps=30) | ||
r_tot = simulate(sim, mdp, policy) | ||
println("Total discounted reward for 1 simulation: $r_tot") | ||
end | ||
|
||
@testset "README Example 2" begin | ||
# Without using CuArrays | ||
mdp = SimpleGridWorld(); | ||
|
||
# the model weights will be send to the gpu in the call to solve | ||
model = Chain(Dense(2, 32), Dense(32, length(actions(mdp)))) | ||
|
||
exploration = EpsGreedyPolicy(mdp, LinearDecaySchedule(start=1.0, stop=0.01, steps=10000/2)); | ||
|
||
solver = DeepQLearningSolver(qnetwork=model, max_steps=10000, | ||
exploration_policy=exploration, | ||
learning_rate=0.005,log_freq=500, | ||
recurrence=false,double_q=true, dueling=true, prioritized_replay=true) | ||
policy = solve(solver, mdp) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5449310
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
5449310
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/122872
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: