读后感

读后感

docker实战 代码勘误

Linux李魔佛 发表了文章 • 0 个评论 • 2346 次浏览 • 2019-11-25 11:24 • 来自相关话题

作者在官网刊登的勘误记录:
 
看这本书的作者一定要看,不然坑挺多的。
一路采坑过来的哭着说。Last updated August 21, 2016
In an effort to offer continued support beyond publication, we have listed many updates to code due to version updates.

[code - omission] Page 18

The command to start the "mailer" is missing a line. Where the book reads:
docker run -d \
--name mailer \
the proper command should read:
docker run -d \
--name mailer \
dockerinaction/ch2_mailer

[code - regression] Page 68

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" reader
Replacement:
docker inspect --format "{{json .Mounts}}" reader

[code - regression] Page 69

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" student
Replacement:
docker inspect --format "{{json .Mounts}}" student

[code - regression] Page 74

The alpine image entrypoint has changed since original publication and has been unset. The last command on the page should now read:
docker run --rm \
--volumes-from tools \
--entrypoint /bin/sh \
alpine:latest \
-c 'ls /operations/*'
[code - regression] Page 75

The docker exec example on the top of page 75 was printed with the wrong tool name. The correct command is:
docker exec important_application /operations/tools/diagnostics

[code - regression] Page 86

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--hostname barker \
busybox:1 \
nslookup barker

[code - regression] Page 87 (top)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns 8.8.8.8 \
busybox:1 \
nslookup docker.com

[code - regression] Page 87 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns-search docker.com \
busybox:1 \
nslookup registry.hub

[code - regression] Page 88 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--add-host test:10.10.10.255 \
busybox:1 \
nslookup test

[code - regression] Page 106

There are a few new problems with this example. First, the named repository (dockerfile/mariadb) no longer exists. You can use mariadb:5.5 as replacement. However, the second problem is that containers created from the mariadb image perform certain initialization at startup. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start the database with the following command:
docker run -d --name ch6_mariadb \
--memory 256m \
--cpu-shares 1024 \
--cap-drop net_raw \
-e MYSQL_ROOT_PASSWORD=test \
mariadb:5.5

[code - regression] Page 107

Containers created from the wordpress:4.1 image perform certain initialization at startup and expect certain environment variables. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start wordpress with the following command:
docker run -d -P --name ch6_wordpress \
--memory 512m \
--cpu-shares 512 \
--cap-drop net_raw \
-e WORDPRESS_DB_PASSWORD=test \
mariadb:5.5

[code - typo] Page 109

The device access example is missing the "run" subcommand. The command listed as:
docker -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
should have been written as:
docker run -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev

[code - typo] Page 110 - 111

Several commands are missing the "run" subcommand. In each case the command begins with
docker -d ...
and should have been written as:
docker run -d ...

[code - regression] Page 115 (bottom)

The busybox and alpine images have been updated to fix the problem described in the paragraph below. The 'su' command does not have the SUID bit set and will not provide any automatic privilege escalation.

[command correction] Page 116

Boot2Docker has been discontinued and rolled into a newer project called Docker Machine. Because a reader is unlikely to have the boot2docker command installed, the command at the top of this page should be changed from:
boot2docker ssh
to the Docker Machine equivalent:
docker-machine ssh default
where default is the name of the machine you created.

[code - regression] Page 119

The ifconfig command has since been removed from ubuntu:latest. Instead of using the ubuntu:latest image for these examples use ubuntu:trusty. The example using ifconfig should look like:
docker run --rm \
--privileged \
ubuntu:trusty ifconfig
[Illustration Mistake] Page 136
Image layer ced2 on the left side of the illustration is listed at c3d2 on the right side. These two layers should represent the same item.

[code - typo] Page 140

Containers need not be in a running state in order to export their file system. The first command on page 140 uses the "run" subcommand but the command listed will never be able to start. Replace "run" with "create." The command should appear as follows:
docker create --name export-test \
dockerinaction/ch7_packed:latest ./echo For Export

[code - missing line] Page 146

In the example Dockerfile near the top of the page the line with the RUN directive is missing part of the instruction. That line should read:
RUN apt-get update && apt-get install -y git

[code - evolution] Page 215

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: s3-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 216

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: rados-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
rados:
poolname: radospool
username: radosuser
chunksize: 4194304
maintenance:
uploadpurging:
enabled: false
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 218

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: redis-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
cache:
blobdescriptor: redis
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
redis:
addr: redis-host:6379
password: asecret
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
[code - typo] Page 220

The name of the file shown should be scalable-config.yml as in previous examples. This example also requires the addition of the newer uploadpurging attributes. The mainenance section of the file should be as follows:
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
[text - typo] Page 240

In the second paragraph the reader is instructed to, "Open ./coffee/api/api.py" this is not the correct location of the file. The correct file location is at, "./coffee/app/api.py."
[text - typo] Page 262

The refere nce to "flock.json" in the first sentence of the third paragraph should be "flock.yml."
[code - typo] Page 270

The git clone command uses the ssh protocol instead of https. The command should read as follows:
git clone https://github.com/dockerinact ... i.git 查看全部
作者在官网刊登的勘误记录:
 
看这本书的作者一定要看,不然坑挺多的。
一路采坑过来的哭着说。
Last updated August 21, 2016
In an effort to offer continued support beyond publication, we have listed many updates to code due to version updates.

[code - omission] Page 18

The command to start the "mailer" is missing a line. Where the book reads:
docker run -d \
--name mailer \
the proper command should read:
docker run -d \
--name mailer \
dockerinaction/ch2_mailer

[code - regression] Page 68

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" reader
Replacement:
docker inspect --format "{{json .Mounts}}" reader

[code - regression] Page 69

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" student
Replacement:
docker inspect --format "{{json .Mounts}}" student

[code - regression] Page 74

The alpine image entrypoint has changed since original publication and has been unset. The last command on the page should now read:
docker run --rm \
--volumes-from tools \
--entrypoint /bin/sh \
alpine:latest \
-c 'ls /operations/*'
[code - regression] Page 75

The docker exec example on the top of page 75 was printed with the wrong tool name. The correct command is:
docker exec important_application /operations/tools/diagnostics

[code - regression] Page 86

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--hostname barker \
busybox:1 \
nslookup barker

[code - regression] Page 87 (top)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns 8.8.8.8 \
busybox:1 \
nslookup docker.com

[code - regression] Page 87 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns-search docker.com \
busybox:1 \
nslookup registry.hub

[code - regression] Page 88 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--add-host test:10.10.10.255 \
busybox:1 \
nslookup test

[code - regression] Page 106

There are a few new problems with this example. First, the named repository (dockerfile/mariadb) no longer exists. You can use mariadb:5.5 as replacement. However, the second problem is that containers created from the mariadb image perform certain initialization at startup. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start the database with the following command:
docker run -d --name ch6_mariadb \
--memory 256m \
--cpu-shares 1024 \
--cap-drop net_raw \
-e MYSQL_ROOT_PASSWORD=test \
mariadb:5.5

[code - regression] Page 107

Containers created from the wordpress:4.1 image perform certain initialization at startup and expect certain environment variables. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start wordpress with the following command:
docker run -d -P --name ch6_wordpress \
--memory 512m \
--cpu-shares 512 \
--cap-drop net_raw \
-e WORDPRESS_DB_PASSWORD=test \
mariadb:5.5

[code - typo] Page 109

The device access example is missing the "run" subcommand. The command listed as:
docker -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
should have been written as:
docker run -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev

[code - typo] Page 110 - 111

Several commands are missing the "run" subcommand. In each case the command begins with
docker -d ...
and should have been written as:
docker run -d ...

[code - regression] Page 115 (bottom)

The busybox and alpine images have been updated to fix the problem described in the paragraph below. The 'su' command does not have the SUID bit set and will not provide any automatic privilege escalation.

[command correction] Page 116

Boot2Docker has been discontinued and rolled into a newer project called Docker Machine. Because a reader is unlikely to have the boot2docker command installed, the command at the top of this page should be changed from:
boot2docker ssh
to the Docker Machine equivalent:
docker-machine ssh default
where default is the name of the machine you created.

[code - regression] Page 119

The ifconfig command has since been removed from ubuntu:latest. Instead of using the ubuntu:latest image for these examples use ubuntu:trusty. The example using ifconfig should look like:
docker run --rm \
--privileged \
ubuntu:trusty ifconfig
[Illustration Mistake] Page 136
Image layer ced2 on the left side of the illustration is listed at c3d2 on the right side. These two layers should represent the same item.

[code - typo] Page 140

Containers need not be in a running state in order to export their file system. The first command on page 140 uses the "run" subcommand but the command listed will never be able to start. Replace "run" with "create." The command should appear as follows:
docker create --name export-test \
dockerinaction/ch7_packed:latest ./echo For Export

