GithubHelp home page GithubHelp logo

assert positive_fraction <= pi about topaz HOT 5 CLOSED

tbepler avatar tbepler commented on July 26, 2024
assert positive_fraction <= pi

from topaz.

Comments (5)

tbepler avatar tbepler commented on July 26, 2024

This error happens when you set pi to be smaller than the observed fraction of positives. That is, you have more labeled particles per micrograph (on average) than you are telling topaz you expect to have.

For example, if you have 100 labeled particles per micrograph and set n=50, it wouldn't make any sense, because you already know there must be at least 100 particles per micrograph!

from topaz.

micahrapp avatar micahrapp commented on July 26, 2024

Ah got it! Does it do this on a per micrograph basis or does it average the pi value for all of them?

from topaz.

tbepler avatar tbepler commented on July 26, 2024

It's averaged over all micrographs.

from topaz.

micahrapp avatar micahrapp commented on July 26, 2024

Sorry to bring this back up, but a labmate just ran into this same issue, and I noticed something weird

source split p_observed num_positive_regions total_regions
0 train 0.0244 5738886 235065600
0 test 0.0249 1462512 58766400
Specified expected number of particle per micrograph = 50.0
With radius = 8
Setting pi = 0.04441738816738817

So the p_observed for test and train is 0.02, and it set pi to 0.04. So the set pi is higher than the observed pi, which is good. But they still got that error. Am I missing something?

from topaz.

tbepler avatar tbepler commented on July 26, 2024

Yep, there was a bug in the code for this. To adjust pi to only apply to the unlabeled data, the training script sets pi = pi - p_observed, because the user defined pi is for all data. The check was being done after the adjustment, as well as before, leading to this error. You can install from the latest master branch where I just fixed this. As a workaround, though, just set -n/--pi even larger to compensate.

Fixed in 79e38bf

from topaz.

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.