ラベル

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)

2020年9月29日火曜日

Teachable Machine やってみた Teachable Machine Works!

 Teachable Machine やってみた

Teachable Machine Works!

遅ればせながら、Teachable Machineをやってみた。画像、音声などのデータで、ネットを教育し、APIを生成、教育結果(モデル)のサーバーもやってくれる。野生動物の自動検知、流れ作業なかの分類作業など、活躍できる場面も多そうだ。A bit outdated but tried Teachable Machine for the 1st time. Based on image and sound data, can educate net, then API is generated and also education result(model) is served to share with others. Looks it can be used in many situation such as detection of wild animals, classification task at the factory line etc. 

手順は簡単。分類したい対象に名前を付けて、1-2秒カメラの前でぐるぐる回す。ここでは、クマとカメのぬいぐるみを使った。無背景も同時に行う。Procedure is easy. Simply name the object and rotate 1-2 second in front of camera. Here I used Bear and Turtle. Sample background at the same time. 


教育はローカルマシンで行われ、GPUが稼働しているのがわかる。Education is done on local machine, hence can observe that GPU is working. 


クマを見せると、Bearが1.0とでる。If Bear is shown, Bear becomes 1.0.
カメを見せるとTurtleが1.0と出る。If Turtle is shown, Turtle becomes 1.0.
教育されたネットがGoogleの採番に従い、Googleに保存され、結果は下のようにAPI経由で他人と共有できる。共有不要ならローカル保存も可能。教育用に撮影した映像はアップロードする必要はない。The educated net is saved under google server numbered by google, and can be shared by others through API. Can save locally if no need to share. No need to upload images used for education. 

下がテストで作成したAPIだ。このようにブログにも簡単に貼り付けできる。Below is the API created by this test. As you can see below, it can be pasted to blog easily. 

Teachable Machine Image Model

2020年9月25日金曜日

AI 株価予測 20200925 の状況8306MUFG Stock Price AI Forecast - 20200925 Status 8306MUFG

  AI 株価予測 20200925 の状況8306MUFG
Stock Price AI Forecast - 20200925 Status 8306MUFG



[前回予測20200911Previous forecast


注)この投稿はあくまで個人メモです。記事に基づく実際の投資は一切行わないでください。
Caution) This is only for my memo.  Never make any actual investment based on this post.

 上値抵抗線は破れず、NYの下落とともにレンジの切り下げモードに入ってきた。AI予想も、新値更新が無いため変化はない。月足、週足共に更なる下落を予測している。Upper range was not broken but bounced back down to cut-down mode of lower range as NY goes down. AI forecast see no change since there is no change on three line breaks.  Both monthly and weekly still forecast further substantial drop. 
 配当利回りが6%近いMUFGにとっては大きなイベントである半期の配当確定日はもうすぐだが、株価下落で利回りはさらに上がりそうだ。The milestone semi annual dividend date is coming soon for MUFG with 6% dividend yield. Dividend yield will go further down as stock price goes down. 


市場全体も同様だ。Same trend for market as a whole. 


NYは、経済再開に伴う感染拡大により下げてきた。状況レンジは切り下げ模様だ。NY market broke up-going lower resistance trend as economy reopens. 


コロナについては絶望的な状況が展開している。有効な治療薬があるにも関わらず認定しようとしない現状では、世界はまだまだコロナに振り回される展開が継続すると見て良いだろう。Covid-19 situation is desperate.  World persistently keep denying the existence of cure-medicine although it exists. Hence confusion will keep going.  

世界はコロナの攻撃を受けてGDPは3割減に近い減少だ。世界がコロナを本気で退治しようと思っていない現状、株価が上昇を続けるには、インフレが必要だ。World economy got GDP 30% down facing Covid-19 attack. As long as world is not serious about resolution, we need inflation to keep stock market going up. 

確かに現在、GDP2割に近い巨額の国債発行と政府支出による経済支援、また、リーマンショック以来の中央銀行によるベースマネーの100兆円から500兆円への急拡大がある。ところが、マネーサプライの伸びは、リーマンショック以来、700兆円から1300兆円と緩やかで通貨乗数は日本では7から2へ大幅に縮小しており、米国も3-4近辺で、インフレとは程遠い。It is true that right now, we have government expenditure backed by huge sovereign issuance that is almost 20% of GDP as well as base money increase from JPY100tr to JPY500tr since Lehman shock. However the growth of money supply since Lehman shock is mild from JPY700tr up to JPY1300tr with multiplier reduction from 7 down to 2. US multiplier is around 3-4 that is far from inflation. 

やはり、全体的な急速な戻りには無理がありそうだ。イケイケどんどんの米国相場が大統領選でどうなるかも含めて、今後の大きな買い場を待ちたい。In conclusion, it look difficult for market for quick recovery as a whole. Let's wait for the next big chance to buy considering the GO-GO US market change by midterm election result.

ML5のFaceAPIをやってみた ML5 FaceAPI Trial

ML5のFaceAPIをやってみた

ML5 FaceAPI Trial


ML5にあった、顔のパーツをハイライトしてくれる面白いツール。Interesting tool on ML5 to detect parts of faces and highlight.

ブログに載せてみたJust tried to put it onto Blog

APIからは座標が出力されるため、いろいろな応用が利きそうだ。Coordination is output through API, so it can be applied to many ways. 

一案として、AI と「いないいないいないばー」をして、AGIへの夢に思いを馳せてみるのもいかがだろうか?Just as one idea, how about playing Peek-a-boo with AI to extend imagination beyond the dream of AGI?



Loading model...

2020年9月24日木曜日

ML5でBodyPixをやってみた! BodyPix on ML5 Works!

ML5でBodyPixをやってみた! BodyPix on ML5 Works!

ML5のGitHubライブラリ一覧を見た。Took a look at ML5 GitHub libraries at a glance. 

数多くのアプリがAPIのように入っていて、簡単に再利用できる。There are so many applications there like API and are easily reusable. 

その中から今日はBodyPixをブログにセットしてみた。Today, I picked BodyPix and set it up to this blog. 

BodyPixは入力された人間の像を、体の部位ごとに色分けして表示する。プログラムはこちら。BodyPix classify the parts of body and colors. Program is here. 

Loading model...

2020年9月23日水曜日

ML5で簡単PoseNet(姿勢認識)Easy PoseNet by ML5

ML5で簡単PoseNet(姿勢認識)

Easy PoseNet by ML5

PoseNetという姿勢を検知する定番のAIがある。There is a standard AI called PoseNet to detect posture. 

まともにプログラミングするとかなり大変だ。It is very hard to program from scratch. 

しかしML5というTensorFlow系のAI啓蒙慈善組織が、親切にもこれを簡単にするライブラリを作成し公表してくれている。However, TensorFlow stream AI educational charity organization called ML5 is kindly releasing public library

このライブラリを用いて作成されたPoseNetが、サンプルで載せられていたので、今回BlogSpot版にしてみた。A sample PoseNet was presented there making use of the library, so this time I put together into BlogSpot version

ML5はYoloMobileNetで利用した。ただ、コールバックのスタイルが制御をML5に渡している形式なのでしばらく敬遠していたが、この簡単さは制御を渡して余りあるだろう。I used ML5 for Yolo and MobileNet. However I stayed away from it for a while since it works in callback form handing over control to ML5 however, its utility may worth more than handing over control.

PoseNet example using p5.js

Loading model...

2020年9月20日日曜日

何故ハイパーインフレは起っていないか? Why Hyper Inflation Is Not Happening?

 何故ハイパーインフレは起っていないか? 

Why Hyper Inflation Is Not Happening?


 QE以降の中央銀行のバランスシートの増大は著しい。日本ではアベノミクス開始以来だ。We see significant inflation of central bank size since QE(Quantitative Easing). In Japan, it is so since Abenomics started. 


そしてまた、コロナ支援でさらに増大する様相だ。And now it expands more as we have government aids for Covid-19.


前代未聞のこの実験的施策の副作用については以前から百家争鳴だ。ハイパーインフレを招く、いや、MMTなので問題ない等々。There has been thousands of theories coming up regarding the side effects of these experimental unprecedented monetary policy.  Some say it invites hyper-inflation, other says no issue since it is MMT, etc, etc. 

実際のところ、どうなのだろうか。米国、日本、ユーロ圏は本当にハイパーインフレに陥ってしまうのだろうか?What will be the reality of this? US, Japan and Europe will really dive into the hyper-inflation? 


でも、中央銀行のバランスシートをよく見るとその心配はなさそうだ。それは、中央銀行が負債の当座預金(銀行預金)が逃げ出さないように維持管理しているからだ。ちなみに政府預金66兆円はここ数か月で増えたコロナ対策資金のようだ。 But as far as we see the central bank's balance sheet structure, no need to worry such. This is because central banks are managing to bank deposit to stay on credit side as it is, but never run away. For information, JPY66tr government deposits are Covid-19 aids generated for the last several months.

「もし、当座預金が日銀のバランスシートからネットで逃亡を始めたら」と心配する人もいるだろう。実はそれが、最も重大なリスクであり、そうなると、日銀は日銀券を発行せざる負えなくなり、本当のハイパーインフレの種を撒いてしまうことになる。Some may worry 'what if current deposit run away as net from BOJ balance sheet'. In reality, it is the most serious risk, since if that happens, BOJ has no option but to issue central bank notes and can invite the seeds for real hyper inflation. 

そこで、以前にも示した上図の様に、マイナス金利政策で当座預金が逃げ出さないように囲い込んでいる訳だ。マイナス金利環境下で当座預金にプラス0.1%の付利を行えば、銀行にとって、マイナス金利で目減りするJGBを持っているより収益に貢献するからである。Hence as presented earlier, BOJ is confining current deposit by negative interest rate policy as in above picture. This works because earning plus 0.1% interest rate on current deposit under negative interest rate policy is better of than holding devaluing JGB under negative interest rate regime. 

これらのことは、以前、本ブログでも何回か触れたが、今回はこれをさらに深堀りしてみた。I touched on these couple of times in this blog however, this time I dig further into the nature of this problem. 


 実は、最終的な日銀のバランスシートを見ただけでは、JGBを購入する上の2つのケースのように、市場から資金を吸収して購入したのか(ケース1)、預金を設定してあげた見合いで購入したのか(ケース2)分からない。In reality, just by looking at the final balance sheet structure of BOJ, it is not clear whether the JGB was bought by absorbing money from market(case-1), or JGB was bought by creating deposit for seller(case-2). 
 ケース1の場合、増加したベースマネーは増えるが、その増分は市場から吸収したお金なので、通貨供給量は変化ない。Case-1 does not make any difference on money supply since base money increase is money absorbed from market. 
 ケース2の場合、ベースマネーはまるまる400兆円分増大し、「お金が刷られている」状態になるものの、「刷られたお金」が日銀のバランスシートの中にとどまっていれば、実体経済への影響はない。日銀のバランスシートは現状では実体経済にあまり関与していないからだ。In  the case-2, base money will increase for the whole amount of JPY400tr with 'money printing' status however, as long as 'printed money' stays within the BOJ balance sheet, there is no impact to the real economy. This is because, BOJ balance sheet is not really related to the real economy at this point. 


その証拠に、経済全体が動いているマネーサプライ(マネーストック)は上図のように1,300兆円であるのに対し、ベースマネーは500兆円と、半分以下だ。加えて、QEが始まる前はベースマネーは100兆円規模であった訳で、「実体経済は日銀のバランスシートの外で動いている」と考えるのが自然だ。通貨乗数は、リーマンショック前の7-8から2へ下がっている。総合すると実体経済に関与しているマネーサプライは実は減少傾向にある。As an evidence, the money supply(money stock) for the whole economy is around JPY1,300tr while base money is around JPY500tr, that is less than half. Also, before the QE, base money was only JPY100tr, hence it is natural to think that 'real economy is moving outside of BOJ balance sheet'.  Money Supply Multiplier has been going down from 7-8 down to 2 since Lehman Shock. In net, the money supply functioning in the real economy is on downtrend.

かくして、QEが始まって以来の異次元な中央銀行のバランスシートの構造は、ハイパーインフレが発生しないように設計、運営されている。As such, central bank's hyper balance sheet structure since QE started has been designed and managed avoiding hyper-inflation to happen. 

ただ、プライマリーバランスが一向にプラスにならず、国債残高が際限なく増えていく場合、国債を日銀が買い続けることは、劣化していく資産を通貨発行により購入し続けることを意味する。最悪の場合として、国家の信任の破綻の連鎖としてハイパーインフレが誘起されるシナリオも完全に否定はできない。Nevertheless, if primary balance never goes positive and if JGB balance keeps increasing infinite, keep purchasing JGB by BOJ means keep buying deteriorating asset by issuing currency. In a worst case scenario, the chance of hyper inflation as a chain reaction of collapse of national credit, cannot be denied 100%.



2020年9月18日金曜日

AI 株価予測 20200918 の状況8306MUFG Stock Price AI Forecast - 20200918 Status 8306MUFG

 AI 株価予測 20200918 の状況8306MUFG

Stock Price AI Forecast - 20200918 Status 8306MUFG



[前回予測20200911Previous forecast


注)この投稿はあくまで個人メモです。記事に基づく実際の投資は一切行わないでください。
Caution) This is only for my memo.  Never make any actual investment based on this post.

 新値更新は無いものの、上方ウエッジを構成している。銀行株と同様、高配当のバリュー株である商社セクターにバフェットが参入するなど、明るいニュースもあった。There was no change on three line break but creation of upper wedge. Some positive news was Warren Buffett's new investment on trading company sector with high dividend yield value stocks just like banking sector. 


市場全体も同様に上方ウエッジを構成しているが、104を切る円高進行により、足踏み状態だ。Market as a whole was also creating upper wedge however, due to JPY appreciation cutting 104, now looks stumbling. 



菅政権は構造改革実行を唱えている。総論としては皆賛成だが、各論ベースでは抵抗が大きいだろう。ただ、少子高齢化など、日本の閉塞感は高まる一方だ。Suga administration is shouting structural reform of Japan society. Just like as usual, people agree as a whole but will face huge resistance when it comes up to respective concrete agenda.  Meanwhile, Japan's dead end atmosphere keeps increasing more and more such as aging as well as low birth rate. 

コロナは、引き続き経済再開に連れて感染者が増加している。ワクチンが行き渡るまで、各自が最良だと考える方法で自衛するしかない。For Covid-19, number of infections has been increasing as Japan reopen the economy. Until all has appropriate vaccine, looks each needs to protect themselves by the best way for each. 


東京では、第二波の終息は経済再開によって終息しそうにない。下図は東京の感染者と死亡者の推移だ。検査数が増えたのか、弱毒化しているのか死亡率は劇的に低下してきている。For Tokyo, the 2nd wave looks persisting as we reopen the economy. Below is the transition of infection and death in Tokyo. The mortality has been decreasing drastically probably due to weakened toxicity or increase of number of infections. 




金融政策には大きな変更はない。 There is no major change on monetary policies. 




 

2020年9月14日月曜日

声でおしえるAI画像分類 Image AI Classifier, that Speaks

声でおしえるAI画像分類   

Image AI Classifier, that Speaks


Google のコードラボから、画像を見て、分類、結果をしゃべってくれるK近傍法によるAIを作ってみた。コードはこちら。From Google CodeLabo, made KNN AI to classify image and speak out the result. Code is here.

各分類ごとに読み方をローマ字で名前を入れる。デフォルトはグー チョキ パーだ。Input the name of each class in the fields below. Default is set as Goo, Choki and Paa, that is rock, scissors, paper in Japanese.

次に、カメラの前で、グーとチョキとパーを作り、確率が1になるまで、A、B、Cボタンをクリックする。Then make sign of each rock, scissors, paper in front of Camera and click corresponding A, B, C button until probability goes 1.

教育が完了すると、カメラの前でサインを作っただけで、グーかチョキかパーかをしゃべってくれる。サインだけでなく、写真とか、物とか、色々応用可能。Once training is done, just showing hand sign in front of Camera, computer speaks if it is rock, scissors, or paper. Application is not just limited to hand signs but pictures, objects etc. 

遊んでみてください! Enjoy this playground!



How do you want to call Class A? / 分類Aを何と呼ぶ?
How do you want to call Class B? / 分類Bを何と呼ぶ?
How do you want to call Class C? / 分類Cを何と呼ぶ?

2020年9月12日土曜日

グラフィックカードでAI高速化 AI Acceleration by Graphic Card

グラフィックカードでAI高速化

AI Acceleration by Graphic Card



お金をかければAIの高速化は容易だが、ここでは、ローコストでグラフィックボードによるAI高速化をやってみた。結果、YOLOが30-60倍ほど早くなった。The more you spend, the faster your AI will be however, here I tried AI acceleration by graphic board in low cost. As a result YOLO became 30-60 times faster.

数世代前のPC、MY29RA-9(Core2-Duo)の内臓グラフィックが暴走を始めた。Win10を再インストールしても症状が変わらないため、グラフィックカードで逃げられると思い、数世代前のグラフィックボードNVS315を準備した。My few generation old PC MY29RA-9(Core2-Duo)'s on-board-graphic just bricked. I did reinstall Win10 but no improvement, hence I installed few generation old graphic board NVS315 to bypass on-board graphic problem. 

ヤフオクでNVS315が700円、DMS-59/VGA変換ケーブル600円、合計1,300円。NVS315 costed JPY700, DMS-59/VGA conversion cable JPY600, total JPY1.3K(=US $12). Both auction price.

インターフェイスはPCI Express Gen I X 16。最初から正確に差し込むと認識せず。取り合いに問題あり。だましだまし挿入しないと認識しない。Interface is PCI Express Gen I X 16. PC did not recognize if I inserted the card solid precisely. Looks there is some connection issue.  However it worked eventually if I changed inserting angle couple of times. 

GPUを利用するには、chrome://settings/systemでハードウエアアクセラレーションをONにする。同時に、WDDMが2.1バージョンであることが必要。このためには、NVIDIAのサイトからドライバをインストールする。ドライバは3D関連を全部入れる。WebGLは3Dを使っていることが、GPUモニタで確認できる。To make use of GPU, need to turn on hardware acceleration at chrome://settings/system. At the same time it is required to have WDDM as version 2.1 or above. For that purpose, download driver from NVIDIA site.  Make sure to choose custom, all 3D related drivers. WebGL is using 3D that can be confirmed in performance monitor GPU section. 


また、Win10では、NV315のドライバが勝手に更新され、WDDMバージョンが1.0となってしまう。このためWin10デバイス自動更新を無効に設定する。Also in Win10, NVS315 drivers are reset automatic to change WDDM version down to 1.0. To avoid such, disable automatic device driver revision.

現状、Win10のv1909は問題リリースの模様。マイクロソフトのページからisoファイルを作るとv2004がダウンロードされてきた。Currently, Win10 v1909 looks problematic release. When I download iso from Microsoft page, it creates v2004 but not v1909.

2020年9月11日金曜日

AI 株価予測 20200911 の状況8306MUFG Stock Price AI Forecast - 20200911 Status 8306MUFG

 AI 株価予測 20200911 の状況8306MUFG

Stock Price AI Forecast - 20200911 Status 8306MUFG



[前回予測20200904Previous forecast


注)この投稿はあくまで個人メモです。記事に基づく実際の投資は一切行わないでください。
Caution) This is only for my memo.  Never make any actual investment based on this post.

新値は更新せず、よって予測に変化はない。 NYが急落したが、影響は今のところ軽微だ。 is no line break, hence there is no change on forecast. NY has gone down suddenly but impact to Japan market is minimal. 


8306MUFGはレンジ内で小動きに留まった。8306MUFG price moved slightly within the range.



状況に大きな変化はなく、相場は上昇を続けている。米国は中間選挙戦が激しさを増す中で、トランプの良くも悪くも現実適応的な株価優先の運営スタイルが明確になってきた。There is no major circumstantial changes and market keeps going up. In US, as midterm election campaign heats up, Trump's, reality-adaptive, stock price oriented management approach, whether good or bad, became distinct.

株式市場が先読みをしているとすると、トランプの再選を市場は見越しているのかもしれない。If stock market foresee the future, stock market may be foreseeing the re-election of Trump. 





2020年9月7日月曜日

HDD冷却ファンの劇的な効果 HDD Cooling Fan's Drastic Effect

冷却ファンの劇的な効果

HDD Cooling Fan's Drastic Effect  



HDDの温度が高い。CrystalDiskInfoの表示は50℃を超えて真っ赤だ。HDD's temperature has gone up. CrystalDiskInfo shows red over 50C.

HDDの温度が50℃を超えると寿命が大幅に短くなるみたい。Looks HDD's life goes much much shorter if temperature goes over 50C. 

どうやって冷却しよう?ファン?ヒートシンク?How can I cool it down? Fan? Heatsink? 

ジャンク箱からコネクタを切断したファンが数個あった。I dig into junk box and found couple of used FANs with no connectors.

必要電源は12V。PC電源の不使用のFDD4ピンコネクタ(下図)にリード線を剥いて直接差し込みテープ固定(上図)。固定はちょうどいい大きさの穴が開いていたので一か所だけボルト固定。Power required is 12V. I inserted stripped cable ends directly into the unused FDD4Pin power connector(as below picture) directly, then covered by tape(as above picture). For body support, found conveniently opened hole where I bolted up(as below picture). 



結果、50℃を超えていたHDD温度は、めでたく45℃程度になりました。As a result, HDD temperature exceeding 50C is now happily moving around 45C. 

ジャンク部品で5℃程度の冷却効果達成!5C temperature reduction has achieved by junk parts! 


2020年9月5日土曜日

AI 株価予測 20200904 の状況8306MUFG Stock Price AI Forecast - 20200904 Status 8306MUFG

AI 株価予測 20200904 の状況8306MUFG
Stock Price AI Forecast - 20200904 Status 8306MUFG



[前回予測20200828Previous forecast


注)この投稿はあくまで個人メモです。記事に基づく実際の投資は一切行わないでください。
Caution) This is only for my memo.  Never make any actual investment based on this post.

新値は更新せず、よって予測に変化はない。 市場全体は、阿部辞任ショックを1日で戻し、NYに連れ高した。週末のNYの急落の影響は小さい。There is no line break, hence there is no change on forecast. Market filled drop due to Abe resignation in one day, then gone up with NY. Drop of NY close to weekend had smaller impact on Japan market. 


MUFGはレンジで推移している。下降トレンドラインは破ったがあまり強い動きではない。MUFG price is moving within the range. It broke downtrend upper resistance but no really strong momentum. 


世界は治療薬やワクチンを待たずして経済再開に走っている。戻りすぎた株価が調整するかどうか、巨額の政府支出の影響が取りざたされている。World is heading for reopening of economy without waiting for "official" therapeutics or vaccines. People are discussing if too well bounced backed stock will dive once more, as well as the impact of massive government expenditure.