Skip to content

Commit 1f2be9a

Browse files
authored
Merge pull request #35 from JuliaReinforcementLearning/HenriDeh-patch-normalization
collect on normalized traces for performance.
2 parents 955d44d + 3bed3fa commit 1f2be9a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ReinforcementLearningTrajectories"
22
uuid = "6486599b-a3cd-4e92-a99a-2cea90cc8c3c"
3-
version = "0.1.8"
3+
version = "0.1.9"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/normalization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ end
194194
function sample(s::BatchSampler, nt::NormalizedTraces, names)
195195
inds = rand(s.rng, 1:length(nt), s.batch_size)
196196
maybe_normalize(data, key) = key in keys(nt.normalizers) ? normalize(nt.normalizers[key], data) : data
197-
NamedTuple{names}(maybe_normalize(nt[x][inds], x) for x in names)
197+
NamedTuple{names}(collect(maybe_normalize(nt[x][inds], x)) for x in names)
198198
end

0 commit comments

Comments
 (0)