AI拼写检查软件AfterTheDeadline

刚才试着安装了一下AfterTheDeadline的atd服务器还有用来和服务器对话并且返回检查结果的命令行工具atdtool。希望用来做文章的拼写检查。没有成功。只好继续用它的网页版:http://www.polishmywriting.com/。等有时间琢磨一下,给它安装上。

这个拼写检查是基于语料库做的,而不是仅仅从字典来检查单词拼写错误。它还可以提出一些语法错误和书写style的建议,例如时态用错了、单复数没有匹配好、尽量避免复杂的困难的词、尽量用主动语态等等。我用了一下还是很不错的,比我自己去一个一个读出来要快多了。它也会提供修改建议。当然,这时候,需要就你来自己做决定了。

如何通过观察生活来学习

我大约9岁的时候,第一次给父母做了点心(浙江农村习惯在下午两点多钟的时候吃一顿加餐)送到了他们干活的农田。我还记得他们很开心,但是也非常吃惊。问:你怎么知道如何做梅菜馅饼的啊?其实,我忘了加肉了,只有面粉和梅菜。不过,确实也挺厉害的。我说:我喜欢吃,平时看看妈妈你做,就会了啊。

我还特别喜欢吃鱼,所以做鱼也是我很早就看会,并且通过自己尝试——自己去钓鱼自己清理自己烧自己吃,就学会了。所以,主要就是看和尝试。当然,有的时候还会尝试一些不是看到的,而是自己想的,就有可能会更好吃了。当然,一般更难吃,直到尝试出来一定的境界——对做饭的理解的境界。现在回忆起来,我从小就是一个吃货,也是一个科学家。

顺便,题外话,如果一定要说一下做饭的境界的话,大概有下面这些。第一、一定要有主要的味道,这个通常是咸,有的时候是甜,很少的时候酸也行,或者这几种的组合。第二、一定要让食材自身的味道和主味配合起来,在主味还是主味的前提下,能够突出食材自己的味道。例如,鱼一定要降低腥味但是保留鲜味,不要用其他味道盖住它。当然,也有违反的时候,例如酸菜鱼。不过那个时候,其实酸菜是主要食材,本来就应该让它的味道做主。第三、有一些食材的使用经验,其实大部分时候就是食材的特点,是很有用的。例如蘑菇由于有大量氨基酸可以替代味精。例如好的黄酱和酱油有的时候可以替代一部分盐,并且氨基酸的含量也很高。第四、某些前人已经积累好的经验可以借鉴,但是要思考为什么管用。例如葱姜可以去掉腥味、鸡蛋打发的时候可以考虑加入柠檬汁几滴、腌制牛肉鸡肉要做好按摩松弛、还有菜谱(食材的组合是烹饪的顺序手法)之类的。学习经验是一方面,思考然后可能推广和借鉴是另一方面。好了,再写下去这个帖子成了做饭帖了。后来在东西双方料理的影响之下,就更加成了带思考的吃货科学家(实验者)了。

回到主题,生活中也有很多可以学习的东西,最主要的原则是“看在眼里”和“做实验”。其实,课程的学习也一样,把老师怎么做的“看在眼里”,然后“自己来尝试,来实验”。那么,怎样才能做到“看在眼里”呢?这是我今天这个帖子的主题。

今天心儿做了一件我经常做的事情,没做好,被我说了。其实,我不应该说,我又没有教过她要做生活有心人,看在眼里,没有教过如何看。那么,到底如何看呢?跟我的理解型阅读和理解型写作一样,WHWM——问What、How、Why、Meanginful这四个问题:他在做什么?他怎么做的?他为什么要这样做,为什么要做这个?如果我来做会怎样,这事对我有意义吗,我要学习和思考吗?

在阅读的时候,我们问:主要信息是什么?这个信息(通过例子、其他概念等)如何构建起来的?为什么传达这个信息,为什么这样构建?对我来说意味着什么,我喜欢吗?

在写作的时候,我们问:我要传达主要信息是什么?这个信息我是如何构建起来的?为什么我要传达这个信息,为什么我要这样传达?对我的读者来说意味着什么,有合理性吗?

在设计一个专业、一门课程甚至一节课的时候,我们问:从促进学生理解学科大图景和学生以后自己学习的角度,我要传达什么信息?这个信息是如何构建的,考虑到学生已有的背景?为什么我要传达这个信息,为什么我要这样传达?对于我的学生来说意味着什么,能够促进理解世界理解学科深入思考吗?

阅读理解作业:这个帖子的主要信息是是什么?作者如何构建的这个主要信息?构建的逻辑上有什么好的地方和缺陷?作者为什么要传达这个信息?有没有一个这个信息本身之上的,一定意义上更重要的“母信息(能够在一定程度上导出这个信息的信息)”?你觉得如何?

Distinguish internal and external factors using machine learning

Recently I came across a paper working on distinguish internal and external factors of a dynamical process using machine learning, with only data on time sequences \(x\left(t-\tau\right), x\left(t-\tau+1\right),\cdots, x\left(t\right)\).

In fact, in the paper, only a few \(x\left(t-2\right), x\left(t-1\right), x\left(t\right) \) are known and are used to predict \(x\left(t+1\right)\) and want to distinguish that how much of this \(x\left(t+1\right)\) is due to internal factors, which leads to \(x_{i}\left(t+1\right)\) and how much is due to external factors, which leads to the additional \(x_e\left(t+1\right)\) such that indeed the observed \(x\left(t+1\right)\) can be explained by combining the two, ie., \(x\left(t+1\right)=x_{i}\left(t+1\right)+x_{e}\left(t+1\right)\) . I have quite some doubts on this idea and this working logic, which I will try to explain here.

  1. Assuming \(x\left(t\right)\) is indeed governed by the following dynamics,
  2. \begin{align}
    x\left(t+1\right) = f\left[x\left(t\right)\right] + z\left(t\right) \\
    z\left(t+1\right) = g\left[z\left(t\right)\right]
    \end{align}
    However with \(f, g\) unknown and \(z\) not observed at all. Not being observed means that we can not really make use of it in constructing our predicting model. We regard \(f\left[x\left(t\right)\right] \) as the internal factor and \(z\left(t\right)\) as the external factor. Here only the full \(x\), thus \(x_{real}\), is known and \(z\) is not known.

  3. Now our question becomes how to figure out \(f\left[x\left(t+1\right)\right] \) and \(z\left(t+1\right)\) starting from a time series of \(x\left(t\right)\).
  4. Assuming there is a perfect algorithm to generate \(x\left(t+1\right)\) starting from a time series of \(x\left(t\right)\) when the dynamics of \(x\left(t\right)\) is fully internal. Let us call this algorithm LP, just for fun. Will this helps us to solve the problem defined above?

    How about we apply blindly to the observed data: \(x\left(t-\tau\right), x\left(t-\tau+1\right),\cdots, x\left(t\right)\)? In principle, we might get
    \begin{align}
    x\left(t-\tau+1\right) = LP\left[x\left(t-\tau\right)\right] + z\left(t-\tau\right) \\
    \cdots \\
    x\left(t+1\right) = LP\left[x\left(t-\tau\right), x\left(t-\tau+1\right),\cdots, x\left(t\right)\right] + z\left(t+1\right)
    \end{align}
    However, there are technical problems and logic problem in this line of thinking.

  5. First, technically we need LP to be very accurate, in fact so accurate that
  6. \begin{align}
    \left|x_{internal}\left(t+1\right) – LP\left[x_{internal}\left(t+1\right)\right]\right| \ll \left|x_{real}\left(t+1\right) – LP\left[x_{internal}\left(t+1\right)\right]\right| \\
    = \left|x_{real}\left(t+1\right) – x_{internal}\left(t+1\right) + x_{internal}\left(t+1\right) – LP\left[x_{internal}\left(t+1\right)\right]\right|
    \end{align}
    Since we are interested in \(x_{real}\left(t+1\right) – x_{internal}\left(t+1\right)\), we have to make sure that the difference between the predicted and the real value is far beyond the difference between the difference between the predicted and the internal.

    In practice, providing some data on this accuracy can be done and is very helpful. For example, by providing LP’s accuracy data on generic examples and \(\left|x_{real}\left(t+1\right) – LP\left[x_{internal}\left(t+1\right)\right]\right|\) for this specific example. They have to be very different. If they are close, then what are supposed to be external might simply due to the inaccurate part of \(LP\left[x_{internal}\left(t+1\right)\right]\).

    If will be even better if one can provide a comparison directly between \(\left|x_{internal}\left(t+1\right) – LP\left[x_{internal}\left(t+1\right)\right]\right|\) and \(\left|x_{real}\left(t+1\right) – LP\left[x_{internal}\left(t+1\right)\right]\right|\). It is however impossible since there is no data on \(x_{internal}\left(t+1\right)\), but only the observed \(x_{real}\left(t+1\right)\). In fact, one can only have \(\left|x_{real}\left(t+1\right) – LP\left[x_{real}\left(t+1\right)\right]\right|\), which is not either of the desired ones above.

    In this case, the accuracy of LP would totally relies on previous experience. This is a logic problem: even when it is accurate on all previous examples, it is not for sure that it will have similar accuracy on this example unless there are theoretical proof of bounds. However, for most machine learning LP, there is no such theoretical bounds, let alone a proof.

  7. Besides the techinical problem, I think, there is a even serious logic problem.
  8. Remmeber that we can only observed \(x_{real}\) but not \(z\) and not \(x_{internal}\). Therefore, we in fact have something like this,
    \begin{align}
    x_{real}\left(t-\tau+1\right) = LP\left[x_{real}\left(t-\tau\right)\right] + \hat{z}\left(t-\tau\right) \\
    \cdots \\
    x_{real}\left(t+1\right) = LP\left[x_{real}\left(t-\tau\right), x_{real}\left(t-\tau+1\right),\cdots, x_{real}\left(t\right)\right] + \hat{z}\left(t+1\right)
    \end{align}
    There is not guarantee that \(\hat{z}\) is any close to or anyhow related to the external factor \(z\).

