Finisky Garden

NLP, 软件工程, 产品设计

Previously we talked about # How to Retry MongoDB Transaction. However, if you use BulkWrite() and one of the operation is retryable (e.g. duplicated key error), the new transactions API will retry the bulk write endlessly which might lead to server CPU 100%. (MongoDB Server v4.4.6-ent, MongoDB Driver v2.12.2)

To avoid such issue, we have three suggestions:

  • Add a cancellation token to limit the max retry time
  • Break the transaction after max retry count
  • Set BulkWriteOptions { IsOrdered = true }

The first two suggestions are also applicable to transactions which don't use BulkWrite().

阅读全文 »

Prompting is one of the hottest NLP techniques. This is a brief introduction to prompting by three questions: what's prompting, why prompting and how to prompting. As a brief introduction, we do not cover too much details but try to summarize the main idea of prompting. For more details, please refer to the original papers.

What's Prompting

I don't find a rigorous defintion for prompting. Just quoting some pieces from papers.

Users prepend a natural language task instruction and a few examples to the task input; then generate the output from the LM. This approach is known as in-context learning or prompting.

By: # Prefix-Tuning: Optimizing Continuous Prompts for Generation

This description brought two concepts: in-context learning and prompting.

Another explantion from probability perspective:

Prompting is the approach of adding extra information for the model to condition on during its generation of Y .

By: # The Power of Scale for Parameter-Efficient Prompt Tuning

阅读全文 »

Prompt是当下最热的NLP技术之一,本文通过 what, why 和 how 三个问题对它进行介绍。力求简明扼要,不是完整综述,更多细节,可参考更多论文原文。

Prompt是什么

首先来看什么是Prompt,没有找到权威定义,引用一些论文中的描述来说明什么是Prompt。

Users prepend a natural language task instruction and a few examples to the task input; then generate the output from the LM. This approach is known as in-context learning or prompting.

By: # Prefix-Tuning: Optimizing Continuous Prompts for Generation

简单来说,用户用一段任务描述和少量示例作为输入,然后用语言模型生成输出。这种方法就叫做in-context learningprompting。Prompting也有另一种偏概率的解释:

Prompting is the approach of adding extra information for the model to condition on during its generation of Y .

By: # The Power of Scale for Parameter-Efficient Prompt Tuning

阅读全文 »

Recently I switched the static website generator from Hexo to Hugo. The main reason is that Hexo is too slow, cannot generate websites with thousands of pages.

Then I found this: # Who Should Use Hugo?

Hugo is for people building a blog, a company site, a portfolio site, documentation, a single landing page, or a website with thousands of pages.

No pain no gain. To use Hugo smoothly, the first problem is how to add customized css or js to the site.

The bad news is that Hugo is not that friendly to a freshman. I spent hours to read documents and understood how it works. Comparatively, Hexo's plugin system and injector is more friendly to a freshman (maybe I forgot how long to learn it haha :-D).

In this post, we will go through how to add customized css or js to Hugo sites in Hugoic way.

If you don't want to understand how it works, just go to Modify Templates section would be fine. :-)

阅读全文 »

最近从Hexo切到了Hugo博客生成引擎,主要原因是Hexo太慢,且在页面数量上千时会崩溃

# Who Should Use Hugo?

Hugo is for people building a blog, a company site, a portfolio site, documentation, a single landing page, or a website with thousands of pages.

使用任何引擎,必须要解决添加自定义css和javascript的问题,才能非常方便地定制化。

可惜Hugo对于初学者不太友好,研究添加css和js费了不少功夫,需要通过读文档理解Hugo的设计思路。相比而言,Hexo的插件系统Hexo injector对新手更友好和容易理解。所以我们聊聊在Hugo中添加自定义css和js的正确方式。

不关心原理的急性子可以直接跳到修改模板代码节进行实操 :-)

阅读全文 »

LingoMeta is an updated English learning application of the basic knowledge and technology of the program. Inspired by the user's time value, LingoMeta integrates daily English practice with test content. LingoMeta's philosophy is: happy study time, improved exams and better daily translation.

