Skip to content

Commit

Permalink
Merge pull request #13 from JuliaTrustworthyAI/10-add-pcd
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-alt authored Jun 6, 2024
2 parents 3d2d5a0 + 50c1fd6 commit 63c1687
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

*Note*: We try to adhere to these practices as of version [v1.1.0].

## Version [1.2.1] - 2024-06-06

### Removed

- No longer clipping generated samples at extrema of prior. [#13]

## Version [1.2.0] - 2024-06-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TaijaBase"
uuid = "10284c91-9f28-4c9a-abbf-ee43576dfff6"
authors = ["Patrick Altmeyer"]
version = "1.2.0"
version = "1.2.1"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand Down
2 changes: 0 additions & 2 deletions src/Samplers/Samplers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ function (sampler::AbstractSampler)(
input_samples =
mcmc_samples(sampler, model, rule, input_samples; niter = niter, kwargs...)
Flux.trainmode!(model)
input_samples =
Float32.(clamp.(input_samples, minimum(sampler.𝒟x), maximum(sampler.𝒟x)))

# Update buffer:
sampler.buffer = cat(input_samples, sampler.buffer, dims = ndims(sampler.buffer))
Expand Down
6 changes: 3 additions & 3 deletions test/samplers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ using TaijaBase.Samplers:
train_y, test_y = prep_y.((train[:, target], test[:, target]))
train_set = Flux.DataLoader(
(train_X, train_y),
batchsize = size(train_X, 2),
batchsize = 100,
shuffle = false,
)

Expand Down Expand Up @@ -174,11 +174,11 @@ using TaijaBase.Samplers:
model, weights, trainlosses, testlosses
end

results = train_logreg(steps = 10000, opt = SGLD(10.0, 1000.0, 0.9))
results = train_logreg(steps = 1000, opt = SGLD(10.0, 1000.0, 0.9))
model, weights, trainlosses, testlosses = results
plot(weights; label = ["Student" "Balance" "Income" "Intercept"])

results = train_logreg(steps = 1000, opt = ImproperSGLD(2.0, 0.01))
results = train_logreg(steps = 100, opt = ImproperSGLD(2.0, 0.01))
model, weights, trainlosses, testlosses = results
plot(weights; label = ["Student" "Balance" "Income" "Intercept"])

Expand Down

2 comments on commit 63c1687

@pat-alt
Copy link
Member Author

@pat-alt pat-alt commented on 63c1687 Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

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/108437

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.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

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:

git tag -a v1.2.1 -m "<description of version>" 63c16879e7c20915e415adf1cb3fb09db771dcf7
git push origin v1.2.1

Please sign in to comment.