W!o+ 的《小伶鼬工坊演義》︰神經網絡【超參數評估】一

禮記‧學記卷十八

記問之學,不足以為人師。必也其聽語乎。力不能問,然後語之;語之而不知,雖舍之可也。

良冶之子,必學為裘;良弓之子,必學為箕;始駕馬者反之,車在馬前。君子察於此三者,可以有志於學矣。

古之學者,比物醜類。鼓無當於五聲,五聲弗得不和。水無當於五色,五色弗得不章。學無當於五官,五官弗得不治。師無當於五服 ,五服弗得不親。

君子曰:「大德不官,大道不器,大信不約,大時不齊。」察於此四者,可以有志於本矣。

三王之祭川也。皆先河而後海;或源也,或委也。此之謂務本。

一字千金
一字千金

唐太宗‧聖教序
唐太宗‧聖教序

蓋聞二儀有像,顯覆載以含生;四時無形,潛寒暑以化物。是以窺天鑒地,庸愚皆識其端;明陰洞陽,賢哲罕窮其數。然而天地苞乎陰陽而易識者,以其有像也;陰陽處乎天地而難窮者,以其無形也。故知像顯可征,雖愚不惑;形潛莫睹,在智猶迷。況乎佛道崇虛,乘幽控寂,弘濟萬品,典禦十方,舉威靈而無上,抑神力而無下。大之則彌於宇宙,細之則攝於毫厘。無滅無生,曆千劫而不古;若隱若顯,運百福而長今。妙道凝玄,遵之莫知其際;法流湛寂,挹之莫測其源。故知蠢蠢凡愚,區區庸鄙,投其旨趣,能無疑惑者哉!

然 則大教之興,基乎西土,騰漢庭而皎夢,照東域而流慈。昔者,分形分跡之時,言未馳而成化;當常現常之世,民仰德而知遵。及乎晦影歸真,遷儀越世,金容掩 色,不鏡三千之光;麗象開圖,空端四八之相。於是微言廣被,拯含類於三塗;遺訓遐宣,導群生於十地。然而真教難仰,莫能一其旨歸,曲學易遵,邪正於焉紛 糾。所以空有之論,或習俗而是非;大小之乘,乍沿時而隆替。

玄奘法師者, 法門之領袖也。幼懷貞敏,早悟三空之心;長契神情,先苞四忍之行。松風水月,未足比其清華;仙露明珠,詎能方其朗潤。故以智通無累,神測未形,超六塵而迥 出,只千古而無對。凝心內境,悲正法之陵遲;棲慮玄門,慨深文之訛謬。思欲分條析理,廣彼前聞,截偽續真,開茲後學。是以翹心淨土,往遊西域。乘危遠邁, 杖策孤征。積雪晨飛,途閑失地;驚砂夕起,空外迷天。萬裏山川,撥煙霞而進影;百重寒暑,躡霜雨(別本有作「雪」者)而前蹤。誠重勞輕,求深願達,周遊西 宇,十有七年。窮曆道邦,詢求正教,雙林八水,味道餐風,鹿苑鷲峰,瞻奇仰異。承至言於先聖,受真教於上賢,探賾妙門,精窮奧業。一乘五律之道,馳驟於心 田;八藏三篋之文,波濤於口海。

爰 自所曆之國,總將三藏要文,凡六百五十七部,譯布中夏,宣揚勝業。引慈雲於西極,注法雨於東垂,聖教缺而複全,蒼生罪而還福。濕火宅之幹焰,共拔迷途;朗 愛水之昏波,同臻彼岸。是知惡因業墜,善以緣升,升墜之端,惟人所托。譬夫桂生高嶺,雲露方得泫其華;蓮出淥波,飛塵不能汙其葉。非蓮性自潔而桂質本貞, 良由所附者高,則微物不能累;所憑者淨,則濁類不能沾。夫以卉木無知,猶資善而成善,況乎人倫有識,不緣慶而求慶!方冀茲經流施,將日月而無窮;斯福遐 敷,與乾坤而永大。朕才謝珪璋。言慚博達。至於內典。尤所未閑。昨制序文。深為鄙拙。唯恐穢翰墨於金簡。標瓦礫於珠林。忽得來書。謬承褒贊。循躬省慮。彌 蓋厚顏。善不足稱,空勞致謝。皇帝在春宮述三藏。聖記。