[code - missing line] Page 146

In the example Dockerfile near the top of the page the line with the RUN directive is missing part of the instruction. That line should read:
RUN apt-get update && apt-get install -y git

[code - evolution] Page 215

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: s3-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 216

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: rados-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
rados:
poolname: radospool
username: radosuser
chunksize: 4194304
maintenance:
uploadpurging:
enabled: false
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 218

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: redis-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
cache:
blobdescriptor: redis
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
redis:
addr: redis-host:6379
password: asecret
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
[code - typo] Page 220

The name of the file shown should be scalable-config.yml as in previous examples. This example also requires the addition of the newer uploadpurging attributes. The mainenance section of the file should be as follows:
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
[text - typo] Page 240

In the second paragraph the reader is instructed to, "Open ./coffee/api/api.py" this is not the correct location of the file. The correct file location is at, "./coffee/app/api.py."
[text - typo] Page 262

The refere nce to "flock.json" in the first sentence of the third paragraph should be "flock.yml."
[code - typo] Page 270

The git clone command uses the ssh protocol instead of https. The command should read as follows:
git clone https://github.com/dockerinact ... i.git

docker实战 勘误 (docker in action)

回复

书籍李魔佛 发起了问题 • 1 人关注 • 0 个回复 • 3496 次浏览 • 2019-11-09 15:48 • 来自相关话题

《机器学习在线 解析阿里云机器学习平台》读后感

深度学习李魔佛 发表了文章 • 0 个评论 • 3183 次浏览 • 2019-03-10 20:18 • 来自相关话题

 现在阿里云的在线学习平台要收费了,一年1700多,所以看了第二章,准备上机试试。没办法,不建议大家看这本书,如果你买了阿里云的学习平台,那么可以去看一下。 不过,既然能买阿里的平台的,应该是直接是要在上面部署的了,这本书是入门的入门,所以还是不要看了。
 
  查看全部
IMG_20190310_201215R.jpg

 现在阿里云的在线学习平台要收费了,一年1700多,所以看了第二章,准备上机试试。没办法,不建议大家看这本书,如果你买了阿里云的学习平台,那么可以去看一下。 不过,既然能买阿里的平台的,应该是直接是要在上面部署的了,这本书是入门的入门,所以还是不要看了。
 
 

大鳄 索罗斯的“反身性”理论 --大师就是大师,或者说是个疯子

闲聊李魔佛 发表了文章 • 1 个评论 • 2720 次浏览 • 2019-02-26 16:25 • 来自相关话题

转载的文章,很有思考价值。推荐一看,需要点耐心。
 索罗斯的投资思想很庞杂,晦涩难懂,很容易产生歧义。

从严格意义上来讲,索罗斯从来没有对外透露过他的具体投资方法。索罗斯在哈佛大学演讲时说幽默的说,凡是读过他书的人绝对赚不到钱,因为没有人能够知道真实的他。

一位观众举手问他:“你能告诉我们真实的你是什么样的吗?”索罗斯笑答:“不能,说出了就没有索罗斯了。”
所以,外界只能是从他的哲学和投资案例来了解他,我也不例外。

我读过索罗斯写的所有书,也读过很多研究索罗斯投资思想的博士硕士论文,我对索罗斯的投资思想有自己的看法。我认为,索罗斯的投资思想是建立在一个基石上,这个基石是错误、可错性、彻底的可错性。市场会犯错误,人会犯错误,一切貌似正确的投资理论也只不过是等待接受检验的错误而已,说得更极端点-----塑造了历史面貌的思想无非是一些内涵丰富的谬论。

一套富于衍生性的谬论往往最初被人们视为真知灼见,只有在它被解释为现实之后,它的缺陷才开始暴露出来,然后将会出现另一套同样内涵丰富的但与之正相反的新谬论,并且这一过程仍将不断地进行下去。这种观点在正统那里可以说是“异端邪说”,但索罗斯靠着这个思想衍生出来的投资方法获得惊人的成就。

可错性与索罗斯的哲学信仰一脉相承。

索罗斯的哲学根基主要是来源于卡尔﹒波普的证伪主义,还有部分是来源于哈耶克的《感觉的秩序》和《科学的反革命》。证伪主义可以说是认识论上的一次革命,它震耳发聩地提出了新的观点。它认为所有的科学知识都是暂时的,都是等待被证伪的,一些今天看来颠簸不破的真理,很可能只是明天的谬论而已。科学命题不能被证实,只可以被证伪,可证伪性是科学与非科学的划分标准。人类科学知识的增长不是累积式的前进,而是排除错误式的前进,先提出假说,然后予以反驳。

由此,索罗斯提出两个反对,一是反对归纳法,二是反对科学主义。

索罗斯认为,不可能经由归纳法则概括出赢取超额利润的一般方法,假如存在,那么投资者理论上就可以通吃市场,而市场将不复存在。归纳法是典型的累积式的认识论,它违法了从猜想到反驳的证伪原则。用黑天鹅理论来说,即使发现了99只白天鹅,也不能用归纳法说所有的天鹅都是白的,也许第100只是黑的。所以,索罗斯认为,试图照搬自然科学研究方法来归纳出金融市场的历史过程、或者从历史过程中总结出一般性的盈利方法,都犯了投资大忌。

与此同时,索罗斯还极力反对科学主义。自然科学和社会科学有巨大的差异,前者研究的对象是独立的事实,无论研究者抱着什么样的态度都改变不了事实,而后者参杂了观察者的偏见,研究者的信仰、价值观、立场、思维方式的差异都可以重塑事实。金融市场属于后者,股价怎么走不仅取决于事实即基本面,也取决于人们的偏见即怎么看待基本面,由此金融市场就充满巨大的不确定性。
为了说明这个问题,索罗斯引用量子力学的理论。海森堡的量子力学认为,量子粒子的质量和速度不可能同时得到精确的测量,其原因在于测量行为干扰了测量对象,在这种情况下,不确定因素是由外部观察者引入的。
 
融市场本身,从而让股价的走势不再是独立的,它总是与参与思维发生反复的共振,这也就是反身性。
 
既然是这样,金融市场就不可能用简单的科学方法来计算。而科学主义者却机械地、毫无批判地将科学方法加诸其研究之上,从这个意义上来说,科学主义恰恰是对科学精神的背叛。

索罗斯赞哈耶克的观点,科学主义是我们的现代科学文明中自我毁灭的力量,是滥用理性的极端表现。他反对任何人假借科学的名义而妄称掌握终极真理的理性狂妄。这也就是为什么投资大师反对过度数学化、工程化倾向,索罗斯甚至不无讽刺的说,他的数学符号从来不比ɑ、? 更多。
而另一个大师巴菲特也说,他用到的数学知识不超过小学水平。索罗斯很反对一些主流经济学家所谓的数量分析,他认同凯恩斯的观点:经济现实中的变量往往是互相依赖的,而某些传统的学者却假设它们是独立存在的,从而用偏微分的方法得出一定的结论,而当他们把结论用于现实时,却又忘记了这些结论赖以存在的假设条件……这是典型的伪数学方法……假设条件使那些作者们能在矫揉造作和毫无用处的数学符号中,忘记现实世界的复杂性和互相依赖的性质。

对归纳法和科学主义的深恶痛疾让索罗斯不得不另辟蹊径,由此索罗斯进入了反身性的世界,并最终得出炼金术的观点。
什么是反身性?

这个概念很晦涩,我们来一层一层的认识它。我们先来看一个命题:一个罗马人说,所有罗马人都撒谎。请问这个罗马人的话是真命题还是假命题?如果相信他,那么就面临一个逻辑悖论:承认了至少有一个罗马人说真话,从而又否定了他。这就是著名的“说谎者悖论”。大哲学家罗素面对这个悖论的时候说,我们应该把命题分为涉及自身的陈述和不涉及自身的陈述,如此就可以解决说谎者悖论。这里就引出一个重要的因素:涉及自身。

索罗斯由此出发来导出反身性概念,索罗斯认为,凡是涉及命题者自身、在内容上“或真”的命题,都是反身性命题。

进一步说,研究对象受到研究者自身的影响就叫反身性。如此一来,股票市场天然就是反身性了,因为股票参与者的观点必然影响到股价,进而让股价不再独立。为了说明这个问题,索罗斯又引出两个函数:

y=f(x) 认知函数
x=F(y) 参与函数

人的行为是y,人的认识是x,行为是认识的函数,表述为认知函数。
其含义是:有什么样的知识就有什么样的行为。而人的行为对人的认识有反作用,认识是行为的函数,表述为参与函数,其含义是:有某一类行为就会有某一类知识。“两个函数同时发挥作用,互相干扰。函数以自变量为前提产生确定的结果,但在这种情境下,一个函数的自变量是另外一个函数的因变量。

