ラベル

AI Forecast 8306MUFG (214) Social (75) life (70) Financial (62) IT (57) Proposal (56) idea (50) Fund Management (48) Trading (43) economics (42) Covid-19 (40) AI (38) Hedge Fund (36) Risk (36) Culture (31) BOJ (29) Science (26) hobby (24) accounting (17) Apps (16) career (11) job (7) Travel (6) Hiking (5) emotion (5) music (3) Statarb (2) piano (2)

2019年12月25日水曜日

中国の核融合炉と社会の激変 Chinese Fusion Reactor and Radical Change of Society

中国の核融合炉と社会の激変

Chinese Fusion Reactor and Radical Change of Society




中国が核融合を2020年に稼働するらしい。日本も参加している国際プロジェクトより5年も早く実現しそうだ。後発だった中国が短期間に追い抜いていく様はただただ驚きだ。Looks like China is going to go live on Fusion Reactor in 2020. That is 5 yrs faster than international project Japan participates. It is just surprising to see the short time surpass by China that used to be behind the scene.

核融合の実用化は、人類が無限のエネルギーを手にすることを意味する。The realization of fusion reactor means unlimited energy is now available for human being.

想定されるパラダイムシフトはあらゆる分野に及ぶ。Paradigm shifts are expected for all kind of fields.

1)化石燃料の需要激減と価格暴落。Major reduction of fossil fuel demand and market crush.

2)原油は戦略資源でなくなる。Oil stops to be strategic natural resource.

3)CO2排出量激減により地球温暖化問題は解決する。Earth warming problem will be gone due to drastic reduction of CO2.

4)エネルギーコストの制約から今まであり得なかったことが可能になる。Technologies , that used to be impossible due to energy cost, will be possible.

  • 石化製品の合成(プラスチック他)Synthetic production of oil derivatives(plastics etc)
  • 居住可能区域の拡大と人口問題の解消 Expansion of inhabitable area and resolution of population problem
  • 砂漠の完全緑化 Total conversion of desert to forest. 
  • 超大深度掘削による鉱物資源の価格暴落 Super deep drilling and market crush of minerals.
5)食糧問題の消滅 Total resolution of food shortages.

以上、思いつくままに列記したが、核融合の実用化がもたらす社会の激変はすさまじいものがある。I listed above randomly but I was shocked again to find out how big modal shift fusion energy will create on human society. 

[追記2020/12/09]
昨日中国は核融合炉を稼働開始したと発表したようだ。出力が入力を上回ったかどうかなど詳細は不明。技術的には既存のトカマクプラズマ方式のようだ。Looks like China started operation of fusion reactor yesterday. Detail is not clear if energy output is over energy input. Technically it is build on Tokamak Plasma architecture. 



[追記2020/12/17]
残念ながら、中国の核融合は他国に追いついたレベルで、発電できる段階にはなっていないようだ。追いつくまでは早かったということだけかもしれない。Disappointed to find out that the level of Chinese fusion energy just caught up with other countries but not reaching up to the level to generate power out of it.  Looks it was fast only up to the point of catch up.

2019年12月21日土曜日

過ぎ去っていく子育て期 Parenting Period Passing Away

過ぎ去っていく子育て期

Parenting Period Passing Away




公園で子供と遊ぶ父親を見かけた。少し前の自分の姿だ。一番小さな子供が小学校4年生になり、子乗せ自転車で公園に送る日々はもう来ない。幼稚園、公園に都合10年通った。名残惜しいけれど、もう多分これで十分だろう。Just saw a father playing with kid in the park. It was me sometime before. Youngest one is now 4th grader of elementary school, so days bringing kids to park by bicycle is over.  Going kindergarten and park for 10 yrs all together.  Become sentimental but that should be enough probably.

子供たちは「肌を離すな」「手を離すな」の時期は過ぎ、「心を離すな」の時期に来ている。Time passed for 'keep skin touch' and 'hold hand' and now in the period of 'hold heart'.

親が子供に与えられる最大の宝物はなんだろう?それは教育だ。親鳥は巣立つヒナに、エサの取り方を教えるが、エサを与え続けない。What is the most precious treasure parent can give to kids? It is education. Parent bird shows kids how to get bait but not keep providing bait itself.

今は中二病の真っ最中で大変だけれど、何年かの後には、宝物で一杯の袋を持って、家から巣立って行って欲しい。They are all in the middle of difficult teenager crisis period, but I wish, some years later, they all leave home on their own with big sack full of treasures.


2019年12月15日日曜日

驚異のグーグルアシスタント 通訳 Surprising Google Assistant Interpreter

驚異のグーグルアシスタント 通訳 Surprising Google Assistant Interpreter



Google Homeを家で使っているが、最近新しい通訳機能が付いていることに気づいた。I am using Google Home at home and recently found new interpreter function added.

「OKグーグル、英語に通訳して」`OK Google, translate into English`

と指示すれば、驚異的な、実用レベルで、逐次通訳を双方向で(英語-->日本語、日本語-->英語)やってくれる。If I direct like above, it interpret in amazing practical level both way(JP-->US, US-->JP) in sentence by sentence basis.

言葉の通じない外国人と日本人との間にスマホを置くだけで、通訳付き会話が成立してしまうのだ!Just putting smart phone in between foreigner and Japanese, conversation become possible with interpreter.

イメージで言うとドラえもんの通訳機。It is just like real Doraemon world.

もちろん、この通訳機能がたとえば、「人生」などの抽象概念を本当に理解してるわけでなく、言語別の文法に基づく構文解析をAIベースで行い、メタ言語にしてから、それを翻訳先言語で再構成しているのだろう。Of course this interpreter does not understand abstract concept like `life` but only analyzing semantically on AI basis to convert into meta language, then construct back to target language mechanically.

なので、当然内容を理解しないと通訳が不可能な場合は通訳できないだろう。Hence, it will not be perfect if real understanding of the context etc is necessary.

しかし、このレベルでの翻訳ができると、AIが内容を本当に理解しているように聞こえてしまうのが不思議だ。However, if it can interpret to this level, it is funny that I feel as if AI has real understanding of the contents.

一つのアイディアとして、このメタ言語を追及していくと、AGIができるかもということも考えられる。This gave me some insight that this meta language approach may lead to AGI somehow.

Androidのスマートフォンで簡単に試せるので是非やってみては? Why not try now if you have Android smart phone?

というか、すぐに爆発的に普及するだろう。Or it will go popular like explosion very soon.

2019年12月9日月曜日

薄氷の日銀バランスシート BOJ Balance Sheet on Thin Ice

薄氷の日銀バランスシート 

BOJ Balance Sheet on Thin Ice




現在、量的緩和政策の下、日銀はマイナス金利政策を敷き、また国債の買い入れも行っている。Currently, under quantitative easing policy, BOJ implemented negative interest rate policy and also buying JGBs.


日銀が国債を買うとき、その資金がなくてはいけない。When BOJ purchase JGB, they need fund.

2つの調達オプションがある。There are two says to procure such fund.
  1. 紙幣を刷って買うPrint Note
  2. 借り入れて買うBorrow from market
紙幣を刷り続けると必ずインフレになり、果ては1千万円で玉ねぎ一個を買うようになる(ハイパーインフレ)ので、借り入れた資金で購入することで人畜無害とする。 If BOJ keep printing money, it will invite inflation for sure, and end up with one onion priced as JPY100K(hyper inflation). Hence BOJ purchases JGB by the money borrowed from banks to immunize impact. 

現状の3段階金利構造(基本B、マクロM、政策P)の下、政策Pはマイナス-10bp、マクロMゼロ、基本Bはプラス10bpであるので、基本Bで預金できている大部分の銀行預金は居心地がよく、引き出す理由はない。Under current 3-tier interest rate structure(B-Basic, M-Macro, P-Policy), P-Policy is set as minus 10bp, M-Macro as zero and B-Basic as plus 10bp, hence most bank depositors feel comfortable and have no incentive to withdraw.


しかし、国債を買うため、さらに銀行預金が必要である場合、日銀の裁量でマクロM部分を増額し、ゼロ金利で銀行預金を集めることになる。因みに、日銀の新規当座預金付利が-10bpなのに、銀行間取引ON金利が-7bp程度なのは、基本の10bpで効果が希薄化されているからだ。However, if BOJ needs more funds to purchase more JGB, BOJ has discretion to allocate more on M-Macro to have funds from bank at 0bp.  For information, market ON interbank interest rate is around -7bp diluted from P-Policy rate of -10bp due to the existence of B-Basic amount with rate of 10bp.

よって、今後、マイナス金利を深堀する場合でも、基本Bを政策より魅力的にしてしておかないと銀行預金が逃げ出してしまう。このため、日銀は政策Pのみをさらに下げるか、もしくは、基本B、マクロM、政策Pを同時に同じだけ下げるだろう。Hence, even if BOJ further decrease negative interest rate going forward, unless BOJ makes B-Basic more attractive than P-Policy, bank deposit will run away.  Thus, BOJ will lower P-Policy rate only further, or BOJ may lower all B-Basic, M-Macro and P-Policy for same amount.

このように、日銀は量的緩和を人畜無害にするため、かなり際どい金利調整を行うことで、資金を日銀へ誘導する必要がある。In conclusion, to make quantitative easing harmless, BOJ needs to extend delicate subtle control over interest rate level to drive funds up to BOJ balance sheet.



2019年12月8日日曜日

国債バブルは破裂しない JGB bubble will not crush

国債バブルは破裂しない
JGB bubble will not crush


国債が暴落する、円が暴騰するなどと心配する人がいるが、心配無用である。これらは政府によってコントロール可能であるからだ。I hear some buzz saying JGB will crush and JPY appreciation will escalate to bubble. However there is no worry for such.  It is because they can be well controlled by government. 

現在の中央銀行のフレームワークで本当の心配事は何か考えてみよう。Let's think over the framework of central bank to find out what is the real risk. 


現在日銀は量的緩和の真っただ中で、バランスシートは上のようになっている。Currently BOJ is in the middle of quantitative easing and balance sheet structure is as above.

以下、リスクシナリオごとに政府がどのように対応できるか考えてみよう。Let's think over each risk scenario to find out what government can do to control.


  • 国債の暴騰JGB Bubble:日銀が保有国債を売却すればたちまち相場は冷却する。Once BOJ sells its JGB inventory, market will be cooled down immediately.
  • 円暴騰JPY Bubble:極論、国債の引き受けを新規紙幣発行で対応すればインフレは確実に発生し、円高は防げる。長期金利の上昇は日銀の国債購入で抑えられる。Ultimately, BOJ can purchase JGB by new note issuance, that makes inflation then can avoid JPY bubble. Long term interest rate can be suppressed by JGB purchase of BOJ.
  • 円暴落JPY Crush:これが真に困難な状況である。国家の信認を失うのは安く、信認を得るのは難しいからだ。This is the real risk. It is easy to loose credit of nation but difficult to acquire.


本当の恐怖は、円の暴落である。The real risk is the JPY crush.






2019年12月5日木曜日

実測700Mbps超、月3千円代のインターネット+(03)発信電話。あるマンションでの選択 Internet Over 700Mbps+(03)Phone, JPY3K/M. One Option for a Condo

実測700Mbps超、月3千円代のインターネット+(03)発信電話あるマンションでの選択
Internet Over 700Mbps+(03)Phone, JPY3K/M. One Option for a Condo



目次Table of Contents

  1. 概要Summary
  2. ネットワーク速度Network Speed
  3. 電話設定Phone setting
  4. ネットワーク構成Network Configuration
  5. 契約形態と料金Contract and fee
  6. まとめConclusion



1.概要Summary

家のネットワークインフラには何を選べばよいのだろうか? スマホのみでテザリング、ポケットWifi、ADSL、光ファイバー、ケーブルTVなど様々な選択があるだろう。Which provider should be picked for home internet connection?  There are lots of ways around starting from smart phone tethering to optical fibre.

我が家の場合は、PC5台、タブレット4台、スマホ3台、AndroidTVにGoogleHome、とかなりの台数があり、接続速度を重視し光ファイバー接続を選択した。My home-use is rather heavy so we picked optical fiber.

プロバイダは価格と速度から最も有利な NURO光(ニューロ) を選び、2年半ほど利用してきた。結果、速度、安定性、価格とも、非常に満足しているので紹介したい。We picked NURO Opt Fiber and used it for 2.5yrs and is very much satisfied with the cost as well as performance.

2.ネットワーク速度Network Speed

 ネットワークはぶっちぎりの700Mbpsで(時々1Gbps)で、完全なストレスフリーだ。この速さは殆んどの人にとって、会社でのインターネット接続の速さ(大きくても100Mbps程度)を軽く超える。下の画面はfast.comだが、この数字を見て感動する人は、価格性能比を考えると、導入する価値は十分あると思う。これだけあれば通常の利用ならお釣りが来る。Network is light speed of 700Mbps(sometimes 1Gbps) exceeding all counter parts and is totally stress free. This speed superseeds most of your office internet access speed that is less than 100Mbps normally. Below screen is fast.com and if you are impressed by this figure, it may worth having for your own. If you have this much, that is more than enough. 


 もっとも、現状で、この速さの接続を必要とするアプリケーションは自宅にサーバーを置く以外考えられない。実用的には10Mbpsもあればほとんどの場合に事足りるだろう。でも、もしこの余裕が、(03)発信電話代込みで、3千円代で手に入るとしたらどうだろう?なお、これは1GのCAT5Eケーブル接続の場合で、Wifiだと20Mbps程度である。It is true that no application besides having server, that requires this speed. Also most of application needs at most 10Mbps. However, if you know that this speed can be obtained together with (03)start phone number for only JPY3K, what do you say? Note that this speed is measured for CAT5E cable installation, while for Wifi, we see around 20Mbps. 

3.電話設定Phone setting

 日本ではまだ、03から始まる旧NTTの番号を持っていることが暗黙の社会的アイデンティティーのとなっているきらいがある。このため、我が家も光ファイバー契約と同時に03から始まるIP電話を契約した。一見NTTの固定電話のように見えるが、実はNTTとまったく関係のないIP電話なのである。In Japan, we still have tacit social subtle consensus to appreciate phone number starting from (03) as a sign of stability, reliability and status for having stable house. To be in line with this, we subscribed IP phone starting from (03) from beginning. This looks like just NTT home phone but it is a IP hone not related to NTT at all. 

4.ネットワーク構成Network Configuration

 ネットワークは1GのLANケーブルを転居時のスケルトンリフォーム時に各部屋にスイッチングハブからスター配線した。電波の弱い部屋には中継器を置いた。ケーブルを外出しで部屋の内部に配線するのももちろんOKだ。Network is set in star form from switching hub through 1G LAN cable at the time of reform before we move in. We placed Wifi repeater when signal is weak. It also works fine, of course, to have cable inside the room but not behind the wall.


上の写真は、CAT5Eコンセント、光Wifiモデム、光ケーブルだ。モデムからスイッチングハブで5つのコンセントに分配した。Picture above shows settings.


各部屋へのCAT5Eケーブルは上の集中コンセントから始まり、CAT5E cable is start from here, then,


 CD管を通り、going through ducts,


各部屋へ送られ、家庭内LANが完成。and sent to each room.


5.契約形態と料金Contract and fee

 我が家はマンションタイプ2Gを契約した。価格は月額3000円をちょっと超えるくらいでありとても経済的だ。正確に言うと、最初の2年はマンションとしての設備導入費の7万円程度を分割払いする必要がある。またマンションで10人以上加入する必要がある。We subscribed 2G condominium type. Price is just above JPY3K. Precisely speaking, we have to make installment payment of initial setup fee around JPY70K. Also 10 people needs to join the subscription.


 上は月々の支払である。電話、番号表示込みで3千円台であることが分かる。Above is monthly bill. You can see that price is around JPY3K, phone and number display inclusive. 


 また、上は、マンションに最初に機器を導入するにあたって分割払いするお金(Hands-Upと呼ぶらしい)が完了していることと、今、同じマンションで利用している人が15人であることを示している。Also, above shows that installment payment(called Hands-Up) is over now and there are 15 people joined same subscription at this moment. 

6.まとめSummary

 この記事をここまで読んだ人は多分インターネットの速度、価格について、いくばくか関心がある人だと思う。現在の契約を解除して入りなおすのは大変だが、コスパに敏感なら、転居、リフォームの際に、考えてみても良いかもしれない。You must be a person with interest on internet speed, price since you come to this point of reading. It is hectic to replace current subscription of course but if you are cost-performance conscious,  you may consider this option at the time of next moving/reform.
 



証券化の思い出 Memory of Securitization

証券化の思い出 

Memory of Securitization



証券化は現在では標準的な手法だが出始めたころは物珍しかった。Securitization is now a standard method but when it came out to the market, it was very special.

東京では外資系の不動産証券化の成功を見て、みながこぞって始めた。In Tokyo market, seeing the success of foreign institution on real estate securitization, everybody followed.

その結果、利ザヤは危険水域まで縮小したが、勢いは衰えなかった。As a result, spread came down to dangerous zone however, the fever remained.

証券化部門は肩で風切る花形部門だった。Securitization department was a shining star, walking with a swagger.

米国では監査法人の不正格付けも相まって、証券化商品はバブル状態となった。In US, together with fraud rating by audit firm, securitization financial products went up to bubble high.

そしてリーマンショックが来た。Then Lehman shock came.

ポールソンが引き金を引く瞬間、六本木ヒルズの周囲から外国人が消えたのを覚えている。皆、情報端末を固唾を飲んで見ていたのだ。 I still remember well when Paulson pulled the trigger. All foreigners were disappeared around Roppongi Hills. All must have been watching the information terminal waiting for the moment.

六本木ヒルズの入口に誇らしげに建っていたリーマンブラザーズの石碑は撤去された。Roppongi hills removed a stele of Lehman Brothers standing proudly in front of its entrance.

世界は逆転した。World became upside down.

証券化と名が付いただけで、皆は眉をひそめ、近づかなくなった。Everybody frowned and left if there is any sign of securitization.

それから10年の月日が流れた。10 years have passed.

現在、証券化の手法は定着し、便利な道具として、皆がその恩恵を得ている。 Nowadays, the securitization products got its status as a common convenient vehicle for everybody to take advantage of it.








2019年12月3日火曜日

虫垂炎との戦いが終わった War is over against appendicitis [ 2022/1/5 Added ]

虫垂炎との戦いが終わった
War is over against appendicitis



柔道好きの小学生の子供が虫垂炎入院から退院した。Elementary school Judo kid came back from hospitalization due to appendicitis.

7日前、38度の熱と頭痛で医者に行くも、インフルエンザ検査は陰性。2日程自宅静養。7 days ago, went down to doctor because of 38 centigrade fever and head aches but was diagnosed as influenza negative.

3日目の朝、平熱に戻り登校。ところが、一時間目に38度の発熱と腹痛で保健室から連絡。近所の医院で診察。白血球が平常レベルであることから医師は炎症なしと判断、代わりに腸内ガスを疑い浣腸処置。しかし腹痛は激痛に変わり、医師は総合病院へ救急搬送指示。3rd day morning, went up to school since temperature has gone down to normal. However during the 1st class of the day, got a call from school infirmary, reporting 38 centigrade fever as well as stomach ache. Near-by doctor prescribed enema due to normal level of white blood cell count however, stomach ache soon turned into severe pain, then doctor directed urgent transfer to general hospital.

エコー、X線、造影剤CTで、虫垂炎と診断It was diagnosed as appendicitis after echographic exam, X-ray as well as contrast enhanced CT.

初期段階のため、手術でなく抗生剤療法が選択可能で、直ちに入院。初日夜40度の発熱はあったが、回診の度に右下腹部の触診による痛みは徐々に減少し、5日で消滅。6日目に退院。Due to very early stage in development, we could choose antibiotics treatment instead of surgery then was hospitalized immediately.  Peaked by first night fever of 40 centigrade, the pain at right lower bottom abdomen gradually faded every time doctor came on periodical examination tour and the pain disappeared by day 5.  We left hospital in day 6.

以下感じたこと。Below, what I felt.

療法選択:抗生剤療法で手術を避けても30%程度=通常の4倍の確率で虫垂炎を再発する。今回、抗生剤を選んだのは、開腹はできるだけ避けるべきだと思ったことと、できるだけ手術痕を子供に残したくなかったから。でも、最近の手術は昔と比べ進歩しているようで、再発リスクを考えると判断が正しかったかどうか自問中。子供の虫垂炎は大人より急速に悪化するため、後日に計画的に手術をする人も多いそうだ(医師の診断の上、保険適用可)。
The choice of treatment: Even if you avoid surgery by way of antibiotics treatment, in the probability of 30%, that is 4 times high as normal, recurrence is observed. We chose antibiotics treatment to avoid operation as well as surgery scar. However recent operation looks advanced than before, hence considering the risk of recurrence, I am asking myself if my decision was right.  Since kid's appendicitis get worse much faster than adults, many people plans surgery later(insurance covered when doctor agrees).

診断精度:炎症の指標である白血球増加は激痛発生とはタイムラグがあり、結果的に初期の虫垂炎の診断には使えなかった。一方、造影剤CT、エコーも常備できる価格ではない。初期診断精度を上げるには、検査機器のさらなる低価格化が必要だ。
The precision of diagnostics: There is time lag between white blood cell count as the inflammation indicator, and the start of severe pain, hence it cannot be used for diagnostics of appendicitis in very early stage. Meanwhile, echographic exam as well as contrast enhanced CT are too expensive for local clinic. Cost reduction of those medical equipments is necessary to increase precision of initial diagnostics.

コスト面:乳幼児医療証により支払いはほぼゼロ。手術を行っていないので、実際のコストは推定25万円程度だと思う。健康保険料は高いが必要だと実感。
For cost: Thanks to additional insurance provided for infant, there was no payment.  Approximate cost incurred will be around JPY250K since we had no operation. Really felt that insurance is necessary although monthly fee is expensive.

自分の心:まだこどもが赤ちゃんの頃、何度も熱をだしたり救急車を呼んだりしたことを思い出した。普段は当たり前で気にもしない、しかし何物にも代えがたい健康の大切さ。自分も家族も手術の体験が全くなく、デフォルトで手術が選択されることに慌てた。
My emotion: I recalled time when kids were baby and had fever or time when I called ambulance. Such an indispensable thing, health, that we take it for granted normally. I was also surprised that surgery is set as default treatment since neither me nor family had ever went through operation at all.

もし、運悪く子供が虫垂炎になったら参考にしてください。  Just for those who have kid happen to have appendicitis unfortunately.

[ 2022/1/5 Added ] 
その後、2年後に再発。抗生物質で入院対応。そのまた1か月後に再発。3度目の抗生物質対応。そして、遂に「待機的手術」を決心。一か月後に手術を行い、虫垂は切除された。Two years later, it came again. Hospitalized and took anti-biotics. Then one month after that, it came back once more. Anti-biotics treatment for the 3rd time. After all, we decided surgical solution on elective basis. Surgical operation was done one month later. Appendices was removed.  

手術は内視鏡(多分Senhance)。多臓器への癒着はなかった。事故無く、きれいに仕上げてくれた担当医師には感謝。手術痕は最小限。待機的手術は「緊急手術」より遥かにお薦め。どう考えても、夜中に起こされて大至急行う手術より、計画的に準備して行う手術の方が安全で、仕上がりも良いだろうから。Surgery operation was done by endoscope( probably Senhance). No adhesions to other organs were found. Thankful to doctor who completed the operation safe and beautiful. Surgical scars were minimal. Elective surgery is very much recommended than emergency surgery. However you think, planned and well prepared surgical operation should be safer and better than the operation done at night by doctor who was waken up in the middle of night. 

現在、内視鏡手術は手術で開ける穴が臍の一か所である単孔式がある。でも、技術的に難易度が高いようで普及しておらず、臍に加えて2か所孔をあけるタイプだった。手術痕は小さく、大人になった時点で言われないと気付かないレベルにまで消えそうな感じになると思われる。Currently there is single port VATS(video-assisted thoracic surgery) that opens up only one port in belly button. However, it looks technically difficult and is not common. Hence 3 port VATS was taken this time. Surgical scars looked small enough to be negligible when my kid grows up to adult unless explicitly explained what happened before. 

2019年11月28日木曜日

AIで温度管理の実験をしよう AI Temperature Control Play Ground

AIで温度管理してみよう

AI Temperature Control Play Ground


エアコンの温度管理をAIでやってみよう。熱伝導方程式による解析的なアプローチよりはるかに簡単に、ニューラルネットは「動物的カン」で答えをだすのである。Let's control air conditioner by AI. Far easier than analytical solution by solving heat conduction equation, neutral network gives out answer like animal hunch.

温度を一定に保つ初期の装置はバイメタルによるOn/Offだった。でも、今は、ニューラルネットがよりスマートにやってくれる。Early day's temperature stabilization was done by bi-metal to perform on/off. But now neutral network does it more smoothly.

下のプログラムでは、外気温、エアコンダイアル設定(+は暖房/-は冷房)、室内温度について9つのデータを取った結果でニューラルネットを教育している。In the program below, AI takes 9 data sample for outside temperature, air conditioner setting(+for heating/-for cooling), and inside temperature.