夫 顯揚正教,非智無以廣其文。崇闡微言。非賢莫能定其旨。蓋真如聖教者。諸法之玄宗。眾經之軌(足屬)也。綜括宏遠。奧旨遐深。極空有之精微。體生滅之機 要。詞茂道曠。尋之者不究其源。文顯義幽。履之者莫測其際。故知聖慈所被。業無善而不臻。妙化所敷。緣無惡而不翦。開法網之綱紀。弘六度之正教。拯群有之 塗炭。啟三藏之秘扃。是以名無翼而長飛。道無根而永固。道名流慶。曆遂古而鎮常。赴感應身。經塵劫而不朽。晨鐘夕梵。交二音於鷲峰。慧日法流。轉雙輪於鹿 菀。排空寶蓋。接翔雲而共飛。莊野春林。與天花而合彩。

伏 惟皇帝陛下。上玄資福。垂拱而治八荒。德被黔黎。斂衽而朝萬國。恩加朽骨。石室歸貝葉之文。澤及昆蟲。金匱流梵說之偈。遂使阿(禾辱)達水。通神旬之八 川。耆阇崛山。接嵩華之翠嶺。竊以性德凝寂。麋歸心而不通。智地玄奧。感懇誠而遂顯。豈謂重昏之夜。燭慧炬之光。火宅之朝。降法雨之澤。於是百川異流。同 會於海。萬區分義。總成乎實。豈與湯武校其優劣。堯舜比其聖德者哉。玄奘法師者。夙懷聰令。立志夷簡。神清齠齔之年。體拔浮華之世。凝情定室。匿跡幽巖。 棲息三禪。巡遊十地,超六塵之境。獨步迦維。會一乘之旨。隨機化物。以中華之無質。尋印度之真文。遠涉恒河。終期滿字。頻登雪嶺。更獲半珠。問道法還。十 有七載。備通釋典。利物為心。以貞觀十九年九月六日奉。

敕於弘福寺。翻譯聖教要文凡六百五十七部。引大海之法流。洗塵勞而不竭。傳智燈之長焰。皎幽闇而恒明。自非久值勝緣。何以顯揚斯旨。所謂法相常住。齊三光之明。

我皇福臻。同二儀之固。伏見禦制。眾經論序。照古騰今。理含金石之聲。文抱風雲之潤。治輒以輕塵足嶽。墜露添流。略舉大綱。以為斯記。

治素無才學。性不聰敏。內典諸文。殊未觀覽。所作論序。鄙拙尤繁。忽見來書。褒揚贊述。撫躬自省。慚悚交並。勞師等遠臻。深以為愧。

貞觀廿二年八月三日內府。

記‧問』之學,非但不足以『為師』,或許也不可『師法』。為什麼呢?『事實』與『資料』無論所積所聚多麼『龐大』且『詳實』,並不能夠自動產生『科學理論』!一個『科學理論』將那『龐大』『事實』和『詳實』『資料』貫串聯繫起來,才能形成『體系』,方可用來說明『萬象』!!

也就是說『知識』之『網絡』往往是『縱橫』『聯繫』的,『概念』的『經緯』常常會『上下』『貫串』。

據聞當初 阿隆佐‧邱奇 Alonzo Church 用『λ 運算』研究『可計算性』問題時,並不知道它自身就是一個『世界上最小的通用性程式語言』。因為『函式』與『變元』兩者是任何人不管想用哪種『□□程式語言』來寫『演算法Algorithm 都需要清楚理解的『概念』。抽象精巧正是為什麼,讀過『λ 運算』的人,多半覺得它既『難懂』又『難解』。這是有原因的,如果用『抽象辦法』談論著『抽象事物』,又不知道為何如此表述當然『難懂』;假使不能『困思勉行』多次的『深思熟慮』 ,以至於能夠一旦了悟那就自然『難解』。通常越是『基本』的概念,由於太過『直覺』了,反而容易『誤解』。就像化學元素『週期表』上的元素不過一一八個,它所構成的世界卻是千嬌萬媚繁多複雜,要講『』的『性質』與『作用』,也許一大本書都不能窮盡,但換個方向說鐵不就是日用之物的嗎?