So, I conclude that firstly there is a serious technical issue, which can be lifted to certain degree by providing data to confirm \(\left|x_{real}\left(t-\tau+1\right) – LP\left[x_{real}\left(t-\tau\right)\right] \right|\) is much bigger than the usual residue of LP. However, if this happens there is a chance that LP is bad for this specific case, then it is natural to see the large inaccuracy above. This is a very tricky problem and in principle impossible to aviod or solve. Secondly, there is a serious logic issue, since the difference between the real data and the predicted data may not due to the desired external factors.

bigphysics Wiki 站点

主要出于整理研究工作实现团队内更好地交流分享的目的,我们建设了研究团队网站——Big Physics(大物理学)

网站采用MediaWiki的后台,用分类来组织具有上下级关系的内容,用超链接来组织具有更一般关系的内容。前者相当于概念地图的层级连接,后者相当于横向连接或者层内连接。一般来说除了最底下的页面,都采用分类当做页面的格式。在Wiki里面,分类页面不仅仅是一个内容组织容器,还是可以提供内容的。

目前已经有的分类有:文献讨论、研究项目(实际上是研究方向,具体项目在这个层级的下一层或者下两层)、研究成果、数据。分类之间允许有重叠。例如,某一篇文献的分享应该放到大类“文献讨论”下面,同时按照内容还需要放到合适的“研究项目”下面。甚至,如果是自己团队的文章,那么,还需要放到“研究成果”的下面。

通过这样的整理,更加容易看清楚研究的大图景、细节,还能够促进交流讨论。经过这几天的使用,我发现确实能够大大地提高工作效率。例如,看过的文献就能够随手整理在合适的逻辑框架中,并且能够留下很好的记录。

团队的各位成员需要学习一点点MediaWiki的语法,例如小节标题、到外部网页的超链接、到内部网页的超链接、加入到上一级分类、新建页面、新建分类、列表、数学公式等。

顺便,整个研究团队的信息技术架构包括:owncloud做的云盘和云同步,git做的版本控制,wordpress做的博客群MediaWiki做的大物理学网站CmapServer做的概念地图服务器Otree做的博弈实验服务器
其他还有汉字学习网站

鸡兔同笼问题的理解型学习,并讨论方程和构造解法的关系

今天心儿回来告诉我学会了鸡兔同笼的计算, 把总头数(例如10)乘以大的那个脚的数量(也就是4),然后减去总的脚的数量(例如34),最后除以2,就得到了鸡的数量。让她试了试,确实能够做计算得到答案。但是,不能告诉我为什么。

实际上,这个问题是很容易想通的。只要做下面的想象:给所有的鸡都添上两只脚,使得所有动物都成为4条腿的;或者,让所有的兔子都收起来前腿,使得所有的动物都成为两条腿的。

先来看前者,我们就得到10只都是4条腿,于是,共\(10\times 4\)只脚。我们看到这个比实际的数量多了\((10\times 4-34)\)只脚。这个多出来的脚是因为我们给鸡贴上的,每只鸡都要贴两只脚,于是,贴了总共\(\left(10\times 4-34\right)\div \left(4-2\right)\)次。于是,鸡的数量就是\(\left(10\times 4-34\right)\div \left(4-2\right)=3\)只。同时,得到兔子的数量是\((10-\left(10\times 4-34\right)\div \left(4-2\right)=7)\)只。可以验算,这是正确的。

其中最关键的一步在于想象给每只鸡都贴上两只脚。另一个关键的一步就是,得到超过的脚的数量以后,想到这个超过就是由这个贴脚导致的,于是算出来贴了多少次。从数学思维的角度来说,从贴了多少次到有多少只鸡之间,还有一个逻辑推理的过程。

那么,合起来,就是这样,
1. 给每只鸡贴上两只脚,导致所有的动物都是四只脚;
2. 于是,这样得到的脚的总数是\(4\times 10=40\)只;
3. 这个比实际的脚的数量多,多\(40-34=6\)只;
4. 这个多出来是因为给每只鸡贴上了两只脚,于是,贴了\(6\div (4-2)=3\)次;
5. 因为每一只鸡都会被贴一次,这个贴次数就是鸡的数量,于是,鸡有\(4=4\)只。

