<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cong</title>
    <description>The latest articles on DEV Community by Cong (@vochicong).</description>
    <link>https://dev.to/vochicong</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F116564%2Fde002e45-4275-43e1-86e0-f06e7481eee6.jpeg</url>
      <title>DEV Community: Cong</title>
      <link>https://dev.to/vochicong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vochicong"/>
    <language>en</language>
    <item>
      <title>MLflowでらくらくなMLライフサイクル管理：前処理・機械学習・予測API一連化</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Mon, 17 Aug 2020 01:56:18 +0000</pubDate>
      <link>https://dev.to/vochicong/mlflow-ml-api-1cnj</link>
      <guid>https://dev.to/vochicong/mlflow-ml-api-1cnj</guid>
      <description>&lt;p&gt;MLflow で実験のパラメータ、メトリックや学習済みモデルの記録については、情報が豊富に見つかりますが、しかし前処理と学習・予測を一連の処理としてパイプライン化する、分かりやすい簡単なサンプルが見つからなかったので、作ってみました。&lt;/p&gt;

&lt;p&gt;よって、このサンプルでは、前処理と学習・予測のパイプライン化に重点を置きます。&lt;br&gt;
また、MLflowで簡単に予測サービス(REST)を立ち上げられることについても少し触れます。&lt;/p&gt;

&lt;p&gt;ソースコードはこちら&lt;br&gt;
&lt;a href="https://github.com/vochicong/h2o_mlflow"&gt;https://github.com/vochicong/h2o_mlflow&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  概要
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;データ: &lt;a href="https://web.stanford.edu/class/archive/cs/cs109/cs109.1166/stuff/titanic.csv"&gt;タイタニック号乗客の生存&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pandas.pydata.org/"&gt;Pandas&lt;/a&gt;で前処理&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html?highlight=automl"&gt;H2O AutoML&lt;/a&gt;で機械学習&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mlflow.org/docs/latest/models.html#example-saving-an-xgboost-model-in-mlflow-format"&gt;MLflow custom model&lt;/a&gt;で前処理と学習・予測をつなげる 🎶&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mlflow.org/docs/latest/models.html#deploy-mlflow-models"&gt;MLflow models serve&lt;/a&gt;で予測RESTサービス&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  開発環境の準備
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://docs.conda.io/en/latest/miniconda.html"&gt;Conda&lt;/a&gt;で環境作成&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;env &lt;/span&gt;update &lt;span class="nt"&gt;-f&lt;/span&gt; conda-dev.yml
conda &lt;span class="nb"&gt;env &lt;/span&gt;update &lt;span class="nt"&gt;-f&lt;/span&gt; h2o/conda.yaml

conda activate h2o_mlflow
python &lt;span class="nt"&gt;--version&lt;/span&gt; &lt;span class="c"&gt;# Python 3.8.5 など&lt;/span&gt;
java &lt;span class="nt"&gt;-version&lt;/span&gt; &lt;span class="c"&gt;# openjdk version "1.8.0_152-release" など&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  コード
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;main.py&lt;/code&gt; にコードが全部入っています。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Preproc: データ前処理のクラス

&lt;ul&gt;
&lt;li&gt;Age, Fareの Min-Maxスケーリング&lt;/li&gt;
&lt;li&gt;Pandas DataFrame から H2OFrame への変換　&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Learner: 機械学習のクラス&lt;/li&gt;
&lt;li&gt;Predictor: 予測専用のクラス&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;前処理・機械学習・テスト予測の実行&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;mlflow run h2o
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  予測APIサービスの起動
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;mlflow run&lt;/code&gt; コマンドが数分で終わると、予測APIの起動コマンド例が出力されるので、コピーして使えます。デフォルトで5000番ポートが使われます。&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/var/folders/j5/1fzcsqzd2_j1s3_5d3qm447h0000gn/T/tmpu_840dh5/main.model

mlflow models serve &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="nv"&gt;$MODEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  予測API用Dockerイメージ
&lt;/h2&gt;

&lt;p&gt;簡単に作れます&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;mlflow models build-docker &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="nv"&gt;$MODEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  予測APIテスト
&lt;/h1&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;pytest h2o/test_api.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;同じテストデータにしたして、APIを使って予測させる場合と、&lt;br&gt;
&lt;code&gt;main.py&lt;/code&gt; でモデルを直接ロードして予測させる場合とを比較して、&lt;br&gt;
同じ予測結果になることを確認します&lt;/p&gt;
&lt;h1&gt;
  
  
  参考）APIのJSON形式
&lt;/h1&gt;

&lt;p&gt;Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"columns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"x1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"x2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"x3"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
               &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
               &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Response（分類問題）&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"predict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"p0"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"p1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"predict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"p0"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"p1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>mlflow</category>
    </item>
    <item>
      <title>speedtest CLI</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Sat, 30 May 2020 01:44:03 +0000</pubDate>
      <link>https://dev.to/vochicong/speedtest-cli-27f0</link>
      <guid>https://dev.to/vochicong/speedtest-cli-27f0</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;brew tap teamookla/speedtest
brew update
brew &lt;span class="nb"&gt;install &lt;/span&gt;speedtest &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;ref: &lt;a href="https://www.speedtest.net/apps/cli"&gt;https://www.speedtest.net/apps/cli&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>To mount Google Cloud Shell home onto Mac</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Mon, 25 Nov 2019 14:26:34 +0000</pubDate>
      <link>https://dev.to/vochicong/to-mount-google-cloud-shell-home-onto-mac-551f</link>
      <guid>https://dev.to/vochicong/to-mount-google-cloud-shell-home-onto-mac-551f</guid>
      <description>&lt;p&gt;You can mount your Google Cloud Shell home onto your local filesystem in your Mac. First, &lt;a href="https://osxfuse.github.io/"&gt;install FUSE and SSHFS&lt;/a&gt;. Then run the command for the mounting point &lt;code&gt;~/my-cloud-shell&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bash -c "$(gcloud alpha cloud-shell get-mount-command ~/my-cloud-shell)"
ls ~/my-cloud-shell
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;More instructions are available at the &lt;a href="https://cloud.google.com/blog/products/gcp/introducing-the-ability-to-connect-to-cloud-shell-from-any-terminal"&gt;Google Cloud Blog&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Toward GCP Data Engineer certification</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Thu, 26 Sep 2019 01:31:32 +0000</pubDate>
      <link>https://dev.to/vochicong/toward-gcp-data-engineer-certification-119i</link>
      <guid>https://dev.to/vochicong/toward-gcp-data-engineer-certification-119i</guid>
      <description>&lt;p&gt;I've finished an advanced course on Coursera, namely &lt;a href="https://www.coursera.org/learn/preparing-cloud-professional-data-engineer-exam"&gt;Preparing for the Google Cloud Professional Data Engineer Exam&lt;/a&gt;. It helped me realize many useful options for GCP storages, databases, and ETL pipelines.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't expect to be taught the touchstone concepts here. The purpose of them in this course is to help you evaluate your preparedness. Seek training in the technical training courses, documentation, labs, and so forth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I didn't have enough time to learn through the corresponding &lt;a href="https://www.coursera.org/specializations/gcp-data-machine-learning"&gt;specialization&lt;/a&gt;. One author of the specialization is &lt;a href="https://twitter.com/lak_gcp"&gt;@lak_gcp&lt;/a&gt; and he has published 2 great books that cover a lot of the details I didn't know well&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learning.oreilly.com/library/view/data-science-on/9781491974551/"&gt;Data Science on the GCP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learning.oreilly.com/library/view/google-bigquery-the/9781492044451/"&gt;Google BigQuery: The Definitive Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For what was not clear enough, I went to the &lt;a href="https://cloud.google.com/solutions"&gt;GCP solutions&lt;/a&gt; and &lt;a href="https://hadoop.apache.org/docs/stable/"&gt;Apache Hadoop docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Halfway toward the Google certified Data Engineer exam, I'm reviewing the course contents one more time, jotting down important concepts and ideas.&lt;/p&gt;

</description>
      <category>gcp</category>
      <category>machinelearning</category>
      <category>bigdata</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Quicker Qwiklabs for GCP</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Sun, 07 Jul 2019 01:36:42 +0000</pubDate>
      <link>https://dev.to/vochicong/quicker-qwiklabs-for-gcp-580e</link>
      <guid>https://dev.to/vochicong/quicker-qwiklabs-for-gcp-580e</guid>
      <description>&lt;p&gt;GCP Qwiklabs don't record user information between learning sessions, forcing the user to type the same Bash commands or the same Python code in Jupyter notebooks again and again.&lt;/p&gt;

&lt;p&gt;For the Bash commands, you can save your typing by using a local GCloud SDK installation.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;After starting a Qwiklabs session, on local you also login using the new GCP credential created for that session.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud auth login
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then you can type the commands specified by the lab, and record the history, so that it will be much easier for you to use the same command later.&lt;/p&gt;

&lt;p&gt;For the Jupyter notebooks, I hope that they will find a way to save my work between sessions, or alternatively initialize each learning session with more proper data.&lt;/p&gt;

</description>
      <category>qwiklabs</category>
      <category>gcp</category>
    </item>
    <item>
      <title>Add a newline to Bash prompt</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Sat, 15 Jun 2019 11:23:27 +0000</pubDate>
      <link>https://dev.to/vochicong/add-a-newline-to-bash-prompt-1e0g</link>
      <guid>https://dev.to/vochicong/add-a-newline-to-bash-prompt-1e0g</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export PS1="$PS1\n\$ "
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zzf7N8Wm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8clbunosrtmlht230ub9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zzf7N8Wm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8clbunosrtmlht230ub9.png" alt="prompt"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>機械学習メモ</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Thu, 06 Jun 2019 01:27:35 +0000</pubDate>
      <link>https://dev.to/vochicong/-26c3</link>
      <guid>https://dev.to/vochicong/-26c3</guid>
      <description>&lt;p&gt;特に日本語と英語の用語対比&lt;/p&gt;

&lt;p&gt;随時更新、時々整理&lt;/p&gt;

</description>
      <category>memo</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>MiniKFでオンプレ機械学習基盤</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Wed, 05 Jun 2019 23:44:14 +0000</pubDate>
      <link>https://dev.to/vochicong/minikf-41pd</link>
      <guid>https://dev.to/vochicong/minikf-41pd</guid>
      <description>&lt;p&gt;&lt;a href="https://www.kubeflow.org/" rel="noopener noreferrer"&gt;Kubeflow&lt;/a&gt; とは &lt;a href="https://kubernetes.io/" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt; ベースの本格的な機械学習基盤です。Google に強力に推進されており、GCPには&lt;a href="https://deploy.kubeflow.cloud/#/" rel="noopener noreferrer"&gt;ワンプッシュ&lt;/a&gt;でデプロイできます。AWSやAzureにも当然設置可能です。&lt;/p&gt;

&lt;p&gt;今回は &lt;a href="https://www.kubeflow.org/docs/started/getting-started-minikf/" rel="noopener noreferrer"&gt;MiniKF&lt;/a&gt;の新登場で、普段の開発マシンやオンプレサーバに簡単に本格的な機械学習基盤 Kubeflow をインストールできるようになりました。&lt;/p&gt;

&lt;h1&gt;
  
  
  準備
&lt;/h1&gt;

&lt;p&gt;必要なもの&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vagrant&lt;/li&gt;
&lt;li&gt;VirtualBox&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Macの場合
&lt;/h2&gt;

&lt;p&gt;Brewを使うと楽勝です。&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew cask install vagrant virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Virtualboxのインストールが &lt;code&gt;The Installation Failed&lt;/code&gt; のエラーで失敗した場合は、Macの「セキュリティとプライバシ」の設定で、 "Oracle America, Inc." のソフトウェアを&lt;a href="https://medium.com/@DMeechan/fixing-the-installation-failed-virtualbox-error-on-mac-high-sierra-7c421362b5b5" rel="noopener noreferrer"&gt;許可&lt;/a&gt;してください。&lt;/p&gt;

&lt;h2&gt;
  
  
  Ubuntuの場合
&lt;/h2&gt;

&lt;p&gt;VirtualBoxは apt で入ります。&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install virtualbox
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;しかし、vagrant は apt で入るバージョンが古くて virtualbox に対応していないので、&lt;a href="https://www.vagrantup.com/downloads.html" rel="noopener noreferrer"&gt;ダウンロード&lt;/a&gt;してインストールしましょう。&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  MiniKF 起動・アクセス
&lt;/h1&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p ~/w/minikf
cd ~/w/minikf
vagrant init arrikto/minikf
vagrant up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;最初の up では、VMイメージのダウンロードに20分くらいかかりますが、VMの起動が終わったら次に MiniKFを起動&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vagrant ssh
minikf # vagrant 内
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;minikfコマンドが成功したら、&lt;br&gt;
Kubeflow 画面 &lt;a href="http://10.10.10.10:8080" rel="noopener noreferrer"&gt;http://10.10.10.10:8080&lt;/a&gt; &lt;br&gt;
へアクセスできるようになります。&lt;/p&gt;
&lt;h2&gt;
  
  
  Macの場合
&lt;/h2&gt;

&lt;p&gt;2019/06/06現在、VM内で &lt;code&gt;minikf&lt;/code&gt; コマンドが失敗に終わりました。&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;An unexpected exception has occured
Line: build/bdist.linux-x86_64/egg/rok_common/cmdutils.py:936
Type: CommandExecutionError
Reason: Command `&amp;lt;ExtCommand `systemctl start data.mount', status=FINISHED (ret: 1), PID=12176, shell=False&amp;gt;' failed: 'Job for data.mount failed. See "systemctl status data.mount" and "journalctl -xe" for details.\n'

The logfile `/home/vagrant/provision.log' may contain more information on this error, including a backtrace.

*** MiniKF provisioning tool terminated. Press Enter to restart, Ctrl-C to exit...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ubuntuなどオンプレサーバに入れた場合
&lt;/h2&gt;

&lt;p&gt;MacなどからSSHトンネルを接続していきましょう。&lt;br&gt;
サーバ &lt;code&gt;ai.local&lt;/code&gt; でMiniKFを動かしていたら、&lt;/p&gt;

&lt;p&gt;ssh -NL 8080:10.10.10.10:8080 ai.local &amp;amp;&lt;br&gt;
   open &lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;によって Kubeflow 画面にいけます。&lt;/p&gt;

&lt;h2&gt;
  
  
  URL、パスワード
&lt;/h2&gt;

&lt;p&gt;設定情報は本系ドキュメントで&lt;a href="https://www.kubeflow.org/docs/started/getting-started-minikf/" rel="noopener noreferrer"&gt;確認しましょう&lt;/a&gt;。 &lt;/p&gt;

&lt;h1&gt;
  
  
  GPU
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;MiniKF does not currently support GPU pass-through, but it is definitely in our immediate plans&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AS82eDLKDWSAFdCpjXanuWw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2AS82eDLKDWSAFdCpjXanuWw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GPUはまだサポートされていないのですが、直近の開発プランに&lt;a href="https://kubeflow.slack.com/archives/CGRKM3N0G/p1559146765015500" rel="noopener noreferrer"&gt;含まれている&lt;/a&gt;とのこと。&lt;/p&gt;

&lt;h1&gt;
  
  
  おわりに
&lt;/h1&gt;

&lt;p&gt;以上、本番で Kubeflow の運用を考えていたら、開発時に MiniKF を使って、本番と開発の差分を小さくしておきましょう。&lt;/p&gt;

&lt;p&gt;本記事は&lt;a href="https://medium.com/@vochicong/minikf%E3%81%A7%E3%82%AA%E3%83%B3%E3%83%97%E3%83%AC%E6%A9%9F%E6%A2%B0%E5%AD%A6%E7%BF%92%E5%9F%BA%E7%9B%A4-2604a992fd6" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;と&lt;a href="https://qiita.com/vochicong/items/0e0180a129f8c15d6a9c" rel="noopener noreferrer"&gt;Qiita&lt;/a&gt;からのクロスポストです。&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>kubeflow</category>
    </item>
    <item>
      <title>Ubuntu で日本語キーボード</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Fri, 29 Mar 2019 02:13:54 +0000</pubDate>
      <link>https://dev.to/vochicong/ubuntu-5b5j</link>
      <guid>https://dev.to/vochicong/ubuntu-5b5j</guid>
      <description>&lt;p&gt;Ubuntu 18.04 では比較的簡単に日本語入力の設定ができるのだが、キーボードレイアウトがUSのままだと、全角半角ボタンでIMEオンオフができなかったり、&lt;code&gt;@&lt;/code&gt; の場所が違ったりして使いづらいため、キーボードのレイアウトを日本語にしたい。&lt;/p&gt;

&lt;h2&gt;
  
  
  コンソールで使うキーボードの設定
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dpkg-reconfigure keyboard-configuration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Generic 105-key PC (intl.)&lt;/code&gt; → &lt;code&gt;Japanese&lt;/code&gt; → &lt;code&gt;Japanese&lt;/code&gt; → &lt;code&gt;The default for the keyboard layout&lt;/code&gt; → &lt;code&gt;No compose key&lt;/code&gt; → &lt;code&gt;Yes&lt;/code&gt; と入力する。&lt;/p&gt;

&lt;h2&gt;
  
  
  X(GUI)で使うキーボードの設定
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gnome-session-properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Add&lt;/code&gt; → &lt;code&gt;setxkbmap -layout jp&lt;/code&gt; → &lt;code&gt;Save&lt;/code&gt;&lt;br&gt;
ちなみに、&lt;code&gt;Caps Lock&lt;/code&gt;キーを&lt;code&gt;Ctrl&lt;/code&gt;として使いたければ&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;setxkbmap -layout jp -option ctrl:nocaps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tt3b73atgb6syoyu3md.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tt3b73atgb6syoyu3md.png" alt="Screenshot from 2019-03-27 12-06-49.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;なお &lt;code&gt;Ctr-Alt-F3&lt;/code&gt; でコンソールへ一時的に切り替えて、&lt;br&gt;
また &lt;code&gt;Ctr-Alt-F2&lt;/code&gt; でX GUIに戻ると、キーボードレイアウトが&lt;br&gt;
USになるバグがあるので、ターミナルに&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; setxkbmap -layout jp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;で解決。&lt;/p&gt;

&lt;h2&gt;
  
  
  キーボードレイアウトの確認
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ setxkbmap -print -verbose 10 | grep layout
layout:     jp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Ubuntuの設定ツールで見ると&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgo8fr6perhlj73agvkz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgo8fr6perhlj73agvkz5.png" alt="Japanese Keyboard layout"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>keyboard</category>
      <category>japanese</category>
      <category>日本語</category>
    </item>
    <item>
      <title>YaneuraOu NNUE-K-P-256-32-32用評価関数バイナリの使い方</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Thu, 17 Jan 2019 10:17:45 +0000</pubDate>
      <link>https://dev.to/vochicong/yaneuraou-nnue-k-p-256-32-32-47k5</link>
      <guid>https://dev.to/vochicong/yaneuraou-nnue-k-p-256-32-32-47k5</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://github.com/yaneurao/YaneuraOu/releases/tag/20190115_k-p-256-32-32"&gt;YaneuraOu NNUE-K-P-256-32-32用評価関数バイナリ nn.bin&lt;/a&gt;から
&lt;code&gt;20190115_k-p-256-32-32.zip&lt;/code&gt;と&lt;code&gt;Source code (zip)&lt;/code&gt;をダウンロードする。&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Source code (zip)&lt;/code&gt; を unzipし、sourceフォルダーに入る&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nnue/nnue_architecture.h&lt;/code&gt;の
#include "architectures/halfkp_256x2-32-32.h"
をコメントアウト。代わりに
#include "architectures/k-p_256x2-32-32.h"
とする。&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Makefile&lt;/code&gt; で &lt;code&gt;YANEURAOU_EDITION = YANEURAOU_2018_TNK_ENGINE&lt;/code&gt;を有効にする&lt;/li&gt;
&lt;li&gt; &lt;code&gt;make&lt;/code&gt; 実行し、実行バイナリ &lt;code&gt;YaneuraOu-by-gcc&lt;/code&gt; を作成&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mkdir -p eval&lt;/code&gt; の上、 &lt;code&gt;20190115_k-p-256-32-32.zip&lt;/code&gt;に含まれる &lt;code&gt;nn.bin&lt;/code&gt; を取り出して、 &lt;code&gt;eval&lt;/code&gt; フォルダーに置く&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>shogi</category>
      <category>engine</category>
      <category>nnue</category>
    </item>
    <item>
      <title>Computer Chess/Shogi links</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Thu, 17 Jan 2019 01:37:09 +0000</pubDate>
      <link>https://dev.to/vochicong/computer-chessshogi-links-1cfg</link>
      <guid>https://dev.to/vochicong/computer-chessshogi-links-1cfg</guid>
      <description>&lt;h2&gt;
  
  
  Howto
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://linuxfan.info/elmo-sdt5-on-linux"&gt;将棋ソフト「elmo」をLinuxにインストールする方法&lt;/a&gt; (Linux Fan)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://linuxfan.info/yaneuraou-on-linux"&gt;将棋ソフト「やねうら王」をLinuxで動かす方法&lt;/a&gt; (Linux Fan)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://linuxfan.info/tanuki-sdt5-on-linux"&gt;「平成将棋合戦ぽんぽこ」をLinuxにインストールする方法&lt;/a&gt;　(Linux Fan)&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://usapyon.game.coocan.jp/usapyon/HowToMakeShogiProgram.html"&gt;将棋プログラムの作り方&lt;/a&gt; (usapyon)&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://yaneuraou.yaneu.com/2018/12/30/nnue%E8%A9%95%E4%BE%A1%E9%96%A2%E6%95%B0%E3%81%AE%E5%AD%A6%E7%BF%92%E6%96%B9%E6%B3%95%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6/"&gt;NNUE評価関数の学習方法について&lt;/a&gt; (yaneuraou)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Engines
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/yaneurao/YaneuraOu"&gt;YaneuraOu mini&lt;/a&gt; is a shogi engine(AI player), stronger than Bonanza6 , educational and tiny code(about 2500 lines) , USI compliant engine , capable of being compiled by VC++2017&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/gunyarakun/python-shogi/blob/master/scripts/random_csa_tcp_match"&gt;gunyarakun/python-shogi&lt;/a&gt; A pure Python shogi library with move generation and validation and handling of common formats.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/niklasf/python-chess"&gt;niklasf/python-chess&lt;/a&gt; A pure Python chess library with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing and UCI/XBoard engine communication&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  評価関数
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://yaneuraou.yaneu.com/2019/01/15/%E3%83%95%E3%83%AD%E3%83%83%E3%83%94%E3%83%BC%E3%83%87%E3%82%A3%E3%82%B9%E3%82%AF%E3%81%AB%E5%8F%8E%E3%81%BE%E3%82%8B%E8%A9%95%E4%BE%A1%E9%96%A2%E6%95%B0%E3%83%90%E3%82%A4%E3%83%8A%E3%83%AA%E5%85%AC/"&gt;YaneuraOu フロッピーディスクに収まる評価関数バイナリ公開&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GUI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://shogigui.siganus.com/"&gt;ShogiGUI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://shogidokoro.starfree.jp/"&gt;将棋所&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  商品
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.jp/exec/obidos/ASIN/B07DL34R4W/aaaaab0c-22/ref=nosim/"&gt;マイナビ 将棋神 やねうら王&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.jp/%E3%83%9E%E3%82%A4%E3%83%8A%E3%83%93%E5%87%BA%E7%89%88-%E3%83%9E%E3%82%A4%E3%83%8A%E3%83%93-%E5%B0%86%E6%A3%8B%E3%83%AC%E3%83%9C%E3%83%AA%E3%83%A5%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3-%E6%BF%80%E6%8C%8714/dp/B017E0YOEG/ref=pd_sbs_65_2?_encoding=UTF8&amp;amp;pd_rd_i=B017E0YOEG&amp;amp;pd_rd_r=ed320813-1b0b-11e9-a286-1d00e8649e5f&amp;amp;pd_rd_w=osP7L&amp;amp;pd_rd_wg=tU31c&amp;amp;pf_rd_p=cda7018a-662b-401f-9c16-bd4ec317039e&amp;amp;pf_rd_r=TH4XXMG3PHXTVHE76KXX&amp;amp;psc=1&amp;amp;refRID=TH4XXMG3PHXTVHE76KXX"&gt;マイナビ 将棋レボリューション 激指14&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Protocols
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.computer-shogi.org/protocol/tcp_ip_server_112.html"&gt;CSA通信プロトコル&lt;/a&gt;: 第17回世界コンピュータ将棋選手権からこのプロトコルが必須。審判サーバを使用するサーバプロトコルと、審判サーバが利用できない場合の1対1プロトコルがあります。&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://hgm.nubati.net/usi.html"&gt;USIプロトコル&lt;/a&gt;: 将棋GUIと将棋エンジンを繋げて、棋譜解析、対局を行う｡&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Associations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.computer-shogi.org/"&gt;コンピュータ 将棋協会 (CSA)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wdoor.c.u-tokyo.ac.jp/shogi/floodgate.html"&gt;コンピュータ将棋連続対局場所 (floodgate)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lectures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://shogi.c.u-tokyo.ac.jp/news/"&gt;将棋で磨く知性と感性&lt;/a&gt; (東京大学教養学部前期課程全学体験ゼミ）&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>shogi</category>
      <category>chess</category>
      <category>programming</category>
    </item>
    <item>
      <title>Docker command to try the Ionic Preview app</title>
      <dc:creator>Cong</dc:creator>
      <pubDate>Tue, 08 Jan 2019 04:13:00 +0000</pubDate>
      <link>https://dev.to/vochicong/docker-command-to-try-the-ionic-preview-app-227</link>
      <guid>https://dev.to/vochicong/docker-command-to-try-the-ionic-preview-app-227</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm -p 8100:8100 --namionic node:8 bash -c \
  "git clone https://github.com/ionic-team/ionic-preview-app.git; cd ionic-preview-app &amp;amp;&amp;amp;\
  npm install &amp;amp;&amp;amp; npm install -g ionic &amp;amp;&amp;amp; ionic serve"

open http://localhost:8100
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

</description>
      <category>docker</category>
      <category>ionic</category>
    </item>
  </channel>
</rss>
