adaptive icon indicating copy to clipboard operation
adaptive copied to clipboard

SequenceLearner does not fulfill API for data

Open jbweston opened this issue 4 years ago • 4 comments

The keys in data for the SequenceLearner are not just the points in the domain: they are tuples that also contain some index into the sequence of values.

This does not conform to the API for data which is:

    data : dict: X → Y
        `function` evaluated at certain points.

where X was previously defined to be the domain of the function being learned.

jbweston avatar Oct 16 '19 16:10 jbweston

I would recommend holding the indices in a different datastructure if it is really necessary.

jbweston avatar Oct 16 '19 16:10 jbweston

What about these changes?

basnijholt avatar Oct 16 '19 20:10 basnijholt

I don't think that that really addresses the issue. If data is a public attribute then it should be something that the user can understand and use, especially because right now it is the only way to access the results of an adaptive run. If every learner decides on its own convention for what to keep in data then this makes adaptive harder to use IMO.

jbweston avatar Oct 17 '19 07:10 jbweston

data is just index -> value in the SequenceLearner.

Like we discussed yesterday, it is not possible to make a point -> value dictionary.

Also, learner.result() will return the list of values in the same order as the sequence.

basnijholt avatar Oct 17 '19 08:10 basnijholt