确定的结果不再出现,我们看到的是一种相互作用,其中情景和参与者的观点两者均为因变量,以致一个初始变化会突然同时引起情景和参与者观点的进一步变化,我称之为反身性。”上述函数又会产生递归性,它们不会产生均衡,而只有一个永无止境的变化过程。用函数表达其变化为:
y=f(F(y))
x=F(f(x))
这就是说,x和y都是它自身变化的函数——认识是认识变化的的函数,行为是行为变化的函数。它实际上也是一种“自回归系统”。索罗斯用这这个函数是想说明,金融市场根本区别于自然科学研究的过程,在那里,一组事件跟随另一组事件,不受思维和认知的干扰。而金融市场是思维参与其中,因果关系不再是一组事件直接导向下一组事件,相反,它以一种类似鞋襻的模式将事实联结与认知,认知复联结于事实。
如此,反身性理论构建完毕,用通俗的话来解释,就是参与者的认知和被认知对象互相影响,基本面影响观点,观点反过来也影响基本面,它们永不均衡,互动变化,以致无穷。

美国学者约翰﹒特雷恩在《大师的投资习惯》中对此有过精彩解读:“‘反身性原理’的本质是指认知可以改变事件,而事件反过来又改变认知。这种效应通常被称为‘反馈’。这就好比,如果你拴住一条脾气好的狗并踢他,骂它‘坏狗’,那么这条狗会真的变得很凶,并扑过来咬你,而这又会引来更多的踢打、更多的撕咬。”

再举个更直白的例子,如果投资者相信美元升值,那么他们的购买行为讲会让美元上涨,这反过来又会使利率降低,刺激经济增长,从而推动美元再次升值。这也就回到前面的那个说谎者的悖论,凡是涉及自我的命题,自我都难逃脱干系。在这个过程中,任何简单的只研究股价本身而不顾参与者偏见的科学主义都是错的。

说得更极端些,那些即使是认识错误的命题,只要有足够强大的影响力,它依然能在股市获利,这就是为什么股价有时候看起来泡沫很大但买的人很多,有时候看起来又低得可怜但无人问津。因为金融市场是个“炼金术”,投资者的决策意意识和决策行为具有像“炼金师”那么改变“事实结构”的“意志力”。在科学家看来,改变“物质结构”的“意念”是伪科学的,但在金融世界里,“改变市场结构”的“主流偏见”却是真是的,却是可以赚大钱的。所以,金融市场拒绝了科学主义,却接纳了金融炼金术。

整理一下刚才的逻辑,索罗斯认为,很多认知貌似真理,其实是错的、不确定的,它们所谓的正确只是暂时的、等待证伪的。无论它们是通过归纳法还是科学主义得到的认识,都不足以垄断真理和科学,在自然科学领域如此,在社会科学领域更是如此。更荒谬的是,很多人把自然科学的方法和结论强加在社会现象的研究中,这如同把魔术方法应用到自然科学领域的炼金术一样,只能使炼金术身败名裂。

社会科学是特殊的领域,研究者可以对研究对象施加自己的影响,在社会、政治、经济事物中,理论即使没有确凿的证据也可以是有效的,因为社会科学充满反身性,只要主流偏见足够强大,谬论也会在某些情况下变成“真理”,所以金融炼金术可以大行其道。

金融市场是反身性市场,它的决策不可能成为一个科学研究的命题,相反,它更像一个“非科学”的“炼金术”,因为金融市场中的决策评价取决于参与者们歪曲了的见解。正是因为参与者的决策并非基于客观的条件,而是对条件的解释,所以金融市场的根子是不确定的、是可错的。

没有人能完全正确认识市场,任何所谓正确的认识都只能是猜测,它还须接受反驳和证伪。投资的过程就是不断提出猜想并让市场验证和反驳的过程,而不是用科学命题去决策的过程。在索罗斯眼里,金融市场是不确定的,这种不确定是根本性的、是绝对的,任何看法都可能错,任何错误都可能发生,它们本质上也就是风险。索罗斯思想的底色就是可错性、不确定性、认知的不完备性,也就是风险性。

索罗斯的哲学认知论让他怀疑一切,包括他自己。
 
索罗斯谈到他为什么和罗杰斯分道扬镳时说,罗杰斯有个重大缺陷:“他极为藐视华尔街专业人才的精明”----尽管在这一点上索罗斯认为自己和罗杰斯看法相同----但是“罗杰斯却极为自信,从来不承认自己也可能犯错”,而“我却时刻相信自己也会犯错误”。这道出了索罗斯内心的哲学根基:证伪主义。市场总是错的,我也总会犯错。这就形成了索罗斯对股市的根本判断:股市风险第一,不确定第一,所以要想在股市生存必须时刻学会逃跑,因为投资本质上是在冒险。
 
个人总结一下,个人理解,要成为索罗斯这种人,那么就是个疯子。 因为他需要怀疑周围的一切,包括他自己,因为在索罗斯看来,什么都是可以证伪的。这样的人,在我看来,会被人理解为人格分裂。 如果不是他靠这个积累了大量财富,绝对会被人当做是一个疯子。
  查看全部
转载的文章,很有思考价值。推荐一看,需要点耐心。
 索罗斯的投资思想很庞杂,晦涩难懂,很容易产生歧义。

从严格意义上来讲,索罗斯从来没有对外透露过他的具体投资方法。索罗斯在哈佛大学演讲时说幽默的说,凡是读过他书的人绝对赚不到钱,因为没有人能够知道真实的他。

一位观众举手问他:“你能告诉我们真实的你是什么样的吗?”索罗斯笑答:“不能,说出了就没有索罗斯了。”
所以,外界只能是从他的哲学和投资案例来了解他,我也不例外。

我读过索罗斯写的所有书,也读过很多研究索罗斯投资思想的博士硕士论文,我对索罗斯的投资思想有自己的看法。我认为,索罗斯的投资思想是建立在一个基石上,这个基石是错误、可错性、彻底的可错性。市场会犯错误,人会犯错误,一切貌似正确的投资理论也只不过是等待接受检验的错误而已,说得更极端点-----塑造了历史面貌的思想无非是一些内涵丰富的谬论。

一套富于衍生性的谬论往往最初被人们视为真知灼见,只有在它被解释为现实之后,它的缺陷才开始暴露出来,然后将会出现另一套同样内涵丰富的但与之正相反的新谬论,并且这一过程仍将不断地进行下去。这种观点在正统那里可以说是“异端邪说”,但索罗斯靠着这个思想衍生出来的投资方法获得惊人的成就。

可错性与索罗斯的哲学信仰一脉相承。

索罗斯的哲学根基主要是来源于卡尔﹒波普的证伪主义,还有部分是来源于哈耶克的《感觉的秩序》和《科学的反革命》。证伪主义可以说是认识论上的一次革命,它震耳发聩地提出了新的观点。它认为所有的科学知识都是暂时的,都是等待被证伪的,一些今天看来颠簸不破的真理,很可能只是明天的谬论而已。科学命题不能被证实,只可以被证伪,可证伪性是科学与非科学的划分标准。人类科学知识的增长不是累积式的前进,而是排除错误式的前进,先提出假说,然后予以反驳。

由此,索罗斯提出两个反对,一是反对归纳法,二是反对科学主义。

索罗斯认为,不可能经由归纳法则概括出赢取超额利润的一般方法,假如存在,那么投资者理论上就可以通吃市场,而市场将不复存在。归纳法是典型的累积式的认识论,它违法了从猜想到反驳的证伪原则。用黑天鹅理论来说,即使发现了99只白天鹅,也不能用归纳法说所有的天鹅都是白的,也许第100只是黑的。所以,索罗斯认为,试图照搬自然科学研究方法来归纳出金融市场的历史过程、或者从历史过程中总结出一般性的盈利方法,都犯了投资大忌。

与此同时,索罗斯还极力反对科学主义。自然科学和社会科学有巨大的差异,前者研究的对象是独立的事实,无论研究者抱着什么样的态度都改变不了事实,而后者参杂了观察者的偏见,研究者的信仰、价值观、立场、思维方式的差异都可以重塑事实。金融市场属于后者,股价怎么走不仅取决于事实即基本面,也取决于人们的偏见即怎么看待基本面,由此金融市场就充满巨大的不确定性。
为了说明这个问题,索罗斯引用量子力学的理论。海森堡的量子力学认为,量子粒子的质量和速度不可能同时得到精确的测量,其原因在于测量行为干扰了测量对象,在这种情况下,不确定因素是由外部观察者引入的。
 
融市场本身,从而让股价的走势不再是独立的,它总是与参与思维发生反复的共振,这也就是反身性。
 
既然是这样,金融市场就不可能用简单的科学方法来计算。而科学主义者却机械地、毫无批判地将科学方法加诸其研究之上,从这个意义上来说,科学主义恰恰是对科学精神的背叛。

