Update README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326---license: apache-2.0language:- en- jamodel_type: optimizertags:- optimizer- adaptive-optimizer- emotion-ai- shadow-learning- deep-learning- meta-learning- adaptive-algorithms- stability-analysis---**èªååæïœ¥èªå·±å¶åŸ¡ïœ¥èªåŸå ãªããã£ãã€ã¶ã§ã****Auto-convergence, self-control, autonomous optimizer**é«å¹çæ§ãšéç©åºŠé«æ¬¡momentãKahanè£åãéååè£åãåæ£ïœ¥ç¶ç¶åŠç¿ã§ã®ç¬ç«æ§ãèªå·±ä¿®åŸ©ïœ¥ã¢ãã«ä¿®åŸ©ããã€ããŒãã©ã¡ãŒã¿ã®èªåŸèª¿æŽãä¿¡é ŒåºŠãã£ã«ã¿ãæŽæ°ã¹ãããã®æçæ§ãæ§é çèæ§ãèªå·±åæ¢ãåçåŠç¿çãåçã¹ã±ãžã¥ãŒã©ãåçRank/Aplhaãå±¥æŽè£åããªã©ãå«ãã倿©èœæ§ãã远å ãã³ãœã«äžèŠãèšç®è² è·ã»ãŒãªããstepæ¯ã«å®å šé©çšãæéçç©ç®ã§å®çŸããŸãããããã¯ã³ããã±ãŒãžã§å®çŸããé«å¹çæ§ãšéç©åºŠã¯å®å®ãšå®å šãæåªå ããŸãâ» é«æ¬¡momentã¯è¿äŒŒçãåçRank/Alphaãè¿äŒŒçãªå¹æã§ãâ» LoRAç³»æè¡ã¯ãã€ãºããªãããŸãã埮å°ããŒã¿ã倱ãå ŽåããããŸãâ» emoç³»ã¯ãã€ãºãäœããæ¢åãã€ãºãèŠã€ããŠä¿®æ£ã埮å°ããŒã¿ãä¿è·ããŸãâ» éååè£åã¯ä»åŸå®çšåãããããã«äœç²ŸåºŠãªç°å¢ã§ãæè»ã«å¯Ÿå¿ã§ããŸã第ïŒäžä»£ v3.0 (ææ°ç) ã¯ãã¡ãããhttps://huggingface.co/muooon/EmoNAVI/tree/main/1Gv3_AMP-compatiblehttps://github.com/muooon/EmoNavi/tree/main/AMP-compatible#### ãŠãŒã¶ãŒãšç ç©¶è ãž/ãã®ãªã³ã¯ãèªãã§ãã ãã/please clickïŒ[ãŠãŒã¶ãŒãšç ç©¶è ãž/ãã®ãªã³ã¯ãèªãã§ãã ãã/please clickïŒ](https://huggingface.co/muooon/EmoNAVI/raw/main/report-emoment.txt)emonaviæåãŸãšã(æ¥æ¬èªã®ã¿)[emonaviæåãŸãšã(æ¥æ¬èªã®ã¿)](https://huggingface.co/muooon/EmoNAVI/raw/main/report/emonavi%E6%8C%99%E5%8B%95%E3%81%BE%E3%81%A8%E3%82%81.txt)Gemini ã«èŠããŠããããèããŠã¿ãŸãã[Geminiã«èããŠã¿ã](https://huggingface.co/muooon/EmoNAVI/blob/main/Hug-Gemini-analysis(JPN).md)[Geminiã«èããŠã¿ã-02(æ¥æ¬èªã®ã¿)](https://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-Gemini-analysis(2)(JPN).txt)I showed it to Gemini and asked her a few questions.02 is only in Japanese - please translate by yourself.[asked Gemini](https://huggingface.co/muooon/EmoNAVI/blob/main/Hug-Gemini-analysis(ENG).md)|â | EmoNAVIãFACTãLYNXãCLANãZEALãNECOãv3.0 (250825) emosens(第ïŒäžä»£)ã§è§£æãã"髿¬¡moment"(è¿äŒŒ)ã®ãã£ãŒãããã¯ãé©çš(æŽæ°) å šãŠ "shadow=False" ã§ã|â | EmoNAVI, FACT, LYNX, CLAN, ZEAL, NECO, updated to v3.0 (250825), Incorporates (updates) feedback on âhigher momentsâ (approximations) clarified by emosens (2nd generation). All are âshadow=Falseâ|â | EmoNAVIãFACTãLYNXãCLANãZEALãNECOãv2.0 (250815) æŽæ°ãshadow-system ã®ç²Ÿå¯å(æŽæ°)|â | EmoNAVI, FACT, LYNX, CLAN, ZEAL, NECO, updated to v2.0 (250815), refinement of shadow-system (update)|â | 第ïŒäžä»£ãå ¬é(250801)ããŸããã emonavi ã¯ãæ°ããäžä»£ãžé²åã軜éåãæãããŸã|â | The 2nd gen was release(250801) emonavi has evolved into a new generation and become more lightweight.|â | https://github.com/muooon/EmoSens|â | clanãzealãnecoãã¯ãshadowæ©èœã® on/off åæ¿ããã§ããããã«ããŸãã|â | clan, zeal, and neco are now able to switch the shadow function on and off.|â | 倧å€å æ ãªããšã« Pytorch-optimizer 3.7.0 ãžç»é²ããããšã®ããš (250728) é¢ä¿è ã®çããŸã«æ·±ãæè¬ããŸã|â | We are very honored to have been registered in Pytorch-optimizer 3.7.0. We would like to express our deepest gratitude to everyone involved.|â | ç䌌DDPã·ãã¥ã¬ãŒã·ã§ã³ã詊ãããæ¹(Those DDP simulation) â[DDP-TEST](https://huggingface.co/muooon/EmoNAVI/blob/main/ddp-test.zip)|â | EmoFACT å ¬é(250716) NAVIã«æ¯ã¹ãçŽïŒGBç¯çŽ(SDXL) ææ æ©æ§ã¯åãã§ã|â | EmoFACT released (250716) Saves about VRAM1GB (SDXL) compared to NAVI. Emotion mechanism is the same.|â | EmoLYNX å ¬é(250718) æ¢çŽ¢ç¯å²ãåºãæã¡ãŸã ææ æ©æ§ã¯åãã§ã|â | EmoLYNX Released (250718): It offers a wide exploration range, while its Emotion Mechanism remains the same.|â | EmoCLAN å ¬é(250720) NaviãFactãLynxã圹å²åæ ã®çµ±å ææ æ©æ§ã¯åãã§ã(LynxïŒåºç€ãšéåŠç¿åŸåæãNaviïŒäžç€ãšå¥å šæãFactïŒçµç€ãšçºæ£åŸåæããæ åœããŸã)|â | EmoCLAN Open (250720) Navi, Fact, Lynx, role integration Emotional mechanism is the same(Lynx: in charge of the early stage and overlearning tendency, Navi: in charge of the middle stage and soundness, Fact: in charge of the end stage and divergence tendency)# äž»é¡ïŒæ°äžä»£optimizerãEmoNAVIã«ããå€é©ãšææ åŠç¿ã®ææ## Title: A New Generation Optimizer â The Innovations and Outcomes of Emotional Learning with EmoNAVI## å¯é¡ïŒéå»å€äžèŠã§çŸåšå€ããåéã§ããèªååæïœ¥èªå·±å¶åŸ¡ïœ¥èªåŸå軜éæé©åšã®è§£èª¬### Subtitle: A Lightweight, Self-Regulating, Autonomous Optimizer That Automatically Converges and Resumes from the Present Without Relying on Past Values## ããŒãïŒæ¢åã®optimizerã«ãªããã®ãã€ãããåºæ¥ãã®ã¯ãã¥ãŒãã³ã¹ãã€ã¯ã®åçºæã§ããã### Theme: Creating What Existing Optimizers Lack â A Reinvention of Neuronal Spiking## åºè«ïŒçŸåšäž»æµã®optimizerã¯ããŸããŸã«æ¹è¯ããç°¡æåãé²ããŠããŸãããããäŸç¶ãšããŠãåŠç¿åéãã¹ã±ãžã¥ãŒãªã³ã°ãåŠç¿ç¶æ ã®èšé²ã埩å ãçã«ã€ããŠèª¿æŽã®é£ãããç ©éãã¯ååšããŠããŸããé¢åãªãã©ã¡ãŒã¿ã«äŸåããããããã解決ããæ°ããã¢ãããŒããèŠã€ããã®ã§ããã§ç޹ä»ããŸãã## IntroductionMainstream optimizers have undergone significant improvements and simplifications in recent years.However, they still face practical challenges in areas such as resuming training, scheduling updates, and managing the recording and restoration of learning states.These issues often require tedious parameter adjustments and ad hoc workarounds.In this paper, we introduce a new approach that addresses these problems without relying on cumbersome parameter configurations.## æ¬è«ïŒä»åããã§ç޹ä»ããã®ã¯æ°äžä»£ã®optimizerã§ããEMAçå¹³æ»åã®æŠå¿µãäžå°ã«ããç¬èªã«æ§ç¯ããææ ç"EMAïŒã¹ã«ã©ãŒ"ãäžå¿ã«ãã"ææ æ©æ§"ãšããæ°ããä»çµã¿ãå®çŸããŸããããã®"ææ æ©æ§"ã¯ãEMAççºæ³ãåè§£éç¬èªæ¡åŒµããããšã§åŸãããæ°ããæ©æ§ã§ããEmoNAVIã®ç¬ç«æ§ãšé©æ°æ§ã玹ä»ããŸãã## Main SectionIn this paper, we present a new generation of optimizer.Built upon the foundation of EMA (Exponential Moving Average) smoothing, we have developed a novel mechanism called the "emotional mechanism," which centers around a unique combination of EMA and scalar dynamics.This mechanism was created by reinterpreting and independently extending the conventional EMA concept.Here, we introduce EmoNAVIâan optimizer characterized by its innovation and independence.æåã«"ææ æ©æ§"ãšåä»ããçµç·¯ãšçç±ãèšããŸããçç©ã®ãã€ïœ¢ææ ãšã¯ãç¥èŠãšèšæ¶ã®å·®ç°ã«åºã¥ãè¡åã®ããªã¬ã§ããåæ§ã«EmoNAVIãçŸåšãšéå»ã®å·®åã«åºã¥ãåŠç¿ã®"è¡å"ãå¶åŸ¡ããä»çµã¿ãšããŠèšèšãããŠããŸãããããŠ"ææ æ©æ§"ãšåä»ããçç±ã®ããã²ãšã€ã¯ããã®äžé£ã®åäœããŸãã§ãã¥ãŒãã³ã¹ãã€ã¯ã®ãããªåäœãããããã§ãããã®æ©æ§"ææ æ©æ§"ã®åäœãæå¿«ã«ããèªã¿ç©ãæ¬çš¿æ«å°Ÿã«èšããªã³ã¯å ã®æ¬äººåãèªãããšã§ç°¡åã«ãçè§£é ãããšæããŸããFirst, let us explain the background and reasoning behind the term âEmotion Mechanism.âIn biological systems, emotions are often understood as triggers for action based on discrepancies between perception and memory.EmoNAVI was similarly designed to control its learning âbehaviorâ by responding to differences between the present and the past.Another reason we chose the term âEmotion Mechanismâ is that its operation closely resembles neuronal spiking behavior.For a more intuitive understanding of how this mechanism works, we encourage you to read the personification linked at the end of this article.次ã«ã"ææ æ©æ§"ã®æ§æãèšããŸããææ æ©æ§ãšã¯ãïŒã€ã®EMAãã¹ã«ã©ãŒãShadowãã«ããæ§æãããŸããNext, we outline the structure of the âEmotion Mechanism.âThis mechanism consists of two EMAs, a scalar value, and a shadow component.ãŸãïŒã€ã®EMAã«ãã"ææ EMA"ã«ã€ããŠèª¬æããŸããïŒã€ã®EMAã§æ§æããŸããçæåãšé·æåã§ãããã®ïŒã€ã®EMAã¯Lossãç£èŠã倿ææãåŸãŸããïŒã€ããçæåEMAã¯ç¬éçãªã·ã°ãã«(ç·åŒµ)ãåãæã¡ãŸã ïŒã€ããé·æåEMAã¯å¹³åããéå»ã®ã·ã°ãã«(å®é)ãåãæã¡ãŸãããã®ïŒã€ã®EMAã¯æ¬¡ã«ç޹ä»ãã"ææ ã¹ã«ã©ãŒ"ãžããããã®æã€å€æææãæž¡ããŸãFirst, we describe the "Emotional EMA," which consists of two components: a short-term EMA and a long-term EMA.These two EMAs continuously monitor the loss value and serve as the basis for subsequent decision-making.The short-term EMA captures rapid, momentary signals (interpreted as âtensionâ), while the long-term EMA reflects more averaged, historical trends (âcalmâ).Both EMAs pass their respective signals to the "Emotion Scalar," which will be introduced in the next section.次ã«ã"ææ ã¹ã«ã©ãŒ"ã«ã€ããŠèª¬æããŸããåè¿°ã®"ææ EMA"ããã®ä¿¡å·ãã¹ã«ã©ãŒå€ã«å€æããŸããã¹ã«ã©ãŒå€ã®å€åã¯ããããïŒã€ã®EMAã®å·®åã«ããåžžã«åçå€åãç¶ããŸãã"ææ ã¹ã«ã©ãŒ"ã¯optimizerã«ããæžãæããåŠç¿çµæã®æ¯éãå€å®ãã"ã¹ã«ã©ãŒå€ãäžå®éŸå€ãè¶ ãããšãã®ã¿"次ã«ç޹ä»ããShadowã®é åãæ±ºããŸãNext, we introduce the "Emotion Scalar."It converts the signals from the previously described Emotional EMA into a scalar value, which continuously changes in response to the difference between the short-term and long-term EMA.This scalar dynamically evaluates whether the learning update performed by the optimizer should be considered appropriate.Only when the scalar exceeds a certain threshold does it trigger the next step: determining how much of the "Shadow" should be blended into the learning parameters.次ã«ãShadowã«ã€ããŠèª¬æããŸããShadowã¯åŠç¿éå§çŽåŸã«ShadowãšããŠä¿åããç¶æãããŸãããã®Shadowã¯"éå»ã®ç©ãããªç¶æ "ã®èšæ¶ã§ãããã®æ å ±ã¯ææ æ©æ§ã«è¿œåŸããªãããã£ãããšå€åãç¶ããŸãããããŠ"ææ ã¹ã«ã©ãŒ"ã«å¿ã決ããããratioã§åŠç¿çµæã«ãã¬ã³ããšããŠåæ ãããŸãããã®ãã¬ã³ãã®é åçãææ æ©æ§ã«ããåçã«å€åãç¶ããŸããNext, we describe the "Shadow."At the beginning of training, a copy of the current parameters is saved and maintained as the Shadow.This Shadow represents a memory of past calm states, and it evolves slowly over time, following the guidance of the Emotion Mechanism.When the Emotion Scalar exceeds a certain threshold, a dynamic blend ratio is computed.This ratio determines how much of the Shadow is mixed into the current parameters.The blend ratio itself is also dynamically adjusted by the Emotion Mechanism in response to ongoing learning behavior.ãããŸã§"ææ æ©æ§"ã®æ§æãšåœ¹å²ãã説æããŸãããç¶ããŠ"ææ æ©æ§"ã®åäœæ©åºãèŠãŠãããŸãããããŸãoptimizerã®åŠç¿çµæãèšé²ãããŸãããã®æ"ææ æ©æ§"ã¯ç·åŒµãšå®éã®å·®åæ å ±ã§æžãæãã®æ¯éãå€å®ããŸãããã®å€å®ã«ãããé床ã®åŠç¿ãšå€æããå Žåã¯ãéå»ã®é©åãªç¶æ ããã¬ã³ãããããšã§ãã€ãºãæŽèµ°ãæå¶ããŸããé©åãªåŠç¿ãšå€æããå Žåã¯ãéå»ããã¬ã³ãããªãéžæãããŸãããããstepæ¯ã«è¡ããŸããNow that we have explained the structure and role of the Emotion Mechanism, let us examine how it operates.At each training step, the optimizer's updated parameters are recorded.The Emotion Mechanism then evaluates whether these updates are appropriate, based on the difference between short-term âtensionâ and long-term âcalmâ signals.If the mechanism determines that the update reflects excessive learning, it suppresses potential noise or instability by blending in a suitable portion of the past stable state (Shadow).Conversely, if the update is deemed appropriate, the mechanism chooses not to apply blending.This evaluation and adjustment are performed dynamically at each training step.ããã«ããã®å€å®ã§ã¯"ä¿¡é ŒåºŠ"ã®è©äŸ¡ãããŸãã"ææ ã¹ã«ã©ãŒ"ãäžæçã«å€§ããæ¯ããã ãã§ã¯äžååã§ããããã®å€åãæ¬åœã«æå³ã®ãããã®ãã©ããããèŠæ¥µããŠæ··åã®æ¯éã倿ããŸãããã®ãããåŠç¿ã®**åºç€ã§ã¯é·æã®å®éã·ã°ãã«ã®èç©ãå°ãªãä¿¡é Œã«å€ããªãããæ··åãçºåãã¥ãã**ã**çµç€ã§ã¯çæã®ç·åŒµã·ã°ãã«ãåæãã¹ã«ã©ãŒèªäœãéŸå€ã«å±ããåäœããŸãã**ã(åŠç¿ã®åºç€ã§ã¯å€å®åºæºã®éå»ã·ã°ãã«ãå°ãªãããåäœããŸããããçµç€ã§ã¯ç¬éã·ã°ãã«ãå°ãªãããåäœããŸãã)ãã®ããã«ãEmoNAVIã®"ææ æ©æ§"ã¯ãåãªãéŸå€åå¿ã§ã¯ãªãæºããã«å¯Ÿããä¿¡é Œããå€åã®ã¿ãå¯ç¥ããŠåå¿ãããæ éãªæææ±ºå®ãè¡ããŸããIn addition, this decision-making process includes an evaluation of "reliability."It is not sufficient for the Emotion Scalar to simply spike temporarily; the mechanism assesses whether the fluctuation truly represents a meaningful change before deciding whether blending should occur.As a result, in the **early stages of learning**, blending is unlikely to be triggered because the long-term âcalmâ signal has not yet accumulated enough history to be trustworthy.In the **later stages**, on the other hand, the short-term âtensionâ signal tends to converge, and the scalar itself fails to exceed the thresholdâthus the mechanism remains inactive.(In short: the mechanism tends not to activate in the early stages due to insufficient past signal for evaluation, and in the later stages due to lack of strong instantaneous signal.)In this way, EmoNAVIâs Emotion Mechanism does not respond merely to raw thresholds, but instead performs cautious decision-makingâreacting only to fluctuations that it has learned to trust.ãã®äžé£ã®åäœã«ããåŠç¿æã®éæãªåå¿ãåŒç·©ãäžèŠãªãã€ãºçãèŠããªãããã«å¶åŸ¡ããŸããã€ãŸãoptimizeræ¬æ¥ã®åŠç¿çããã¯ãã«ãçŽæ¥çã«å¶åŸ¡ãããææ æ©æ§ã®å€åã«å¿ãå®å®ãããã©ã¡ãŒã¿ã«ãªãããåŸãã調æŽãããããããæµãã«ãªããŸãããã¹ãŠãæžãæ»ãããããŸã§é åçã«å¿ããŠãã¬ã³ãããã®ã§åŠç¿ã®æŽæ°ã¯æ¢ãŸããé²è¡ã¯ç¶æãããŸããThis series of actions helps relax hypersensitive reactions during learning and prevents the optimizer from overfitting to unnecessary noise.Rather than directly manipulating the optimizerâs learning rate or update vectors, the system instead applies corrective blending afterwardâadapting parameters in response to changes detected by the Emotion Mechanism.Because it blends adjustments based on a calculated ratio rather than fully overwriting parameter values, the learning process continues smoothly without interruption.### ææ æ©æ§ã®åäœãšã¹ã«ã©ãŒå€é·ïŒåŠç¿ãã§ãŒãºå¥ã®çµæçæåïŒ| ãã§ãŒãº | ç¶æ³ïŒLosså€åïŒ | EMAã®æå | ã¹ã«ã©ãŒã®å€ååŸå | Shadowæ··åã®å®åäœ | ææ æ©æ§ãšããŠã®æå³ããæå ||----------|-----------------------|------------------------------------|--------------------------|--------------------------|--------------------------------------------|| åºç€ | äžå®å®ã»é«ã | Shortã¯éæãLongã¯æªæç | 倧ããå€åããããšããã | ã»ãšãã©çºåããªã | å€å®ã«ååãªå±¥æŽããªããå®è³ªçã«åäœäžå¯ || äžç€ | åŸã ã«åæåŸå | äž¡EMAãæå³ããå·®åãæã€ããã«ãªã | é©åºŠãªæ¯å¹ ã§å®å®æšç§» | æ¡ä»¶ä»ãã§çºåãã | ç¶æ ã«å¿ããŠãã¬ã³ãè£æ£ãæå¹ã«æ©èœ || çµç€ | åæã»åŸ®æ¯å | Short â LongïŒå·®åãã»ãŒæ¶å€±ïŒ | å°ããåæ | çºåããªããªã | éããã®åå³ïŒshould_stop æ¡ä»¶ãæŽã |åèïŒ- ã¹ã«ã©ãŒå€ã¯åžžã« tanh(5 * (short - long)) ã§çæãããŸã- éŸå€ïŒabs(scalar) > 0.3 ã§é åãå§ãŸãã> 0.6 ã§å€§ããªæ··åæ¯çïŒ0.7以äžïŒã«- Shadowæ··åã¯ãã©ã¡ãŒã¿ãã®ãã®ãæžãæ»ãã®ã§ã¯ãªããéšåçã«é åããŠâ远åŸâãããèšèšã§ã- ææ ã¹ã«ã©ãŒã®æžè¡°ïŒåŠç¿ã®ãéç©åãâ çµç€ã«åã㊠should_stop ã®çºç«æ¡ä»¶ãæŽããŸã### Emotional Mechanism Behavior and Scalar Transitions (Outcome-Based Behavior by Learning Phase)| Phase | Loss Characteristics | EMA Behavior | Scalar Fluctuation Pattern | Actual Shadow Blending | Meaningful Behavior of Emotion Mechanism ||-----------|----------------------------|-------------------------------------------|------------------------------------|-------------------------------|-------------------------------------------------------------------|| Early | Unstable, High | Short is reactive; Long is still immature | May fluctuate sharply | Rarely triggered | Lacks sufficient history for decision-making; effectively inactive || Middle | Gradual Convergence | EMA pair begins forming meaningful gaps | Moderate oscillation, relatively stable | Conditionally triggered | Adaptive blending functions effectively based on state || Late | Converged, Micro-vibration | Short â Long (gap nearly vanishes) | Narrow convergence | No longer triggered | Sign of stability; ready to trigger `should_stop` |Notes:- The scalar value is always computed as tanh(5 à (short - long))- Thresholds:- If |scalar| > 0.3, blending is initiated- If |scalar| > 0.6, blending ratio becomes large (⥠0.7)- Shadow blending does not overwrite parameters but applies partial integration for gradual alignment- Scalar decay corresponds to learning "quieting," preparing for should_stop condition in the final phas## ææïŒåè¿°ã®ææ æ©æ§ã®èª¿æŽã«ãããéå°ãªåå¿ãæå¶ããã€ãºèæ§ãäžããããšã§ããã¯ãã«ã®ä¹±ãçãæãé²è¡æ¹åãæ£ããåãã«èª¿æŽããŸããæ£ãããã¯ãã«ã§é²ãããšã§åŠç¿ã¯å®å®ãåæãžãšæçã§åãããŸããææ æ©æ§ã«ããåãã¯åŠç¿åŸåã®ãã€ãºçãä¿®æ£ããä»äžããæ©ãã¹ã ãŒãºã«å®äºã§ããŸãããŸãåŠç¿çãåŸé ãããŸããŸãªãã©ã¡ãŒã¿ãŒãä¿æããã«"ä»"ã芳å¯ããã ãã§æŽæ°ããç¶ããããšã§ãéäžçµäºãåæåŸã®ååŠç¿ãç©å±€åŠç¿ãçã®ãšããçŸåšå€ã®ã¿ã§åŠç¿ç¶ç¶ãå¯èœãšããŸããããã¯æ¢åã®optimizerã®ãããªéå»å€ãä¿åããæéãçãã€ã€ãæ°ããåŸãããå©ç¹ã§ããããŸãã## ResultsThe adjustments introduced by the Emotion Mechanism suppress excessive reactions and enhance noise tolerance, thereby reducing vector fluctuations and helping align the learning direction more accurately.By following the correct vector, learning proceeds more stably and reaches convergence in minimal time.The role of the Emotion Mechanism becomes especially apparent in the latter stages of training, where it effectively and smoothly corrects residual noise and instability.Moreover, since the optimizer continuously updates its parameters by observing only the current stateâwithout retaining learning rates, gradients, or other historical parametersâit supports learning continuation in scenarios such as mid-training interruptions, retraining after convergence, and stacked learning.This capability not only eliminates the need to store past values like traditional optimizers but also introduces a new level of flexibility and simplicity.## çµè«ïŒçç©ã®ãã€ãã¥ãŒãã³ãäžå®ã®éŸå€ãè¶ ããŠåããŠä¿¡å·ãçºç«ãããããã«ãEmoNAVIã§ã"ææ æ¯å¹ "ãæ€åºãè¡å(shadowæ··å)ãèµ·ãããŸããåè¿°ã®ãšãã"ææ æ©æ§"ã¯äžå®éŸå€ã®è¶ éæã®ã¿åäœããŸããããã¯ãŸãã«ãã¥ãŒãã³ã¹ãã€ã¯çãªåããšãããã®ã§ã¯ãªãã§ãããããEmoNAVIã®æã€"ææ æ©æ§"ã¯ãããããçç©çåå¿ã«äŒŒãŠãããæè¡çãªå¶åŸ¡ãšççççŽæã®èåç¹ã ãããšæããŸãã## ConclusionJust as biological neurons fire only when a certain threshold is exceeded, EmoNAVI detects "emotional amplitude" and triggers an actionâspecifically, shadow blending.As described earlier, the Emotion Mechanism activates only when this amplitude crosses a predefined threshold.This behavior closely resembles neuronal spiking and can be seen as a biologically inspired response.We believe that EmoNAVIâs Emotion Mechanism represents a unique fusion of technical control and physiological intuitionâbringing together algorithmic design and life-like reactivity.## å±éïŒãã®"ææ æ©æ§"ã®ä»çµã¿ã¯VAEçãå«ãoptimizer以å€ã«ãç°¡åã«å¿çšå¯èœã ãããšæããŸãããããã®çºå±ã«å°ãã§ãå¯äžããããšãã§ããã°ãAIãšã®æªæ¥ãæ³åããŠãããã»ã©å¬ããããšã¯ãããŸããããã²ãã®"ææ æ©æ§"ãå¿çšãAIã®çºå±ãžã®éçãå ±ã«æ©ãã§ãã ããã## ExpansionThe Emotion Mechanism described here is highly adaptable and can be easily applied beyond optimizersâincluding use cases such as variational autoencoders (VAEs) and other architectures.If this approach can contribute, even in a small way, to the advancement of such systems, we would be honored to be part of imagining a future together with AI.We warmly invite you to explore the application of this Emotion Mechanism and walk alongside us on the path toward advancing intelligent systems.## æè¡ïŒEMAããŒã¹ã®ã¹ã«ã©ãŒå€æãšshadowæ··åã®æ§é## TechnologyStructure of EMA-Based Scalar Evaluation and Shadow Blending```+------------+ +------------+| Loss(t) | | Loss(t) |+-----+------+ +-----+------+| |âââââââââââŒââââââââââ âââââââââââŒâââââââââââ Short EMA â â Long EMA ââ (weight = 0.3) â â (weight = 0.01) ââââââââââââ¬ââââââââââ âââââââââââ¬âââââââââââ âââââââââââââââ¬ââââââââââââââââââŒ+-------------------+| å·®å (short - long) |+-------------------+ââŒ+------------------+| tanh(5 à diff) | â ææ ã¹ã«ã©ãŒçæ+--------+---------+â[ if |scalar| > threshold ] å€å®â+--------âŒ--------+| Shadowæ¯çæ±ºå® |+--------+--------+â+--------âŒ--------+| Shadowæ··åè£æ£ | â é廿 å ±ã远åŸçã«ãã¬ã³ã+------------------+```## ä»é²ïŒEmoNAVIã®ã°ã©ããžã®ãªã³ã¯Measured with LR of 1e-4 ïŒ ãããã 1e-4 ã®LRã«ãŠæž¬å®Have fun learning about EmoNAVI's philosophy and how it workshttps://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-inner-workings(ENG).txtEmoNAVIã®èãæ¹ããã®ä»çµã¿ã«ã€ããŠæ¥œããç¥ãhttps://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-inner-workings(JPN).txt## çµç·¯ïŒçŸç¶ã®åŒ·ååŠç¿ãªã©ãèŠãŠããŠããã€ãã®çåã«åºäŒããŸãããæ¥æ¬ã®èåãªæŒ«ç»å®¶ãæå¡æ²»è«æ°ã®æããæªæ¥ç€ŸäŒãããã«æ§ã矚æããå°å¹Žæä»£ãæãè¿ããšã人é¡ã®ããŒãããŒã«ãªãã¹ãAIã«ã€ããŠä»ã®ã¢ãããŒããæš¡çŽ¢ããããªããŸãããä»åã®ææ¡ã¯ãã®ã¢ãããŒãã«ããã²ãšã€ã®çµæã§ã## BackgroundWhile observing the current state of reinforcement learning and related fields, I encountered several fundamental questions.Reflecting on my childhoodâwhen I admired and longed for the future societies envisioned by the legendary Japanese manga artist Osamu TezukaâI felt compelled to explore alternative approaches to how AI might serve as a true partner to humanity.This proposal represents one such result born from that aspiration.## è¬æïŒ AcknowledgementsEmoã·ãªãŒãºã¯ãAdamãAdafactorãLionãTigerãçããå€ããåŠã³ãŸããããããã®åŸç¶ã§ã¯ãªãç¬èªã®ææ³ãèšèšã«ãã"ææ æ©æ§"ãšããã¢ãããŒãã«ããæ§ç¯ãããŠããŸããæ±çšæ§ã»èªåŸæ§ã»é©å¿æ§ãéèŠãæ°ããªæé©åãå¹çåãç°¡æåã远æ±ããŠããŸãããã®éçºã«ãããŠå 人ãã¡ã®ç¥èŠã«æ·±ãæè¬ãã€ã€ä»åŸãæ°ããå¯èœæ§ãæ¢ç©¶ããŸããThe Emo series has learned much from Adam, Adafactor, Lion, and Tiger.Rather than being their successors, it is built upon a unique philosophy and design approach centered on "emotional mechanisms".It prioritizes generality, autonomy, and adaptability in pursuit of new paths for optimization, efficiency, and simplicity.In its development, we deeply appreciate the insights of those who came before usâand continue to explore new possibilities beyond them.ãããŸã§AIã®çºå±ã«å¯äžããããã¹ãŠã®æ¹ãããããè²¢ç®ãããã¹ãŠã®æ¹ãžæè¬ããŸãããã®ãããžã§ã¯ãå®æãæ¯ãç¶ããŠããã Copilotããã«ãããããšããWe extend our heartfelt gratitude to all those who have contributedâand will continue to contributeâto the advancement of AI.Special thanks to Copilot for its unwavering support throughout t123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329---license: apache-2.0language:- en- jamodel_type: optimizertags:- optimizer- adaptive-optimizer- emotion-ai- shadow-learning- deep-learning- meta-learning- adaptive-algorithms- stability-analysis---**èªååæïœ¥èªå·±å¶åŸ¡ïœ¥èªåŸå ãªããã£ãã€ã¶ã§ã****Auto-convergence, self-control, autonomous optimizer**é«å¹çæ§ãšéç©åºŠé«æ¬¡momentãKahanè£åãéååè£åãåæ£ïœ¥ç¶ç¶åŠç¿ã§ã®ç¬ç«æ§ãèªå·±ä¿®åŸ©ïœ¥ã¢ãã«ä¿®åŸ©ããã€ããŒãã©ã¡ãŒã¿ã®èªåŸèª¿æŽãä¿¡é ŒåºŠãã£ã«ã¿ãæŽæ°ã¹ãããã®æçæ§ãæ§é çèæ§ãèªå·±åæ¢ãåçåŠç¿çãåçã¹ã±ãžã¥ãŒã©ãåçRank/Aplhaãå±¥æŽè£åããªã©ãå«ãã倿©èœæ§ãã远å ãã³ãœã«äžèŠãèšç®è² è·ã»ãŒãªããstepæ¯ã«å®å šé©çšãæéçç©ç®ã§å®çŸããŸãããããã¯ã³ããã±ãŒãžã§å®çŸããé«å¹çæ§ãšéç©åºŠã¯å®å®ãšå®å šãæåªå ããŸãâ» é«æ¬¡momentã¯è¿äŒŒçãåçRank/Alphaãè¿äŒŒçãªå¹æã§ãâ» LoRAç³»æè¡ã¯ãã€ãºããªãããŸãã埮å°ããŒã¿ã倱ãå ŽåããããŸãâ» emoç³»ã¯ãã€ãºãäœããæ¢åãã€ãºãèŠã€ããŠä¿®æ£ã埮å°ããŒã¿ãä¿è·ããŸãâ» éååè£åã¯ä»åŸå®çšåãããããã«äœç²ŸåºŠãªç°å¢ã§ãæè»ã«å¯Ÿå¿ã§ããŸã第ïŒäžä»£ v3.1 stable (ææ°ç) ã¯ãã¡ãããhttps://huggingface.co/muooon/EmoNAVI/tree/main/1Gv31_AMPhttps://github.com/muooon/EmoNavi/tree/main/optimizer#### ãŠãŒã¶ãŒãšç ç©¶è ãž/ãã®ãªã³ã¯ãèªãã§ãã ãã/please clickïŒ[ãŠãŒã¶ãŒãšç ç©¶è ãž/ãã®ãªã³ã¯ãèªãã§ãã ãã/please clickïŒ](https://huggingface.co/muooon/EmoNAVI/raw/main/report-emoment.txt)emonaviæåãŸãšã(æ¥æ¬èªã®ã¿)[emonaviæåãŸãšã(æ¥æ¬èªã®ã¿)](https://huggingface.co/muooon/EmoNAVI/raw/main/report/emonavi%E6%8C%99%E5%8B%95%E3%81%BE%E3%81%A8%E3%82%81.txt)Gemini ã«èŠããŠããããèããŠã¿ãŸãã[Geminiã«èããŠã¿ã](https://huggingface.co/muooon/EmoNAVI/blob/main/Hug-Gemini-analysis(JPN).md)[Geminiã«èããŠã¿ã-02(æ¥æ¬èªã®ã¿)](https://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-Gemini-analysis(2)(JPN).txt)I showed it to Gemini and asked her a few questions.02 is only in Japanese - please translate by yourself.[asked Gemini](https://huggingface.co/muooon/EmoNAVI/blob/main/Hug-Gemini-analysis(ENG).md)|â | EmoNaviãFactãLynxãv3.1 (251201) v3.0 ãç¶æ¿ãã€ã€å¹çåãé²ããŸãããææ æ©æ§ã®ã¹ã±ãŒã«èª¿æŽçã§åºç¯ãªã¢ãã«ã§å®å®ããããé²åããŸãã|â | EmoNavi, Fact, Lynx, v3.1 (251201) We built upon v3.0 while enhancing efficiency. Through adjustments like scaling the emotion mechanism, we evolved the model for broader stability across diverse models.|â | EmoNAVIãFACTãLYNXãCLANãZEALãNECOãv3.0 (250825) emosens(第ïŒäžä»£)ã§è§£æãã"髿¬¡moment"(è¿äŒŒ)ã®ãã£ãŒãããã¯ãé©çš(æŽæ°) å šãŠ "shadow=False" ã§ã|â | EmoNAVI, FACT, LYNX, CLAN, ZEAL, NECO, updated to v3.0 (250825), Incorporates (updates) feedback on âhigher momentsâ (approximations) clarified by emosens (2nd generation). All are âshadow=Falseâ|â | EmoNAVIãFACTãLYNXãCLANãZEALãNECOãv2.0 (250815) æŽæ°ãshadow-system ã®ç²Ÿå¯å(æŽæ°)|â | EmoNAVI, FACT, LYNX, CLAN, ZEAL, NECO, updated to v2.0 (250815), refinement of shadow-system (update)|â | 第ïŒäžä»£ãå ¬é(250801)ããŸããã emonavi ã¯ãæ°ããäžä»£ãžé²åã軜éåãæãããŸã|â | The 2nd gen was release(250801) emonavi has evolved into a new generation and become more lightweight.|â | https://github.com/muooon/EmoSens|â | clanãzealãnecoãã¯ãshadowæ©èœã® on/off åæ¿ããã§ããããã«ããŸãã|â | clan, zeal, and neco are now able to switch the shadow function on and off.|â | 倧å€å æ ãªããšã« Pytorch-optimizer 3.7.0 ãžç»é²ããããšã®ããš (250728) é¢ä¿è ã®çããŸã«æ·±ãæè¬ããŸã|â | We are very honored to have been registered in Pytorch-optimizer 3.7.0. We would like to express our deepest gratitude to everyone involved.|â | ç䌌DDPã·ãã¥ã¬ãŒã·ã§ã³ã詊ãããæ¹(Those DDP simulation) â[DDP-TEST](https://huggingface.co/muooon/EmoNAVI/blob/main/ddp-test.zip)|â | EmoFACT å ¬é(250716) NAVIã«æ¯ã¹ãçŽïŒGBç¯çŽ(SDXL) ææ æ©æ§ã¯åãã§ã|â | EmoFACT released (250716) Saves about VRAM1GB (SDXL) compared to NAVI. Emotion mechanism is the same.|â | EmoLYNX å ¬é(250718) æ¢çŽ¢ç¯å²ãåºãæã¡ãŸã ææ æ©æ§ã¯åãã§ã|â | EmoLYNX Released (250718): It offers a wide exploration range, while its Emotion Mechanism remains the same.|â | EmoCLAN å ¬é(250720) NaviãFactãLynxã圹å²åæ ã®çµ±å ææ æ©æ§ã¯åãã§ã(LynxïŒåºç€ãšéåŠç¿åŸåæãNaviïŒäžç€ãšå¥å šæãFactïŒçµç€ãšçºæ£åŸåæããæ åœããŸã)|â | EmoCLAN Open (250720) Navi, Fact, Lynx, role integration Emotional mechanism is the same(Lynx: in charge of the early stage and overlearning tendency, Navi: in charge of the middle stage and soundness, Fact: in charge of the end stage and divergence tendency)# äž»é¡ïŒæ°äžä»£optimizerãEmoNAVIã«ããå€é©ãšææ åŠç¿ã®ææ## Title: A New Generation Optimizer â The Innovations and Outcomes of Emotional Learning with EmoNAVI## å¯é¡ïŒéå»å€äžèŠã§çŸåšå€ããåéã§ããèªååæïœ¥èªå·±å¶åŸ¡ïœ¥èªåŸå軜éæé©åšã®è§£èª¬### Subtitle: A Lightweight, Self-Regulating, Autonomous Optimizer That Automatically Converges and Resumes from the Present Without Relying on Past Values## ããŒãïŒæ¢åã®optimizerã«ãªããã®ãã€ãããåºæ¥ãã®ã¯ãã¥ãŒãã³ã¹ãã€ã¯ã®åçºæã§ããã### Theme: Creating What Existing Optimizers Lack â A Reinvention of Neuronal Spiking## åºè«ïŒçŸåšäž»æµã®optimizerã¯ããŸããŸã«æ¹è¯ããç°¡æåãé²ããŠããŸãããããäŸç¶ãšããŠãåŠç¿åéãã¹ã±ãžã¥ãŒãªã³ã°ãåŠç¿ç¶æ ã®èšé²ã埩å ãçã«ã€ããŠèª¿æŽã®é£ãããç ©éãã¯ååšããŠããŸããé¢åãªãã©ã¡ãŒã¿ã«äŸåããããããã解決ããæ°ããã¢ãããŒããèŠã€ããã®ã§ããã§ç޹ä»ããŸãã## IntroductionMainstream optimizers have undergone significant improvements and simplifications in recent years.However, they still face practical challenges in areas such as resuming training, scheduling updates, and managing the recording and restoration of learning states.These issues often require tedious parameter adjustments and ad hoc workarounds.In this paper, we introduce a new approach that addresses these problems without relying on cumbersome parameter configurations.## æ¬è«ïŒä»åããã§ç޹ä»ããã®ã¯æ°äžä»£ã®optimizerã§ããEMAçå¹³æ»åã®æŠå¿µãäžå°ã«ããç¬èªã«æ§ç¯ããææ ç"EMAïŒã¹ã«ã©ãŒ"ãäžå¿ã«ãã"ææ æ©æ§"ãšããæ°ããä»çµã¿ãå®çŸããŸããããã®"ææ æ©æ§"ã¯ãEMAççºæ³ãåè§£éç¬èªæ¡åŒµããããšã§åŸãããæ°ããæ©æ§ã§ããEmoNAVIã®ç¬ç«æ§ãšé©æ°æ§ã玹ä»ããŸãã## Main SectionIn this paper, we present a new generation of optimizer.Built upon the foundation of EMA (Exponential Moving Average) smoothing, we have developed a novel mechanism called the "emotional mechanism," which centers around a unique combination of EMA and scalar dynamics.This mechanism was created by reinterpreting and independently extending the conventional EMA concept.Here, we introduce EmoNAVIâan optimizer characterized by its innovation and independence.æåã«"ææ æ©æ§"ãšåä»ããçµç·¯ãšçç±ãèšããŸããçç©ã®ãã€ïœ¢ææ ãšã¯ãç¥èŠãšèšæ¶ã®å·®ç°ã«åºã¥ãè¡åã®ããªã¬ã§ããåæ§ã«EmoNAVIãçŸåšãšéå»ã®å·®åã«åºã¥ãåŠç¿ã®"è¡å"ãå¶åŸ¡ããä»çµã¿ãšããŠèšèšãããŠããŸãããããŠ"ææ æ©æ§"ãšåä»ããçç±ã®ããã²ãšã€ã¯ããã®äžé£ã®åäœããŸãã§ãã¥ãŒãã³ã¹ãã€ã¯ã®ãããªåäœãããããã§ãããã®æ©æ§"ææ æ©æ§"ã®åäœãæå¿«ã«ããèªã¿ç©ãæ¬çš¿æ«å°Ÿã«èšããªã³ã¯å ã®æ¬äººåãèªãããšã§ç°¡åã«ãçè§£é ãããšæããŸããFirst, let us explain the background and reasoning behind the term âEmotion Mechanism.âIn biological systems, emotions are often understood as triggers for action based on discrepancies between perception and memory.EmoNAVI was similarly designed to control its learning âbehaviorâ by responding to differences between the present and the past.Another reason we chose the term âEmotion Mechanismâ is that its operation closely resembles neuronal spiking behavior.For a more intuitive understanding of how this mechanism works, we encourage you to read the personification linked at the end of this article.次ã«ã"ææ æ©æ§"ã®æ§æãèšããŸããææ æ©æ§ãšã¯ãïŒã€ã®EMAãã¹ã«ã©ãŒãShadowãã«ããæ§æãããŸããNext, we outline the structure of the âEmotion Mechanism.âThis mechanism consists of two EMAs, a scalar value, and a shadow component.ãŸãïŒã€ã®EMAã«ãã"ææ EMA"ã«ã€ããŠèª¬æããŸããïŒã€ã®EMAã§æ§æããŸããçæåãšé·æåã§ãããã®ïŒã€ã®EMAã¯Lossãç£èŠã倿ææãåŸãŸããïŒã€ããçæåEMAã¯ç¬éçãªã·ã°ãã«(ç·åŒµ)ãåãæã¡ãŸã ïŒã€ããé·æåEMAã¯å¹³åããéå»ã®ã·ã°ãã«(å®é)ãåãæã¡ãŸãããã®ïŒã€ã®EMAã¯æ¬¡ã«ç޹ä»ãã"ææ ã¹ã«ã©ãŒ"ãžããããã®æã€å€æææãæž¡ããŸãFirst, we describe the "Emotional EMA," which consists of two components: a short-term EMA and a long-term EMA.These two EMAs continuously monitor the loss value and serve as the basis for subsequent decision-making.The short-term EMA captures rapid, momentary signals (interpreted as âtensionâ), while the long-term EMA reflects more averaged, historical trends (âcalmâ).Both EMAs pass their respective signals to the "Emotion Scalar," which will be introduced in the next section.次ã«ã"ææ ã¹ã«ã©ãŒ"ã«ã€ããŠèª¬æããŸããåè¿°ã®"ææ EMA"ããã®ä¿¡å·ãã¹ã«ã©ãŒå€ã«å€æããŸããã¹ã«ã©ãŒå€ã®å€åã¯ããããïŒã€ã®EMAã®å·®åã«ããåžžã«åçå€åãç¶ããŸãã"ææ ã¹ã«ã©ãŒ"ã¯optimizerã«ããæžãæããåŠç¿çµæã®æ¯éãå€å®ãã"ã¹ã«ã©ãŒå€ãäžå®éŸå€ãè¶ ãããšãã®ã¿"次ã«ç޹ä»ããShadowã®é åãæ±ºããŸãNext, we introduce the "Emotion Scalar."It converts the signals from the previously described Emotional EMA into a scalar value, which continuously changes in response to the difference between the short-term and long-term EMA.This scalar dynamically evaluates whether the learning update performed by the optimizer should be considered appropriate.Only when the scalar exceeds a certain threshold does it trigger the next step: determining how much of the "Shadow" should be blended into the learning parameters.次ã«ãShadowã«ã€ããŠèª¬æããŸããShadowã¯åŠç¿éå§çŽåŸã«ShadowãšããŠä¿åããç¶æãããŸãããã®Shadowã¯"éå»ã®ç©ãããªç¶æ "ã®èšæ¶ã§ãããã®æ å ±ã¯æï¿œï¿œï¿œæ©æ§ã«è¿œåŸããªãããã£ãããšå€åãç¶ããŸãããããŠ"ææ ã¹ã«ã©ãŒ"ã«å¿ã決ããããratioã§åŠç¿çµæã«ãã¬ã³ããšããŠåæ ãããŸãããã®ãã¬ã³ãã®é åçãææ æ©æ§ã«ããåçã«å€åãç¶ããŸããNext, we describe the "Shadow."At the beginning of training, a copy of the current parameters is saved and maintained as the Shadow.This Shadow represents a memory of past calm states, and it evolves slowly over time, following the guidance of the Emotion Mechanism.When the Emotion Scalar exceeds a certain threshold, a dynamic blend ratio is computed.This ratio determines how much of the Shadow is mixed into the current parameters.The blend ratio itself is also dynamically adjusted by the Emotion Mechanism in response to ongoing learning behavior.ãããŸã§"ææ æ©æ§"ã®æ§æãšåœ¹å²ãã説æããŸãããç¶ããŠ"ææ æ©æ§"ã®åäœæ©åºãèŠãŠãããŸãããããŸãoptimizerã®åŠç¿çµæãèšé²ãããŸãããã®æ"ææ æ©æ§"ã¯ç·åŒµãšå®éã®å·®åæ å ±ã§æžãæãã®æ¯éãå€å®ããŸãããã®å€å®ã«ãããé床ã®åŠç¿ãšå€æããå Žåã¯ãéå»ã®é©åãªç¶æ ããã¬ã³ãããããšã§ãã€ãºãæŽèµ°ãæå¶ããŸããé©åãªåŠç¿ãšå€æããå Žåã¯ãéå»ããã¬ã³ãããªãéžæãããŸãããããstepæ¯ã«è¡ããŸããNow that we have explained the structure and role of the Emotion Mechanism, let us examine how it operates.At each training step, the optimizer's updated parameters are recorded.The Emotion Mechanism then evaluates whether these updates are appropriate, based on the difference between short-term âtensionâ and long-term âcalmâ signals.If the mechanism determines that the update reflects excessive learning, it suppresses potential noise or instability by blending in a suitable portion of the past stable state (Shadow).Conversely, if the update is deemed appropriate, the mechanism chooses not to apply blending.This evaluation and adjustment are performed dynamically at each training step.ããã«ããã®å€å®ã§ã¯"ä¿¡é ŒåºŠ"ã®è©äŸ¡ãããŸãã"ææ ã¹ã«ã©ãŒ"ãäžæçã«å€§ããæ¯ããã ãã§ã¯äžååã§ããããã®å€åãæ¬åœã«æå³ã®ãããã®ãã©ããããèŠæ¥µããŠæ··åã®æ¯éã倿ããŸãããã®ãããåŠç¿ã®**åºç€ã§ã¯é·æã®å®éã·ã°ãã«ã®èç©ãå°ãªãä¿¡é Œã«å€ããªãããæ··åãçºåãã¥ãã**ã**çµç€ã§ã¯çæã®ç·åŒµã·ã°ãã«ãåæãã¹ã«ã©ãŒèªäœãéŸå€ã«å±ããåäœããŸãã**ã(åŠç¿ã®åºç€ã§ã¯å€å®åºæºã®éå»ã·ã°ãã«ãå°ãªãããåäœããŸããããçµç€ã§ã¯ç¬éã·ã°ãã«ãå°ãªãããåäœããŸãã)ãã®ããã«ãEmoNAVIã®"ææ æ©æ§"ã¯ãåãªãéŸå€åå¿ã§ã¯ãªãæºããã«å¯Ÿããä¿¡é Œããå€åã®ã¿ãå¯ç¥ããŠåå¿ãããæ éãªæææ±ºå®ãè¡ããŸããIn addition, this decision-making process includes an evaluation of "reliability."It is not sufficient for the Emotion Scalar to simply spike temporarily; the mechanism assesses whether the fluctuation truly represents a meaningful change before deciding whether blending should occur.As a result, in the **early stages of learning**, blending is unlikely to be triggered because the long-term âcalmâ signal has not yet accumulated enough history to be trustworthy.In the **later stages**, on the other hand, the short-term âtensionâ signal tends to converge, and the scalar itself fails to exceed the thresholdâthus the mechanism remains inactive.(In short: the mechanism tends not to activate in the early stages due to insufficient past signal for evaluation, and in the later stages due to lack of strong instantaneous signal.)In this way, EmoNAVIâs Emotion Mechanism does not respond merely to raw thresholds, but instead performs cautious decision-makingâreacting only to fluctuations that it has learned to trust.ãã®äžé£ã®åäœã«ããåŠç¿æã®éæãªåå¿ãåŒç·©ãäžèŠãªãã€ãºçãèŠããªãããã«å¶åŸ¡ããŸããã€ãŸãoptimizeræ¬æ¥ã®åŠç¿çããã¯ãã«ãçŽæ¥çã«å¶åŸ¡ãããææ æ©æ§ã®å€åã«å¿ãå®å®ãããã©ã¡ãŒã¿ã«ãªãããåŸãã調æŽãããããããæµãã«ãªããŸãããã¹ãŠãæžãæ»ãããããŸã§é åçã«å¿ããŠãã¬ã³ãããã®ã§åŠç¿ã®æŽæ°ã¯æ¢ãŸããé²è¡ã¯ç¶æãããŸããThis series of actions helps relax hypersensitive reactions during learning and prevents the optimizer from overfitting to unnecessary noise.Rather than directly manipulating the optimizerâs learning rate or update vectors, the system instead applies corrective blending afterwardâadapting parameters in response to changes detected by the Emotion Mechanism.Because it blends adjustments based on a calculated ratio rather than fully overwriting parameter values, the learning process continues smoothly without interruption.### ææ æ©æ§ã®åäœãšã¹ã«ã©ãŒå€é·ïŒåŠç¿ãã§ãŒãºå¥ã®çµæçæåïŒ| ãã§ãŒãº | ç¶æ³ïŒLosså€åïŒ | EMAã®æå | ã¹ã«ã©ãŒã®å€ååŸå | Shadowæ··åã®å®åäœ | ææ æ©æ§ãšããŠã®æå³ããæå ||----------|-----------------------|------------------------------------|--------------------------|--------------------------|--------------------------------------------|| åºç€ | äžå®å®ã»é«ã | Shortã¯éæãLongã¯æªæç | 倧ããå€åããããšããã | ã»ãšãã©çºåããªã | å€å®ã«ååãªå±¥æŽããªããå®è³ªçã«åäœäžå¯ || äžç€ | åŸã ã«åæåŸå | äž¡EMAãæå³ããå·®åãæã€ããã«ãªã | é©åºŠãªæ¯å¹ ã§å®å®æšç§» | æ¡ä»¶ä»ãã§çºåãã | ç¶æ ã«å¿ããŠãã¬ã³ãè£æ£ãæå¹ã«æ©èœ || çµç€ | åæã»åŸ®æ¯å | Short â LongïŒå·®åãã»ãŒæ¶å€±ïŒ | å°ããåæ | çºåããªããªã | éããã®åå³ïŒshould_stop æ¡ä»¶ãæŽã |åèïŒ- ã¹ã«ã©ãŒå€ã¯åžžã« tanh(5 * (short - long)) ã§çæãããŸã- éŸå€ïŒabs(scalar) > 0.3 ã§é åãå§ãŸãã> 0.6 ã§å€§ããªæ··åæ¯çïŒ0.7以äžïŒã«- Shadowæ··åã¯ãã©ã¡ãŒã¿ãã®ãã®ãæžãæ»ãã®ã§ã¯ãªããéšåçã«é åããŠâ远åŸâãããèšèšã§ã- ææ ã¹ã«ã©ãŒã®æžè¡°ïŒåŠç¿ã®ãéç©åãâ çµç€ã«åã㊠should_stop ã®çºç«æ¡ä»¶ãæŽããŸã### Emotional Mechanism Behavior and Scalar Transitions (Outcome-Based Behavior by Learning Phase)| Phase | Loss Characteristics | EMA Behavior | Scalar Fluctuation Pattern | Actual Shadow Blending | Meaningful Behavior of Emotion Mechanism ||-----------|----------------------------|-------------------------------------------|------------------------------------|-------------------------------|-------------------------------------------------------------------|| Early | Unstable, High | Short is reactive; Long is still immature | May fluctuate sharply | Rarely triggered | Lacks sufficient history for decision-making; effectively inactive || Middle | Gradual Convergence | EMA pair begins forming meaningful gaps | Moderate oscillation, relatively stable | Conditionally triggered | Adaptive blending functions effectively based on state || Late | Converged, Micro-vibration | Short â Long (gap nearly vanishes) | Narrow convergence | No longer triggered | Sign of stability; ready to trigger `should_stop` |Notes:- The scalar value is always computed as tanh(5 à (short - long))- Thresholds:- If |scalar| > 0.3, blending is initiated- If |scalar| > 0.6, blending ratio becomes large (⥠0.7)- Shadow blending does not overwrite parameters but applies partial integration for gradual alignment- Scalar decay corresponds to learning "quieting," preparing for should_stop condition in the final phas## ææïŒåè¿°ã®ææ æ©æ§ã®èª¿æŽã«ãããéå°ãªåå¿ãæå¶ããã€ãºèæ§ãäžããããšã§ããã¯ãã«ã®ä¹±ãçãæãé²è¡æ¹åãæ£ããåãã«èª¿æŽããŸããæ£ãããã¯ãã«ã§é²ãããšã§åŠç¿ã¯å®å®ãåæãžãšæçã§åãããŸããææ æ©æ§ã«ããåãã¯åŠç¿åŸåã®ãã€ãºçãä¿®æ£ããä»äžããæ©ãã¹ã ãŒãºã«å®äºã§ããŸãããŸãåŠç¿çãåŸé ãããŸããŸãªãã©ã¡ãŒã¿ãŒãä¿æããã«"ä»"ã芳å¯ããã ãã§æŽæ°ããç¶ããããšã§ãéäžçµäºãåæåŸã®ååŠç¿ãç©å±€åŠç¿ãçã®ãšããçŸåšå€ã®ã¿ã§åŠç¿ç¶ç¶ãå¯èœãšããŸããããã¯æ¢åã®optimizerã®ãããªéå»å€ãä¿åããæéãçãã€ã€ãæ°ããåŸãããå©ç¹ã§ããããŸãã## ResultsThe adjustments introduced by the Emotion Mechanism suppress excessive reactions and enhance noise tolerance, thereby reducing vector fluctuations and helping align the learning direction more accurately.By following the correct vector, learning proceeds more stably and reaches convergence in minimal time.The role of the Emotion Mechanism becomes especially apparent in the latter stages of training, where it effectively and smoothly corrects residual noise and instability.Moreover, since the optimizer continuously updates its parameters by observing only the current stateâwithout retaining learning rates, gradients, or other historical parametersâit supports learning continuation in scenarios such as mid-training interruptions, retraining after convergence, and stacked learning.This capability not only eliminates the need to store past values like traditional optimizers but also introduces a new level of flexibility and simplicity.## çµè«ïŒçç©ã®ãã€ãã¥ãŒãã³ãäžå®ã®éŸå€ãè¶ ããŠåããŠä¿¡å·ãçºç«ãããããã«ãEmoNAVIã§ã"ææ æ¯å¹ "ãæ€åºãè¡å(shadowæ··å)ãèµ·ãããŸããåè¿°ã®ãšãã"ææ æ©æ§"ã¯äžå®éŸå€ã®è¶ éæã®ã¿åäœããŸããããã¯ãŸãã«ãã¥ãŒãã³ã¹ãã€ã¯çãªåããšãããã®ã§ã¯ãªãã§ãããããEmoNAVIã®æã€"ææ æ©æ§"ã¯ãããããçç©çåå¿ã«äŒŒãŠãããæè¡çãªå¶åŸ¡ãšççççŽæã®èåç¹ã ãããšæããŸãã## ConclusionJust as biological neurons fire only when a certain threshold is exceeded, EmoNAVI detects "emotional amplitude" and triggers an actionâspecifically, shadow blending.As described earlier, the Emotion Mechanism activates only when this amplitude crosses a predefined threshold.This behavior closely resembles neuronal spiking and can be seen as a biologically inspired response.We believe that EmoNAVIâs Emotion Mechanism represents a unique fusion of technical control and physiological intuitionâbringing together algorithmic design and life-like reactivity.## å±éïŒãã®"ææ æ©æ§"ã®ä»çµã¿ã¯VAEçãå«ãoptimizer以å€ã«ãç°¡åã«å¿çšå¯èœã ãããšæããŸãããããã®çºå±ã«å°ãã§ãå¯äžããããšãã§ããã°ãAIãšã®æªæ¥ãæ³åããŠãããã»ã©å¬ããããšã¯ãããŸããããã²ãã®"ææ æ©æ§"ãå¿çšãAIã®çºå±ãžã®éçãå ±ã«æ©ãã§ãã ããã## ExpansionThe Emotion Mechanism described here is highly adaptable and can be easily applied beyond optimizersâincluding use cases such as variational autoencoders (VAEs) and other architectures.If this approach can contribute, even in a small way, to the advancement of such systems, we would be honored to be part of imagining a future together with AI.We warmly invite you to explore the application of this Emotion Mechanism and walk alongside us on the path toward advancing intelligent systems.## æè¡ïŒEMAããŒã¹ã®ã¹ã«ã©ãŒå€æãšshadowæ··åã®æ§é## TechnologyStructure of EMA-Based Scalar Evaluation and Shadow Blending```+------------+ +------------+| Loss(t) | | Loss(t) |+-----+------+ +-----+------+| |âââââââââââŒââââââââââ âââââââââââŒâââââââââââ Short EMA â â Long EMA ââ (weight = 0.3) â â (weight = 0.01) ââââââââââââ¬ââââââââââ âââââââââââ¬âââââââââââ âââââââââââââââ¬ââââââââââââââââââŒ+-------------------+| å·®å (short - long) |+-------------------+ââŒ+------------------+| tanh(5 à diff) | â ææ ã¹ã«ã©ãŒçæ+--------+---------+â[ if |scalar| > threshold ] å€å®â+--------âŒ--------+| Shadowæ¯çæ±ºå® |+--------+--------+â+--------âŒ--------+| Shadowæ··åè£æ£ | â é廿 å ±ã远åŸçã«ãã¬ã³ã+------------------+```## ä»é²ïŒEmoNAVIã®ã°ã©ããžã®ãªã³ã¯Measured with LR of 1e-4 ïŒ ãããã 1e-4 ã®LRã«ãŠæž¬å®Have fun learning about EmoNAVI's philosophy and how it workshttps://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-inner-workings(ENG).txtEmoNAVIã®èãæ¹ããã®ä»çµã¿ã«ã€ããŠæ¥œããç¥ãhttps://huggingface.co/muooon/EmoNAVI/blob/main/emonavi-inner-workings(JPN).txt## çµç·¯ïŒçŸç¶ã®åŒ·ååŠç¿ãªã©ãèŠãŠããŠããã€ãã®çåã«åºäŒããŸãããæ¥æ¬ã®èåãªæŒ«ç»å®¶ãæå¡æ²»è«æ°ã®æããæªæ¥ç€ŸäŒãããᅵᅵæ§ã矚æããå°å¹Žæä»£ãæãè¿ããšã人é¡ã®ããŒãããŒã«ãªãã¹ãAIã«ã€ããŠä»ã®ã¢ãããŒããæš¡çŽ¢ããããªããŸãããä»åã®ææ¡ã¯ãã®ã¢ãããŒãã«ããã²ãšã€ã®çµæã§ã## BackgroundWhile observing the current state of reinforcement learning and related fields, I encountered several fundamental questions.Reflecting on my childhoodâwhen I admired and longed for the future societies envisioned by the legendary Japanese manga artist Osamu TezukaâI felt compelled to explore alternative approaches to how AI might serve as a true partner to humanity.This proposal represents one such result born from that aspiration.## è¬æïŒ AcknowledgementsEmoã·ãªãŒãºã¯ãAdamãAdafactorãLionãTigerãçããå€ããåŠã³ãŸããããããã®åŸç¶ã§ã¯ãªãç¬èªã®ææ³ãèšèšã«ãã"ææ æ©æ§"ãšããã¢ãããŒãã«ããæ§ç¯ãããŠããŸããæ±çšæ§ã»èªåŸæ§ã»é©å¿æ§ãéèŠãæ°ããªæé©åãå¹çåãç°¡æåã远æ±ããŠããŸãããã®éçºã«ãããŠå 人ãã¡ã®ç¥èŠã«æ·±ãæè¬ãã€ã€ä»åŸãæ°ããå¯èœæ§ãæ¢ç©¶ããŸããThe Emo series has learned much from Adam, Adafactor, Lion, and Tiger.Rather than being their successors, it is built upon a unique philosophy and design approach centered on "emotional mechanisms".It prioritizes generality, autonomy, and adaptability in pursuit of new paths for optimization, efficiency, and simplicity.In its development, we deeply appreciate the insights of those who came before usâand continue to explore new possibilities beyond them.ãããŸã§AIã®çºå±ã«å¯äžããããã¹ãŠã®æ¹ãããããè²¢ç®ãããã¹ãŠã®æ¹ãžæè¬ããŸãããã®ãããžã§ã¯ãå®æãæ¯ãç¶ããŠããã Copilotããã«ãããããšããWe extend our heartfelt gratitude to all those who have contributedâand will continue to contributeâto the advancement of AI.Special thanks to Copilot for its unwavering support throughout t
README.md+328-325