问了gpt几个适合孩子打字的网站,选择了typing club,看起来娱乐性不错,打算让果果试一试。主要培养孩子如下几点:

  1. 认识比本的字母,英文的基础
  2. 通过打字接触到计算机的一个外设,对计算机能有初步认识
  3. 打字是编辑的基础,编辑是coding的基础
  4. 打字也是使用工具的基础
  5. 等能够打字了,可以学习数学相关的工具,比如maple learn和mathematica,gpt告诉我maple learn更适合孩子,等后面可以试一试

前几天网站的图片遭到了不法分子的攻击,怪我没有安全防范意识,bucket还是用公有读,配置COS Referer白名单即可。

果果的打字练习第一课

Motivation

The LLM model is to big to put into the device, if there any batter architecture to make the model small enough to put to the device and keep the precision and inference performance.

The LLM model embedding the word to very high dimension, in order to do better classification. But it will affected by the curse of dimensionality. So we need deep neural net work(more parameters) and more training data to avoid overfitting.

Also use attention mechanism to make them classifiable.

But each time put some words into the space, may be adding one new dimension only useful for related words, and for most other words will add one no useful dimension. And the whole vector space is sparse and need more training data and complex model(more parameters).

We can use the idea of mixture of experts, they form one graph, and some experts are independent, but some has relations between each other, can be connected by edges. So the problem becomes make each experts' dimension as small as possible, and the duplication features in different experts as small as possible. We convert one high dimension sparse LLM to many row dimension dense experts. Just like the symbol table design in compiler, we can use one big flatten symbol table, but the scope level and scope name in each scope are same and can be eliminated, so traditional implementation of the symbol table use the chain of scopes hash table, make a more compact memory.

Design

A graph to represent the model, is all experts, and is the edge of the two experts.

Partitioning

Take the compute system as the whole world. We can split experts to

  • operating system
  • database
  • compiler
  • programming language
  • distributed
  • network
  • micro architecture
  • application
  • electronic
  • common knowledge

Once a word file system coming, will be both added to operating system and databse, and if a word computer arrived, it will be put to the common knowledge. And all experts depend on the common knowledge.

Evolve

All the experts can be version controlled, and can evolve, refactoring. Like add more words, add dimension, remove words to other experts, extract more experts. Just like the package manage system, all experts are packages.

Query(inference)

The query convert to tokens, and send to the related experts, exploit method use dependent experts to combine the results, exploare method to query other experts to find results too. The results contian all the experts, the sub graph forms a path. The path can be cached.

Online learning

Support real time input sentences. The tokenizer first to classification, and put to different experts, batch will trigger insert. Insert data to the experts, and update the path.

During the period 1904 to1947, the vacuum tube was the electronic device of interest and development. In 1904, the vacuum-tube diode was introduced by J. A. Fleming. Shortly thereafter, in 1906, Lee De Forest added a third element, called the control grid, to the vacuum diode, resulting in the first amplifier, the triode. In the following years, radio and television provided great stimulation to the tube industry. Production rose from about 1 million tubes in 1922 to about 100 million in 1937. In the early 1930s the four- element tetrode and the five-element pentode gained prominence in the electron-tube industry. In the years to follow, the industry became one of primary importance, and rapid advances were made in design, manufacturing techniques, high-power and high-frequency applications, and miniaturization.

三极管的发明,和工业界的需求有密切联系。radio and television provided great stimulation to the tube industry. 看现在的AI需求,对于新计算机体系结构也会有新的需求,比如memory system的演进,可能会有比较革命性的变革,比如pim。

On December 23, 1947, however, the electronics industry was to experience the advent of a completely new direction of interest and development. It was on the afternoon of this day that Dr. S. William Shockley, Walter H. Brattain, and John Bardeen demonstrated the amplifying action of the first transistor at the Bell Telephone Laboratories. The original transistor (a point-contact transistor) is shown in Fig. 2. The advantages of this three-terminal solid-state device over the tube were immediately obvious: It was smaller and lightweight; it had no heater requirement or heater loss; it had a rugged construction; it was more efficient since less power was absorbed by the device itself; it was instantly available for use, requiring no warm-up period; and lower operating voltages were possible. Note that this chapter is our first discussion of devices with three or more terminals. You will find that all amplifiers (devices that increase the voltage, current, or power level) have at least three terminals, with one controlling the flow or potential between the other two.

The first transistor

为什么这些创新都是来自美国,Bell实验室,中国到现在为止,始终没有这样原创性的工作,抄永远是跟在别人屁股后面的。这个原型满足了一些基本特性需求:

  • smaller and lightweight
  • it had no heater requirement or heater loss
  • it had a rugged construction
  • it was more efficient since less power was absorbed by the device itself
  • it was instantly available for use, requiring no warm-up period;
  • and lower operating voltages were possible

在研发过程中,应该是有这些目标牵引进行设计探索的。所以从底层原理出发,解决工业界比较强烈的需求,可以做出一些原创性的事情。

The circuit consists of a resistor in series with the voltage source connected to the inverting input of the OpAmp. The non-inverting input of the OpAmp is short circuited to ground(common). A resistor is connected to the output and provides a negative feedback path to the inverting input terminal.

inverting opamp and Since is connected to the common or ground terminal, Node 1 is said to be a virtual ground due to the virtual short circuit between the inverting and non-inverting terminals (which is grounded) as defined by the voltage constraints, The node voltage method of analysis is applied at node 1, By appling Equation , obtained from the virtual short circuit, and the constraint on the current as defined in Equation, Equation is simplified to Solving for the voltage gain, , Notice that the voltage gain is dependent only on the ratio of the resistors external to the OpAmp, and . The amplifier increases the amplitude of the input signal by this ratio. The negative sign in the voltage gain indicates an inversion in the signal.

The output voltage is also constrained by the supply voltages and , Using Equation , the maximum resistor ratio for a given input voltage is

实验

根据下图,计算增益和。如果,输出是多少?多大的输入电压幅值,会造成amplifier饱和?

inverting opamp example

Solution:

The output voltage is independent of the load resistor, , because of the low output resistance of the OpAmp. Therefore, the gain of amplifier is Using KCL at node a, The currents and are and Solving for yields, For and input voltage signal of 由于我使用的是模块,具体参考双电源供电

要计算amplifier的linear region,输入幅值需要小于,

一些实验结果

总体效果

big picture

输入

黄色为输入,左下角一个格子为1v,而蓝色一个格子为5v。

liner op region

输入为2v左右导致输出饱和

发现输出的顶部已经不再是正弦波。和理论计算比较一致。

saturation

运算放大器需要类似的双电源供电。由于只有一个单通道的直流电压源,所以需要做一个双电源供电模块。

diff voltage

所需要的元件:

  1. 单通道电压源
  2. LM324N
  3. 47K电阻两个
  4. 1电容一个100电容两个
实现

参考文章:

https://blog.csdn.net/qq_41836400/article/details/98345011

修改include/apue.h

include/apue.h增加

1
#include <sys/sysmacros.h>

修改stdio/buf.c

打开apue.3e/stdio/buf.c,搜索_LP64,大致在(文件的89~93行),将其删除

1
2
3
4
5
#ifdef _LP64
#define _flag __pad[4]
#define _ptr __pad[1]
#define _base __pad[2]
#endif

is_unbuffered, is_linebufferedbuffer_size替换如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
int
is_unbuffered(FILE *fp)
{
return(fp->_flags & _IONBF);
}

int
is_linebuffered(FILE *fp)
{
return(fp->_flags & _IOLBF);
}

int
buffer_size(FILE *fp)
{
#ifdef _LP64
return(fp->_IO_buf_end - fp->_IO_buf_base);
#else
return(BUFSIZ); /* just a guess */
#endif
}

#else

#error unknown stdio implementation!

#endif

copy头文件和库

1
2
sudo cp ./include/apue.h /usr/include/
sudo cp ./lib/libapue.a /usr/lib/

oh-my-tmux

1
2
3
4
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .

add lines at the end of ~/.tmux.conf.local

1
2
3
4
5
6
7
8
9
10
11
12
13
	# force Vi mode
# really you should export VISUAL or EDITOR environment variable, see manual
set -g status-keys vi
set -g mode-keys vi

# replace C-b by C-a instead of using both prefixes
set -gu prefix2
unbind C-a
unbind C-b
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
set -g prefix M-o
bind M-o send-prefix

install zsh and oh-my-zsh

add 185.199.108.133 raw.githubusercontent.com t o/etc/hosts

1
2
3
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
chsh -s $(which zsh)

install nodejs

install nvm

1
2
3
4
5
6
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.zshrc
nvm list-remote
nvm install v20.8.0
node -v

npm源

1
npm config set registry https://registry.npmmirror.com

install hexo and pandoc

