網頁

2019年5月29日 星期三

吳恩達深度學習課最新補充教程:交互式demo助你輕鬆理解神經網絡初始化

初始化對 深度神經網絡 收斂有重要影響。優秀的初始化模式可以加速訓練,但是需要小心操作以避免常見的陷阱。deeplearning.ai 最新上線了 AI Notes 欄目,以長文的形式作爲《 深度學習專項課程》的補充。其具備交互式的 demo,有助於讀者輕鬆掌握 深度學習基礎概念。AI Notes 的第一篇教程就是「初始化 神經網絡」。

2019年5月25日 星期六

Genetic algorithms, part I

人們常常將人工智能的整體概念與更具體的術語“機器學習”或“深度學習”混為一談。 重要的是要了解任何AI模型的差異和局限,以便您了解它們的能力以及在哪裡有效地應用它們。 考慮到這一點,我們將轉向一種新的AI算法:遺傳演算法(GA)。

2019年5月16日 星期四

All you need to know about Support Vector Machines

SVM是一種簡單的分類演算法,每個機器學習從事者都應該在他們的工具箱中使用。 讓我們首先了解它是如何工作的,然後看看它的優點和缺點。



Python Class

Python是一種物件導向的程式語言(OOPS)。 這意味著,python中的所有內容都是某些class的object或instance,簡單來說,Python class是一種object的藍圖, 或者說它是初始化variables,定義methods,static methods,class methods等組合而成。在本文中,我們將展示如何在Python中創建class,創建class的object或instance,修改object,刪除object或instance。

2019年5月13日 星期一

2019年5月6日 星期一

Mac Keras+RDKit

因為tensorflow安裝以及RDKit利用Homebrew安裝都是呼叫同一個呼叫/usr/local/bin裡的python3,所以使用這兩個函式庫之前要先輸入

$ which python3

來確認是否呼叫正確位置的python3。不是的話,由於先前安裝RDKit時,有設定"export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH"在~/.bash_profile,因此輸入

$ source ~/.bash_profile

再確認python3是否更改為"/usr/local/bin/python3"


2019年5月4日 星期六

ValueError: Object arrays cannot be loaded when allow_pickle=False

Using TensorFlow backend.
Traceback (most recent call last):
  File "test_keras.py", line 13, in <module>
    (X_train, y_train), (X_test, y_test) = imdb.load_data(num_words=top_words)
  File "/usr/local/lib/python3.6/site-packages/keras/datasets/imdb.py", line 59, in load_data
    x_train, labels_train = f['x_train'], f['y_train']
  File "/usr/local/lib/python3.6/site-packages/numpy/lib/npyio.py", line 262, in __getitem__
    pickle_kwargs=self.pickle_kwargs)
  File "/usr/local/lib/python3.6/site-packages/numpy/lib/format.py", line 692, in read_array
    raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False


numpy版本不符合當前代碼,更新Numpy版本1.16.3,導致加載數據過程中出錯,

$ pip install numpy==1.16.2

參考
https://www.twblogs.net/a/5cc61956bd9eee1ac2ed4944

Xcode version must be specified to use an Apple CROSSTOOL

ERROR: /private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/external/local_config_cc/BUILD:58:5: in apple_cc_toolchain rule @local_config_cc//:cc-compiler-armeabi-v7a: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler-armeabi-v7a' failed; build aborted
INFO: Elapsed time: 0.242s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (5 packages loaded, 48 targets configured)
    currently loading: tensorflow/core ... (2 packages)

$ bazel clean --expunge
$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
$ sudo xcodebuild -license
$ bazel clean --expunge

Mac Python3.7.3切換3.6.5_1

$ brew unlink python

安裝3.6.5
$ brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

$ brew switch python 3.7.3

$ brew switch python 3.6.5_1



參考
https://stackoverflow.com/questions/51726203/installing-python3-6-alongside-python3-7-on-mac

2019年5月3日 星期五

Executing genrule //tensorflow:python_api_gen failed (Exit 1) bash failed: error executing command /bin/bash -c ...

ERROR: /Users/yangyan-ling/tensorflow/tensorflow/BUILD:541:1: Executing genrule //tensorflow:python_api_gen failed (Exit 1) bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/sandbox/darwin-sandbox/5695/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api.runfiles/org_tensorflow/tensorflow/tools/api/generator/create_python_api.py", line 27, in <module>
    from tensorflow.python.util import tf_decorator
  File "/private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/sandbox/darwin-sandbox/5695/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 63, in <module>
    from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin
  File "/private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/sandbox/darwin-sandbox/5695/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api.runfiles/org_tensorflow/tensorflow/python/framework/framework_lib.py", line 52, in <module>
    from tensorflow.python.framework.importer import import_graph_def
  File "/private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/sandbox/darwin-sandbox/5695/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api.runfiles/org_tensorflow/tensorflow/python/framework/importer.py", line 27, in <module>
    from tensorflow.python.framework import function
  File "/private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/sandbox/darwin-sandbox/5695/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api.runfiles/org_tensorflow/tensorflow/python/framework/function.py", line 37, in <module>
    from tensorflow.python.ops import variable_scope as vs
  File "/private/var/tmp/_bazel_yangyan-ling/2ce5cc8600b6d4faf46244230a6eedc1/sandbox/darwin-sandbox/5695/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/tools/api/generator/create_python_api.runfiles/org_tensorflow/tensorflow/python/ops/variable_scope.py", line 24, in <module>
    import enum  # pylint: disable=g-bad-import-order
ImportError: No module named enum
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3067.684s, Critical Path: 183.55s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 5694 processes: 5691 darwin-sandbox, 3 local.
FAILED: Build did NOT complete successfully


$ pip install enum34
$ pip uninstall enum


參考
https://github.com/tensorflow/serving/issues/893

Python yaml

最近Yaml(YAML Ain’t a Markup Language)在python編程裡算是比較流行的配置項方法。主要是把變量寫進yaml做配置文件,然後python腳本從yaml文件裏面取得變量,用來表達資料序列的格式,讓程式可讀性變高,而且通過縮進表示結構,這一點與python不謀而合。

Mac install tensorflow-1.9.0+Keras

官方版的安裝對Mac有許多限制,如果不想利用虛擬環境跑TensorFlow的話,以下是安裝流程。

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


參考
https://vyspiansky.github.io/2018/09/28/xcodebuild-requires-xcode/

Reaxys

https://www.reaxys.com/#/search/quick

深度學習在藥物發現領域的興起

http://www.ifuun.com/a2018053013535954/

ECFP

http://fantom-zona.hatenablog.com/entry/2018/03/24/075741
https://programtalk.com/python-examples/deepchem.feat.CircularFingerprint/
https://www.getit01.com/p20190219352046137/
https://blog.csdn.net/weixin_41171061/article/details/83746038

RDKit:Chemical Fingerprinting

https://blog.csdn.net/u012325865/article/details/81784517

TensorFlow2.0中文教程

http://bangqu.com/48ce39.html