如果没有这个思考的过程,那么,计算会计算上面的过程,得到答案也是枉然,并不是理解型学习。

技巧上,综合算式也是有意义的,也就是鸡有
\begin{align}
\left(10\times 4-34\right)\div \left(4-2\right)=3只。
\end{align}

反过来让兔子前腿收起来的过程,我们可以得到,兔子有
\begin{align}
\left(34-10\times 2\right)\div \left(4-2\right)=7只。
\end{align}

作业:10个硬币,5分的和2分的,总的钱数是32分,问各多少个。
作业:通过阅读本文,指出来,哪些地方反映了理解型学习。提示,每一个计算能够说出来是什么和什么的什么关系导致的这样的计算吗?

有的老师说这个“贴脚”的方法和“假设大家都是兔子或者都是鸡”的是一样的。其实,它们不一样。第一、假设性问题对小学生来说是一个比较困难的地方。第二、操作型构造型解决方法是一个很好的解决问题的思路。当然,这样的假设性问题,总比直接讲解解方程要好。在形成构造型解决方式之前,学生直接学习假设性问题甚至方程,对高质量思维的形成是有阻碍的。

当然,我在前面强调的另一点——每一步的计算都要说出来是什么东西和什么东西的什么关系使得这个计算成立,是更加重要的一点。

同时,这个例子也能说明,有的时候能够得到问题的答案,会算,是不够的,可以试试让学生说出来,也就是教一教同伴。这个时候可以促进学生更加深入的思考,也更好地检验是不是真的明白了,从关系的角度明白了,而不是仅仅是计算。关系是可以推而广之的,只要遇到具有类似关系的其他的东西,但是计算本身(除非看作关系的体现)是不能推而广之的。

这个问题如果用方程来做,不管是二元方程还是一元方程都实在太简单了,例如\(x\times 4 + \left(10-x\right)\times 2 =34\)。从思路上来说,方程更加直接和简单,只要按照题目阐述的意思,把语句转化成数学表达式最后找到题目中给出来的这个表达式所计算的东西给出来的答案,就得到了方程。例如,这个假设兔子是\(x\)只,则得到鸡是\(\left(10-x\right)\)只,然后,计算总的脚的数量为表达式\(\left(x\times 4 + \left(10-x\right)\times 2\right)\),最后找到这个数就在题目里面,也就是\(34\)。接着就求解未知数\(x\)就可以了。

求解的过程,实际上就是把左边的复杂的整个含有\(x\)的表达式转化成仅仅是\(x\),转化的过程中,注意方程的左右两边要做相同的操作(相同的操作才能保证方程左右两边一直相等)。

因此,方程的思路是假设某个东西的值已经知道了,然后,顺着题目给定的思路信息计算下去,得到某个已知的量的表达式,让这个表达式等于一直的量。对比上面的构造性解法的思路,我们发现构造性思路比较复杂,需要想出来一个办法直接得到这个答案。也就是说,综合算式或者构造性解法的思路是构造(想)出来一个计算过程这个过程的终点(最终计算结果)就是所要求的答案。把语言转化成数学表达式(中间最重要的是搞清楚所算的东西之间的关系)和构造一个比较复杂的过程来直接表述答案,都是重要的数学思维。

也许,你会说,从难度来说,方程简单多了,没有必要让孩子们经受综合算式和构造性解法的痛苦。这样是有缺陷的。首先,我们要明确两者在培养数学思维上确实是有区别的。其次,有没有必要训练一个比较复杂的构造性思维?很有必要。思考的深度,沿着某个逻辑的推理的深度,这些是思维质量中非常重要的一环。更何况从实用的角度来说,将来会遇到,很多的问题的漂亮的解法或者证明,是通过构造性解法来实现的。

因此,在小学四年级,这个构造性思维最最关键的时期,来学习方程,我觉得是有很大问题的。我们不需要通过降低学习难度来减负,不能深入就没有浅出,只有肤浅。我们需要通过帮助学生理解,帮助学生整理思路,认识清楚问题,来减负。

将来例如六年级再学习了方程之后,还可以反过来对比求解方程的步骤和构造性求解的关系,你会发现,原来所谓的构造解,完全可以看做某个方程的求解过程。或者说,通过方程来求解,就是把一个需要通过比较深入的思考比较长的逻辑链条才能解决的问题,变成一个只要顺着思路,做好从语言到数学表达式的转化就可以解决的问题。

但是,如果学生对于综合算式和构造解法的理解不深刻,我如何才能让他/她将来体会到两者的联系呢?将来就有可能不会构造,只会列方程。于是,将来需要对几何题甚至更一般的问题做构造性解法的时候,就抓瞎了。