阅读全文 »

LingoMeta 是采用尖端人工智能技术的新一代英语学习应用程序。受用户时间价值最大化理念的启发,LingoMeta 将英语日常练习与考试内容无缝融合。

LingoMeta 的理念是:更少的学习时间,更高的考试分数和更好的日常对话。

阅读全文 »

本文为十月川北自驾游记系列之五,黄龙。

十月川北自驾游记系列:

  1. 十月川北自驾游记——成都
  2. 十月川北自驾游记——乐山
  3. 十月川北自驾游记——都江堰
  4. 十月川北自驾游记——九寨沟
  5. 十月川北自驾游记——黄龙

我们先去的九寨沟,回程玩黄龙,考虑到川主寺这边没什么好的酒店,就计划上午玩黄龙(10点到,1点出),晚上赶到都江堰住(晚7点左右),但显然这个安排是非常紧的,加上我们游览的速度并不快,导致不可能在晚上赶到都江堰。出于行车安全考虑,改住在茂县,住宿简直是个噩梦。

开篇之前,还是先聊几个FAQ:

  • 九寨沟黄龙旅游是否会高反?

九寨沟县城、酒店和沟口海拔在2000米左右,九寨沟景区最高点长海和原始森林约3000米,个人体验3000以下不怎么有高反的感觉。3000以上再运动可能会有些气短,但总体没问题。 黄龙景区就稍高些,入口就3200,最高点3568,如果先玩九寨再玩黄龙的话,基本也就适应了,问题不大。我和父母都是徒步上下山,没坐索道,有些气喘,可以接受。景区路上还设有氧吧,有卖小氧气瓶(200次/瓶)的,我觉得没有必要。一路上看到吸氧的人也不多,也没见到任何人有明显的高反。在这个海拔谈高反,个人观点纯属生意,99%的人没必要担心这个,觉得有高反,大部分属于心理作用。

阅读全文 »

本文为十月川北自驾游记系列之四,九寨沟。

十月川北自驾游记系列:

  1. 十月川北自驾游记——成都
  2. 十月川北自驾游记——乐山
  3. 十月川北自驾游记——都江堰
  4. 十月川北自驾游记——九寨沟
  5. 十月川北自驾游记——黄龙

游记之前,先聊两个FAQ:

  • 九寨沟黄龙旅游是否会高反?

九寨沟县城、酒店和沟口海拔在2000米左右,九寨沟景区最高点长海和原始森林约3000米,个人体验3000以下不怎么有高反的感觉。3000以上再运动可能会有些气短,但总体没问题。 黄龙景区就稍高些,入口就3200,最高点3568,如果先玩九寨再玩黄龙的话,基本也就适应了,问题不大。我和父母都是徒步上下山,没坐索道,有些气喘,可以接受。景区路上还设有氧吧,有卖小氧气瓶(200次/瓶)的,我觉得没有必要。一路上看到吸氧的人也不多,也没见到任何人有明显的高反。在这个海拔谈高反,个人观点纯属生意,99%的人没必要担心这个,觉得有高反,大部分属于心理作用。

  • 成都到九寨沟路况如何?

毕竟是旅游线路,路况不错,驾驶难度小于丽江到香格里拉和青甘大环线。 从成都到都江堰是高速,自不必提。然后是G213国道到松潘,G544到九寨沟。两段国道都是双向单车道的山路,有山路驾驶经验的话非常好开。值得一提的是隧道比较多,尤其是在都江堰到汶川段,有隧道群。

阅读全文 »

本文为十月川北自驾游记系列之三,都江堰。

十月川北自驾游记系列:

  1. 十月川北自驾游记——成都
  2. 十月川北自驾游记——乐山
  3. 十月川北自驾游记——都江堰
  4. 十月川北自驾游记——九寨沟
  5. 十月川北自驾游记——黄龙

都江堰

问道青城山 拜水都江堰

都江堰市离成都很近,开车大约一个小时可达。都江堰市的景点主要有三个:青城山,都江堰和卧龙中华大熊猫苑。

阅读全文 »
0%