Skip to content

Commit

Permalink
fix divide by zero edge case in baselevel learning
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Jun 26, 2023
1 parent 7631a5e commit 4c36c62
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docs_clean_up.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "documenter@juliadocs.github.io"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ACTRModels"
uuid = "c095b0ea-a6ca-5cbd-afed-dbab2e976880"
authors = ["itsdfish"]
version = "0.12.3"
version = "0.12.4"

[deps]
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
Expand Down
2 changes: 1 addition & 1 deletion src/MemoryFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function baselevel!(N, L, k, lags, d)
if N > k
tk = lags[k]
x1 = (N - k) * (L^(1 - d) - tk^(1 - d))
x2 = (1 - d) * (L - tk)
x2 = (1 - d) * max(L - tk, .001)
approx = x1 / x2
end
return log(exp(exact) + approx)
Expand Down

0 comments on commit 4c36c62

Please sign in to comment.