Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Add prints for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelfneumann committed Nov 2, 2021
1 parent 3e88818 commit ab8bf97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,3 +712,5 @@ sequential runs of hyperparameter setting `m` of the `Agent` in the
* [ ] Add `TimeLimit` to `gym` package so that time limits can be altered
* [ ] All input nodes should have unique names. Use `gop.Unique()`.
* [ ] VAC still gets NaNs. Problem could be with Multi-dim actions in GaussianTreeMLP. Does VPG also get NaNs??
7 changes: 5 additions & 2 deletions agent/nonlinear/continuous/vanillaac/VanillaAC.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"

"github.com/samuelfneumann/golearn/agent"
"github.com/samuelfneumann/golearn/agent/nonlinear/continuous/policy"
"github.com/samuelfneumann/golearn/buffer/expreplay"
env "github.com/samuelfneumann/golearn/environment"
"github.com/samuelfneumann/golearn/network"
Expand Down Expand Up @@ -255,8 +256,10 @@ func New(e env.Environment, c agent.Config, seed int64) (agent.Agent, error) {
// SelectAction returns an action for the timestep t
func (v *VAC) SelectAction(t ts.TimeStep) *mat.VecDense {
a := v.behaviour.SelectAction(t)

// ! Standard deviation is taking off to infinity. Maybe use gop.Clamp()
fmt.Println()
fmt.Println(a)
fmt.Println(v.trainPolicy.(*policy.GaussianTreeMLP).StdDev())
return a
}

Expand Down Expand Up @@ -286,7 +289,7 @@ func (v *VAC) ObserveFirst(t ts.TimeStep) error {
// Observe stores an action taken in the environment and the next
// time step as a result of taking that action
func (v *VAC) Observe(action mat.Vector, nextStep ts.TimeStep) error {
fmt.Println(action)
//fmt.Println(action)
if !nextStep.First() {
nextAction := mat.NewVecDense(v.actionDims, nil)
transition := ts.NewTransition(v.prevStep, action.(*mat.VecDense),
Expand Down

0 comments on commit ab8bf97

Please sign in to comment.