garage icon indicating copy to clipboard operation
garage copied to clipboard

Constraining the output interval of the GaussianLSTMModel to [0.0 .. 1.0]

Open glisca opened this issue 2 years ago • 1 comments

What would be the simplest way to constrain the GaussianLSTMModel [1] to output values only within the interval [0.0 .. 1.0]?

[1] https://github.com/rlworkgroup/garage/blob/6461a071f0155712add1b41316003e90c9c77899/src/garage/tf/models/gaussian_lstm_model.py#L16

Many thanks in advance!

glisca avatar Apr 22 '22 20:04 glisca

I don't believe this is possible with the current API, but it is not difficult to implement. My recommendation is to copy gaussian_lstm_model.py into your project's source, and modify line 260 to wrap a TransformedDistribution with a Sigmoid, around dist.

A PR implementing this (gated by a flag) would of course also be welcome.

krzentner avatar Apr 27 '22 16:04 krzentner