struct ValueTest <: TrainingTest
    idx::Integer
    state::AbstractState
    image::AbstractImage
    value::Float32
end

mutable struct ValueTests <: TrainingTests
    tests::Vector{ValueTest}
    images::AbstractArray{Float32, 4}
    actual_value::AbstractArray{Float32, 2}
    period::Int
    warmup::Int
    function ValueTests(tests; period=1, warmup=0)
        new(
            tests, 
            tensorize(get_image.(tests)),
            Flux.unsqueeze(get_value.(tests), 1),
            period,
            warmup,
        )
    end
end

function gettestfn(tests::ValueTests)
    function fn(n::Network)
        getvaluemse(
            tests, 
            initialinferencefn(tests)(n)
        )
    end
end

struct ValueTestsSVG
    tests::ValueTests
end
svg(x::ValueTests) = ValueTestsSVG(x)

function Base.show(io::IO, m::MIME"image/svg+xml", x::ValueTestsSVG)
    num_tests = length(x.tests)
    range = 1:(min(10, num_tests))
    subset = 1:num_tests
    subset_indices = subset[range]
    svgbatch = [gridsvg(x.tests[i]) for i in subset_indices]
    Base.show(io, m, GridSVG(svgbatch, main_title="Value Tests"))
end