1
2
npm install -g hexo-cli
sudo apt install pandoc

install hexo-theme-next

1
2
cd blog
npm install hexo-theme-next

theme-next patch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/_config.yml b/_config.yml
index 5059e2e..e4daac4 100644
--- a/_config.yml
+++ b/_config.yml
@@ -40,8 +40,8 @@ custom_file_path:
# ---------------------------------------------------------------

favicon:
- small: /images/favicon-16x16-next.png
- medium: /images/favicon-32x32-next.png
+ small: /images/favicon-16x16.png
+ medium: /images/favicon-32x32.png
apple_touch_icon: /images/apple-touch-icon-next.png
safari_pinned_tab: /images/logo.svg
#android_manifest: /images/manifest.json
@@ -164,9 +164,9 @@ sidebar:
# Sidebar Avatar
avatar:
# Replace the default image and set the url here.
- url: #/images/avatar.gif
+ url: /images/maru.jpeg
# If true, the avatar will be dispalyed in circle.
- rounded: false
+ rounded: true
# If true, the avatar will be rotated with the cursor.
rotated: false

@@ -501,7 +501,7 @@ math:

# hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
mathjax:
- enable: false
+ enable: true
# See: https://mhchem.github.io/MathJax-mhchem/
mhchem: false

@@ -712,7 +712,7 @@ firestore:
# Show Views / Visitors of the website / page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi
busuanzi_count:
- enable: false
+ enable: true
total_visitors: true
total_visitors_icon: user
total_views: true
@@ -812,9 +812,11 @@ pdf:

# Mermaid tag
mermaid:
- enable: false
+ enable: true
# Available themes: default | dark | forest | neutral
- theme: forest
+ theme:
+ light: default
+ dark: dark


# ---------------------------------------------------------------
@@ -894,6 +896,7 @@ vendors:
# MathJax
# mathjax: //cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
mathjax:
+ enable: true

# KaTeX
# katex: //cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css
diff --git a/layout/_partials/footer.swig b/layout/_partials/footer.swig
index f60ea9b..dc5f8e9 100644
--- a/layout/_partials/footer.swig
+++ b/layout/_partials/footer.swig
@@ -42,6 +42,12 @@
{%- endif %}
</div>

+<div class=BbeiAn-info">
+ {{ __('<E6><B5><99>ICP<E5><A4><87>') }} -
+ <a href="http://www.miitbeian.gov.cn/">20003462<E5><8F><B7></a>
+ </a>
+</div>
+
{%- if theme.footer.powered %}
<div class="powered-by">
{%- set next_site = 'https://theme-next.org' %}

下载emacs 29.1

  • gi t clone的方式,需要autogen一下

install dependencies

树莓派源

cat /etc/apt/sources.list

1
2
deb http://mirrors.aliyun.com/raspbian/raspbian/ bullseye  main non-free contrib rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ bullseye main non-free contrib rpi

安装emacs依赖

1
sudo apt install libxpm-dev libgif-dev libgnutls28-dev libgtk-3-dev libjpeg-dev libtiff-dev libncurses-dev libgccjit-10-dev

编译

1
2
3
./configure --with-native-compilation
make -j
sudo make install

树莓派小电台

参考炬峰的视频,来搞个电台玩玩。

r pi t x

1
2
3
4
5
6
7
8
git clone https://github.com/F5OEO/rpitx
cd rpitx
./install.sh

sudo reboot

cd rpitx
./easytest.sh # FmRds

windows安装SDR软件

  • 淘宝买一个软件无线电R820T2+RTL2832U
  • 下载地址

树莓派设置

audio输入输出设置

  • Audio Inputs - USB Audio Device
  • Audio Outputs - Analog

验证输入输出

1
arecord -f cd - | aplay -V sterio -

修改testfmrds.sh脚本

1
sudo arecord -f cd -D plughw:2,0 -c 2 - | sudo ./pifmrds -freq "$1" -audio -

修改/boot/config.txt

1
2
# Enable audio (loads snd_bcm2835)
dtparam=audio=off

测试

1
./testfmrds.sh 434

rplidar

build on the pi and dev machine

1
2
3
4
5
6
cd ~/code/dep_ws/src
git clone https://github.com/Slamtec/sllidar_ros2.git
cd ..
colcon build --symlink-install
source install/setup.bash
ros2 launch sllidar_ros2 view_sllidar_launch.py

for normal rplidar

1
sudo apt install ros-foxy-rplidar-ros
0%