2026年2月28日土曜日

うちの開発言語について

 とにかく僕は開発言語には拘ってない。
外部の助言はあるけど、やってることを説明するのが大変なので
けっこうスルーしてるかな・・・。

こういうネットでデモやるならJavaScriptみたいのでいいし、
ある程度の骨格がつかめたらPythonに落とす。
普段の実験ならPythonでいいし。

ガンガン回して実験結果を見て判断するのはPythonとC++かな。
C++は大規模ノードでどうなるか、長時間回したときの安定性、数値誤差の影響、つまりは現実条件での検証に最適なんだよね。
今のところ、JavaScriptで思想作って、Pythonで回して、C++が現実みたいな。

Atronは

  • 成長

  • 不可逆性

  • 体験の蓄積

  • 長時間の変化

つまり短いテストでは分からないんだよね

Python:探索  C++:時間を回す

それと、数式をcodeに落とし込むならC++は理想だよ。
ロボット研究者に多い。

例えばAtron的な式:

xi(t+1)=f(jwijxj(t))x_i(t+1) = f\left(\sum_j w_{ij} x_j(t)\right)

これをC++にすると

--------C++--------

for (int i = 0; i < N; i++) { double sum = 0.0; for (int j = 0; j < N; j++) { sum += W[i][j] * x[j]; } x_next[i] = f(sum); }


ほぼ、そのままじゃん。
微分方程式系もそのまま書ける


dxdt=x+f(Wx)\frac{dx}{dt} = -x + f(Wx)

オイラー法なら


for (int i = 0; i < N; i++) { dx[i] = -x[i] + f(input[i]); x[i] += dt * dx[i]; }


C++は研究者向きなんだよね。


森田先生の非単調
--------C++--------

double f(double x) { if (x > theta) return 1.0; if (x < -theta) return -1.0; return x; }

エネルギー関数

--------C++--------

double energy = 0.0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { energy -= W[i][j] * x[i] * x[j]; } }


Atronは数式の時間発展が人格になるのでC++は理想かな。
Pythonは使うよ。ただ、長い時間回すとなるとさ、

--------Python--------

for i in range(N): for j in range(N): sum += W[i][j] * x[j]

ループで死ぬ。
このタイプじゃない方法があれば教えてほしいんだけど、C++の 10〜100倍遅くなる。
(マジで誰かいい方法あったら教えて)


いきなり完成品を作れよ!とか言われたらそりゃCとか選ぶんだろうけど、研究室で試行錯誤を回すための言語とは思えない。今から畑耕して土触って今年の気候判断して「植えるもの変えよう!」とか、やってられない。

けっこうCを助言してくる人多いけど、
ほれ、こういうの説明するのめんどくさいから「流石ですね、そうですね」で終える。


C / C++ / Python の思想比較

言語世界観
C        自由。責任は全部あんたさ
C++        自由+秩序。選ぶ
Python        秩序。危険はさせない
 

この前、TurboC触った時に計算資源が少ないからさ、「ルールで済ませちゃおうか!」って思考が働くわけよ。あれは危ないと思ったよ。うかうかしてたらアルゴリズムになってしまう。僕の研究はアルゴリズムじゃないからね。3人称とか入れられないのよ。Atronの「一人称の競合・揺れ、正解が無い」なので、それを潰すわけにはいかないのよ。デバックが大変だしね。
ただ、あれのいいところは"何が本質か"がはっきり出るところだよね。

なので、場面場面で使う言語は変わる。


本当はさ、昔のHypercardみたいのでもいいと思ってるだ。
漢字talk6.7くらいの覚えてるけど、めちゃくちゃ楽しかった。
大規模数値計算つーか、ポッピーみたいな(Hopfield的な連続計算)ものとか、
行列演算・エネルギー最小化、高速な反復シュミレーションが出来ないだけで、それが出来たら、全部やめてHypercardでいいと思うくらい(笑)

