-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoalloc.jl
52 lines (46 loc) · 1.67 KB
/
noalloc.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using ComputerAdaptiveTesting.Aggregators
using PsychometricsBazaarBase.Integrators
using FittedItemBanks.DummyData: dummy_full, std_normal, std_mv_normal
using ComputerAdaptiveTesting.Sim: run_random_comparison
using ComputerAdaptiveTesting.NextItemRules
using FittedItemBanks
using Base.Filesystem
using ComputerAdaptiveTesting
using ComputerAdaptiveTesting.DecisionTree: DecisionTreeGenerationConfig, generate_dt_cat
using ComputerAdaptiveTesting.Sim
using ComputerAdaptiveTesting.NextItemRules
using ComputerAdaptiveTesting.TerminationConditions
using ComputerAdaptiveTesting.Aggregators
using FittedItemBanks
using PsychometricsBazaarBase.Integrators
using PsychometricsBazaarBase.Optimizers
import PsychometricsBazaarBase.IntegralCoeffs
using ItemResponseDatasets.VocabIQ
using RIrtWrappers.Mirt
using Random
using Distributions
include("./utils/RandomItemBanks.jl")
using .RandomItemBanks: clumpy_4pl_item_bank
using InteractiveUtils: @code_warntype
using Profile.Allocs: @profile
using PProf
function main()
rng = Xoshiro(42)
params = clumpy_4pl_item_bank(rng, 3, 10)
integrator = even_grid(-6.0, 6.0, 13)
ability_estimator = MeanAbilityEstimator(PriorAbilityEstimator(std_normal), integrator)
next_item_rule = catr_next_item_aliases["MEPV"](ability_estimator)
config = DecisionTreeGenerationConfig(;
max_depth=UInt(2),
next_item=next_item_rule,
ability_estimator=ability_estimator,
)
config = preallocate(config)
@time generate_dt_cat(config, params)
@time generate_dt_cat(config, params)
@profile sample_rate=0.1 generate_dt_cat(config, params)
PProf.Allocs.pprof()
end
if abspath(PROGRAM_FILE) == @__FILE__
main()
end