索罗斯赞哈耶克的观点,科学主义是我们的现代科学文明中自我毁灭的力量,是滥用理性的极端表现。他反对任何人假借科学的名义而妄称掌握终极真理的理性狂妄。这也就是为什么投资大师反对过度数学化、工程化倾向,索罗斯甚至不无讽刺的说,他的数学符号从来不比ɑ、? 更多。
而另一个大师巴菲特也说,他用到的数学知识不超过小学水平。索罗斯很反对一些主流经济学家所谓的数量分析,他认同凯恩斯的观点:经济现实中的变量往往是互相依赖的,而某些传统的学者却假设它们是独立存在的,从而用偏微分的方法得出一定的结论,而当他们把结论用于现实时,却又忘记了这些结论赖以存在的假设条件……这是典型的伪数学方法……假设条件使那些作者们能在矫揉造作和毫无用处的数学符号中,忘记现实世界的复杂性和互相依赖的性质。

对归纳法和科学主义的深恶痛疾让索罗斯不得不另辟蹊径,由此索罗斯进入了反身性的世界,并最终得出炼金术的观点。
什么是反身性?

这个概念很晦涩,我们来一层一层的认识它。我们先来看一个命题:一个罗马人说,所有罗马人都撒谎。请问这个罗马人的话是真命题还是假命题?如果相信他,那么就面临一个逻辑悖论:承认了至少有一个罗马人说真话,从而又否定了他。这就是著名的“说谎者悖论”。大哲学家罗素面对这个悖论的时候说,我们应该把命题分为涉及自身的陈述和不涉及自身的陈述,如此就可以解决说谎者悖论。这里就引出一个重要的因素:涉及自身。

索罗斯由此出发来导出反身性概念,索罗斯认为,凡是涉及命题者自身、在内容上“或真”的命题,都是反身性命题。

进一步说,研究对象受到研究者自身的影响就叫反身性。如此一来,股票市场天然就是反身性了,因为股票参与者的观点必然影响到股价,进而让股价不再独立。为了说明这个问题,索罗斯又引出两个函数:

y=f(x) 认知函数
x=F(y) 参与函数

人的行为是y,人的认识是x,行为是认识的函数,表述为认知函数。
其含义是:有什么样的知识就有什么样的行为。而人的行为对人的认识有反作用,认识是行为的函数,表述为参与函数,其含义是:有某一类行为就会有某一类知识。“两个函数同时发挥作用,互相干扰。函数以自变量为前提产生确定的结果,但在这种情境下,一个函数的自变量是另外一个函数的因变量。

确定的结果不再出现,我们看到的是一种相互作用,其中情景和参与者的观点两者均为因变量,以致一个初始变化会突然同时引起情景和参与者观点的进一步变化,我称之为反身性。”上述函数又会产生递归性,它们不会产生均衡,而只有一个永无止境的变化过程。用函数表达其变化为:
y=f(F(y))
x=F(f(x))
这就是说,x和y都是它自身变化的函数——认识是认识变化的的函数,行为是行为变化的函数。它实际上也是一种“自回归系统”。索罗斯用这这个函数是想说明,金融市场根本区别于自然科学研究的过程,在那里,一组事件跟随另一组事件,不受思维和认知的干扰。而金融市场是思维参与其中,因果关系不再是一组事件直接导向下一组事件,相反,它以一种类似鞋襻的模式将事实联结与认知,认知复联结于事实。
如此,反身性理论构建完毕,用通俗的话来解释,就是参与者的认知和被认知对象互相影响,基本面影响观点,观点反过来也影响基本面,它们永不均衡,互动变化,以致无穷。

美国学者约翰﹒特雷恩在《大师的投资习惯》中对此有过精彩解读:“‘反身性原理’的本质是指认知可以改变事件,而事件反过来又改变认知。这种效应通常被称为‘反馈’。这就好比,如果你拴住一条脾气好的狗并踢他,骂它‘坏狗’,那么这条狗会真的变得很凶,并扑过来咬你,而这又会引来更多的踢打、更多的撕咬。”

再举个更直白的例子,如果投资者相信美元升值,那么他们的购买行为讲会让美元上涨,这反过来又会使利率降低,刺激经济增长,从而推动美元再次升值。这也就回到前面的那个说谎者的悖论,凡是涉及自我的命题,自我都难逃脱干系。在这个过程中,任何简单的只研究股价本身而不顾参与者偏见的科学主义都是错的。

说得更极端些,那些即使是认识错误的命题,只要有足够强大的影响力,它依然能在股市获利,这就是为什么股价有时候看起来泡沫很大但买的人很多,有时候看起来又低得可怜但无人问津。因为金融市场是个“炼金术”,投资者的决策意意识和决策行为具有像“炼金师”那么改变“事实结构”的“意志力”。在科学家看来,改变“物质结构”的“意念”是伪科学的,但在金融世界里,“改变市场结构”的“主流偏见”却是真是的,却是可以赚大钱的。所以,金融市场拒绝了科学主义,却接纳了金融炼金术。

整理一下刚才的逻辑,索罗斯认为,很多认知貌似真理,其实是错的、不确定的,它们所谓的正确只是暂时的、等待证伪的。无论它们是通过归纳法还是科学主义得到的认识,都不足以垄断真理和科学,在自然科学领域如此,在社会科学领域更是如此。更荒谬的是,很多人把自然科学的方法和结论强加在社会现象的研究中,这如同把魔术方法应用到自然科学领域的炼金术一样,只能使炼金术身败名裂。

社会科学是特殊的领域,研究者可以对研究对象施加自己的影响,在社会、政治、经济事物中,理论即使没有确凿的证据也可以是有效的,因为社会科学充满反身性,只要主流偏见足够强大,谬论也会在某些情况下变成“真理”,所以金融炼金术可以大行其道。

金融市场是反身性市场,它的决策不可能成为一个科学研究的命题,相反,它更像一个“非科学”的“炼金术”,因为金融市场中的决策评价取决于参与者们歪曲了的见解。正是因为参与者的决策并非基于客观的条件,而是对条件的解释,所以金融市场的根子是不确定的、是可错的。

没有人能完全正确认识市场,任何所谓正确的认识都只能是猜测,它还须接受反驳和证伪。投资的过程就是不断提出猜想并让市场验证和反驳的过程,而不是用科学命题去决策的过程。在索罗斯眼里,金融市场是不确定的,这种不确定是根本性的、是绝对的,任何看法都可能错,任何错误都可能发生,它们本质上也就是风险。索罗斯思想的底色就是可错性、不确定性、认知的不完备性,也就是风险性。

索罗斯的哲学认知论让他怀疑一切,包括他自己。
 
索罗斯谈到他为什么和罗杰斯分道扬镳时说,罗杰斯有个重大缺陷:“他极为藐视华尔街专业人才的精明”----尽管在这一点上索罗斯认为自己和罗杰斯看法相同----但是“罗杰斯却极为自信,从来不承认自己也可能犯错”,而“我却时刻相信自己也会犯错误”。这道出了索罗斯内心的哲学根基:证伪主义。市场总是错的,我也总会犯错。这就形成了索罗斯对股市的根本判断:股市风险第一,不确定第一,所以要想在股市生存必须时刻学会逃跑,因为投资本质上是在冒险。
 
个人总结一下,个人理解,要成为索罗斯这种人,那么就是个疯子。 因为他需要怀疑周围的一切,包括他自己,因为在索罗斯看来,什么都是可以证伪的。这样的人,在我看来,会被人理解为人格分裂。 如果不是他靠这个积累了大量财富,绝对会被人当做是一个疯子。
 

《pythno金融实战》 读后感与勘误

书籍李魔佛 发表了文章 • 0 个评论 • 2505 次浏览 • 2019-02-16 19:23 • 来自相关话题

这本书有过多的错误,所以读起来有点不爽。
 
对于没有一定金融知识的程序员来说,也许是一本天书,专有名词特别多,而书中也没做详细的解释。
 
主要是书中代码注释太少,看起来很吃力。
 
不推荐。
 
勘误:
P165
最后一行应该是卖出IBM的股票
 
P181
公式 8-27 应该为 y=3+2x**2 (错的太离谱)
 
 
PS:这本书不是老外写的,是一个中国人写的,封面上居然写着译本。 查看全部
这本书有过多的错误,所以读起来有点不爽。
 
对于没有一定金融知识的程序员来说,也许是一本天书,专有名词特别多,而书中也没做详细的解释。
 
主要是书中代码注释太少,看起来很吃力。
 
不推荐。
 
勘误:
P165
最后一行应该是卖出IBM的股票
 
P181
公式 8-27 应该为 y=3+2x**2 (错的太离谱)
 
 
PS:这本书不是老外写的,是一个中国人写的,封面上居然写着译本。

