fhswf / MLPro

MLPro - The Integrative Middleware Framework for Standardized Machine Learning in Python
https://mlpro.readthedocs.io/
Apache License 2.0
12 stars 3 forks source link

Refact: StreamTask, OATask - order of processing/adaption on new/obsolete instances #988

Closed detlefarend closed 4 weeks ago

detlefarend commented 1 month ago

Motivation Currently, methods StreamTask.run() and OATask.adapt() get instances to be processed in two different parameters

As a result, both lists are processed separately and block-wise.

Since an instance has a unique time stamp (see issue #987) the processing/adaptation should take place in an overall order by time stamp.

One possibility is to replace parameters p_inst_new, p_inst_del by a new parameter

Benefit Processing/adaptation is much more plausible than before.

Are the proposed changes backward compatible?

Related development objects

detlefarend commented 1 month ago

@steveyuwono @syamrajsatheesh this heavy design weakness came to my notice during working on SPARCCStream. Unfortunately, the resulting changes are extensive. But better now than after releasing MLPro 2... What is your opinion? Do you see a better way to solve this?

steveyuwono commented 1 month ago

@steveyuwono @syamrajsatheesh this heavy design weakness came to my notice during working on SPARCCStream. Unfortunately, the resulting changes are extensive. But better now than after releasing MLPro 2... What is your opinion? Do you see a better way to solve this?

Hi @detlefarend , what do you mean by block-wise? Regarding the order of processing the instances, I agree with the idea of ordering based on its timestamp rather than first the addition and then the deletion.

Regarding the proposed solution, a dict is a good solution as the new parameter.

detlefarend commented 1 month ago

Hi @steveyuwono, with block-weise I mean that we currently process all new instances in method _adapt() before we process all obsolete instances in method _adapt_reverse().

Ok, I will do the refactoring tomorrow in a separate branch. The best is to merge everything to main before. Any doubts, better ideas, last words?

steveyuwono commented 1 month ago

Okay, sounds good! Nothing else from my side...

detlefarend commented 1 month ago

@laxmikantbaheti I already refactored the normalizers due to the new stream instance management (see oa.streams.tasks.OATask, run() and adapt()). I also added numerous further howtos to validate every single oa task in 2d/3d/nd mode. Two things are not yet solved:

detlefarend commented 1 month ago

@laxmikantbaheti I also started refactoring oa.systems. Here further things are to do. I added a brief description to the issue.