Skip to content

Commit

Permalink
return chunk in add_chunk!
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Nov 15, 2024
1 parent ffb4c51 commit 7537377
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
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.13.2"
version = "0.13.3"

[deps]
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
Expand Down
12 changes: 8 additions & 4 deletions docs/src/example1.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ using Plots
Random.seed!(87545)
# create chunks of declarative knowledge
chunks = [Chunk(;name=:Bob, department=:accounting),
Chunk(;name=:Alice, department=:HR)]
chunks = [
Chunk(;name=:Bob, department=:accounting),
Chunk(;name=:Alice, department=:HR)
]
# initialize declarative memory
declarative = Declarative(memory=chunks)
Expand All @@ -41,8 +43,10 @@ we can create a vector of chunks using the `Chunk` constructor. Constructor acce
```@example examplesetup1
# create chunks of declarative knowledge
chunks = [Chunk(;name=:Bob, department=:accounting),
Chunk(;name=:Alice, department=:HR)]
chunks =
[Chunk(;name=:Bob, department=:accounting),
Chunk(;name=:Alice, department=:HR)
]
```

## Create a Model
Expand Down
4 changes: 3 additions & 1 deletion src/MemoryFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,10 @@ function add_chunk!(memory::Declarative, cur_time = 0.0; bl::T = 0.0, slots...)
slots...
)
push!(memory.memory, c)
return c
else
update_chunk!(chunk[1], cur_time)
return chunk[1]
end
return nothing
end
Expand Down Expand Up @@ -1346,7 +1348,7 @@ log of activations across a set of chunks.
- `chunks`: a set of chunks over which slot-values are blended
"""
function blended_activation(chunks)
exp_act = map(x -> exp(x.act_mean), chunks)
exp_act = map(x -> exp(x.act), chunks)
return log(sum(exp_act))
end

Expand Down

0 comments on commit 7537377

Please sign in to comment.