Skip to content

JA: Add ja/lite/microcontrollers/get_started.md#123

Merged
lamberta merged 5 commits into
tensorflow:masterfrom
zinziroge:zinziroge_ja_microcontroller__get_started
Apr 6, 2020
Merged

JA: Add ja/lite/microcontrollers/get_started.md#123
lamberta merged 5 commits into
tensorflow:masterfrom
zinziroge:zinziroge_ja_microcontroller__get_started

Conversation

@zinziroge
Copy link
Copy Markdown
Contributor

@zinziroge zinziroge requested a review from lamberta as a code owner March 15, 2020 08:12
@tfdocsbot
Copy link
Copy Markdown
Collaborator

Reviewers added, please take a look.
@ohtaman, @sfujiwara, @masa-ita, @AseiSugiyama, @yukinagae, @nuka137, @chie8842, @kiszk

When your review is finished, approve the pull request or include "LGTM" in your comment.

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no CLA has not been signed label Mar 15, 2020
@zinziroge
Copy link
Copy Markdown
Contributor Author

@googlebot I signed it!

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes CLA has been signed and removed cla: no CLA has not been signed labels Mar 15, 2020
マイクロコントローラ向けTensorFlow Liteの使い方の基本を実演します。

* [Micro speech](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples/micro_speech) -
マイクロフォンで音声を取り込み、"yes"と"no"という単語を検出します。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion] 音声 ->

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

[Hello World](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples/hello_world)
アプリケーション例を始めから終わりまで見ていきます。

## Hello World サンプル
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion] サンプル -> の例

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

## Hello World サンプル

この例はマイクロコントローラ向けTensorFlow Liteの使い方の基本を実演します。
モデルの訓練、TensorFlow Liteと共に使うためのモデル変換、
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion] モデルの訓練 -> モデルの訓練から
The invention is to want to represent that 始めから終わりまでのワークフロー includes 訓練, 変換, and 実行.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

Comment on lines +99 to +102
* [`schema_generated.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/schema/schema_generated.h)
TensorFlow Lite [`FlatBuffer`](https://google.github.io/flatbuffers/) モデルファイルフォーマットのスキームを含みます。
* [`version.h`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/version.h)
TensorFlow Lite スキームへのバージョン情報を提供します。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] スキーム -> スキーマ

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.


### モデルをインクルードする

マイクロコントローラ向けTensorFlow Lite インタープリタは、モデルがC++配列で提供されることを期待しています。*Hellow World* サンプルでは、モデルは `sine_model_data.h` と `sine_model_data.cc` で定義されています。ヘッダーは以下の行に含まれます。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion] 行に -> 行で

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.


### ログ取得を用意する

ログ取得の準備するために、`tflite::ErrorReporter` ポインタが作成され、ポインタは `tflite::MicroErrorReporter` インスタンスに対して使用されます。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] 準備する -> 準備をする

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion]

`tflite::ErrorReporter` ポインタが作成され、ポインタは `tflite::MicroErrorReporter` インスタンスに対して使用されます。

->

`tflite::MicroErrorReporter` インスタンスへのポインタを使って、`tflite::ErrorReporter` ポインタが作成されます。 

or

`tflite::MicroErrorReporter` インスタンスへのポインタを持つ、`tflite::ErrorReporter` ポインタが作成されます。 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your 2nd suggestion.

Copy link
Copy Markdown
Contributor

@AseiSugiyama AseiSugiyama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your great work! Could you check the followings?

  • This PR contains untranslated files build_convert.md, index.md, and library.md. Could you remove these files from this PR?
  • I reviewed your PR. Could you check it, please?


* [Arduino Nano 33 BLE Sense](https://store.arduino.cc/usa/nano-33-ble-sense-with-headers)
(Arduino IDEを使います)
* [SparkFun Edge](https://www.sparkfun.com/products/15170) (ソースから直接ビルドします)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice translation 👍


## サポートされているデバイスを入手する

この案内書にしたがっていくには、サポートされたハードウェアデバイスが必要です。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion]

Suggested change
この案内書にしたがっていくには、サポートされたハードウェアデバイスが必要です。
このガイドにしたがっていくには、サポートされたハードウェアデバイスが必要です。

I think ガイド is better than 案内書 or 手順書 to be consistent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

## サポートされているデバイスを入手する

この案内書にしたがっていくには、サポートされたハードウェアデバイスが必要です。
使用するアプリケーション例は下記デバイスで検証されています。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion]

Suggested change
使用するアプリケーション例は下記デバイスで検証されています
使用するサンプルのアプリケーションは下記デバイスで検証されています

At the following, examples is translated サンプル. So it seems to be better to use the word サンプル here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.


## サンプルを探索する

マイクロコントローラ向けTensorFlow Liteはいくつかのアプリケーション例が付属しており、
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion]

Suggested change
マイクロコントローラ向けTensorFlow Liteはいくつかのアプリケーション例が付属しており
マイクロコントローラ向けTensorFlow Liteにはいくつかのサンプルのアプリケーションが付属しており

Same as above, I guess it is better to translate example into サンプル.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

## サンプルを探索する

マイクロコントローラ向けTensorFlow Liteはいくつかのアプリケーション例が付属しており、
それらはさまざまなタスクの使い方を実演します。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion]

Suggested change
それらはさまざまなタスクの使い方を実演します
それらはさまざまなタスクへの適用の仕方を実際の例によって示します

I think the words "its use" means "how to use TensorFlow Lite" not "how to use tasks". How about this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your suggestion is right.

```

`AllOpsResolver` は、マイクロコントローラ向けTensorFlow Liteで利用可能なすべての演算を読み込み、それは多くのメモリを使用します。
与えられたモデルはこれら演算の一部のみを使用するであろうから、現実のアプリケーションは必要な演算のみを読み込むことが推奨されます。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion]

Suggested change
与えられたモデルはこれら演算の一部のみを使用するであろうから、現実のアプリケーションは必要な演算のみを読み込むことが推奨されます
通常、モデルが必要とするのはこれらの演算のうちの一部のため、現実世界に適用する際には必要な演算のみを読み込むことが推奨されます

I think the words real world application means implementation into the real world or deploying it into a production environment (not software). How do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your suggestion is right.

Comment on lines +219 to +220
// それは次元ごとに1つの要素を持つ。我々の入力は2次元のテンソルで1つの要素を含むので、
// "dims" は2であるべきである。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by these two lines 🤔 In this Jupyter notebook , the input of the original model (x_test) has the shape (200, ) and this means x_test is a 1-D array. However, based on this document, the input of this model should have two dimensions.

I cannot find any description supports this claim. Let me check.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your translation has no problem and we have nothing to fix on this line. Since English documents are the "single source of truth", it is better to discuss at the tensorflow/tensorflow repo. I'll do that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this comment came from my misunderstanding. What I have to check truly is the input shape of sine_model, not the input of model_2 . Thank you for your suggestion!

モデルの出力テンソルは、`tflite::MicroIntepreter` 上で `output(0)` を呼ぶことで取得できます。
`0` は最初の(そして唯一の)出力テンソルであることを表します。

サンプルでは、モデルの出力は1つの2次元テンソルに含まれる1つの浮動小数点数です。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, I'm confused by this line too. IMO, the model's output seems to be 1D Tensor contains two elements 🤔

Copy link
Copy Markdown
Contributor

@AseiSugiyama AseiSugiyama Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, same as above, this comment came from my misunderstanding.


コードの残り部分は、モデルの読み込みと推論を実演します。

### ログ取得を用意する
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion]

Suggested change
### ログ取得を用意する
### ログ取得を準備する

I guess this seems to be better to be consistent with the next line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.


### ログ取得を用意する

ログ取得の準備するために、`tflite::ErrorReporter` ポインタが作成され、ポインタは `tflite::MicroErrorReporter` インスタンスに対して使用されます。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggeston]

Suggested change
ログ取得の準備するために`tflite::ErrorReporter` ポインタが作成され、ポインタは `tflite::MicroErrorReporter` インスタンスに対して使用されます
ログ取得の準備をするために`tflite::MicroErrorReporter` インスタンスのポインタを用いて `tflite::ErrorReporter` ポインタが作成されます

I think tflite::ErrorReporter is an abstract class and tflite::MicroErrorReporter is one of implementations of it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this(#123 (comment)) sugession .

uint8_t tensor_arena[tensor_arena_size];
```

要求される大きさは使用するモデルに依存し、実験によって決められる必要があるかもしれません。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion]

Suggested change
要求される大きさは使用するモデルに依存し、実験によって決められる必要があるかもしれません
要求される大きさは使用するモデルに依存し、実験によって決める必要があるかもしれません

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

このテンソルを検証し、形と型が期待したものであることを確認します。

```C++
// 入力は期待するプロパティを持つこと確認する
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion]

Suggested change
// 入力は期待するプロパティを持つこと確認する
// 入力は期待するプロパティを持つことを確認する

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

TF_LITE_MICRO_EXPECT_NE(nullptr, input);
// プロパティ "dims" はテンソルの形を教えてくれる。
// それは次元ごとに1つの要素を持つ。我々の入力は2次元のテンソルで1つの要素を含むので、
// "dims" は2であるべきである。
Copy link
Copy Markdown

@kiszk kiszk Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion]

Suggested change
// "dims" は2であるべきである
// "dims" の数は2であるべきである

or "dims" の次元数は2であるべきである。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your 2nd suggestion.

TF_LITE_MICRO_EXPECT_EQ(kTfLiteFloat32, input->type);
```

enum値 `kTfLiteFloat32` は、TensorFlow Lite のデータ型の一つへの参照であり、
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[weak suggestion]

Suggested change
enum値 `kTfLiteFloat32` は、TensorFlow Lite のデータ型の一つへの参照であり
enum値 `kTfLiteFloat32` は、TensorFlow Lite のデータ型のうちの一つへの参照であり

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

この単体テストを一度ひととおり読み終えたら、
[`main_functions.cc`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/examples/hello_world/main_functions.cc)
にあるサンプルアプリケーションのコードを理解できるはずです。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] delete this blank line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.


ライブラリがさまざまなモデルやアプリケーションと共にどのように利用できるかを知るためには、ほかのサンプルをデプロイし、そのコードを初めから終わりまで見てみることをお薦めします。

<a class="button button-primary" href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples">Githubのサンプルアプリケーション</a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion]

Suggested change
<a class="button button-primary" href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples">Githubのサンプルアプリケーション</a>
<a class="button button-primary" href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples">GitHubのサンプルアプリケーション</a>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used your suggestion.

* deleted untranslaed files
@AseiSugiyama
Copy link
Copy Markdown
Contributor

@zinziroge Great work! LGTM!

@tfdocsbot tfdocsbot added the lgtm Community-added approval label Apr 5, 2020
@zinziroge
Copy link
Copy Markdown
Contributor Author

thank for reviewing, @AseiSugiyama @kiszk !!

Copy link
Copy Markdown
Member

@lamberta lamberta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the translation and review! 🚀

@lamberta lamberta merged commit 7b78a6f into tensorflow:master Apr 6, 2020
@zinziroge zinziroge deleted the zinziroge_ja_microcontroller__get_started branch June 4, 2020 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes CLA has been signed ja lgtm Community-added approval translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants