Giter VIP home page Giter VIP logo

Comments (8)

farigys avatar farigys commented on August 18, 2024 1

I am really sorry! Solved it- typos should come in pairs in t, and I wasn't saving them like that. I am closing this issue. Thanks a lot for your help!

from checklist.

marcotcr avatar marcotcr commented on August 18, 2024

Yes, Invariance tests should work with predictions saved from files. Are you using one of our release suites? If not, can you possibly share the test / suite in question?

from checklist.

farigys avatar farigys commented on August 18, 2024

I am not using the release suites as my task does not resemble any of the presented task. I am trying to create my own tests (as you've shown in tutorial 3). The first process works (wrapping the prediction model in a PredictionWrapper), but the second process is not. I can share my code here (which is pretty much the exact code in the tutorial):

t = Perturb.perturb(dataset, Perturb.add_typos)
test = INV(**t)
test.run_from_file('/tmp/softmax_preds.txt', file_format='softmax', overwrite=True)

from checklist.

marcotcr avatar marcotcr commented on August 18, 2024

You did not call test.to_raw_file. I'm guessing your softmax_preds.txt file contains predictions for the original dataset, but not for the test cases (which include examples with typos)

from checklist.

farigys avatar farigys commented on August 18, 2024

my softmax_preds.txt contains prediction for the test cases (example + typo perturbed data). I did not save the test cases in /tmp/raw_file.txt. May be that's the problem?

from checklist.

farigys avatar farigys commented on August 18, 2024

I am saving the raw text using test.to_raw_file and my softmax_preds.txt contains the class probabilities separated by space. I am getting this error:

File "run_checklist_from_saved_prediction.py", line 116, in <module>
    main()
  File "run_checklist_from_saved_prediction.py", line 112, in main
    test.run_from_file('/tmp/softmax_preds.txt', file_format='softmax', overwrite=True)
  File "/Users/fsadeque/Desktop/checklist-master/checklist/abstract_test.py", line 324, in run_from_file
    self.run_from_preds_confs(preds, confs, overwrite=overwrite)
  File "/Users/fsadeque/Desktop/checklist-master/checklist/abstract_test.py", line 293, in run_from_preds_confs
    self.update_expect()
  File "/Users/fsadeque/Desktop/checklist-master/checklist/abstract_test.py", line 129, in update_expect
    self.results.expect_results = self.expect(self)
  File "/Users/fsadeque/Desktop/checklist-master/checklist/expect.py", line 78, in expect
    return [fn(x, pred, confs, labels, meta) for x, pred, confs, labels, meta in zipped]
  File "/Users/fsadeque/Desktop/checklist-master/checklist/expect.py", line 78, in <listcomp>
    return [fn(x, pred, confs, labels, meta) for x, pred, confs, labels, meta in zipped]
  File "/Users/fsadeque/Desktop/checklist-master/checklist/expect.py", line 120, in expect_fn
    orig_pred = preds[0]
TypeError: 'int' object is not subscriptable

Edit: this is how my softmax_preds.txt look like:

0.026281951 0.3031675 0.64833623 0.01582296 0.006391341
0.022482133 0.20569728 0.74865955 0.017401822 0.0057589416
0.011106909 0.058008775 0.46179605 0.4471355 0.021952866
0.01102794 0.037073947 0.41210234 0.5221132 0.017682495
0.5810922 0.1305551 0.12312923 0.07375503 0.09146844

from checklist.

marcotcr avatar marcotcr commented on August 18, 2024

Ugh, would it be possible at all for you to share the first few examples from your dataset? i.e. print(dataset[:2])

from checklist.

farigys avatar farigys commented on August 18, 2024

Sure. This is the output of t.data[:3]:

['they will be different because the water will slow the sound waves down of the pitch making it queiter', 'they will be different ebcause the water will slow the sound waves down of the pitch making it queiter', "The more water there is the more sound will be absorbed by the water's density."]

from checklist.

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.