cair / PyTsetlinMachineCUDA

Massively Parallel and Asynchronous Architecture for Logic-based AI
https://arxiv.org/abs/2009.04861
MIT License
41 stars 4 forks source link

Support of multilabel? #8

Open Filco306 opened 3 years ago

Filco306 commented 3 years ago

Hello,

I was wondering, does the Tsetlin machine support multilabel output? I saw multiclass, but that assumes only one label is true, correct?

Thanks! :)

Cheers

olegranmo commented 3 years ago

Hi @Filco306! We usually train one multi-class TM per output for multi-class outputs, which can be done from the outside. However, I plan to add multi-output as a thin Python wrapper as well, like the multi-class wrapper. The https://github.com/cair/PyCoalescedTsetlinMachineCUDA is BTW inherently multi-output (binary). Multi-class is actually then mapped to multi-output and then back again to multi class with argmax on the multiple outputs. This allows sharing of clauses among the outputs. A thin Python-wrapper for multi-output is coming soon for this one as well.

olegranmo commented 3 years ago

Let me know if this functionality is something you will need soon, and I will prioritize finishing these wrappers :-).

Filco306 commented 3 years ago

Hello,

Thank you for your quick reply! On the tasks I am trying to use it for, I need the support for multi-labels; I think I can use the PyCoalesced Machine, wouldn't that work? I need to read your work more thoroughly, but I have to say that I find this highly interesting and very promising for many problems that can be converted into binary representations :)

olegranmo commented 3 years ago

PyCoalesced should work - just added the class 'MultiOutputTsetlinMachine' where the output 'Y' can be a binary vector. Let me know how it works :-)