docker实战 勘误 (docker in action)

回复

书籍李魔佛 发起了问题 • 1 人关注 • 0 个回复 • 3496 次浏览 • 2019-11-09 15:48 • 来自相关话题

docker实战 代码勘误

Linux李魔佛 发表了文章 • 0 个评论 • 2346 次浏览 • 2019-11-25 11:24 • 来自相关话题

作者在官网刊登的勘误记录:
 
看这本书的作者一定要看,不然坑挺多的。
一路采坑过来的哭着说。Last updated August 21, 2016
In an effort to offer continued support beyond publication, we have listed many updates to code due to version updates.

[code - omission] Page 18

The command to start the "mailer" is missing a line. Where the book reads:
docker run -d \
--name mailer \
the proper command should read:
docker run -d \
--name mailer \
dockerinaction/ch2_mailer

[code - regression] Page 68

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" reader
Replacement:
docker inspect --format "{{json .Mounts}}" reader

[code - regression] Page 69

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" student
Replacement:
docker inspect --format "{{json .Mounts}}" student

[code - regression] Page 74

The alpine image entrypoint has changed since original publication and has been unset. The last command on the page should now read:
docker run --rm \
--volumes-from tools \
--entrypoint /bin/sh \
alpine:latest \
-c 'ls /operations/*'
[code - regression] Page 75

The docker exec example on the top of page 75 was printed with the wrong tool name. The correct command is:
docker exec important_application /operations/tools/diagnostics

[code - regression] Page 86

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--hostname barker \
busybox:1 \
nslookup barker

[code - regression] Page 87 (top)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns 8.8.8.8 \
busybox:1 \
nslookup docker.com

[code - regression] Page 87 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns-search docker.com \
busybox:1 \
nslookup registry.hub

[code - regression] Page 88 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--add-host test:10.10.10.255 \
busybox:1 \
nslookup test

[code - regression] Page 106

There are a few new problems with this example. First, the named repository (dockerfile/mariadb) no longer exists. You can use mariadb:5.5 as replacement. However, the second problem is that containers created from the mariadb image perform certain initialization at startup. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start the database with the following command:
docker run -d --name ch6_mariadb \
--memory 256m \
--cpu-shares 1024 \
--cap-drop net_raw \
-e MYSQL_ROOT_PASSWORD=test \
mariadb:5.5

[code - regression] Page 107

Containers created from the wordpress:4.1 image perform certain initialization at startup and expect certain environment variables. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start wordpress with the following command:
docker run -d -P --name ch6_wordpress \
--memory 512m \
--cpu-shares 512 \
--cap-drop net_raw \
-e WORDPRESS_DB_PASSWORD=test \
mariadb:5.5

[code - typo] Page 109

The device access example is missing the "run" subcommand. The command listed as:
docker -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
should have been written as:
docker run -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev

[code - typo] Page 110 - 111

Several commands are missing the "run" subcommand. In each case the command begins with
docker -d ...
and should have been written as:
docker run -d ...

[code - regression] Page 115 (bottom)

The busybox and alpine images have been updated to fix the problem described in the paragraph below. The 'su' command does not have the SUID bit set and will not provide any automatic privilege escalation.

[command correction] Page 116

Boot2Docker has been discontinued and rolled into a newer project called Docker Machine. Because a reader is unlikely to have the boot2docker command installed, the command at the top of this page should be changed from:
boot2docker ssh
to the Docker Machine equivalent:
docker-machine ssh default
where default is the name of the machine you created.

[code - regression] Page 119

The ifconfig command has since been removed from ubuntu:latest. Instead of using the ubuntu:latest image for these examples use ubuntu:trusty. The example using ifconfig should look like:
docker run --rm \
--privileged \
ubuntu:trusty ifconfig
[Illustration Mistake] Page 136
Image layer ced2 on the left side of the illustration is listed at c3d2 on the right side. These two layers should represent the same item.

[code - typo] Page 140

Containers need not be in a running state in order to export their file system. The first command on page 140 uses the "run" subcommand but the command listed will never be able to start. Replace "run" with "create." The command should appear as follows:
docker create --name export-test \
dockerinaction/ch7_packed:latest ./echo For Export

[code - missing line] Page 146

In the example Dockerfile near the top of the page the line with the RUN directive is missing part of the instruction. That line should read:
RUN apt-get update && apt-get install -y git

[code - evolution] Page 215

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: s3-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 216

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: rados-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
rados:
poolname: radospool
username: radosuser
chunksize: 4194304
maintenance:
uploadpurging:
enabled: false
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 218

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: redis-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
cache:
blobdescriptor: redis
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
redis:
addr: redis-host:6379
password: asecret
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
[code - typo] Page 220

The name of the file shown should be scalable-config.yml as in previous examples. This example also requires the addition of the newer uploadpurging attributes. The mainenance section of the file should be as follows:
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
[text - typo] Page 240

In the second paragraph the reader is instructed to, "Open ./coffee/api/api.py" this is not the correct location of the file. The correct file location is at, "./coffee/app/api.py."
[text - typo] Page 262

The refere nce to "flock.json" in the first sentence of the third paragraph should be "flock.yml."
[code - typo] Page 270

The git clone command uses the ssh protocol instead of https. The command should read as follows:
git clone https://github.com/dockerinact ... i.git 查看全部
作者在官网刊登的勘误记录:
 
看这本书的作者一定要看,不然坑挺多的。
一路采坑过来的哭着说。
Last updated August 21, 2016
In an effort to offer continued support beyond publication, we have listed many updates to code due to version updates.

[code - omission] Page 18

The command to start the "mailer" is missing a line. Where the book reads:
docker run -d \
--name mailer \
the proper command should read:
docker run -d \
--name mailer \
dockerinaction/ch2_mailer

[code - regression] Page 68

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" reader
Replacement:
docker inspect --format "{{json .Mounts}}" reader

[code - regression] Page 69

Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" student
Replacement:
docker inspect --format "{{json .Mounts}}" student

[code - regression] Page 74

The alpine image entrypoint has changed since original publication and has been unset. The last command on the page should now read:
docker run --rm \
--volumes-from tools \
--entrypoint /bin/sh \
alpine:latest \
-c 'ls /operations/*'
[code - regression] Page 75

The docker exec example on the top of page 75 was printed with the wrong tool name. The correct command is:
docker exec important_application /operations/tools/diagnostics

[code - regression] Page 86

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--hostname barker \
busybox:1 \
nslookup barker

[code - regression] Page 87 (top)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns 8.8.8.8 \
busybox:1 \
nslookup docker.com

[code - regression] Page 87 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns-search docker.com \
busybox:1 \
nslookup registry.hub

[code - regression] Page 88 (bottom)

It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--add-host test:10.10.10.255 \
busybox:1 \
nslookup test

[code - regression] Page 106

There are a few new problems with this example. First, the named repository (dockerfile/mariadb) no longer exists. You can use mariadb:5.5 as replacement. However, the second problem is that containers created from the mariadb image perform certain initialization at startup. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start the database with the following command:
docker run -d --name ch6_mariadb \
--memory 256m \
--cpu-shares 1024 \
--cap-drop net_raw \
-e MYSQL_ROOT_PASSWORD=test \
mariadb:5.5

[code - regression] Page 107

Containers created from the wordpress:4.1 image perform certain initialization at startup and expect certain environment variables. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start wordpress with the following command:
docker run -d -P --name ch6_wordpress \
--memory 512m \
--cpu-shares 512 \
--cap-drop net_raw \
-e WORDPRESS_DB_PASSWORD=test \
mariadb:5.5

[code - typo] Page 109

The device access example is missing the "run" subcommand. The command listed as:
docker -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
should have been written as:
docker run -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev

[code - typo] Page 110 - 111

Several commands are missing the "run" subcommand. In each case the command begins with
docker -d ...
and should have been written as:
docker run -d ...

[code - regression] Page 115 (bottom)

The busybox and alpine images have been updated to fix the problem described in the paragraph below. The 'su' command does not have the SUID bit set and will not provide any automatic privilege escalation.

[command correction] Page 116

Boot2Docker has been discontinued and rolled into a newer project called Docker Machine. Because a reader is unlikely to have the boot2docker command installed, the command at the top of this page should be changed from:
boot2docker ssh
to the Docker Machine equivalent:
docker-machine ssh default
where default is the name of the machine you created.

[code - regression] Page 119

The ifconfig command has since been removed from ubuntu:latest. Instead of using the ubuntu:latest image for these examples use ubuntu:trusty. The example using ifconfig should look like:
docker run --rm \
--privileged \
ubuntu:trusty ifconfig
[Illustration Mistake] Page 136
Image layer ced2 on the left side of the illustration is listed at c3d2 on the right side. These two layers should represent the same item.

[code - typo] Page 140

