[DRAFT - DO NOT MERGE] Add magnetometer#268
Closed
microbit-robert wants to merge 5 commits intomainfrom
Closed
Conversation
Model accuracy can be highly variable due to non-determinism. This change improves the consistency of the trained model.
|
Preview build will be at |
microbit-robert
commented
Jul 9, 2024
|
|
||
| // Store with ML-Algorithm settings | ||
| export const settings = persistantWritable<MlSettings>('MLSettings', initialMLSettings); | ||
| export const settings = writable<MlSettings>(initialMLSettings); |
Author
There was a problem hiding this comment.
Don't persist mlSettings to localStorage. These settings cannot currently be set by the user and storing these data in localStorage is making it tricky to update them independently of other keyed data in localStorage. See persistVersion in storeUtil.ts.
Author
There was a problem hiding this comment.
Sensor selection, which is user controlled, has been pulled out into persistentSettings which is persisted to localStorage.
Author
|
Closing in favour of #575 as it is based on an up-to-date React version of the app. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch adds the ability to record data using the magnetometer. It is built on top of some proposed model improvements which appear to make the result of model training more consistent.
This branch allows the user to switch between accelerometer and magnetometer data and will warn the user about clearing existing recordings (if present) when this switch is made. The sensor dropdown appears over the live graph in the bottom left.
This branch includes a new filter which seems to help the model differentiate between left and right swiping motions over the top of the micro:bit with a magnetic object. The filter attempts to get the first significant change in gradient and output the signed vector of this gradient.
Accelerometer and magnetometer data cannot be used together. I'm not sure there's a scenario where they would work well together. So far, one dataset has simply occluded another and made training and inference worse.
All data is now scaled to -2..2. This value has been set as a result of dividing accelerometer data by 1000, but it's somewhat abitrary when including the magnetometer data. It has proved difficult to change while maintaining backwards compatibility.