diff --git a/README.md b/README.md index 997827360603b932c53e3614d47e43cf473cbbe9..da6aa7385fe2b637ec03e38f9c33c5805391e7ad 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ PaddleHub是基于PaddlePaddle生态下的预训练模型管理和迁移学习 * [回归任务](https://github.com/PaddlePaddle/PaddleHub/tree/release/v1.2/demo/sentence_similarity) * [句子语义相似度计算](https://github.com/PaddlePaddle/PaddleHub/tree/release/v1.2/demo/sentence_similarity) * [阅读理解任务](https://github.com/PaddlePaddle/PaddleHub/tree/release/v1.2/demo/reading-comprehension) +* PaddleHub支持超参优化(Auto Fine-tune),给定Finetune任务运行脚本以及超参搜索范围,Auto Fine-tune即可给出对于当前任务的较佳超参数组合。 + * [PaddleHub超参优化功能autofinetune使用教程](https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.2/tutorial/autofinetune.md) * PaddleHub引入『**模型即软件**』的设计理念,支持通过Python API或者命令行工具,一键完成预训练模型地预测,更方便的应用PaddlePaddle模型库。 * [PaddleHub命令行工具介绍](https://github.com/PaddlePaddle/PaddleHub/wiki/PaddleHub%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7) @@ -105,8 +107,6 @@ PaddleHub如何自定义迁移任务,详情参考[wiki教程](https://github.c 如何使用PaddleHub超参优化功能,详情参考[autofinetune使用教程](https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.2/tutorial/autofinetune.md) -如何使用PaddleHub“端到端地”完成文本相似度计算,详情参考[word2vce使用教程](https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.2/tutorial/sentence_sim.ipynb) - 如何使用ULMFiT策略微调PaddleHub预训练模型,详情参考[PaddleHub 迁移学习与ULMFiT微调策略](https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.2/tutorial/strategy_exp.md) ## FAQ diff --git a/docs/imgs/pbt_optimization.gif b/docs/imgs/pbt_optimization.gif new file mode 100644 index 0000000000000000000000000000000000000000..a9bdc8694fe5ee2e7ee088fce1d05eb310aa54ab Binary files /dev/null and b/docs/imgs/pbt_optimization.gif differ diff --git a/docs/imgs/thermodynamics.gif b/docs/imgs/thermodynamics.gif new file mode 100644 index 0000000000000000000000000000000000000000..c367c80b9e805447ceaac18b00cb061b81399b2e Binary files /dev/null and b/docs/imgs/thermodynamics.gif differ diff --git a/paddlehub/common/lock.py b/paddlehub/common/lock.py index ea44f0a36a1e49752fb5e123d34ecaaa71771bf5..814b834f20d2f8008069aafdc52564e4a3453537 100644 --- a/paddlehub/common/lock.py +++ b/paddlehub/common/lock.py @@ -1,5 +1,6 @@ -import fcntl import os +if os.name == "posix": + import fcntl class WinLock(object): @@ -15,23 +16,22 @@ class Lock(object): _owner = None def __init__(self): - self.LOCK_EX = fcntl.LOCK_EX - self.LOCK_UN = fcntl.LOCK_UN - self.LOCK_TE = "" if os.name == "posix": self.lock = fcntl else: self.lock = WinLock() _lock = self.lock + self.LOCK_EX = self.lock.LOCK_EX + self.LOCK_UN = self.lock.LOCK_UN def get_lock(self): return self.lock def flock(self, fp, cmd): - if cmd == fcntl.LOCK_UN: + if cmd == self.lock.LOCK_UN: Lock._owner = None self.lock.flock(fp, cmd) - elif cmd == fcntl.LOCK_EX: + elif cmd == self.lock.LOCK_EX: if Lock._owner is None: Lock._owner = os.getpid() self.lock.flock(fp, cmd) diff --git a/tutorial/autofinetune.md b/tutorial/autofinetune.md index a22f3f279a984135be680029b87809514fda4b52..4fbe8f1fd514e1369f227737d36d40a727b78b10 100644 --- a/tutorial/autofinetune.md +++ b/tutorial/autofinetune.md @@ -8,11 +8,17 @@ PaddleHub Auto Fine-tune提供两种超参优化策略: * HAZero: 核心思想是通过对正态分布中协方差矩阵的调整来处理变量之间的依赖关系和scaling。算法基本可以分成以下三步: 采样产生新解;计算目标函数值;更新正态分布参数。调整参数的基本思路为,调整参数使得产生更优解的概率逐渐增大。优化过程如下图: -![贝叶斯优化过程](https://raw.githubusercontent.com/PaddlePaddle/PaddleHub/release/v1.2/docs/imgs/bayesian_optimization.gif) +
+
+
+
+