Coder Social home page Coder Social logo

Comments (6)

jeffhuang avatar jeffhuang commented on July 21, 2024

Thank you! You may have identified a key bug. I'll look into this soon.

from webgazer.

jeffhuang avatar jeffhuang commented on July 21, 2024

@larsbonczek can you also say under what conditions the exception was thrown? Like had the code been running for a while, or was this a certain configuration?

from webgazer.

larsbonczek avatar larsbonczek commented on July 21, 2024

This error occurred in an online experiment built using PCIbex. The exception is usually thrown part-way into the experiment (which is quite long).

I took a look at PCIbex' implementation of the eye tracking element and realized that it generates a lot of data points during the calibration process (it emulates a click event multiple times per second). I verified this by checking the number of calibration points saved into the browser's IndexedDB by webGazer. One run of the calibration process generates 602 data points. After that, another calibration step is performed after each step of the experiment. When the error occured, I checked the IndexedDB again and saw that the stored list had reached 700 data points, which matches the window size mentioned above.

I think that due to the large amount of data points that is generated during the calibration process, the data window containing the calibration points fills up quite quickly during the experiment, which triggers the above exception.

Testing this hypothesis is difficult, since PCIbex automatically triggers a re-calibration if the calibration score falls below a certain threshold during the experiment. Before this re-calibration, the data window is cleared, thus preventing the error from occurring. The error only occurs if no re-calibration is required for a sufficient number of steps, which is a rare occurrence.

from webgazer.

jeffhuang avatar jeffhuang commented on July 21, 2024

I think you're exactly right. weightedXArray and weightedYArray data are being accessed with the trueIndex index in lines 66-67, but lines 68-69 and even 72-73 treat it like a regular array, so there's a mismatch between the index used, once the DataWindow size is about 700 (the default window size)

The bug seems to be introduced in an old commit but the pre-commit code also seems wrong to me (it's push()ing to an array that was already initialized to the correct length)

From just my reading, the pull request seems perfect to me, but someone should test it. An easy way to test might be to reduce the default window size from 700 to 10, and see if the fix does indeed work.

from webgazer.

larsbonczek avatar larsbonczek commented on July 21, 2024

I'm not familiar with webGazer, so I don't think that I am the right person to test this. Would you be willing to give it a try?

from webgazer.

jeffhuang avatar jeffhuang commented on July 21, 2024

I'm going to look this over a little bit, maybe give it a brief test, but the PR seems pretty harmless either way. @alexpapster said she'd be able to test it a bit more thoroughly later but I think it's fine to merge in the meantime. Thanks again for investigating Lars.

from webgazer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.