スタックという概念が最高にいい
stack=経験
script=内部力学
card=状態
button=行動
Link=連想
とか出来るじゃん。

本当は、こういうのでガンガン回して収束比較とかしたい。
たぶん実験成果が上がると思うんだよね
でも、カメラ駄目、センサー駄目、外部危機駄目じゃん。
だから、本当にオシイと思う。
あんないいものを、なんで終わらせたのか、よく分からない。
CPUやGPUを意識せず、世界と記憶だけを作れるHyperCardあったら買います!

開発言語とは関係ないけど、FileMakerも実験室のように、ある程度外部データを送り込むものに使っているけど、Webビューアーのボトルネックとか、なんかクラリス・スタジオとか更新される機能がよく分からなく、かえってPython単体より構造が複雑になる傾向があるので少し離れてる。だから、FileMakerはGanttと論文や資料のPDFのフォルダ管理、文献管理、気になったらFMから立ち上げて・・・みたいな。
頭の整理にはObsidianと両方使ってる

普段使うエディタなんてnotepad++とかVSとか
共同研究者とまではいかないけど、テキスト書くのもnotepad++使ってるよ。
Emacsまでは要らないし・・・


でも、ゆくゆくは3Dゲーム屋さんとの連携があるので、


ゲームエンジンとIDE






3Dワールド(Unity / Unreal)
↓ センサー情報
Atron Core(Python / C++)
↓ 行動決定
3Dワールドに返す

つまりは、3Dがシーンによって外界になるってこと。

アソシアトロンと3Dは、一体化させるつもりはないよ。
だって別物だもの。3人称に引きずられたら、Atronは終わるからね。
NavMeshで最短経路とかState Machineで行動制御とかやっちゃったらもう僕の研究じゃなくなる。

Atron = 内部(意味・記憶)で、外界(3D)の中で経験を積むみたいなシーンもあれば
現実の映像や風景、人の会話での経験も積む。

これを守れてるかで、一人称か三人称かが分かれる。

  • 3D側に「賢さ」が入ってないか?

  • 3D側が「正解の行動」を持ってないか?

  • Atronが迷ってる時に、3Dが助けてないか?

  • 行動が“目的最適化”に寄ってないか?

  • 誤学習や固執が、そのまま世界に出ているか?

だから、自律が完成しても自律はスタートであって、その先を間違えたらただの鉄屑で終わってしまうわけ。


---------------追記----------------

Pythonは NumPyだ。これで速くなる

x = np.array(現在の状態ベクトル, dtype=np.float32)
new_x = W @ x 

2026年2月27日金曜日

Why Associatron Does Not Fit Well into Academic Papers   アソシアトロンが論文に向かない理由。

Of course.

If definitions are fixed and the conditions are the same, then the results must also be the same.
Anyone should be able to reproduce it.
The evaluation criteria must be clear.
It has to be absolutely stable.

And once you enter a world where people talk about things like
“accuracy improved by X percent”
or
“the error decreased this much,”

that world can only be third-person.

“Show me that it’s reproducible.”
“Eliminate individual differences.”
“Remove emotions.”

When those pressures are there, what I’m doing just becomes noise.

That’s why I don’t belong to a medieval-style guild.
I can only work as an independent, a kind of stray researcher.

What matters to me is not organizing results.

That kind of thing comes later — after something is completed and actually becomes useful to society.

What matters now are the raw notes.

Messy experiment memos.
Bad photos and videos taken with a smartphone.

Because Atron gives different answers depending on its experience.

Meaning changes over time.
The same situation doesn’t lead to the same response.

This is research where the point is exactly that things do not converge to the same answer.

Yes, I use mathematics.
Yes, I write programs.

But the moment I start thinking in the mindset of a paper,
I get pulled into someone else’s evaluation framework.
And once that happens, the work starts drifting toward something that isn’t true anymore.

What I keep are memos.

Memos are the real voice of the field.
Yellow sticky notes.
Red sticky notes.