いろいろパラメータを変えて走らせてみよう。You can change parameter and play around in the test environment. Pls try.

活性化関数は全部で11ある。There are all 11 activation functions you can try (elu, hardsigmoid, linear, relu, relu6, selu, sigmoid, softmax, softplus, softsign, tanh).

プログラムはこちら。Codes are here. 



Air Conditioning AI Controller
Decide control level to achieve target room tempetature

#OfNeurons/layerニューロン数/層
#ofEpoc教育繰り返し回数
InputLyrActivFunc入力層活性化関数
HidnLyrActivFunc中間層活性化関数
#ofHiddenLayer中間層の数

データー番号 data number   
               
x. 外気温temperature   outside
               
z. 冷暖力Air conditioning power (+warm/-cool)
               
y. 最終室温Final room temperature
               


2019年11月20日水曜日

超簡単ブルースアドリブ(Super Easy Blues improvisation)

超簡単ブルースアドリブ

Super Easy Blues improvisation




ダイアトニックスケール(1/1/0.5/1/1/1/0.5)でキーがCの時、コード進行の上に、ブルーススケール(2.5/1/0.5/0.5/2.5/0.5)構成音(C/Eb/F/Gb/G/Bb)をランダムにリズムに乗せるだけでブルースアドリブが完成。途中にクロマチックスケール(0.5/0.5/0.5/0.5/...)など他のスケールも入れるともっとカッコ良くなる。やってみよう!びっくりするほど役に立つよ!

キーボード:Roland FP-5
コード進行:セッションパートナーr.1ポップス
音色:161アルトサックス When you are in key C diatonic scale(1/1/0.5/1/1/1/0.5) chord progression, you can just randomly put C blues scale (2.5/1/0.5/0.5/2.5/0.5) notes C/Eb/F/Gb/G/Bb to have quick and easy improvisation. Inserting other scale such as chromatic scale (0.5/0.5/0.5/0.5/...) will make it sounds nicer. Try it and you will find it totally surprisingly useful.

Keyboard:Roland FP-5
Chord progression: Session Partner r.1 Pops
Instrument : 161 Alt Sax

円コイン(中央銀行デジタル通貨)の構造 The Architecture of Yen Coin(CBDC)

円コイン(中央銀行デジタル通貨)の構造 The Architecture of Yen Coin(CBDC)



LIBRAからの挑戦もあって、中央銀行によるデジタル通貨(CBDC)の議論が始まった。日銀のスライド(2019/7/5 [参考1])には、プリペイドカード形式での導入案が紹介されている。LIBRAの最大の利点は国境を透過するPTP(個人間)決済である。PTP決済ができて初めてCDBCは「お札」と同等の利便性をもつ。LIBRAは各国通貨にリンクするステーブルコインであるが、マネロン対策、通貨主権の観点からグローバルな公式展開は許容されなかった。Facing challenges from LIBRA, discussion on CBDC(Central Bank Digital Currency) has started. BOJ made prepaid card style proposal as in Reference 1. Meanwhile LIBRA's biggest advantage is PTP settlement across boundaries. CBDC becomes cash equivalent only when PTP settlement is possible. LIBRA was rejected by countries due to lack of money laundering measure as well as risk of invasion on sovereignty, although it is a stable coin linked to currency of each countries.

ここではPTP(個人間)決済の利便性・マネロン対策・国家の通貨主権・金融政策のすべてを満足するCBDCの形態を段階別に2つ提案したい。Here, I wish to propose two-stage approach for development of CBDC that satisfies all problems that LIBRA has.

第一段階 日銀券(お札・硬貨)だけを円コイン化 
Stage 1. Convert Central Bank Note to CBDC 
  • 日銀の口座型CBDCのプラン[参考1]をPTP(個人間)化する。発行済み日銀券(現在100兆円)を保有しているすべての経済主体(個人・法人・含非居住者)は日銀のバランスシート上にアカウントを持ち、互いにCBDCを日銀口座間振替で決済できる体制に移行する。Convert BOJ's proposal in Reference-1 to PTP. All economic body own account on BOJ balance sheet and can settle CBDC mutually. 
  • 円の全利用者のトランザクションをリアルタイムで行うインフラの整備が必須なため、追加投資を最小にするため、当面、銀行に当座預金、普通預金の他に政府預金を追加してもらい、口座振替は政府預金間のみ許可する対応も一案。To save cost of implementation, it may be an idea to mandate existing commercial banks to include government account access in their existing services while approving settlement only in between government accounts by way of CBDC. 
  • PTP決済が可能で現在の現金と利便性は同等以上、アカウントは国民識別IDなどと対応させることでマネロン対策になり、その他現状の、国家の通貨主権、金融政策などはそのまま維持される。This makes CBDC as convenient as current cash while having anti money laundering feature through national ID linkage. Currency sovereignty as well as monetary policy will be maintained. 
