Skip to content

implement bias correction #78

@micahwoodard

Description

@micahwoodard

proposal from @hanhou about what the autowater and lickspout movement logic should be.

For simplicity, I think we could use only |bias| as the single metric for both autowater and autolickport.

I agree with Xinxin Yin that being able to turn auto water and lick spout on and off separately may be desirable, but I don't think their logic should be independent or we should only rely on lick spout even in early sessions. To me, using water as an incentive to shape behavior is better than moving the lickspout, since it does not change the nature of the task (i.e., tracking water reward) and thus doesn't make the mice mistakenly think it's a different task (i.e. tracking the lick spouts).

In summary, we may want:

  • (Bowen) try water first, and if it doesn't work, move the lick spout
  • (Han) move the lick spouts to the biased side if |bias| > threshold_bad and bring them back to center if |bias| < threshold_good
  • (Xinxin) being able to control the relative strength of autolickspout and autowater over the training

I can think of a simple algorithm that implements all these points. It essentially uses a parameter antibias_water_first_max to control, once |bias| crosses threshold_bad, the number of auto-water attempts before we start to move the lick spouts:

antibias_water_count = 0
if bias_check_interval <= trial_number - last_bias_check:
    last_bias_check = trial_number
    if |bias| > threshold_bad:   # red state
        # do intervention
        if antibias_water_count < antibias_water_first_max:
             give_water_correction()
             antibias_water_count += 1
        else:
             move_lickspout_to_the_biased_side()
        return
    # Reset antibias_water_count once not in red state
    antibias_water_count = 0
    
    # If in green state, always bring lick spouts back to center
    if |bias| < threshold_good: 
        move_lickspouts_back_to_center()
       
    # If in yellow state, do nothing

In this implementation, antibias_water_first_max=0 gives us pure lickspout movement (my original proposal)

Image

antibias_water_first_max=inf gives us pure autowater

Image

and antibias_water_first_max=1 gives us Bowen's proposal

Image

we can gradually increase the parameter antibias_water_first_max over the curriculum (from 1 to inf?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions