Vengineerの妄想(準備期間)

人生は短いけど、長いです。人生を楽しみましょう!

2019年7月の映画鑑賞

映画好きの戯言

 

16本、[ 162本:劇場:1本、DVD:36本、GYAO!:125本 ]

 

 

ミッシング・デイ(2014)/RECLAIM(GYAO!)
養子ビジネスは。。。

 


阪急電車 片道15分の奇跡(2011)(GYAO!)
なかなか良かったよ。

 

 

フィルス(2013)/FILTH(GYAO!)
ジェームズ・マカヴォイが超おっさんに見えたが、
この時すでに33歳だった。今年40歳か。。。ウォンテッド(2008)のイメージ(当時29歳)のインパクトが強すぎる。。ペネロピ(2006)にも出ていたんですね。気が付かなかったというより、クリスティナ・リッチしか観ていなかった

 

ANTIPORNO アンチポルノ(2016)(GYAO!)
よくわからない作品だった。

 

森山中教習所(2015)(GYAO!)
主演:野村周平だったんだ。 賀来賢人ばかり気になっていた。

 

蜘蛛の巣を払う女(2018)/THE GIRL IN THE SPIDER'S WEB(DVD)
ドラゴン・タトゥーの女」の最新作。女優さんクレア・フォイ(35歳)のお耳、どうなっているかを知りたい。

 

アナイアレイション -全滅領域-<未>(2018)/ANNIHILATION(DVD)
ナタリー・ポートマン主演だけど、日本では未公開作品。
エクス・マキナ(2015)アレックス・ガーランド監督・脚本作品。よくわからなかった。
28日後... (2002)、サンシャイン2057 (2007)(これもよくわかならなかった)、28週後... (2007)

 

 

クリード 炎の宿敵(2018)/CREED II(DVD)
ロッキーの宿敵のアポロの息子のお話?CREED IIということで、クリード チャンプを継ぐ男(2015)/CREED Iあった。後で観よう。

 

万引き家族(2018)/SHOPLIFTERS(DVD)
カンヌ国際映画祭2018年パルム・ドール受賞作品。あんな家族構成ありえないということで。

 

ヘアスプレー(2007)GYAO!
iPad 3のOSをアップデートしたら、GYAO!が見られるようになったので、かなり嬉しい。
iPadの解像度は2k以上だからね。
ミュージカル映画としては好きな作品。

 

黒執事(2014)(GYAO!)
このボーイッシュな剛力彩芽は、あまり可愛くないよ。

 

ハングリー・ラビット(2011)/SEEKING JUSTICE(GYAO!)
ニコラス・ケイジの得意なパターン。なんか見たことある作品。2015年1月に見ていた。

Efficientnet-EdgeTPU



Efficientnet-EdgeTPU are a family of image classification neural network models customized for deployment on Google Edge TPU. These networks are closely related to Efficientnets.

引用
    Efficientnet-EdgeTPU were developed using the AutoML MNAS framework by augmenting the neural network search 
    space with building blocks tuned to execute efficiently on the EdgeTPU neural network accelerator architecture. 

    The neural architecture search was incentivized to discover models that achieve low parameter footprint 
    and low latency on EdgeTpu, while simultaneously achieving high classification accuracy. 

    This neural architecture search produced a baseline model: edgetpunet-S, 
    which is subsequently scaled up using EfficientNet's compound scaling method to produce the M and L models.

とありますね。。。AutoML MNAS frameworkで開発されたんですね。。。

ResNet-50でのEdge TPUのLatencyの 53 ms に対して、Efficentnet-Edge TPU-S では 5ms と10倍速いと。。
そして、精度もいいと。。。

Efficentnet-Edge TPU-Lだと、Latencyは 25 ms 程度ですが、
精度は80%超えて、Inception-v4やInception-Resnet-2よりいいです。

Cloud TPU上で学習して、Post-training quantizationにて量子化して、Edge TPUで実行できるというのもいいですね。

Post-trainingquantizationは、July 2019 Updatesで対応できたんですからね。

Edge TPUの &quot;Usb.XXXX&quot;オプション


昨日のEdge TPU CompilerがUpdateの続き、

edgetpu.hを覗いてみたら、

NewEdgeTpuContextOpenDeviceのオプションに、"Usb.AlwaysDfu"と"Usb.MaxBulkInQueueLength"が追加されていました。
  // Same as above, but the created context is associated with the given device
  // type, path and options.
  //
  // Available options are:
  //  - "Performance": ["Low", "Medium", "High", "Max"] (Default is "Max")
  //  - "Usb.AlwaysDfu": ["True", "False"] (Default is "False")
  //  - "Usb.MaxBulkInQueueLength": ["0",.., "255"] (Default is "32")
  virtual std::unique_ptr<EdgeTpuContext> NewEdgeTpuContext(
      DeviceType device_type, const std::string& device_path,
      const DeviceOptions& options) = 0;

  // Same as above, but the specified options would used to create a new context
  // if no existing device is compatible with the specified type and path.
  //
  // If a device of compatible type and path can be found, the options could be
  // ignored. It is the caller's responsibility to verify if the returned
  // context is desirable, through #EdgeTpuContext::GetDeviceOptions().
  //
  // Available options are:
  //  - "Performance": ["Low", "Medium", "High", "Max"] (Default is "Max")
  //  - "Usb.AlwaysDfu": ["True", "False"] (Default is "False")
  //  - "Usb.MaxBulkInQueueLength": ["0",.., "255"] (Default is "32")
  virtual std::shared_ptr<EdgeTpuContext> OpenDevice(
      DeviceType device_type, const std::string& device_path,
      const DeviceOptions& options) = 0;

"Usb.AlwaysDfu"には、"True" or "False" が設定でき、デフォルト値は "False"
"Usb.MaxBulkInQueueLength"には、0~255を設定でき、デフォルト値は 32

この2つって、何を意味するのかな?

また、"Performace"って最初からあるオプションで、"Low", "Medium", "High", "Max"があって、デフォルト値は "Max"

これ、何か、変わるのかな???

Edge TPU CompilerがUpdate


6月3日のブログ、Google Edge TPUの offline compilerから約2か月

July 2019 Updates
  
   ・New on-device transfer learning APIs
   ・post-training quant support
   ・new TF Lite delegate


この中で、new TF Lite delegate が気になったので。。。

TensorFlow Liteの例題、load_image.py
    interpreter = Interpreter(model_path=args.model_file)

を

    interpreter = Interpreter(model_path=args.model_file,
    experimental_delegates=[load_delegate('libedgetpu.so.1.0')])

に変更するだけ、experimental_delegatesに、load_delegateにてライブラリを呼び出すだけ。。。

    from tensorflow.lite.python.interpreter import load_delegate

で、load_delegate を取り込めばいい。

おっと、なんだ、experimental_delegates なんか、無かったんだけどね。

interpreter.pyを見たら、追加されていたわ。。。
  def __init__(self,
               model_path=None,
               model_content=None,
               experimental_delegates=None):
    """Constructor.
    Args:
      model_path: Path to TF-Lite Flatbuffer file.
      model_content: Content of model.
      experimental_delegates: Experimental. Subject to change. List of
        [TfLiteDelegate](https://www.tensorflow.org/lite/performance/delegates)
        objects returned by lite.load_delegate().


@_tf_export('lite.experimental.load_delegate')
def load_delegate(library, options=None):
  """Returns loaded Delegate object.
  Args:
    library: Name of shared library containing the
      [TfLiteDelegate](https://www.tensorflow.org/lite/performance/delegates).
    options: Dictionary of options that are required to load the delegate. All
      keys and values in the dictionary should be convertible to str. Consult
      the documentation of the specific delegate for required and legal options.
      (default None)
  Returns:
    Delegate object.
  """

  # TODO(b/137299813): Fix darwin support for delegates.
  if sys.platform == 'darwin':
    raise RuntimeError('Dynamic loading of delegates on Darwin not supported.')

  try:
    delegate = Delegate(library, options)
  except ValueError as e:
    raise ValueError('Failed to load delegate from {}\n{}'.format(
        library, str(e)))
  return delegate

まだ、darwin ではサポートされていないけど、Delegateクラスを生成するだけ。。


  def __init__(self, library, options=None):
    """Loads delegate from the shared library.
    Args:
      library: Shared library name.
      options: Dictionary of options that are required to load the delegate. All
        keys and values in the dictionary should be serializable. Consult the
        documentation of the specific delegate for required and legal options.
        (default None)
    Raises:
      RuntimeError: 

のように定義されていて、library が 共有ライブラリ名、optionsはオプション。デフォルト値は、None。

    self._library = ctypes.pydll.LoadLibrary(library)

のように、共有ライブラリをロードして、optionsパラメータを使って、
共有ライブラリ内のtflite_plugin_create_delegateを呼びだせばいいんだね。

    self._delegate_ptr = self._library.tflite_plugin_create_delegate(
        options_keys, options_values, len(options), error_capturer_cb)

}}}
にあって、解放は

  def __del__(self):
    # __del__ can be called multiple times, so if the delegate is destroyed.
    # don't try to destroy it twice.
    if self._library is not None:
      self._library.tflite_plugin_destroy_delegate.argtypes = [ctypes.c_void_p]
      self._library.tflite_plugin_destroy_delegate(self._delegate_ptr)
      self._library = None

にあるように、tflite_plugin_destroy_delegateを呼び出せばいいと。。

つまり、
 ・tflite_plugin_create_delegate
 ・tflite_plugin_destroy_delegate

があれば、Delegate作れるんだね。

AlibabaがRISC-Vコア搭載SoCを



Alibabaの子会社 Pingtouge Semiconductor があったんだと思って、Google君に聞いたら、出てきました。


そう、また、自分のブログに教わりました。。。

Xuantie 910


 ・artificial intelligence (AI)
 ・5G
 ・internet of things (IoT)
 ・autonomous vehicle

 ・2.5GHz
 ・12nm process node
 ・12-stage out-of-order
 ・clusters of four, and up to four clusters

Pingtougeって、
引用
  which was established by Alibaba Group in September 2018 following the acquisition of C-Sky Microsystems, 
  also plans to release its code as open-source on GitHub, likely to be in September 2019.

キタよ。。。2019年9月にオープンソース化だって。

Mediumの記事、Alibaba Is Open-Sourcing Its Powerful New RISC-V Processor for 5G and AI
によると、
    Pingtouge is also putting significant research and development efforts into its embedded chip series CK902 
    and its neural network chip Ali-NPU, 
    and has pledged to produce a quantum computing chip in the next two to three years.

ToshibaがNVIDIAのNVDLAを使っていた


いつものように、Google君に聞いていたら、見つけた。東芝NVIDIAのNVDLAを使っていた


このホワイトペーパーでは、

    The purpose of this paper is to outline and discuss the issues that could be encountered 
    when using NVDLA for SoC implementation. 

    Issues such as limited support along with other potential pitfalls will be discussed. 
    Toshiba has implemented NVDLA and will reveal items learned as well as some results. 

ということのようです。

このブログでのNVDLAについては、2017年11月30日のNVIDIAのNVDLA、nvdlav1なので、2017-Q4はまだリリースされる前だったのかも。


NVIDIAのNVDLA経由で github を覗いてみたら、SWの更新されていました。

ToshibaのWhite Paperに書いてあるように、コンパイラなどはバイナリでの提供の模様です。

HWをオープンソースで公開しても、
それよりももっと大切なコンパイラは普通に考えてソースコードを公開することはないので。。

そういう意味でハードウェア開発だけしてもコンパイラが無いと作り込みが出来ないという例になっちゃうのかな?

ちょっと違うけど、RISC-Vはハードウェアとソフトウェアがオープンソースで公開されているので、
こちらは順調というか、ガンガン広がっているような気がするんだけど、どうなるのだろうかな?

A Hardware-Software Blueprint for Flexible Deep Learning Specialization



これ、VTAのバージョンアップの論文なのね。

 [v1] Wed, 11 Jul 2018 15:19:30 UTC (1,824 KB)
 [v2] Sun, 21 Apr 2019 03:51:47 UTC (480 KB)
 [v3] Tue, 23 Apr 2019 00:50:43 UTC (480 KB)

で、
v1での論文のタイトルは、VTA: An Open Hardware-Software Stack for Deep Learning だった。

v2での論文のタイトルも、VTA: An Open Hardware-Software Stack for Deep Learning

v3では、A Hardware-Software Blueprint for Flexible Deep Learning Specialization

しかしながら、PDFでは、
v2の時点で、A Hardware-Software Blueprint for Flexible Deep Learning Specializationになっています。

v2とv3ではそれほど差が無いようですね。2日違いなので、誤字脱字レベルなんでしょうね。。。

で、v1 と v2 をざっと比べたら、全然違う論文ですよ。読まないと。。。