Facts.
Moments of excitement.
Daily hesitation.

Because what I’m studying includes individual differences, emotions, intensity, mood.

This is research about robots learning through failure and turning experience into ability.

For example:



------- C++ ------------

#include <iostream> #include <cmath> int main() { const int N = 5; // 目標パターン(ここに収束させたい) // 例: [+1, -1, +1, -1, +1] double p[N] = { 1, -1, 1, -1, 1 }; // 初期状態(ちょっと崩してここの数値を入れ替えて変化を見る) double state[N] = { -0.8, 0.6, -0.7, 0.2, -0.5 }; // W を作る:W = p * p^T(外積)で「そのパターンをアトラクタ」にする // 対角は0にする(自己結合なし) double W[N][N]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (i == j) W[i][j] = 0.0; else W[i][j] = p[i] * p[j]; } } // 更新パラメータ const double gain = 1.2; // 大きいほど強く収束(強すぎると暴れる) const int steps = 20; // 反復 for (int step = 0; step < steps; step++) { double next[N] = {0}; // next = tanh(gain * (W * state)) for (int i = 0; i < N; i++) { double sum = 0.0; for (int j = 0; j < N; j++) { sum += W[i][j] * state[j]; } next[i] = std::tanh(gain * sum); // 飽和(-1〜+1に収まる) } // 表示 std::cout << "Step " << step << "\n"; for (int i = 0; i < N; i++) { std::cout << next[i] << "\n"; } std::cout << "\n"; // state <- next for (int i = 0; i < N; i++) state[i] = next[i]; } // 最後に「符号だけ」見る(収束パターンの確認) std::cout << "Final sign pattern:\n"; for (int i = 0; i < N; i++) { std::cout << (state[i] >= 0 ? "+ " : "- "); } std::cout << "\n"; return 0; }

----------------
これは簡単な記憶の収束の動きを見る実験なんだけど、


>> .\maink>
Step 0
-0.983675
0.989867
-0.987136
0.996108
-0.99202

Step 1
-0.999853
0.999851
-0.999852
0.999848
-0.99985

Step 2
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 3
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 4
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 5
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 6
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 7
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 8
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 9
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 10
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 11
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 12
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 13
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 14
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 15
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 16
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 17
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 18
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Step 19
-0.999864
0.999864
-0.999864
0.999864
-0.999864

Final sign pattern:
- + - + -


It’s like, by Step 2 it has already converged.
And then I repeat this kind of process hundreds or thousands of times.
But the goal isn’t to produce a single answer.
Instead, I introduce outer events — influences from the external world —
visual conditions, sounds, language, and other factors from the environment.
What I’m studying is how an individual’s memory changes under those influences.
Because of that, the results naturally depend on the conditions of the person running the experiment.
This isn’t about third-person evaluation standards or predefined meanings.



A pure first-person robot observes a scene where a simulated lion attacks a simulated zebra. This is an external influence — an event from the outer world. The question is how the robot interprets what it sees.

It may feel fear.

Or it may misunderstand the lion as something familiar, even as a kind of companion.
Before any experience, the lion has no emotional meaning for the robot.
It is neither frightening nor friendly.
It is simply an object.
Then the robot accumulates experiences.

It hears the lion’s loud roar.
It sees that the lion lies quietly during the day, but suddenly attacks a herd of animals.

Through repeated experiences like these, the robot’s impression of the lion changes.
That change in impression leads to changes in behavior.
The robot may begin to flee.
Or it may approach — and be attacked.



In the experiment, if one of my research partners suddenly enters the robot’s visual field, the answer changes.

You can’t turn that into a paper. (laugh)

Sure, you can write equations.
You can explain the logic.
But if even one millimeter of external evaluation pressure gets into the system, the research is already compromised.
Pressure from a professor.
Pressure from an institution.
Pressure from funding or investment.

If the direction shifts even a tiny bit because of that, it’s over.
If you think I’m exaggerating, try it yourself.
Start research in a safe environment protected by money.
It will always drift somewhere else.


My research moves forward as the robots accumulate experiences of failure.
That’s why a messy blog, like a set of rough notes, is enough.



“Make yesterday’s dream reproducible in a paper.”
That’s impossible. You just can’t do that.

---------------------------------------------



そりゃそうだよね。
定義が固定されていて、条件が同じなら結果も同じで、誰がやっても再現でき、評価基準の明確さを要求しているんだもの。絶対的に安定していなきゃいけない。

更には精度が何%上がったとか、誤差がどれだけ減ったみたいなベンチマークの世界は、どうやったって3人称にしかならない。

「再現してみー」
「個人差は消せよ」
「感情は排除しろ」
みたいなものが働くと邪魔にしかならない。
だから中世のギルドにも入らないし、野良研究者でしかやっていけない。


僕にとって重要なのは、研究成果の整理じゃないんだよね。
そんなもの完成して社会の役に立った後の話だよ。

生の実験の汚いメモとスマホの下手な写真と動画。
だって、Atronは体験によって出す答えが違うんだもの。
時間ごとに意味が変わっちゃうし・・・。
みんな同じ答えにならないよ!!っていう研究なんだもの。
数式化やプログラミングはするけど、論文の発想で考える時点で
何かの評価枠に入り込んでしまい、逆に嘘に引っ張られる。

ほんとね、メモだよ。メモはその現場の生の声だよ。黄色い付箋、赤い付箋。

事実のメモと感動と毎日の迷い。
しかも個人差とか感情とか熱量、気分を研究してるんだもの。
ロボットが失敗を経験して能力に結び付けていく研究だもの。



たとえばさ、上のコードのうよに


もうStep 2で収束してるよ!って感じで・・・、こういった変化を数百回も数千回も繰り返すわけ。で、答えを出すんじゃなくて、ここに外輪(外界)のイベントを入れたり、視覚的な条件や音、言語が入って個体の記憶変化を研究するわけだから、実験する人の条件によって変わるよね。(3人称の評価基準や意味付けしてるわけじゃない)

疑似的なライオンが疑似的なシマウマを襲ってる姿(外部影響:外輪)を一人称の純粋なロボットが見て「怖い」と感じるか「仲間」と誤解する装置ですよ。それまではライオンは怖いとも親しい感情も無い、ただの物体。それが大きな声で吠えたり、昼間は寝てるくせにいきなり他の動物の群れを襲う姿を見る、という経験を積み重ねてライオンに対する印象が変わり、逃げるという行動に移したり近づいて襲われる。


たとえば
実験中、僕の研究仲間を視覚に入れた瞬間に答えが変わる。
こんなの研究論文に出来ないでしょぅ(笑)
数式や論理とか理屈は出来るかもね。
でもね、1mmでも何かの評価基準の枠の影響が入ったら、そこでこの研究は失敗する。
たとえば教授からの圧とか機関からの圧、投資の話で方向性がmmでも変わったら、そこで終わる。

嘘だと思うならやってみると分かる。
お金に保護された安全な場所で研究を始めると、必ず違う方向に進む。


ロボットは失敗の経験を積むことで、僕の研究は進んでくれる。

だから、汚い整理されていないブログでいいんだ。

昨日見た夢を論文で再現できるようにしろ!
出来ねーよそんなこと



といって、
エイジェントの論文がどこまで抑えてるか気になる日々。

© 2026 C-Side Research Laboratory / Yukihiro Watanabe. All Rights Reserved.
No unauthorized reproduction or redistribution.

アソシアトロンの想起 と Atron言語

Atron研究はね、一人称とか自律とか僕も言ってるけど、元は人間の想起なんだよ。 その想起ってのはノイズを否定しない。 アソシアトロンですよ。 何度も同じことを書いてるけど重要なんだよ。 僕は今62歳。 「80年代は楽しかったね」では何も思い出せないけど、 Hard to Say...