Giter Site home page Giter Site logo

Comments (9)

cosmic-cortex avatar cosmic-cortex commented on May 27, 2024

Can you post the error messages here? Without them, I cannot tell for sure.

Does your model work without modAL? Can you train it with your data? Because I don't think the 3D shape is a problem for modAL, since the data interacts with the model only. (I have tried other 3D shapes for image classification problems, they work fine.)

from modal.

alexv1247 avatar alexv1247 commented on May 27, 2024

This is the error message fot batch_uncertainty_sampling:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-c64fd087a5a2>", line 1, in <module> runfile('C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py', wdir='C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types') File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py", line 44, in <module> query_idx, query_instance = learner.query(x_pool, n_instances=20) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\models\base.py", line 194, in query query_result = self.query_strategy(self, *query_args, **query_kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\batch.py", line 197, in uncertainty_batch_sampling n_instances=n_instances, metric=metric, n_jobs=n_jobs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\batch.py", line 150, in ranked_batch metric=metric, n_jobs=n_jobs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\batch.py", line 82, in select_instance n_labeled_records, _ = X_training.shape ValueError: too many values to unpack (expected 2)

from modal.

alexv1247 avatar alexv1247 commented on May 27, 2024

This is the error for expected_error_reduction:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-c64fd087a5a2>", line 1, in <module> runfile('C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py', wdir='C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types') File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/alexv/PycharmProjects/Active_Learning/active_learning_types/standard_modAL.py", line 44, in <module> query_idx, query_instance = learner.query(x_pool, n_instances=20) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\models\base.py", line 194, in query query_result = self.query_strategy(self, *query_args, **query_kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\expected_error.py", line 64, in expected_error_reduction X_new = data_vstack((learner.X_training, x.reshape(1, -1))) File "C:\ProgramData\Anaconda3\lib\site-packages\modAL\utils\data.py", line 22, in data_vstack return np.concatenate(blocks) ValueError: all the input arrays must have same number of dimensions

Since this is the same code I used for the default query strategy and the same data I dont know how to tackle this error.

from modal.

cosmic-cortex avatar cosmic-cortex commented on May 27, 2024

What is the type and shape of your training data? Especially x_initial_training and x_pool, the problem seems to be with those.
For batch sampling, it seems to be that x_initial_training is actually a 1D array. With expected error reduction, the problem can be the same if the shape of these arrays are different. Can you check these?

from modal.

alexv1247 avatar alexv1247 commented on May 27, 2024

x_pool is a numpy array with a shape of (31982, 10, 6) and type float.
x_inital_training is a numpy array with a shape of (636, 10, 6) and type float

from modal.

cosmic-cortex avatar cosmic-cortex commented on May 27, 2024

I'll try to figure out what went wrong soon. Not sure I can look into this during the weekend, but I'll fix this by the end of next week!

from modal.

cosmic-cortex avatar cosmic-cortex commented on May 27, 2024

Quick update: the bug is definitely in modAL, I am preparing a fix, it will be ready soon!

from modal.

alexv1247 avatar alexv1247 commented on May 27, 2024

thanks a lot for your effort!

Sent with GitHawk

from modal.

cosmic-cortex avatar cosmic-cortex commented on May 27, 2024

The fix is in! Now these query strategies work with multidimensional data. You can update your local installation by installing directly from the master branch:

pip install git+https://github.com/modAL-python/modAL.git

Let me know if there is a problem!

A small note. Expected error reduction will only work with scikit-learn models since this requires cloning and retraining the classifier, which might not work with Keras.

from modal.

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.