─── 摘自《W!o 的派生‧十日談之《二》

 

也許因記問之學難成大器乎??所以 Michael Nielsen 先生作此難題連連之文︰

How to choose a neural network’s hyper-parameters?

Up until now I haven’t explained how I’ve been choosing values for hyper-parameters such as the learning rate, η, the regularization parameter, λ, and so on. I’ve just been supplying values which work pretty well. In practice, when you’re using neural nets to attack a problem, it can be difficult to find good hyper-parameters. Imagine, for example, that we’ve just been introduced to the MNIST problem, and have begun working on it, knowing nothing at all about what hyper-parameters to use. Let’s suppose that by good fortune in our first experiments we choose many of the hyper-parameters in the same way as was done earlier this chapter: 30 hidden neurons, a mini-batch size of 10, training for 30 epochs using the cross-entropy. But we choose a learning rate η=10.0 and regularization parameter λ=1000.0. Here’s what I saw on one such run:

>>> import mnist_loader
>>> training_data, validation_data, test_data = \
... mnist_loader.load_data_wrapper()
>>> import network2
>>> net = network2.Network([784, 30, 10])
>>> net.SGD(training_data, 30, 10, 10.0, lmbda = 1000.0,
... evaluation_data=validation_data, monitor_evaluation_accuracy=True)
Epoch 0 training complete
Accuracy on evaluation data: 1030 / 10000

Epoch 1 training complete
Accuracy on evaluation data: 990 / 10000

Epoch 2 training complete
Accuracy on evaluation data: 1009 / 10000

...

Epoch 27 training complete
Accuracy on evaluation data: 1009 / 10000

Epoch 28 training complete
Accuracy on evaluation data: 983 / 10000

Epoch 29 training complete
Accuracy on evaluation data: 967 / 10000

Our classification accuracies are no better than chance! Our network is acting as a random noise generator!

“Well, that’s easy to fix,” you might say, “just decrease the learning rate and regularization hyper-parameters”. Unfortunately, you don’t a priori know those are the hyper-parameters you need to adjust. Maybe the real problem is that our 30 hidden neuron network will never work well, no matter how the other hyper-parameters are chosen? Maybe we really need at least 100 hidden neurons? Or 300 hidden neurons? Or multiple hidden layers? Or a different approach to encoding the output? Maybe our network is learning, but we need to train for more epochs? Maybe the mini-batches are too small? Maybe we’d do better switching back to the quadratic cost function? Maybe we need to try a different approach to weight initialization? And so on, on and on and on. It’s easy to feel lost in hyper-parameter space. This can be particularly frustrating if your network is very large, or uses a lot of training data, since you may train for hours or days or weeks, only to get no result. If the situation persists, it damages your confidence. Maybe neural networks are the wrong approach to your problem? Maybe you should quit your job and take up beekeeping?

In this section I explain some heuristics which can be used to set the hyper-parameters in a neural network. The goal is to help you develop a workflow that enables you to do a pretty good job setting hyper-parameters. Of course, I won’t cover everything about hyper-parameter optimization. That’s a huge subject, and it’s not, in any case, a problem that is ever completely solved, nor is there universal agreement amongst practitioners on the right strategies to use. There’s always one more trick you can try to eke out a bit more performance from your network. But the heuristics in this section should get you started.

───

 

或當思由於人人『尺』尺『寸』寸

《說文解字》

寸,十分也。人手卻一寸,動脈,謂之寸口。从又,从一。凡寸之屬皆从寸。