Containers need not be in a running state in order to export their file system. The first command on page 140 uses the "run" subcommand but the command listed will never be able to start. Replace "run" with "create." The command should appear as follows:
docker create --name export-test \
dockerinaction/ch7_packed:latest ./echo For Export

[code - missing line] Page 146

In the example Dockerfile near the top of the page the line with the RUN directive is missing part of the instruction. That line should read:
RUN apt-get update && apt-get install -y git

[code - evolution] Page 215

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: s3-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 216

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: rados-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
rados:
poolname: radospool
username: radosuser
chunksize: 4194304
maintenance:
uploadpurging:
enabled: false
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001

[code - evolution] Page 218

The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: redis-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
cache:
blobdescriptor: redis
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
redis:
addr: redis-host:6379
password: asecret
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
[code - typo] Page 220

The name of the file shown should be scalable-config.yml as in previous examples. This example also requires the addition of the newer uploadpurging attributes. The mainenance section of the file should be as follows:
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
[text - typo] Page 240

In the second paragraph the reader is instructed to, "Open ./coffee/api/api.py" this is not the correct location of the file. The correct file location is at, "./coffee/app/api.py."
[text - typo] Page 262

The refere nce to "flock.json" in the first sentence of the third paragraph should be "flock.yml."
[code - typo] Page 270

The git clone command uses the ssh protocol instead of https. The command should read as follows:
git clone https://github.com/dockerinact ... i.git

《机器学习在线 解析阿里云机器学习平台》读后感

深度学习李魔佛 发表了文章 • 0 个评论 • 3183 次浏览 • 2019-03-10 20:18 • 来自相关话题

 现在阿里云的在线学习平台要收费了,一年1700多,所以看了第二章,准备上机试试。没办法,不建议大家看这本书,如果你买了阿里云的学习平台,那么可以去看一下。 不过,既然能买阿里的平台的,应该是直接是要在上面部署的了,这本书是入门的入门,所以还是不要看了。
 
  查看全部
IMG_20190310_201215R.jpg

 现在阿里云的在线学习平台要收费了,一年1700多,所以看了第二章,准备上机试试。没办法,不建议大家看这本书,如果你买了阿里云的学习平台,那么可以去看一下。 不过,既然能买阿里的平台的,应该是直接是要在上面部署的了,这本书是入门的入门,所以还是不要看了。
 
 

大鳄 索罗斯的“反身性”理论 --大师就是大师,或者说是个疯子

闲聊李魔佛 发表了文章 • 1 个评论 • 2720 次浏览 • 2019-02-26 16:25 • 来自相关话题

转载的文章,很有思考价值。推荐一看,需要点耐心。
 索罗斯的投资思想很庞杂,晦涩难懂,很容易产生歧义。

从严格意义上来讲,索罗斯从来没有对外透露过他的具体投资方法。索罗斯在哈佛大学演讲时说幽默的说,凡是读过他书的人绝对赚不到钱,因为没有人能够知道真实的他。

一位观众举手问他:“你能告诉我们真实的你是什么样的吗?”索罗斯笑答:“不能,说出了就没有索罗斯了。”
所以,外界只能是从他的哲学和投资案例来了解他,我也不例外。

我读过索罗斯写的所有书,也读过很多研究索罗斯投资思想的博士硕士论文,我对索罗斯的投资思想有自己的看法。我认为,索罗斯的投资思想是建立在一个基石上,这个基石是错误、可错性、彻底的可错性。市场会犯错误,人会犯错误,一切貌似正确的投资理论也只不过是等待接受检验的错误而已,说得更极端点-----塑造了历史面貌的思想无非是一些内涵丰富的谬论。

一套富于衍生性的谬论往往最初被人们视为真知灼见,只有在它被解释为现实之后,它的缺陷才开始暴露出来,然后将会出现另一套同样内涵丰富的但与之正相反的新谬论,并且这一过程仍将不断地进行下去。这种观点在正统那里可以说是“异端邪说”,但索罗斯靠着这个思想衍生出来的投资方法获得惊人的成就。

可错性与索罗斯的哲学信仰一脉相承。

索罗斯的哲学根基主要是来源于卡尔﹒波普的证伪主义,还有部分是来源于哈耶克的《感觉的秩序》和《科学的反革命》。证伪主义可以说是认识论上的一次革命,它震耳发聩地提出了新的观点。它认为所有的科学知识都是暂时的,都是等待被证伪的,一些今天看来颠簸不破的真理,很可能只是明天的谬论而已。科学命题不能被证实,只可以被证伪,可证伪性是科学与非科学的划分标准。人类科学知识的增长不是累积式的前进,而是排除错误式的前进,先提出假说,然后予以反驳。

由此,索罗斯提出两个反对,一是反对归纳法,二是反对科学主义。

索罗斯认为,不可能经由归纳法则概括出赢取超额利润的一般方法,假如存在,那么投资者理论上就可以通吃市场,而市场将不复存在。归纳法是典型的累积式的认识论,它违法了从猜想到反驳的证伪原则。用黑天鹅理论来说,即使发现了99只白天鹅,也不能用归纳法说所有的天鹅都是白的,也许第100只是黑的。所以,索罗斯认为,试图照搬自然科学研究方法来归纳出金融市场的历史过程、或者从历史过程中总结出一般性的盈利方法,都犯了投资大忌。

与此同时,索罗斯还极力反对科学主义。自然科学和社会科学有巨大的差异,前者研究的对象是独立的事实,无论研究者抱着什么样的态度都改变不了事实,而后者参杂了观察者的偏见,研究者的信仰、价值观、立场、思维方式的差异都可以重塑事实。金融市场属于后者,股价怎么走不仅取决于事实即基本面,也取决于人们的偏见即怎么看待基本面,由此金融市场就充满巨大的不确定性。
为了说明这个问题,索罗斯引用量子力学的理论。海森堡的量子力学认为,量子粒子的质量和速度不可能同时得到精确的测量,其原因在于测量行为干扰了测量对象,在这种情况下,不确定因素是由外部观察者引入的。
 
融市场本身,从而让股价的走势不再是独立的,它总是与参与思维发生反复的共振,这也就是反身性。
 
既然是这样,金融市场就不可能用简单的科学方法来计算。而科学主义者却机械地、毫无批判地将科学方法加诸其研究之上,从这个意义上来说,科学主义恰恰是对科学精神的背叛。

索罗斯赞哈耶克的观点,科学主义是我们的现代科学文明中自我毁灭的力量,是滥用理性的极端表现。他反对任何人假借科学的名义而妄称掌握终极真理的理性狂妄。这也就是为什么投资大师反对过度数学化、工程化倾向,索罗斯甚至不无讽刺的说,他的数学符号从来不比ɑ、? 更多。
而另一个大师巴菲特也说,他用到的数学知识不超过小学水平。索罗斯很反对一些主流经济学家所谓的数量分析,他认同凯恩斯的观点:经济现实中的变量往往是互相依赖的,而某些传统的学者却假设它们是独立存在的,从而用偏微分的方法得出一定的结论,而当他们把结论用于现实时,却又忘记了这些结论赖以存在的假设条件……这是典型的伪数学方法……假设条件使那些作者们能在矫揉造作和毫无用处的数学符号中,忘记现实世界的复杂性和互相依赖的性质。

对归纳法和科学主义的深恶痛疾让索罗斯不得不另辟蹊径,由此索罗斯进入了反身性的世界,并最终得出炼金术的观点。
什么是反身性?

这个概念很晦涩,我们来一层一层的认识它。我们先来看一个命题:一个罗马人说,所有罗马人都撒谎。请问这个罗马人的话是真命题还是假命题?如果相信他,那么就面临一个逻辑悖论:承认了至少有一个罗马人说真话,从而又否定了他。这就是著名的“说谎者悖论”。大哲学家罗素面对这个悖论的时候说,我们应该把命题分为涉及自身的陈述和不涉及自身的陈述,如此就可以解决说谎者悖论。这里就引出一个重要的因素:涉及自身。

索罗斯由此出发来导出反身性概念,索罗斯认为,凡是涉及命题者自身、在内容上“或真”的命题,都是反身性命题。

进一步说,研究对象受到研究者自身的影响就叫反身性。如此一来,股票市场天然就是反身性了,因为股票参与者的观点必然影响到股价,进而让股价不再独立。为了说明这个问题,索罗斯又引出两个函数:

y=f(x) 认知函数
x=F(y) 参与函数

人的行为是y,人的认识是x,行为是认识的函数,表述为认知函数。
其含义是:有什么样的知识就有什么样的行为。而人的行为对人的认识有反作用,认识是行为的函数,表述为参与函数,其含义是:有某一类行为就会有某一类知识。“两个函数同时发挥作用,互相干扰。函数以自变量为前提产生确定的结果,但在这种情境下,一个函数的自变量是另外一个函数的因变量。

确定的结果不再出现,我们看到的是一种相互作用,其中情景和参与者的观点两者均为因变量,以致一个初始变化会突然同时引起情景和参与者观点的进一步变化,我称之为反身性。”上述函数又会产生递归性,它们不会产生均衡,而只有一个永无止境的变化过程。用函数表达其变化为:
y=f(F(y))
x=F(f(x))
这就是说,x和y都是它自身变化的函数——认识是认识变化的的函数,行为是行为变化的函数。它实际上也是一种“自回归系统”。索罗斯用这这个函数是想说明,金融市场根本区别于自然科学研究的过程,在那里,一组事件跟随另一组事件,不受思维和认知的干扰。而金融市场是思维参与其中,因果关系不再是一组事件直接导向下一组事件,相反,它以一种类似鞋襻的模式将事实联结与认知,认知复联结于事实。
如此,反身性理论构建完毕,用通俗的话来解释,就是参与者的认知和被认知对象互相影响,基本面影响观点,观点反过来也影响基本面,它们永不均衡,互动变化,以致无穷。

美国学者约翰﹒特雷恩在《大师的投资习惯》中对此有过精彩解读:“‘反身性原理’的本质是指认知可以改变事件,而事件反过来又改变认知。这种效应通常被称为‘反馈’。这就好比,如果你拴住一条脾气好的狗并踢他,骂它‘坏狗’,那么这条狗会真的变得很凶,并扑过来咬你,而这又会引来更多的踢打、更多的撕咬。”

再举个更直白的例子,如果投资者相信美元升值,那么他们的购买行为讲会让美元上涨,这反过来又会使利率降低,刺激经济增长,从而推动美元再次升值。这也就回到前面的那个说谎者的悖论,凡是涉及自我的命题,自我都难逃脱干系。在这个过程中,任何简单的只研究股价本身而不顾参与者偏见的科学主义都是错的。

说得更极端些,那些即使是认识错误的命题,只要有足够强大的影响力,它依然能在股市获利,这就是为什么股价有时候看起来泡沫很大但买的人很多,有时候看起来又低得可怜但无人问津。因为金融市场是个“炼金术”,投资者的决策意意识和决策行为具有像“炼金师”那么改变“事实结构”的“意志力”。在科学家看来,改变“物质结构”的“意念”是伪科学的,但在金融世界里,“改变市场结构”的“主流偏见”却是真是的,却是可以赚大钱的。所以,金融市场拒绝了科学主义,却接纳了金融炼金术。

整理一下刚才的逻辑,索罗斯认为,很多认知貌似真理,其实是错的、不确定的,它们所谓的正确只是暂时的、等待证伪的。无论它们是通过归纳法还是科学主义得到的认识,都不足以垄断真理和科学,在自然科学领域如此,在社会科学领域更是如此。更荒谬的是,很多人把自然科学的方法和结论强加在社会现象的研究中,这如同把魔术方法应用到自然科学领域的炼金术一样,只能使炼金术身败名裂。

社会科学是特殊的领域,研究者可以对研究对象施加自己的影响,在社会、政治、经济事物中,理论即使没有确凿的证据也可以是有效的,因为社会科学充满反身性,只要主流偏见足够强大,谬论也会在某些情况下变成“真理”,所以金融炼金术可以大行其道。

金融市场是反身性市场,它的决策不可能成为一个科学研究的命题,相反,它更像一个“非科学”的“炼金术”,因为金融市场中的决策评价取决于参与者们歪曲了的见解。正是因为参与者的决策并非基于客观的条件,而是对条件的解释,所以金融市场的根子是不确定的、是可错的。

没有人能完全正确认识市场,任何所谓正确的认识都只能是猜测,它还须接受反驳和证伪。投资的过程就是不断提出猜想并让市场验证和反驳的过程,而不是用科学命题去决策的过程。在索罗斯眼里,金融市场是不确定的,这种不确定是根本性的、是绝对的,任何看法都可能错,任何错误都可能发生,它们本质上也就是风险。索罗斯思想的底色就是可错性、不确定性、认知的不完备性,也就是风险性。

索罗斯的哲学认知论让他怀疑一切,包括他自己。
 
索罗斯谈到他为什么和罗杰斯分道扬镳时说,罗杰斯有个重大缺陷:“他极为藐视华尔街专业人才的精明”----尽管在这一点上索罗斯认为自己和罗杰斯看法相同----但是“罗杰斯却极为自信,从来不承认自己也可能犯错”,而“我却时刻相信自己也会犯错误”。这道出了索罗斯内心的哲学根基:证伪主义。市场总是错的,我也总会犯错。这就形成了索罗斯对股市的根本判断:股市风险第一,不确定第一,所以要想在股市生存必须时刻学会逃跑,因为投资本质上是在冒险。
 
个人总结一下,个人理解,要成为索罗斯这种人,那么就是个疯子。 因为他需要怀疑周围的一切,包括他自己,因为在索罗斯看来,什么都是可以证伪的。这样的人,在我看来,会被人理解为人格分裂。 如果不是他靠这个积累了大量财富,绝对会被人当做是一个疯子。
  查看全部
转载的文章,很有思考价值。推荐一看,需要点耐心。
 索罗斯的投资思想很庞杂,晦涩难懂,很容易产生歧义。

从严格意义上来讲,索罗斯从来没有对外透露过他的具体投资方法。索罗斯在哈佛大学演讲时说幽默的说,凡是读过他书的人绝对赚不到钱,因为没有人能够知道真实的他。

一位观众举手问他:“你能告诉我们真实的你是什么样的吗?”索罗斯笑答:“不能,说出了就没有索罗斯了。”
所以,外界只能是从他的哲学和投资案例来了解他,我也不例外。

我读过索罗斯写的所有书,也读过很多研究索罗斯投资思想的博士硕士论文,我对索罗斯的投资思想有自己的看法。我认为,索罗斯的投资思想是建立在一个基石上,这个基石是错误、可错性、彻底的可错性。市场会犯错误,人会犯错误,一切貌似正确的投资理论也只不过是等待接受检验的错误而已,说得更极端点-----塑造了历史面貌的思想无非是一些内涵丰富的谬论。

一套富于衍生性的谬论往往最初被人们视为真知灼见,只有在它被解释为现实之后,它的缺陷才开始暴露出来,然后将会出现另一套同样内涵丰富的但与之正相反的新谬论,并且这一过程仍将不断地进行下去。这种观点在正统那里可以说是“异端邪说”,但索罗斯靠着这个思想衍生出来的投资方法获得惊人的成就。

可错性与索罗斯的哲学信仰一脉相承。

索罗斯的哲学根基主要是来源于卡尔﹒波普的证伪主义,还有部分是来源于哈耶克的《感觉的秩序》和《科学的反革命》。证伪主义可以说是认识论上的一次革命,它震耳发聩地提出了新的观点。它认为所有的科学知识都是暂时的,都是等待被证伪的,一些今天看来颠簸不破的真理,很可能只是明天的谬论而已。科学命题不能被证实,只可以被证伪,可证伪性是科学与非科学的划分标准。人类科学知识的增长不是累积式的前进,而是排除错误式的前进,先提出假说,然后予以反驳。

由此,索罗斯提出两个反对,一是反对归纳法,二是反对科学主义。

索罗斯认为,不可能经由归纳法则概括出赢取超额利润的一般方法,假如存在,那么投资者理论上就可以通吃市场,而市场将不复存在。归纳法是典型的累积式的认识论,它违法了从猜想到反驳的证伪原则。用黑天鹅理论来说,即使发现了99只白天鹅,也不能用归纳法说所有的天鹅都是白的,也许第100只是黑的。所以,索罗斯认为,试图照搬自然科学研究方法来归纳出金融市场的历史过程、或者从历史过程中总结出一般性的盈利方法,都犯了投资大忌。

与此同时,索罗斯还极力反对科学主义。自然科学和社会科学有巨大的差异,前者研究的对象是独立的事实,无论研究者抱着什么样的态度都改变不了事实,而后者参杂了观察者的偏见,研究者的信仰、价值观、立场、思维方式的差异都可以重塑事实。金融市场属于后者,股价怎么走不仅取决于事实即基本面,也取决于人们的偏见即怎么看待基本面,由此金融市场就充满巨大的不确定性。
为了说明这个问题,索罗斯引用量子力学的理论。海森堡的量子力学认为,量子粒子的质量和速度不可能同时得到精确的测量,其原因在于测量行为干扰了测量对象,在这种情况下,不确定因素是由外部观察者引入的。
 
融市场本身,从而让股价的走势不再是独立的,它总是与参与思维发生反复的共振,这也就是反身性。
 
既然是这样,金融市场就不可能用简单的科学方法来计算。而科学主义者却机械地、毫无批判地将科学方法加诸其研究之上,从这个意义上来说,科学主义恰恰是对科学精神的背叛。

