nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.24k stars 233 forks source link

neuro node #324

Closed nortikin closed 10 years ago

nortikin commented 10 years ago

Alex made neuro node

neuro simple node, that learning from you how to find one ideal value between several changable values (some objects) and ideal that you propose. i.e. [[ 2.2, 2.5, 3.0 ]] in data, if this several change in time with every update and [[ 2.4 ]] as ideal solution from you can give something after time, as [[ 2.385432 ]] or something that ideal for node's opinion you, as teacher can change conditions, and than node will consider result by his own. He will understand your logic himselve

nortikin commented 10 years ago

and we dont know where to use neuro network

enzyme69 commented 10 years ago

Yes, need (simple) example please. Is it like simulation?

nortikin commented 10 years ago

i don't know how to use this. it makes desigions itself. but i see it useless

zeffii commented 10 years ago

@nortikin have you seen grasshopper Galapagos node?

nortikin commented 10 years ago

now changed - you can define data from objects. count of objects and items have to be still but values different in time. the same with ideal - change to study node, and than he will choose correct value

nortikin commented 10 years ago

yes, galapagos i used to find ideal solution. there is recursion and there is finding solution depend on some. Alex's node can by itself choose right value from inserted, but you have to teach it. tha same, if we will develop this node, it will be case of galapagos

nortikin commented 10 years ago

Александр writes:

Для настройки нейросети нужно указывать параметры максимального числа на входе и количество внутренних персептронов во внутреннем слое (может быть любым).
ещё нужно задавать гистерезис выходных значений, по которому анализировать - надо ещё один цикл обучения или нет.
 Коэффициенты обучения сбрасываются, если количество значений на входе дата было изменено.
Это примитивнейший нейрон. Но и задача примитивная.
ещё доработал - сигмойду затащил в тело класса.
пока подключен эталон, товарищь учится. Когда его не будет, товарищ будет оперировать текущими весами
Cfyzzz commented 10 years ago

Парни, если у вас будут идеи по поводу мозга в Сверчке, прошу вас обозначать их. Вам не нужно задумываться над реализацией, потому что это мешает творчески подходить к задаче.

Своей целью считаю получить опыт в нейронных сетях и дать пользу Сверчку.

ly29 commented 10 years ago

I would get very happy with a example.

nortikin commented 10 years ago

Alexander write https://github.com/nortikin/sverchok/issues/324#issuecomment-48604637, i try to translate:

if you have ideas on brain of sverchok, please, describe them here. You not need to think of realisation of node, because it interrupt creativity process.

My aim to have experience in neuro networks and take benefits to Sverchok
nortikin commented 10 years ago

example of practical usage - no, but i have example of workflow

nortikin commented 10 years ago

https://drive.google.com/file/d/0B6KMvjWAjGiyUDNWZS1Ca3hHNGM/edit?usp=sharing

Cfyzzz commented 10 years ago

уже обрабатывает. Даже списки на уровне бъектов теперь обрабатываются. Вообще в одном объекте может быть не одно значение, а несколько. Это будет считаться количеством входных сигналов.

Cfyzzz commented 10 years ago

Работа с нейроном строится из двух этапов. Первый - обучение. Второй практическое использование. Нод построен так, чтобы моно было наблюдать процесс обучения (изначально делал его скрытным). На этапе обучения мы подключаем один объект с нужным количеством входных значений и подключаем слот Эталон. Система подстраивается под это значение. В предлагаемом ниже примере вы задаёте координату куда ползти. http://www.pasteall.org/blend/30322

Чтобы коэффициенты не сбивать, нужно отключить слот Эталон и система обучаться дальше не будет. Но будет работать с подобранными коэффициентами.

А вот видео как работать с файлом http://www.youtube.com/watch?v=zwfEz_oclLg&feature=youtu.be

nortikin commented 10 years ago

yes, just press right arrow to activate brain - it learn in two steps

enzyme69 commented 10 years ago

Area Calc Blend actually does not work in my side. I tried opening it, but Blender hangs.

ly29 commented 10 years ago

I looked a bit a the code read a bit about neural networks and wow do I need to study more.

One small request, can you add the Sv prefix to the class/bl_idname?

enzyme69 commented 10 years ago

Ok, so Neuro Network is next node to explore. I become rocket scientist.


nortikin commented 10 years ago

@ly29 i will do this. Alex not often coming here.

nortikin commented 10 years ago

did

enzyme69 commented 10 years ago

PyroEvil http://pyroevil.com/2014/03/10/neural-network-biped-walking/

nortikin commented 10 years ago

@enzyme69 they still cannot walk. stupid dolls

nortikin commented 10 years ago

http://www.youtube.com/watch?v=mJaI2bnaq9Q this better. Alex has done some like this time ago in BGE but without legs

zeffii commented 10 years ago

that video (last one) is excellent :) reminds me of ragdolls of funkboxing: http://www.youtube.com/watch?v=yzrl7pCAbcs

nortikin commented 10 years ago

last football team is perfectly mirror from ukrainian

nortikin commented 10 years ago

offtop, but have to save. http://www.youtube.com/watch?v=jOLhnwllpgs this is dream!!! houdiny rulez

zeffii commented 10 years ago

yeah! that's beautiful parametric work there.

enzyme69 commented 10 years ago

Yes, Houdini is a bit crazy powerful and complex.

I bet that you all love it. Zeffii will think it is too node-based.

You can definitely investigate Houdini, VEX code, VOP SOP and stuff. While developing Sverchok. Because that is probably what Blender can be like.

Particles in Houdini is also powerful.

For some stuffs I always want to do in Houdini, Sverchok actually simplify it. Maybe Houdini can do the exact same thing, but different thinking.

Sverchok read points and connect it as edge. Houdini see Points and Faces.

Procedural Road, bridge, we can probably already do it in Sverchok to certain level, that is in the back of my mind since beginning.

The problem with Houdini: too many nodes :) too many smart Houdini people but they cannot teach the complexity, so artists need to be "at certain genius level" in order to create a working node setup, Otherwise, most artists are just using the easy tools like Copy Stamping nodes. While the actual capability of Houdini is so beyond the scope.

Anyways, neuron network and genetic algorithm is also complex.

There is a tutorial for Houdini for AI, and it was so complex, I keep it somewhere until one day maybe I can understand it.

On Saturday, 12 July 2014, Dealga McArdle notifications@github.com wrote:

yeah! that's beautiful parametric work there.

— Reply to this email directly or view it on GitHub https://github.com/nortikin/sverchok/issues/324#issuecomment-48746711.


nortikin commented 10 years ago

google prepared SI (sinthetic intelligance) some time ago. Hired some stuff, peeople who deal with it. And maybe now we can see, foult of theyrs new quantum computer is the end of SI at all?

zeffii commented 10 years ago

I don't know how 'vectorized' grasshopper/dynamo/houdini are, but most of the tutorials i've looked have generally been lacking in this concept. This either means I've watching crap tutorials.. or Sverchok is doing something quite different.

Cfyzzz commented 10 years ago

Ребята, я читаю ту ветку внимательно. Сейчас я начал работу о нейронной сети. Первый узел - комом. Но это было всегда так и Сверчок тоже родился из идеи и скрипта Никиты по распределению донора-объекта по поверхности другого объекта. Я в поисках достойного примера для Сверчка. Например, сейчас работаю с формами. Если будут успехи, я о них обязательно сообщу. Вообще кризис идей по этому поводу ощущается остро.

nortikin commented 10 years ago

Кризис идей в котором смысле?

enzyme69 commented 10 years ago

Thanks Alex and Nikita.

nortikin commented 10 years ago

it is only Alex for this node

Cfyzzz commented 10 years ago

preview http://www.youtube.com/watch?v=kqhPx5Jrn6g&feature=youtu.be

enzyme69 commented 10 years ago

Alex, maybe it can be for:

(nooby guess)

Cfyzzz commented 10 years ago

Есть проблема. Создаю объект Elman класса SvNeuro_Elman в секции class SvNeuroElman1LNode(bpy.types.Node, SverchCustomTreeNode):

в итоге получаю, что на все узлы SvNeuroElman1LNode имеют один объект Elman. Т.е. не у каждого узла свой Элман, а один Элман на все узлы.

Подскажите решение этой проблемы.


Eng google translate: There is a problem. I'm create 'Elman' by class SvNeuro_Elman in section code class SvNeuroElman1LNode (bpy.types.Node, SverchCustomTreeNode):

The result is that all nodes 'SvNeuroElman1LNode' have one object 'Elman'. I.e. one Elman to all nodes SvNeuroElman1LNode. This is bad

Prompt decision this problem.

ly29 commented 10 years ago

The problem is that non bpy.props are shared between all instances of a class. The solution is to create a dictionary with a unique key that can hold the data. For creating the key see node_id in data_structure, don't use the node name. This is good for temporary data and as a cache. however to save state between seasons you need to serialize the object to a stringproperty.

nortikin commented 10 years ago

то есть кэш с ключём имени узла или node id

Cfyzzz commented 10 years ago

Где создавать экземпляр класса Elman? Так понял, что кроме кэша данные никак не разделить. Ок. Буду думать над такой структурой.

т.е. заводить новый кэш или есть какая-то помойка (куча)?

ly29 commented 10 years ago

We should make a standard way to do save state between sesions. Only 2 nodes (Object In and Neuro) really do/need that right now but I guess more and more will want to store things that can't be automatically regenerated from the node network.

ly29 commented 10 years ago

Create dict in the file, either in class or global in the file. Use the generated node_id as primary key and store the Elman for the specific node in there. This works fine when the information can be easily regenerated from other resources. But to serialize the state to you need a stringproperty. It isn't as easy as it should be.

nortikin commented 10 years ago

save some RNA property? that you mean?

Kosvor commented 10 years ago

У этой версии результат на один уровень глубже [вложен] чем принято в сверчке.

Cfyzzz commented 10 years ago

критика принята. Исправил. Но пока этот нейрон не хорошо работает. Даже очень плохо - не решает поставленных задач. W.I.P.

Cfyzzz commented 10 years ago

Анализирует входящие данные с шумом и пытается выдать среднюю линию

2014-07-15 16 42 59 http://dl.dropboxusercontent.com/u/59609328/BigFiles/area-calc.blend

Kosvor commented 10 years ago

I believe that now is a complete neural network and we have to wait until the Sverchok will support recursion outside of nodes, so we can try to create a genetic/evolutionary algorithm.

nortikin commented 10 years ago

сделает всё без шума и пыли. Усё будет в лучшем виде, шеф (с)

ly29 commented 10 years ago

I'm a bit busy right now, will try to finish recursion with the separate ui thing soon. Then sverchok will be Turing complete.

enzyme69 commented 10 years ago

@Alex Can do circle packing?