尺,十寸也。人手卻十分動脈爲寸口。十寸爲尺。尺,所以指尺規榘事也。从尸,从乙。乙,所識也。周制,寸、尺、咫、 尋、常、仞諸度量,皆以 人之體爲法。凡尺之屬皆从尺。

 

每每不同,所以如此把脈定象耶!!

是否能仿效取法自身『身』經絡『經 絡』呢??!!

如果說有一門研究『夢的科學』稱作夢學 Oneirology ,為什麼直到今天『經絡』還排徊在『主流科學圈』之外?難到『針灸』真能以其『無用性』就可存在了數千年??但是『理論』之『實效性』並不能夠『釋疑』,就彷彿『熱力學』的『』,直到玻爾茲曼用著『統計力學』來『定義』,它的『意義』或許方被釐清!!所以在那還沒有『系統理論』的古早之前,就有《黃帝內經》之『經絡系統』的『五臟六腑』體系論述,實在是『很可疑』!這樣看來《周公解夢》也就是解『非理性之夢』的了!!

Meridians 【經絡】in acupuncture 【針灸】and infrared imaging
Shui-yin Lo

Summary The meridians in acupuncture are hypothesized to be made up of polarized molecules. Quantum excitations, quasi-particles and others are assumed to be the media of communication between different parts of the body connected by meridians. Infrared pictures are taken to depict the effect of acupuncture on one acupoint of a meridian to a far away pain area.

HYPOTHESIS
Acupuncture has been around for many thousands of years in China and has achieved good results in both man and animals. It has also recently begun to gain wide acceptance in the West. However, despite many scientific studies, it has still failed to achieve the recognition 【承認】it needs within mainstream orthodox scientific circles. Many studies over the past 40 years have shown that electric conductivity 【導電性】on acupuncture points (1±4) is lower than that on neighboring points. One of the most recent studies has been carried out using functional magnetic resonance imaging (fMRI)【功能性磁振造影】; it has reported the correlation between vision acupoints in the foot and corresponding brain cortices 【皮層】. When acupuncture stimulation is per formed on a vision-related acupoint (located on the lateral aspect of the foot), fMRI shows activation of the occipital lobes 【枕葉】. Stimulation of the eye using direct light results in similar activation in the occipital lobes when visualized by fMRI.

Two main questions need to be answered in a modern scientific way:

1. What are meridians?

2. What is the qi 【氣】that is supposed to circulate around the meridians?

The theory behind acupuncture is that the body has a system of meridians which channel 【形成河道】some kind of substance, energy, or information that has been vaguely called qi in the literature. Unfortunately, so far, when one dissects 【解剖】the human body, one does not find any substance that distinguishes the meridians from their surrounding tissues, quite unlike other human systems such as the nerve system or the blood system. Therefore the most likely explanation is that meridians are made up of same ordinary molecules that make up other living materials surrounding them with the exception that they are more ordered. These ordered molecules are neutral but electrically polarized. This provides the natural explanation on the concept of the balance of yin 【陰】and yang 【陽】in Chinese medicine as the neutralization 【中和】of negative and positive charges in electricity. Our hypothesis is then as follows:

The meridians are made up of electrically polarized molecules. On the meridians there are quantum phenomena 【量子現象】such as excitations, quasi-particles 【準粒子】, etc. that account for significant properties of meridians. These polarized molecules line up their polarity to form bigger clusters 【叢集】. Specifically, they are most likely water molecules 【水分子】that group together to form water clusters, which have permanent electric dipole moment. These water clusters then line up together to form the meridians. It has been suggested for a long time that water plays a very active role in the living state of the human body.

……

當□□的理論,用○○的話語來講,『意義』是否會『改變』?『現象』自然就『道遷』??『理化』當真能『不同』???天經地義的該是︰

真理不分東西學問沒有國界!!科學不在人種!!!

回歸到︰

事實』是『決疑』之依據,『實驗』是『決疑』的方法。

─── 摘自《M♪o 之 TinyIoT ︰ 《承轉》之《決疑‧上》!!