第二段階 すべての円のコイン化
Stage 2. Convert all Yen to CBDC 


  • 特徴 Feature
    1. 送金・振替は日銀口座間のみ合法とする。銀行口座間振替は順次停止する。Make only settlements in between CBDC as legal. Money transfers between existing bank accounts will be stopped. 
    2. 日銀の口座に存在する円のみを有効な円と告知する。具体的な会計仕訳は[参考2]を参照。Declare that only Yen in BOJ accounts is valid Yen. Accounting sample entries are shown in Reference-2. 
    3. 円の利用者は日銀の自分の口座で資金を保存する選択ができ、銀行の信用リスク(取付騒ぎ)を回避する選択肢を持つ。Yen users now have right to keep fund at BOJ account, thus can avoid bank's credit risk(bank run). 
    4. マネロン対策、国家の通貨主権、金融政策は引き続き維持される。 Anti money laundering, Currency sovereignty as well as monetary policy will be maintained. 
  • 管理Management
    1. すべての円はコイン化され、円コインの決済はすべて、日銀のバランスシート上で行われるため、準備率という概念は消滅し、通貨供給量は日銀のバランスシートの大きさとなる。There is no central bank reserve concept anymore while money supply is directly monitored by the size of BOJ balance sheet. 
    2. すべての円の動きがリアルタイムに日銀バランスシート上で管理できる。All Yen movement is monitored on BOJ balance sheet on real time. 
  • 法制Legal framework
    1. 円コインの決済にかかわらない会計処理は基本現状通りとなる。Accounting process irrelevant to Yen coin settlement will be kept as current manner.
    2. 現状の金融契約はそのまま大きな変更なく継続利用できる。Existing financial contracts will be kept as they are without any major changes. 
[参考1] Reference 1

2019年11月17日日曜日

強化学習も関数補間 Reinforcement Learning is also Function Interpolation

強化学習も関数補間

 Reinforcement Learning is also Function Interpolation




AIの「教師あり学習」と「強化学習」とは異なる方法と感じる人も多いだろう。強化学習の代表選手であるQ学習は、関数の補間機能である「教師あり学習」と比べ、どこが違うのだろうか。Many may feel that supervised learning and reinforcement learning are different. What is the difference between Q learning representing reinforcement learning and supervised learning that interpolate functions?

実は、Q学習も「教師あり学習」も、全空間を記述する関数、即ち補間関数を作り上げようとしている点で、本質的な違いはない。In reality, there is no fundamental difference between the Q learning and supervised learning since both try to establish interpolating function describing whole problem universe.

Q学習においては、環境に対し、エージェントが行動Aをとり、報酬rを得た場合、状態Sと行動Aの組合せにおける価値Qを、Qテーブルという表に保存する。テーブルというデータ構造上、全空間は離散化されているが、DQN(Deep Q Neural Network)を使えば離散化は不要となる。なお、Q関数は一般的にはN次元だが、上の図は見易くするため、2次元で書いてある。In Q learning, value Q at state S and action A is stored in table called Q table when agent took action A against environment. Whole problem universe is discritized due to table in nature while such discritization will be unnecessary if DQN(Deep Q neural Network) is used. Q is N dimensional in general however for ease of presentation, it is shown as 2 dimensional.

次のサイクルの行動Aは、現在の状態Sの場合のQを最大にするAとする。探索の幅を広げるために、Aの選択は時々ランダムを入れる。次の行動Aを環境に入れ、次のサイクルが始まる。The action A for next cycle is set by picking the A that makes Q maximum when state is S. For diversity expansion, take A randomly once in a while. The next cycle will start by applying action A to environment.

\begin{align} Q(S_{t},A_{t})  &\gets Q(S_{t},A_{t}) + \alpha(r_{t} + \gamma Max_{A}[Q(S_{t+1},A)] - Q(S_{t},A_{t}) )  \\
&\gets (1-\alpha)Q(S_{t},A_{t}) +\alpha(r_{t} + \gamma Max_{A}[Q(S_{t+1},A)] ) \\  \\

S_{t}  &:  時刻tにおける状態 \ State \ at \ time \ t \\
A_{t} &:  時刻tにおける行動 \ Action \ taken \ at \ time \ t \\
Q(S_{t},A_{t})   &:  S_{t}、A_{t}の場合の価値 \ Value \ at \  S_{t},  \ A_{t} \\
\alpha &:  学習率 \ learning \ rate\\
r_{t}   &:  報酬 \ reward\\
\gamma   &: 割引率 \ discount \ factor\\
Max_{A}[Q(S_{t+1},A)] )   &: A変化時のQの最大値 \ Max \ Q \ by \ varying \ A  \\
\end{align}

