Giter VIP home page Giter VIP logo

Comments (4)

samtygier-stfc avatar samtygier-stfc commented on June 30, 2024 1

I've switched to doing the progress bar updates from a callback:
mantidproject/mantidimaging@5006fd3

It would be good if there was a mention in the release notes about the change.

from cil.

paskino avatar paskino commented on June 30, 2024

So far algo.max_iteration is used, although we would like to discourage it in favour of the algo.run method with callbacks.
Also, next has been removed (it was there for compatibility with Python2) but __next__ is still there.

from cil.

casperdcl avatar casperdcl commented on June 30, 2024

For now you could use:

algo = PDGH(...)
algo.max_iterations = 1000000
for i in iter(algo):
    ...  # do something with algo

but it might stop working in a future release.

Best is:

from cil.optimisation.utilities.callbacks import Callback, ProgressCallback

class EachIterCallback(Callback):
    def __call__(self, algo):
        ...  # do something with algo

algo = PDHG(...)
algo.run(1000000, callbacks=[ProgressCallback(), EachIterCallback()])

vis. https://tomographicimaging.github.io/CIL/v24.0.0/optimisation/#callbacks

If you've made any custom callbacks you think others will benefit from (e.g. TensorboardCallback or something) please do open a PR adding it to Wrappers/Python/cil/optimisation/utilities/callbacks.py!

from cil.

casperdcl avatar casperdcl commented on June 30, 2024

I've switched to doing the progress bar updates from a callback: mantidproject/mantidimaging@5006fd3

lgtm!

It would be good if there was a mention in the release notes about the change.

Unfortunately it is mentioned in the highly inaccessible CIL@master:/CHANGELOG.md but for some unknown reason @TomographicImaging/cil-developers seem to dislike keeping the more standard CIL/releases readable/helpful/neat/up-to-date/in-sync 😠

from cil.

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.