Store ML training data in a separate HDF5 file

master
Alinson S. Xavier 4 years ago
parent 7750e16862
commit d87476631a

@ -15,7 +15,7 @@ mutable struct FileInstance <: Instance
function FileInstance(filename::AbstractString, build_model::Function)::FileInstance
instance = new(nothing, nothing, filename, nothing, build_model)
instance.py = PyFileInstance(instance)
instance.h5 = Hdf5Sample(filename)
instance.h5 = Hdf5Sample("$filename.h5", mode="a")
instance.filename = filename
return instance
end

@ -15,7 +15,7 @@ using Cbc
solver = LearningSolver(Cbc.Optimizer)
solve!(solver, instance)
h5 = Hdf5Sample(filename)
h5 = Hdf5Sample("$filename.h5")
@test h5.get_scalar("mip_wallclock_time") > 0
end

@ -56,7 +56,7 @@ end
instance = FileInstance(filename, build_model)
solver = LearningSolver(Cbc.Optimizer)
solve!(solver, instance)
h5 = MIPLearn.Hdf5Sample(filename)
h5 = MIPLearn.Hdf5Sample("$filename.h5")
@test h5.get_array("mip_var_values") == [1.0, 0.0]
end
end

Loading…
Cancel
Save