「教師あり学習」では最初から大量の教育データがあったが、強化学習では、最初の状態からいろいろ試行を重ねるたびに教育データを集積していくところが異なる。しかし、解の全空間を対象にした補間関数を求めているという点では全く一致している。Supervised training has big data for education but reinforcement learning accumulates data as making try & error.  However, both are identical from the point of seeking for interpolation function covering whole problem universe in scope.

 このため、過去のデータなどから教育データを生成できる場合は、強化学習より「教師あり学習」が効率が良い。一方、二足歩行、ゲームなど、最初の状態が明確で、そこから分岐していくデータのみに意味がある場合など、範囲を絞り込むなんからの境界条件がある場合は強化学習が適している。Hence, if historical data is well prepared, it is more efficient to use supervised learning. Meanwhile, if initial condition is clear followed by consequential status where bounds are rather limited with boundary condition, reinforcement learning may fit.

 この学習の過程を考えていると、人間の学習とダブって見える。最初の教え方がまずいと、紆余曲折、遠回りをして目的を達成することになるが、その過程で、普通なら体験しない様々な場面に遭遇し人生を豊にする。This reinforcement learning process overlaps the process of learning done by human being. If initial instruction is not correctly provided, we end up going around, making detour to achieve objective however, during such elongated process, we may face many interesting situations that other will not encounter, then life will be more fascinating.

 人生の選択は組合せの爆発で、全てのケースを「教師あり学習」することは不可能だ。自然、強化学習となり、そこでは少ないサンプルの試行錯誤の経験値を元に最適化を図っていくことになる。しかし過学習の果て、状態が少しでもずれると利用できなくなったり、逆にデータの少なさにより学習が収束しなかったりなど、少ないサンプルでの収束には問題も多い。これは人間にも言えることで、修練を重ねることで強くなっていく。The choice in life is an explosion of combination, hence it is impossible to have supervised learning for the whole problem universe. Naturally learning will be reinforcement learning where optimization is based on try and error. However over learning destroy robustness while data scarcity makes non convergence.  This applies to human life also however it is mitigated by multiple training.

 この強化学習の考え方は生命の学習と近いものがある。環境が与えたある範囲の最適関数をいち早く正しく習得した個体が生き残る。This reinforcement learning idea is similar to learning by living creatures. Only those that learn the optimized function given by environment correctly and quickly should survive.

2019年11月15日金曜日

格安スマホ革命.. 中国製スマホはEbayをチェック Smart Phone Revolution .. Check Ebay for Chinese Smart Phone

格安スマホ革命.. 中国製スマホはEbayをチェック 
Smart Phone Revolution .. Check Ebay for Chinese Smart Phone



格安スマホの本流を行く1機種を紹介したい。Let me introduce one main streamer of cheap smart phone.

それはDoogee X5 Max Proだ。4,000mAhのバッテリーで中国製格安スマホにありがちな連続使用時間を解消し、信頼性ともに十分に実用的である。It is Doogee X5 Max Pro. Equipped with 4,000mAh battery, it solves battery shortage problem unlike other Chinese cheap smart phones. Reliable and performance is high enough. 

今日現在、本体価格1万円程度、交換バッテリーは千円程度だ。It costs only JPY10K and battery costs JPY1K as of today.

Amazonでは取り扱いが不定期だが、Ebay(US)では本体・バッテリー共、通年在庫がみつかる。Amazon does not have consistent inventory but Ebay(US) does  including battery throughout a year.

現在新たに楽天がキャリアとして参入するが、SIMベースの格安スマホでほぼ同様のサービスが数分の1の価格で実現できる現在、大手キャリアはその存在意義を問われている。Rakuten is now jumping into smart phone business as new career however, such careers are now questioned for their existence facing super cost effective cheap smart phones based on SIM.

また、統一ブランド名の下で、格安スマホ利用を端末購入から設定まで一貫して有償サポートするビジネスも成り立つ。宣伝をうまくやれば革命がおこるかもしれない。As a new business chance, paid service to support cheap smart phone implementation from purchase to setting up is possible. If done well for advertisement, can create revolution to the smart phone business.










2019年11月13日水曜日

プログラミングと数学(小さな発見) Programming and Mathematics(One Tiny Finding)

プログラミングと数学(小さな発見) Programming and Mathematics(One Tiny Finding)



CartPoleという棒立ての問題をQテーブルを用いて離散的に強化学習するPythonのステップを読んだ。4要素の連続値ベクタを5ステップに離散化したのち、スカラーに次元圧縮するロジックを見つけて感動した。I read Python code for reinforced learning using Q table for CartPole problem to let pole keep standing on the cart.  Very impressed to find out one logic to perform dimension reduction from 4 dimension to scalar on 4 element continuous number vector with 5 step discretization.

最初、下記の赤の部分が何をしているのか不明だった。いろいろ見ていくうちに、離散化ステップをNとしたN進法で次元圧縮しているのだということが分かり、「アッタマいい!」と納得した。プログラムは単なるコーディングでなく、いろいろな知恵の集合体であることを再認識した。Initially no idea what below red part is doing.  While reading further, I realized that it is a N base dimension reduction taking number of discritization steps as N. Very smart way to do all at once.  At the same time I realized again that programming is not just a coding but including lots of wisdom.

def digitize_state(observation):
    cart_pos, cart_v, pole_angle, pole_v = observation
    digitized = [
        np.digitize(cart_pos, bins=bins(-2.4, 2.4, num_dizitized)),
        np.digitize(cart_v, bins=bins(-3.0, 3.0, num_dizitized)),
        np.digitize(pole_angle, bins=bins(-0.5, 0.5, num_dizitized)),
        np.digitize(pole_v, bins=bins(-2.0, 2.0, num_dizitized))
    ]
    return sum([x * (num_dizitized**i) for i, x in enumerate(digitized)])