索罗斯赞哈耶克的观点,科学主义是我们的现代科学文明中自我毁灭的力量,是滥用理性的极端表现。他反对任何人假借科学的名义而妄称掌握终极真理的理性狂妄。这也就是为什么投资大师反对过度数学化、工程化倾向,索罗斯甚至不无讽刺的说,他的数学符号从来不比ɑ、? 更多。
而另一个大师巴菲特也说,他用到的数学知识不超过小学水平。索罗斯很反对一些主流经济学家所谓的数量分析,他认同凯恩斯的观点:经济现实中的变量往往是互相依赖的,而某些传统的学者却假设它们是独立存在的,从而用偏微分的方法得出一定的结论,而当他们把结论用于现实时,却又忘记了这些结论赖以存在的假设条件……这是典型的伪数学方法……假设条件使那些作者们能在矫揉造作和毫无用处的数学符号中,忘记现实世界的复杂性和互相依赖的性质。

对归纳法和科学主义的深恶痛疾让索罗斯不得不另辟蹊径,由此索罗斯进入了反身性的世界,并最终得出炼金术的观点。
什么是反身性?

这个概念很晦涩,我们来一层一层的认识它。我们先来看一个命题:一个罗马人说,所有罗马人都撒谎。请问这个罗马人的话是真命题还是假命题?如果相信他,那么就面临一个逻辑悖论:承认了至少有一个罗马人说真话,从而又否定了他。这就是著名的“说谎者悖论”。大哲学家罗素面对这个悖论的时候说,我们应该把命题分为涉及自身的陈述和不涉及自身的陈述,如此就可以解决说谎者悖论。这里就引出一个重要的因素:涉及自身。

索罗斯由此出发来导出反身性概念,索罗斯认为,凡是涉及命题者自身、在内容上“或真”的命题,都是反身性命题。

进一步说,研究对象受到研究者自身的影响就叫反身性。如此一来,股票市场天然就是反身性了,因为股票参与者的观点必然影响到股价,进而让股价不再独立。为了说明这个问题,索罗斯又引出两个函数:

y=f(x) 认知函数
x=F(y) 参与函数

人的行为是y,人的认识是x,行为是认识的函数,表述为认知函数。
其含义是:有什么样的知识就有什么样的行为。而人的行为对人的认识有反作用,认识是行为的函数,表述为参与函数,其含义是:有某一类行为就会有某一类知识。“两个函数同时发挥作用,互相干扰。函数以自变量为前提产生确定的结果,但在这种情境下,一个函数的自变量是另外一个函数的因变量。

确定的结果不再出现,我们看到的是一种相互作用,其中情景和参与者的观点两者均为因变量,以致一个初始变化会突然同时引起情景和参与者观点的进一步变化,我称之为反身性。”上述函数又会产生递归性,它们不会产生均衡,而只有一个永无止境的变化过程。用函数表达其变化为:
y=f(F(y))
x=F(f(x))
这就是说,x和y都是它自身变化的函数——认识是认识变化的的函数,行为是行为变化的函数。它实际上也是一种“自回归系统”。索罗斯用这这个函数是想说明,金融市场根本区别于自然科学研究的过程,在那里,一组事件跟随另一组事件,不受思维和认知的干扰。而金融市场是思维参与其中,因果关系不再是一组事件直接导向下一组事件,相反,它以一种类似鞋襻的模式将事实联结与认知,认知复联结于事实。
如此,反身性理论构建完毕,用通俗的话来解释,就是参与者的认知和被认知对象互相影响,基本面影响观点,观点反过来也影响基本面,它们永不均衡,互动变化,以致无穷。

美国学者约翰﹒特雷恩在《大师的投资习惯》中对此有过精彩解读:“‘反身性原理’的本质是指认知可以改变事件,而事件反过来又改变认知。这种效应通常被称为‘反馈’。这就好比,如果你拴住一条脾气好的狗并踢他,骂它‘坏狗’,那么这条狗会真的变得很凶,并扑过来咬你,而这又会引来更多的踢打、更多的撕咬。”

再举个更直白的例子,如果投资者相信美元升值,那么他们的购买行为讲会让美元上涨,这反过来又会使利率降低,刺激经济增长,从而推动美元再次升值。这也就回到前面的那个说谎者的悖论,凡是涉及自我的命题,自我都难逃脱干系。在这个过程中,任何简单的只研究股价本身而不顾参与者偏见的科学主义都是错的。

说得更极端些,那些即使是认识错误的命题,只要有足够强大的影响力,它依然能在股市获利,这就是为什么股价有时候看起来泡沫很大但买的人很多,有时候看起来又低得可怜但无人问津。因为金融市场是个“炼金术”,投资者的决策意意识和决策行为具有像“炼金师”那么改变“事实结构”的“意志力”。在科学家看来,改变“物质结构”的“意念”是伪科学的,但在金融世界里,“改变市场结构”的“主流偏见”却是真是的,却是可以赚大钱的。所以,金融市场拒绝了科学主义,却接纳了金融炼金术。

整理一下刚才的逻辑,索罗斯认为,很多认知貌似真理,其实是错的、不确定的,它们所谓的正确只是暂时的、等待证伪的。无论它们是通过归纳法还是科学主义得到的认识,都不足以垄断真理和科学,在自然科学领域如此,在社会科学领域更是如此。更荒谬的是,很多人把自然科学的方法和结论强加在社会现象的研究中,这如同把魔术方法应用到自然科学领域的炼金术一样,只能使炼金术身败名裂。

社会科学是特殊的领域,研究者可以对研究对象施加自己的影响,在社会、政治、经济事物中,理论即使没有确凿的证据也可以是有效的,因为社会科学充满反身性,只要主流偏见足够强大,谬论也会在某些情况下变成“真理”,所以金融炼金术可以大行其道。

金融市场是反身性市场,它的决策不可能成为一个科学研究的命题,相反,它更像一个“非科学”的“炼金术”,因为金融市场中的决策评价取决于参与者们歪曲了的见解。正是因为参与者的决策并非基于客观的条件,而是对条件的解释,所以金融市场的根子是不确定的、是可错的。

没有人能完全正确认识市场,任何所谓正确的认识都只能是猜测,它还须接受反驳和证伪。投资的过程就是不断提出猜想并让市场验证和反驳的过程,而不是用科学命题去决策的过程。在索罗斯眼里,金融市场是不确定的,这种不确定是根本性的、是绝对的,任何看法都可能错,任何错误都可能发生,它们本质上也就是风险。索罗斯思想的底色就是可错性、不确定性、认知的不完备性,也就是风险性。

索罗斯的哲学认知论让他怀疑一切,包括他自己。
 
索罗斯谈到他为什么和罗杰斯分道扬镳时说,罗杰斯有个重大缺陷:“他极为藐视华尔街专业人才的精明”----尽管在这一点上索罗斯认为自己和罗杰斯看法相同----但是“罗杰斯却极为自信,从来不承认自己也可能犯错”,而“我却时刻相信自己也会犯错误”。这道出了索罗斯内心的哲学根基:证伪主义。市场总是错的,我也总会犯错。这就形成了索罗斯对股市的根本判断:股市风险第一,不确定第一,所以要想在股市生存必须时刻学会逃跑,因为投资本质上是在冒险。
 
个人总结一下,个人理解,要成为索罗斯这种人,那么就是个疯子。 因为他需要怀疑周围的一切,包括他自己,因为在索罗斯看来,什么都是可以证伪的。这样的人,在我看来,会被人理解为人格分裂。 如果不是他靠这个积累了大量财富,绝对会被人当做是一个疯子。
 

《pythno金融实战》 读后感与勘误

书籍李魔佛 发表了文章 • 0 个评论 • 2505 次浏览 • 2019-02-16 19:23 • 来自相关话题

这本书有过多的错误,所以读起来有点不爽。
 
对于没有一定金融知识的程序员来说,也许是一本天书,专有名词特别多,而书中也没做详细的解释。
 
主要是书中代码注释太少,看起来很吃力。
 
不推荐。
 
勘误:
P165
最后一行应该是卖出IBM的股票
 
P181
公式 8-27 应该为 y=3+2x**2 (错的太离谱)
 
 
PS:这本书不是老外写的,是一个中国人写的,封面上居然写着译本。 查看全部
这本书有过多的错误,所以读起来有点不爽。
 
对于没有一定金融知识的程序员来说,也许是一本天书,专有名词特别多,而书中也没做详细的解释。
 
主要是书中代码注释太少,看起来很吃力。
 
不推荐。
 
勘误:
P165
最后一行应该是卖出IBM的股票
 
P181
公式 8-27 应该为 y=3+2x**2 (错的太离谱)
 
 
PS:这本书不是老外写的,是一个中国人写的,封面上居然写着译本。