Orange Forum • View topic - Loops

Loops

A place to ask questions about methods in Orange and how they are used and other general support.

Loops

Postby nick » Mon May 15, 2006 19:13

Is there a reason why widgets do not (obviously) support loops? Is there a work-around? What have I missed? I would like to investigate some constructs that involve feedback loops.

Postby Blaz » Fri May 19, 2006 6:12

We purposly prohibited loops in Orange Canvas since it would be very easy to to construct a schema with infinite loops that would block the system. We thought of a workaround (widgets would need to declare for which combinations of input signals do they automatically update the output), but that could significantly complicate the interface and perhaps the implementations. Furthermore, for the current set of widgets, we have not seen any benefits of cyclic connections (everythin that we have though of could be done by a simple cascade of widgets).

Can you let us know why would you need the loops, to help us in understanding better your problem?

Postby nick » Sat May 20, 2006 15:27

My interests are in the combining of the types of statistical facilities you provide in orange (which I think are very fine, BTW) with adaptic control, such as Kalman filters, and more generally with active systems in which such things as resonances can exist. I'm NOT interested in "yet another graphical programming language."

My motivation for loops comes in part from the recent renaissance of artificial intelligence, as exemplified by such things as the "DARPA Grand Challenge" robotic car event. Statistical processes played an important role in the success of the entries that finished in 2005. Statistics is becoming a significant factor in AI as it is practiced today, but loops are necessary.

There are graphical programming environments available, such as Khoros, Simulink, and Hyperception, but none (that I know of) that are free and open source, and certainly none that have the statistical sophistication of orange.

I realize that your intent is NOT to produce a graphical programming environment, and I have some understanding of the sticky issues that loops introduce. I was hoping that you had already considered loops in the context of active systems, and that I had just missed it. I do think that loops can be introduced into orange, at least in limited but useful forms, without overly complicating your system. But then, I obviously don't have a deep understanding of your code.

Postby Gregor Leban » Tue May 23, 2006 15:00

Hi Nick,

I developed Orange Canvas so I can tell you some small modifications that you can do in your local version of Canvas that will allow you to make loops. Changes are only 2.

One is in the orngDoc.py file in OrangeCanvas folder.
Open the file and comment the lines 98, 99 and 100.

The second change is in the orngSignalManager.py file which is in the same folder.
There you just have to comment the line 179.

I tried this and it works. You will however face problems if all the widgets that you will connect in the cycle will automatically send something on their output when they will receive new input - this will create a loop that won't finish processing.

I do however believe that whatever your task is you can find a solution without using the cycles. You can most likely do this by appropriately defining your outputs of widgets. You can, for example send on the widget output the whole widget instance (self). What you can do then is take this instance in the next widget and modify it (or iteratively optimize some parameters). The result is the same as it would be if you would connect this two widgets in a cycle.

Hope this is of any help...
Tell me if you have any questions about this.

Gregor

Postby nick » Thu May 25, 2006 16:28

Thanks, Gregor. I'll give your coding changes a try.

My interests lie in studying the storage of information as standing resonances in dynamic, probabilistic systems. This combines active control mechanisms with statistics, and I suppose loosely falls under the heading of "cybernetics." Orange supplies two of the three tools I think I need, strong statistics and graphical programming, leaving only the need for looping constructs to produce the resonant attractors.

I agree with you that there is a large potential for creating infinite loops in the modified system I'm after. I plan to address this issue by building in means to manually interrupt such situations. Ideally, the system I want would function more as a discrete event simulator, with a master control queue that schedules all widget executions, but that lies in the future.

Your help is very much appreciated, and I can't say enough good things about Orange. If you're interested, I'll forward some examples of what I'm doing when they're ready.

Nick

Postby Gregor Leban » Thu May 25, 2006 20:52

nick wrote: If you're interested, I'll forward some examples of what I'm doing when they're ready.


Yes, please do. Maybe we'll be able to give you some helpful advice. In the mean time, if you'll have any questions just post them on the forum.

Gregor


Return to Questions & Support



cron