Coder Social home page Coder Social logo

testingautomated-usi / uncertainty-wizard Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 5.0 430 KB

Uncertainty-Wizard is a plugin on top of tensorflow.keras, allowing to easily and efficiently create uncertainty-aware deep neural networks. Also useful if you want to train multiple small models in parallel.

Home Page: https://uncertainty-wizard.readthedocs.io

License: MIT License

Shell 4.01% Python 95.99%
keras keras-tensorflow testing uncertainty uncertainty-neural-networks uncertainty-quantification

uncertainty-wizard's People

Contributors

dependabot[bot] avatar miweiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

uncertainty-wizard's Issues

`stochastic_from_keras` should not use static file path

Executing stochastic_from_keras in different processes at the same time, using default parameters, can lead to failures, as both processes use the same temporary weight path.

A workaround exists: Just pass custom, differing (e.g. random) temp_weights_path when calling stochastic_from_keras.

Multiple Inputs Compatibility

Hello,

Nice project !

I am trying to make it work for a multi-input keras model, represented by a list of numpy arrays.

Unfortunately, I am getting this following error:

ValueError: At the moment, uwiz stochastic models support only (unbatched)numpy arrays and tf.data.Datasets as inputs. Please transform your input in one of these forms

Is there any workaround for making this project work for multi-input?

Dynamic Growth Utility Method

If the main thread initializes TensorFlow in its default settings, all GPU space will be used up by it, disallowing LazyEnsemble multiprocessing to run on that GPU.

Thus, the user can typically do one of the following:

  • Make GPU invisible
  • Configure TF not to use GPU or to allow gpu allocation growth

Both these changes are not particularly user friendly. However, uncertainty-wizard offers a utility function which can be used for this: DynamicGpuGrowthContextManager.enable_dynamic_gpu_growth().

Simply calling this utility method will configure tf to use dynamic gpu memory growth. This is probably easier and nicer for the end-user.
It will also allow increasing end-user code version compatibility with future versions of tf: TensorFlows GPU config is still experimental and future versions may require different imports (which will be dynamically resolved in future uncertainty-wizard versions based on the used tf version).

This should be described in the docs and also added to the examples.

Multi-GPU issue on new tensorflow versions

There appear to be problems with the multi-gpu configuration with newer tensorflow versions (identified with tf 2.10).

  • The gpu api is not experimental anymore, so this can be refactored
  • For some reason, the virtual devices are now already created when we want to create them, leading to an error. But some new APIs should help around that. Need to investigate.

Ensembles should expose a `model_free_task` interface

Such an interface would allow running tasks without loading or persisting any model.

Advantage: Pre- and post-processing tasks that don't rely on a specific keras model (but are still model dependent, i.e., they should run for every model id) will run faster (no model serialization or deserialization) and can potentially be more heavily parallelized (as memory is not filled with keras models).

multi-quantifier quantification as_dict

The methods predict_quantified on stochastic models and predict_quantified and quantify_predictions on ensembles should accept an optional flag (default False) allowing the following behavior:

  • The results are returned as Dict[str, Dict[str, np.ndarray]], where the outer dict keys are a particular quantifiers alias and the inner dict keys are 'prediction' and 'quantification' (see the example below)
  • If a quantifier was passed as an alias (str), the same alias should be used as dict key. If the quantifier was passed as an object, the first alias of the class should be used.

E.g., the return value of predict_quantified(quantifiers=['var_ratio', PredictiveEntropy()], as_dict=True) should be

{
     "var_ratio": {"prediction": <pred_array>, "quantification": <quantification_array>},
     "predictive_entropy": {"prediction": <pred_array>, "quantification": <quantification_array>}
}

The goal of this issue is to allow to generate outputs that are self-explanatory and do not need to remember the order of the passed quantifiers.

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.