<feed xmlns="http://www.w3.org/2005/Atom"> <id>https://wa008.github.io/</id><title>Benson's blog</title><subtitle>Wander around</subtitle> <updated>2026-02-25T09:43:17+08:00</updated> <author> <name>Benson</name> <uri>https://wa008.github.io/</uri> </author><link rel="self" type="application/atom+xml" href="https://wa008.github.io/feed.xml"/><link rel="alternate" type="text/html" hreflang="en" href="https://wa008.github.io/"/> <generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator> <rights> © 2026 Benson </rights> <icon>/assets/img/favicons/favicon.ico</icon> <logo>/assets/img/favicons/favicon-96x96.png</logo> <entry><title>How AI Will Change the Mobile Ecosystem</title><link href="https://wa008.github.io/posts/How-ai-will-change-mobile-development/" rel="alternate" type="text/html" title="How AI Will Change the Mobile Ecosystem" /><published>2026-02-24T00:00:00+08:00</published> <updated>2026-02-24T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/How-ai-will-change-mobile-development/</id> <content src="https://wa008.github.io/posts/How-ai-will-change-mobile-development/" /> <author> <name>Benson</name> </author> <summary>How mobile development will be next year There are many mobile development platforms for non-technical users nowadays, like Rork and Lovable. They are not perfect now but will become much better in a year, just like how ChatGPT changed in the year after it was published, and like how much vibe coding agents have progressed in the last year. These platforms can generate everything we need to submit to the App Store and Google Play Store, like app packages, screenshots, privacy policies, and descriptions. Maybe next year, everyone can build and publish one app in 3 hours. I don’t mean a professionally designed app like Photoshop or Figma, but it’s very possible for a standard music app or management app. Z-Library &amp;amp;amp; Copyright Many users use Z-Library to download books rather than paying for them, but they reject it when someone wants to clone their app. What is the reason? I think it’s because we’re developers, and we make up the majority of voices on the internet. We take advantage of Z-Library, but we lose our advantage with an application copy. This means copying applications will become more like Z-Library if we ignore our attitude. Moreover, how do we define copyright for an app? Unlike a book, it’s hard to identify whether an app violates copyright or not. Based on the two arguments above, I think copying will happen more in the future; some users will choose the cheaper ones because of the price. Media news Another example is transferring from newspapers to UGC platforms. Nowadays, we obtain information from lots of websites other than official news media, like Hacker News, Twitter, and personal blogs. It takes zero cost. Oh, it’s not zero—we have to pay for cloud costs through advertisements. It’s not much, just like the cost to build a new app next year. Nowadays, there is too much information generated by non-professional writers, and most users read information from them over professional news media. New media didn’t kill news, but made the ecosystem richer. It might be the same in the future for applications. Better market: Games We usually use apps to solve a problem; it’s different from reading books. We usually don’t want to explore new apps when we don’t have a demand. Books are more like games—we like to explore new games for fun. So, I think AI will have more influence on games, like other creativity fields. Summary AI will bring strong creativity to the app ecosystem. The costs will become lower for users, and the market will become more competitive for creators and the ecosystem will become richer for stores.</summary> </entry> <entry><title>Look ahead</title><link href="https://wa008.github.io/posts/2025-we-are-entering-AI-era/" rel="alternate" type="text/html" title="Look ahead" /><published>2026-02-23T00:00:00+08:00</published> <updated>2026-02-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/2025-we-are-entering-AI-era/</id> <content src="https://wa008.github.io/posts/2025-we-are-entering-AI-era/" /> <author> <name>Benson</name> </author> <summary>ChatGPT was published in November 2022, it’s 3 years and 3 month till now. Look back, it’s hard to believe that it change so much for computer science and programming. How AI change programming When ChatGPT was published at frist time, we were surprised that it can answer unlimited questions, after that, we started to use it for every question while ridicule, we shared the hallucination with colleagues and friend when we met the ridiculous problem. But that didn’t change the frequency people use it. The appear of cursor stand new stage of application on programming of AI, I didn’t try cursor at first, I thought VS code will with in the end, as past competition of editor. of course, I think I was totally wrong. Next stage is coding agent, like claude code, antigravity and codex. We don’t need to write code in editor window, it’s like the premium version of autocomplate in cursor. I can see that they are becoming better and better in the past half year. Right now, I become too lazy to write code by myself. I havn’t use claude code much now, based on my expericen on antigravity and codex, the coding agent is perfect, but I know the boundary of AI’s capacity, I know that they can edit where I want them to. I don’t have to change code by myself as long as AI coding agent can locate correctly based on my instruction. When I open VS code now, I think it’s like the product of last century. It’s hard to predict This remind me that some people said this years will be the best year in next 10 years in 2019, nobody believed that. But it’s true. We usually don’t belive the thing that havn’t happened, it’s hard predict the future. But it’s much better if we can realize that it’s hard to belive, as a result, it’s more probably to predict part of the future. We also can have more willness to believe new products. Influence AI bring mobile ecosystem AI have significantly reduced the cost of mobile development. There are more and more mobile development platform now, they automate the whole process of mobile deveopment, you don’t need to code 1 line and don’t need to open editor. What you need to is chating and validate the result. The interesting topic of mobile development is how it will change the mobile ecosystem future. Today, I remind the influence electronic book brought to paper book. Of course, it’s not totally same. One similar point is that new mehtod reduce the cost significantly. How much we are willing to pay for the creator of application if its cost is low. Of course, some users will pay for the beautiful appearance, future support and trust, but most users pay for current APP, not others. If we copy currently great app with low cost, how many users will chose the low-price one? it’s hard to say. What about the app that need backend? it depends on what data the backend has, copyright data or just store user’s data. The worlding is change faster than what we thought, keep looking ahead</summary> </entry> <entry><title>Goodbye 2025</title><link href="https://wa008.github.io/posts/2025-year-summary/" rel="alternate" type="text/html" title="Goodbye 2025" /><published>2026-01-13T00:00:00+08:00</published> <updated>2026-01-13T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/2025-year-summary/</id> <content src="https://wa008.github.io/posts/2025-year-summary/" /> <author> <name>Benson</name> </author> <summary>Previous Plan My first blog was summary of 2021, that is the start of the blog, it’s a little hard to believe that I write this blog for five years, I like this feeling. See back the plan of 2025, it’s just very simple. English: fluent Exercise New Products Read My english is much better than me in the start of 2025, one of the most important reasons is that I came to Canada and start to learn here, but not bad, I think achieve well for this goal even I not very fluent. Speaking of Exercise, I didn’t exercise much during majority of 2025, but I exercise regularly recently, that makes feel I finished this task. Yeah, people usually care more what happend recently over in the past, That’s why we need to record what happend and what we are feeling now. Regarding of new products, I really build a lot of product this years, most of them are useless, only me care about them. In particular, I build a lot recently, This is the frist time I have strong feeling that I have so strong productivity with AI. I like the feeling that produce. I didn’t read much this year, including recently. It’s too busy. In addition, I lost interest and passion to read old information when I want to build something new. Others in 2025 I like the new era of AI, I think it bring more productivity to everyone. We can create more tools, products as we want. In the past, some of reasons that I like AI was from my work, now, I touched the power of AI. I want to automate everything that can be done by AI recently, it’s possible. It seems that I’m too excited recently, I don’t want to keep this status for a long time, it’s not good for my physical body. I need a better balance. Antigravity is the pivot for me to realize the power of AI because I have so many tokens to use, to program. That makes me understant why it’s more hard for poor people to earn money, because they have more resource to use, there are more space for them to use their creativity. After arriving Canada, I change a lot for my eating habit, I don’t want to eat fully now, it’s not healthy for my physical body. I also want to eat more simple food, that means food that are created easily. I obtained these knowledge from naval books. I also start to by stock in end of 2025, even I don’t have much money to invest, but it’s a new start. 2026 What I want to achieve: Health: Eating Exercising Sports Products: Build some great products APP Saas Paper Investment: Save money to prepare Annual blog 2024 2023 2022 2021</summary> </entry> <entry><title>Hacker News to Kindle</title><link href="https://wa008.github.io/posts/hackernews-2-kindle/" rel="alternate" type="text/html" title="Hacker News to Kindle" /><published>2025-12-17T00:00:00+08:00</published> <updated>2025-12-17T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/hackernews-2-kindle/</id> <content src="https://wa008.github.io/posts/hackernews-2-kindle/" /> <author> <name>Benson</name> </author> <summary>Why kindle is better I usualy read kindle on the bed before I fall asleep, I think the big advantage of reading kindle is that kindle leads less distractions. When I use computer and browser the website, it’s so eary to do other think when a notification jump, like text messages app or gmail. In contrast, When I read on kindle, I only focus on kindle and nothing else. In the past, I just readed books on kindle. But recently, I found that I can send weekly The Economist edition to kindle to read news. But the weekly update cannot meet my requirement, because my wife spend much more time on preparetion on falling asleep. I realize that I can send more news into kindle to read. It’s a much better choice than reading on the computer or Phone. HN2Kindle The best choice is Hacker News, that is the most popular news source for tech. So, I build a project to send Hacker News contents to kindle. I think kindle or books is definitely a better choice to obtain information than computer or Phone, it can lead less distractions and improve the efficiency. The problems of books and kindle were slow update, but it can be solved by thiry-party service. We can solve this problem as long as we can fine high-quality data, even AI generated contents. Disadvantage I just found a disadvantage of reading news in the evening, it makes me excited. As a result, it will be hard to fall asleep. But it doesn’t matter if you read it at day. Idea comes from new thing I usually have a new idea when I try something new, like finding out new idea about entrepreneurship, taking driving test, university ddl-alert, reading news on kindle. Most things I do are not my choice, but it doesn’t matter, I can have a new idea when I do something new. So, I should try new thing in life when I have new idea. Another method is mining demand from other people, like reddit, quora, that need more ability to simulate what others are experiencing, and it cost more time to fine the valuable ideas from the whole market.</summary> </entry> <entry><title>Another project</title><link href="https://wa008.github.io/posts/another-project-202511/" rel="alternate" type="text/html" title="Another project" /><published>2025-11-28T00:00:00+08:00</published> <updated>2025-11-28T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/another-project-202511/</id> <content src="https://wa008.github.io/posts/another-project-202511/" /> <author> <name>Benson</name> </author> <summary>Project The last month goes fast, because I almost spned all my last month into a new project. Right now, I finish the first relative muture version of the project. Of course, I still realize some feature that I intended to implement later, I just cannot help myself to optimize that part when I was thinking of that. I really enjoyed the feeling that I put all myself into a thing that I’m total responsible and liked. Even I must pend the project because winter is coming, many thing in canada will stop in winter, outdoor activities becomes rare in winter. There is no enought clients for my new project. Reflection Yeah, I don’t want to share more details about this project now, but I want to write relection about the project. The success of a project is very very hard, it will influeced by lots of reason, you can success only when you have the all requirements. Generally, the most important reason about a project is not you, or the most element that have largest influence for the project is not the people how participate the project, that maybe something you can not make decision, like economic trend, or governmental policy. But the owner of project should be responsible to indentify these crucial and necessay elements. For example, I should know that there are few or almost zero clients during winter season for my project, as a reuslt, I can spend less efforts that I’ve done in the project. I also learn some great things from the project: Build the entire service for users rather than half-service, clients prefer to purchase the entire product with high price voer half-service with low price. Reaching out your target clients is the most hard part, don’t be shy when you are readching out, do anything that can help you to reaching out the clients. Publish the first experimental version as soon as possible, to get feedback ASAP and push the positive circle. I also learnt that publish the first muture version as late as possible from someone else, but I don’t have opportunity to apply that in my project. Influence in life I always put anything away when I have a great project to participate with, I’m happy during do the project. But after I failed and quitted the project, I lost so much thing. I need to meet the consequence resulting from my careless for my life, like the relationship with my partner, the poor assignments that I finished without enough care. It happends a lot that a project failed in the end, I should balanace my life better when I meet my next project. More specificly, I should be more peaceful when I meet next great project, that can help me to counter the challenges in life.</summary> </entry> <entry><title>How to imporve english</title><link href="https://wa008.github.io/posts/english-proficiency/" rel="alternate" type="text/html" title="How to imporve english" /><published>2025-10-11T00:00:00+08:00</published> <updated>2025-10-11T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/english-proficiency/</id> <content src="https://wa008.github.io/posts/english-proficiency/" /> <author> <name>Benson</name> </author> <summary>English proficiency I though I can improve my english ability after staying in english speaking country for some time naturally, this is definitely wrong. English proficiency can be imporved only when I practice it. Changing naturally is just the cover of true life. Recently, I took two interviews, that’s the direct event that I realize I still have huge disadvantages on english proficiency. First one is a basic english recorded-video interview, I just introduce myself and failed in that interview. Second is a coding interview for a project, the problem is reading for the materials, I read so slow, as a result, I don’t have enough time for coding. How to improve When I was preparing the standard english test in the past, I use ChatGPT a lot. The most I used ChatGPT is for speaking, it has native speaking ability and talk with me all the time, talking is the more direct and efficient way to imporve speaking ability, talking is practicing for speaking. In addition, I also use ChatGPT to help me correct the sentences or essay I wrote, and use ChatGPT build some automatic tools for listening. After I passed the exam, I use it less and less for learning english. I don’t have the clear target for learning english now, so, I don’t have a clear plan and assign dedicated time for learning english. As a result, I never use ChatGPT for learning english after that. These thing doesn’t influence the fact that ChatGPT is the best tool to help people learn english. Just like saying in The Almanack of Naval that I was reading recently, any opinions cannot influence facts, we should know what is really fact without influence of any kinds of emotions. Back to orignal topic, for input end, we can just practice more listening and reading, there are so much materils we can use. For writing part, we also can practice by ourself and let ChatGPT to correct me for uncorrect spells and obvious grammar errors. For speaking part, I also can practice with ChatGPT, the correctness can be improved from writing, as a result, I can learn english all by myself without helps from others. Diffculty It’s easy to execute with a clear plan, but I realise that I looked for some execuses to avoid the efforts I should put in learning english, this just like the old saying. This makes me have a more deep understanding that we need to recognise as much as fact in life, human are good at looking for execuse for what the do naturally. Hope I can execute the plan well.</summary> </entry> <entry><title>Introduction of Fraud detection</title><link href="https://wa008.github.io/posts/fraud-detection-introduction/" rel="alternate" type="text/html" title="Introduction of Fraud detection" /><published>2025-09-15T00:00:00+08:00</published> <updated>2025-09-15T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/fraud-detection-introduction/</id> <content src="https://wa008.github.io/posts/fraud-detection-introduction/" /> <author> <name>Benson</name> </author> <category term="fraud" /> <category term="working" /> <summary>In short, Target of fraud detection is to detect fradulent traffic and filtering or block them. What mekes this interesting and difficult are what we are detecting are human, it might be as hard as you can imagine to defense with huamn. Strategy Rules Most of the traffic are produced by pruely machine/device without any human involved, like Ddos. Rules usually can handle these kind of fraudulent traffic because they are too obvious. The core ideas to design a rule is to fine a dimension and feature, like count of traffic from same IP. What we need is find a proper dimension and valid features for current case. Models After we block the huge amount of fraudulent traffic, fraud rings usually will add more human-liked feature into the traffic, or create the behaviour totally manually. What they care is RIO, just like what we cared. If the profit is high enough for the manual operation time, it will worth. We need more features and signals to detect fraudulent traffic when they are more likely produced by human, that’s why we need statistic algorithm and machine learning models to detect. Anomaly deteciton Linear regression Tree-base models Graph-base models Deep learning models Mixture of above fraud similation We can simulate the fraud rings to attack our business, which can improve anti-fraud quality help use to estimate the cost to break anti-fraud productions. architecture Online Online Service usually reponse result within 50ms, errors in online product might block all of users of bussiness, and it some times really happens becuase it is designed to blcok users. So we should make sure we don’t give false positive result to business. Streaming We need streaming system to calculate faeture values, these feature will be used in rules and models. Offline Some complex algorithm cannot be implemented in online and streaming system, we can keep high-productivity iteration in offline stage. We also can try various different methods without considering efficiency. In addition, we can detect the hardest fraudulent traffic in offline stage, which is benefitical for online model training. Risk alert Risk alert can prevent from false negative samples. We can reduce the threshold of online rules and models to create risk alert methods, it’s also a great method to apply low-accuracy algorithms. Monitor service Monitor the traffic that we judge fraudulent, prevent from false positive. Montiro and analysis feedback from business, the have more clear view about these traffic. Summary Fradu detection is a mixture area that need engineering, statistics, algorithms and security, it’s a very interesting topic if you like it. It will be more challenging influenced by AI because there are less and less difference between huamn and AI.</summary> </entry> <entry><title>PopTranslate</title><link href="https://wa008.github.io/posts/poptranslate-introduction/" rel="alternate" type="text/html" title="PopTranslate" /><published>2025-09-14T00:00:00+08:00</published> <updated>2025-09-14T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/poptranslate-introduction/</id> <content src="https://wa008.github.io/posts/poptranslate-introduction/" /> <author> <name>Benson</name> </author> <summary>Introduction PopTranslate is a translation chrome extension, main features: Pop up translated contents immediately after selecting contents without extra click Show english dictionary when selecting a word Show translated contenst in the right above corner user experience Sub window will show quickly after selecting, ensuring real-time experience for users User can click any other place but sub window to close pop-up windows, it’s easy to close Availability I use free google translate API for translation service, free dictionaryapi for dictionary service. This project cost zero for me, so this extension can be available for a long time without extra cost investment.</summary> </entry> <entry><title>Last day in netease</title><link href="https://wa008.github.io/posts/last-day-in-netease/" rel="alternate" type="text/html" title="Last day in netease" /><published>2025-08-22T00:00:00+08:00</published> <updated>2025-08-22T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/last-day-in-netease/</id> <content src="https://wa008.github.io/posts/last-day-in-netease/" /> <author> <name>Benson</name> </author> <summary>Today is the last day for me in netease, I don’t much as much feeling as that in baidu, on the one hand, I spend much more time in baidu, almose five days, one the other hand, that’s my first job, first time is always different. What makes my surprise is yesterday, the boss, all people in my small group have a bye-bye lunch, leader and boss are both friendly even I only stay here over four month. This is a friendly team, we don’t have the rules of big tech company, like how to flattery for leaders, says some words what are needed but we don’t want. In the middle of lunch conversation, we talked about the flattery atmostphere in baidu, what made me surprise is that some people think flattery issues is more serious than I thought. In the last moment, I suddenly remembered that we don’t have a cheer up, so, I ask for one. Boss jokingly said that the ex-baiduer want a cheer in the end, I also realise that. Actually, it’s usually not my job in the common dinner. What makes me unforgottable is freedom and flexibility in this netease team, we totally dont have to care the reporting relationship in daily works and chatting, which makes the atmosphere great, maybe perfect. In the back road from restaurant to company, I was told much information about last era of Internet and companies in that time. There are much opportunities in that era, there are so much products they can do, some of them became totally successful. I always like the story of history, especially sounded from a person how experience by himself/herself, it’s like Qin emperor teach me the history of Qin dynasty.</summary> </entry> <entry><title>Better idea between Copilot-typed and CLI-typed assistant</title><link href="https://wa008.github.io/posts/there-should-be-a-better-code-assistant-between-cli-typed-and-copilot-typed-tool/" rel="alternate" type="text/html" title="Better idea between Copilot-typed and CLI-typed assistant" /><published>2025-08-12T00:00:00+08:00</published> <updated>2025-08-12T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/there-should-be-a-better-code-assistant-between-cli-typed-and-copilot-typed-tool/</id> <content src="https://wa008.github.io/posts/there-should-be-a-better-code-assistant-between-cli-typed-and-copilot-typed-tool/" /> <author> <name>Benson</name> </author> <summary>Copilot-typed GitHub Copilot, cursor, GPT-codex, winsurf, trae are representative products of Copilot-typed tools, their function is to help users complete code automatically when necessary. Of course, they provide interactive conversation for users with code as content, which is common feature. This is the direct usage intruction in coding field when LLM appears. CLI-typed Claude-code is the first CLI-typed coding assistant, after Gemini-CLI join the wars among CLI-typed coding assistants, cursor-CLI also was published on 8th August. CLI-typed tools are the representative products in vibe coding era, which means people can release themself from editors, What they only need to do is talking with LM and express their thoughts and opinions. I think the step from Copilot-typed to CLI-typed(vibe coding) is too big to be workable, LLM cannot transfer an idea or demand into product by himself. The main disadvantages of CLI-typed (vibe coding) is that LLM cannot solve complex projects because it’s not good at designing the solution. but developers are good at that, especially for junior developers. It’s not necessary to use LLM to solve all tasks. Better tool A better product should provide more space for junior developers to express their thought of design, and also provide more control space for users, some users really like the feeling of controlling and enjoy that, this also can help LLM program better code because the instrction is more clear. More specifically, I think develpers can design their project in any depth from generality to details by the new ideal tool, and LLM can program code based on the design from developers. In additon, there’re more advantages in this way. Designing of developers could be seen as ideal documentation of project It’s easy to save the checkpoint of the project in the process of developing. Developers are not probably mad for multi-round conversations. Maybe this can be solved based on CLI-typed tools, but I’m not sure how to proceed in detail.</summary> </entry> <entry><title>Gemini-cli</title><link href="https://wa008.github.io/posts/gemini-cli/" rel="alternate" type="text/html" title="Gemini-cli" /><published>2025-07-07T00:00:00+08:00</published> <updated>2025-07-07T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/gemini-cli/</id> <content src="https://wa008.github.io/posts/gemini-cli/" /> <author> <name>Benson</name> </author> <summary>Gemini-cli Gemini-cli is command line tool supported by Gemini-2.5-pro model, it’s a similar product with Claude-code by Anthropic but free, what’s more, Google open source all code of Gemini-cli in github and receive 20k stars in only one day, 40k in three days, this’s scene that never happened for a long time. I use Gemini-cli to generate a project which can transfer model from huggingface into modelscope, I need this feature for a long time. As a result, I complete this project in three hours, this make me suprise. Gemini-cli was good at search various api and to use them, which will consume much time for human. Gemini-cli is strong for me because Add/delete/modify file in command, which create more space for llm to use their ability. execute code and receive output after exectuing, iterate the code by executing on turn and another. When meet name alreadly be used, it will change a new name to test it, and recover the name before finis the code, small but interesting design. Gemini-cli really spent so much tokens, shows the determination of Google on AI. hf-ms-transfer I’m unwilling to start a new project or update a existing project naturally, it’s hard to start, but, it’s eary to continue after starting. In my opinion, this is the difference between nature and maturation. This also happens on hf-ms-transfer project, even it’s not hard to finish. I think this is why many people always say that just do it rather than talk a lot, it’s reasonable. it’s everyone should overcome.</summary> </entry> <entry><title>LLM Post-Training experience</title><link href="https://wa008.github.io/posts/experience-about-llm-fine-tune/" rel="alternate" type="text/html" title="LLM Post-Training experience" /><published>2025-06-23T00:00:00+08:00</published> <updated>2025-06-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/experience-about-llm-fine-tune/</id> <content src="https://wa008.github.io/posts/experience-about-llm-fine-tune/" /> <author> <name>Benson</name> </author> <category term="LLM" /> <summary>Prompt Prompt is the most direct way to influence response, tips for good prompt: Clear instruction about our demand Provide necessary context, role, tone, format guide LLM output reasoning process before final answer More instructions, less constraints Exampler can ensure the constructure is as same as example The purpose of prompt in post-training is building best reasoning architecture in response, training could optimize other detailed contents in response One shot learning One example in prompt (one shot) can ensure output architecture is as same as example. In binary-class tasks, one example probably result in answer trend to that in example. In binary-class tasks, two examples probably result in unstable of answer. Experience / Conclusion Model size of model to train is related with information volume of datasets Larger model need more information volum to fine-tune We can use small-size model to test whether the solution is feasible with low cost Smaller model has better stability of response Amount of data is positively correlated with model performance Quality of data is positively correlated with model performance Training process The purpose of training is to ensure performance on test dataset increase in stable trend and range. ensure the loss/reward curve and performance on test dataset change with same trend If performance of test dataset don’t increase as expected, overfitting / reward hacking occur. If loss cannot reduce as expected, there is something wrong in training dataset adjust learning-rate and regularization penalty by observing loss curve with training steps If loss decreased slowly, raise LR. If loss curve is unstable, lower LR. When overfitting occur, raise regularization penalty. If loss can not increase in late stages, try to lower it. verify idea with pure control experiment retry total same experiment to exclude influence of random make LLM output intermediate reasoning process before output final answer For specific task, put as much logit as in rule rather than in prompt if possible Thinking rewrad is valid and necessary in RL model reward even multi model reward is helpful in RL Multi-stage training The purpose of dataset is to provide information to model to learn, in the late stages, model already know more than before, more extra information should be sent to model. So, in the late stage, we should increase information diversity How to increase information diversity: put hard samples in late training stages increase temperature in late training stages for GRPO select samples which have unstable results for GRPO Reference Google prompt engineering Six Key Elements of AI Agent Prompt Engineering</summary> </entry> <entry><title>Papers I readed recently about LLM application</title><link href="https://wa008.github.io/posts/papers-about-LLM-applications/" rel="alternate" type="text/html" title="Papers I readed recently about LLM application" /><published>2025-06-22T00:00:00+08:00</published> <updated>2025-06-22T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/papers-about-LLM-applications/</id> <content src="https://wa008.github.io/posts/papers-about-LLM-applications/" /> <author> <name>Benson</name> </author> <category term="LLM" /> <summary>How much do LLM memorize? key definition unintended memorization: memorize a specific dataset generalization (intended memorization): contains about the true data-generation process calculation method: by information entropy and mutual information double desent appear on the changing points from unintended memorization into generalization GPT-models store 3.6bits data per parameters value of float32 is 9% higher than float16 Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters trade-off between pre-train model size and inference-time(inference length) performance can ouperform 14x size model performance is better in easy and medium problem, judge easy, medium or hard question based on the pass rate two ways to increase inference-compute-time best-of-N: sample N outputs parallel and choose the best one based on learned verifier or reward function. revise response: revise original response Prolonged Reinforcement Learning tempurature: increase tempurate to avoid entropy collapse decoupled clip to increase exploration space dynamic sampling: erase all truely right or wrong samples calculate loss from sample level into token level – DAPO KL-regularization and reference model reset illusion of thinking for hanio tasks lower performance in simple-level question for reasoning model than general mdoel because it get wrong answer when thinking even already get correct answer [over thinking] better performance in medium-level question zero-performance in hard question Gemini 2.5 tech report dataset ensure dataset quality fliter and drop duplicates post-training verifiable reward and model-base generative rewards to provide sophisticated and scaleable feedback signals verifiable reward model-base: more sophisticated and scaleable feedback signals update LR-method to improve the stability of training result: learning in complex space</summary> </entry> <entry><title>Difference between LLMs and traditional computer technology</title><link href="https://wa008.github.io/posts/difference-between-LLMs-and-traditional-computer-tech/" rel="alternate" type="text/html" title="Difference between LLMs and traditional computer technology" /><published>2025-05-25T00:00:00+08:00</published> <updated>2025-05-25T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/difference-between-LLMs-and-traditional-computer-tech/</id> <content src="https://wa008.github.io/posts/difference-between-LLMs-and-traditional-computer-tech/" /> <author> <name>Benson</name> </author> <category term="LLM" /> <summary>ALL thing are certain in traditional computer technology, some programer say that there are beauty of certainty in traditional computer technology compared with current LLMs. For the influence or effects for this world, traditional computer technology can solve the certain problems and LMMs can slove all others, but LLMs sometimes cannot slove correctly. Compared with SFT, RL-base method like DPO, GRPO want human to use certain logits to improve the quality of LLMs when solving all uncertain problems, that’s the direction of we train LMMs by RL-base method. What we need to do is to mining certain logits as much as we can. One aspect is all data in the true world, which already had been used in pre-train stage. Another aspect, we can create some logits which are suitable for all data produced by LLMs, like logits in math and coding. that’s why RL-based method works well in these two fields. For math, finding correct answer is hard but to validate if one specific answer is correct is related more easy. it works in programming, what we need is to create enough test case and set a automate test process.</summary> </entry> <entry><title>GRPO</title><link href="https://wa008.github.io/posts/docs-grpo/" rel="alternate" type="text/html" title="GRPO" /><published>2025-05-20T00:00:00+08:00</published> <updated>2025-05-20T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/docs-grpo/</id> <content src="https://wa008.github.io/posts/docs-grpo/" /> <author> <name>Benson</name> </author> <category term="LLM" /> <category term="FT" /> <summary>Main idea Key point it to understand the below pictures Iteration steps for each input, generator G outputs for each output, calculate logits_prob for each token in current, old, reference model calcualte objective value as loss update old model in each step update reference model in each epoch Objective function G is amount of outputs in each group for each input O_i is i-th output in current group t is index of tokens in O_i q is input O_i,t is t-tokens in i-th output pi is model parameter KL value Hyper parameters Name in huggingface-trl beta weight for KL-value between current model and reference model, increase to avoid over-fitting num_iterations Numbers of iteration per batch, GRPO iterations times in Algorithm 1 picture, similar with LR epsilon for both clip lower_bound and upper_bound epsilon_high repalce epsilon for clip upper_bound when exist sync_ref_model bool, whether to Whether to synchronize the reference model with the active model every ref_model_sync_steps steps, using the ref_model_mixup_alpha parameter ref_model_mixup_alpha float, default 0.6, π_ref = α * π_θ + (1 - α) * π_ref_prev ref_model_sync_steps int, default 512, To use this parameter, you must set sync_ref_model=True. FAQ Q: How to cold start? A: In first step, we know advantages for each output, which can push parameters updating to make objective value as much as possible Q: How to simplify Zoom up/down in objective function?</summary> </entry> <entry><title>Weekly-#26 AI Application</title><link href="https://wa008.github.io/posts/weekly-26-2025-AI-application/" rel="alternate" type="text/html" title="Weekly-#26 AI Application" /><published>2025-04-20T00:00:00+08:00</published> <updated>2025-04-20T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-26-2025-AI-application/</id> <content src="https://wa008.github.io/posts/weekly-26-2025-AI-application/" /> <author> <name>Benson</name> </author> <summary>LLM Application The purpose of Appcalition is to try our best to meed the demand of users. Depth of technology is not very important. There are many unexplainable points in the field of LLM, as a result, there are some basic method we can use to improve the quality of product. Prompt is the first point engineers always use in the frist step, it’s easy to start but hard to advanced. In The first week, I’m still spending all time on understanding the information of project and demand of users and project manager. In the next few weeks, I hope I can try something about prompts. Beyond of job I realised that I spend almost zero time on technology after work in the recent five weeks, of course, I’m relax myself in my free time. I’m not sure it’s right or efficient for me. Reading Reading is too less for me rencently, maybe I should quit the books that I cannot insist on, Try some books that I have more interest on. Positive circle is more important.</summary> </entry> <entry><title>Weekly-#25 AI infra and application</title><link href="https://wa008.github.io/posts/weekly-25-2025-AI-infra-and-application/" rel="alternate" type="text/html" title="Weekly-#25 AI infra and application" /><published>2025-04-06T00:00:00+08:00</published> <updated>2025-04-06T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-25-2025-AI-infra-and-application/</id> <content src="https://wa008.github.io/posts/weekly-25-2025-AI-infra-and-application/" /> <author> <name>Benson</name> </author> <summary>LLM Inference It’s a great milestone when I finish a mature and iterable project, even it’s still in the first stage. There’re plenty AI infra repositoreis and projects in github, but most of them are designed and developed for nvidia GPU, some of them are designed for AMD. LLM computation industry is a huge field and market, there’re also many domestic GPU brands in china. As a result, the work space is huge to make domestic GPU show its best performance. This field is fun, enough patience and strong coding ability are required. In addition, Knowledge are more stable than that in other fileds because it change in less frequancy. Similarly, knowledge about CPU change less than programming language in recent decades, expecially for Python. As a result, I can put enough energy in this fields becuase it worth not only for money but also for research result. LLM Application LLM application is another great direction which is related with LLM. LLM create new ability that not appear in the world, like the invention of electricity and steam engine. As a result, we can solve more real problems in the world by LLM, the feedback will be more direct if we success. In addtion, LLM inference demand is built on the demand of LLM application, it last for long time only if there’s real useful LLM application. Speaking of the specific work of LLM application, I need to have a deep understanding about the exist field or problem and LLM ability, it wroks when I integrate them together. We are in the best age because of AI, don’t waste it.</summary> </entry> <entry><title>Weekly-#24 First week as LLM inference engineer</title><link href="https://wa008.github.io/posts/weekly-24-frist-week-of-new-jobs/" rel="alternate" type="text/html" title="Weekly-#24 First week as LLM inference engineer" /><published>2025-03-22T00:00:00+08:00</published> <updated>2025-03-22T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-24-frist-week-of-new-jobs/</id> <content src="https://wa008.github.io/posts/weekly-24-frist-week-of-new-jobs/" /> <author> <name>Benson</name> </author> <summary>This is the first week to work as a LLM inference engineer, the real work content is what I want in the past. I don’t have much experience in this field, But it’s still acceptable. To do what I like is nice, I can put all my energy into my work. I hope freshness is not the only reason and I can maintain this status for longer time. Small company don’t have mature manage system, there’s also some advantage about this, for example, I don’t need spend much or any time on formalistic work, which is also positive for my mood. What I’m doing is a new direction, there’re much thing I should learn and there’s less historical burden I shuold take, I like this status.</summary> </entry> <entry><title>Weekly-#23 seeking job</title><link href="https://wa008.github.io/posts/weekly-23-2025-seeking-job/" rel="alternate" type="text/html" title="Weekly-#23 seeking job" /><published>2025-03-09T00:00:00+08:00</published> <updated>2025-03-09T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-23-2025-seeking-job/</id> <content src="https://wa008.github.io/posts/weekly-23-2025-seeking-job/" /> <author> <name>Benson</name> </author> <summary>This is the second time period that I need to seek a job position in my life till now. I don’t have much experience to take a interview in the past, I think I learn a lot this time. First lesson I learn Preparation is necessary for me to seek a better job than that in the past, not only for the project experience or basic knowledge, but also the attitude and future plan. I need to prepare for some dedicated time even not enough before the interview. Project experience Interview will let me know which project I have done is important and valuable, I should do that more in the future. Basic knowledge I will review all basic knowledge before interview, it’s a opportunity to review all details or theoretical knowledge. Future plan Failed interview let me know what I should learn in the future, This is a good way to get the new direction.</summary> </entry> <entry><title>Weekly-#22 2025 New Year</title><link href="https://wa008.github.io/posts/weekly-22-2025-new-year/" rel="alternate" type="text/html" title="Weekly-#22 2025 New Year" /><published>2025-02-02T00:00:00+08:00</published> <updated>2025-02-02T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-22-2025-new-year/</id> <content src="https://wa008.github.io/posts/weekly-22-2025-new-year/" /> <author> <name>Benson</name> </author> <summary>Happy New Year! Feel more happiness this year, really enjoy.</summary> </entry> <entry><title>AutoSwitch Translate</title><link href="https://wa008.github.io/posts/weekly-21-AutoSwitch-Translate/" rel="alternate" type="text/html" title="AutoSwitch Translate" /><published>2025-01-18T00:00:00+08:00</published> <updated>2025-01-18T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-21-AutoSwitch-Translate/</id> <content src="https://wa008.github.io/posts/weekly-21-AutoSwitch-Translate/" /> <author> <name>Benson</name> </author> <summary>Product AutoSwitch Translate Final make this extension, which can automatically switch target language when source language is same with target language. What surprised me was I only spen half day to program and build this extension, which inspired to do it immediately after have a new idea, this will be the best experience not only for result but also for my satisfaction. This can save lots of time when using Goole Translate. In addition, I can totally transfer from baidufanyi to Google Translate. PopTranslate Found the API used in Google Translate extension and use it in my extension, maybe it’s not a nice behavior. It works well in for five days, hope it works for a long time. Triton I want to do more about Triton, here is all what I can think * rewrite or improve current kernel * flash attention * cut cross entropy * CE * analysis time and memory cost of kernel * compare different model and framework [H] * Unsloth * Deepseed * TensorRT-LLM * vLLM * Liger-Kernel * Flash-attention * xformers * DeepSeek * MoE * electricity * MLA * MTP * fp8 * dimensions * fine-tune * inference * improve and test * architecture ability * cuda * llama.cpp As a result, I will try Pytroch profiler at first, there will be more thing in it I can do. In addition, Found a good post about matrix multiplication, try to do it by Triton. English Podcast: Do not weel, I need more patience. Read and comment: as above. Books: Read more on first language Summary 1) Do it as soon as possible after having a new idea. 2) I always travel in a loop between hope and disappointment, maybe this is the life. This week Triton Update PopTranslate Google translate extension English Exercise Next week Triton English Reading</summary> </entry> <entry><title>Goodbye 2024</title><link href="https://wa008.github.io/posts/year-of-2024/" rel="alternate" type="text/html" title="Goodbye 2024" /><published>2025-01-16T00:00:00+08:00</published> <updated>2025-01-16T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/year-of-2024/</id> <content src="https://wa008.github.io/posts/year-of-2024/" /> <author> <name>Benson</name> </author> <summary>What I do keywods: Jan-May: work Travel: wuhan, huangshan IELTS Products: Chinese blog collection slack to discord IELTS speaking assistant PopTranslate Security clearance project AutoBuilder LLM acceleration Youtube xiaohongshu table tennis blog: 33 What I do are good: Try many my own products Try new-type products Try to maintain products which can last long time LLM translation, new idea What I do are bad: Not enough focus Prepare not enough for uncertainty Plan of last year English: 6.5 Study aboard: half Exercise Study something new Read 2025 English: fluent Exercise New products Read</summary> </entry> <entry><title>Weekly-#20 Breaking of glass</title><link href="https://wa008.github.io/posts/weekly-20-broken-of-glass/" rel="alternate" type="text/html" title="Weekly-#20 Breaking of glass" /><published>2025-01-12T00:00:00+08:00</published> <updated>2025-01-12T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-20-broken-of-glass/</id> <content src="https://wa008.github.io/posts/weekly-20-broken-of-glass/" /> <author> <name>Benson</name> </author> <summary>Product Triton Try to debug the Liger-Kernel but found it works well except bfloat type. Learning news about LLM translation and try to realise the whole one in this kind of project, like cut cross entropy Glass My glass broke on 1.9, I’m really blind when I lost my glass. This is first experience I broke my glass and realise that how the backup of glass is important. This is what I do next: 1) Buy the invisible glass, which is accessable immediately. I can use it untill I get a better option. 2) Buy one new in near store, the quality is maybe not well but practical. My degree of glass is really high, as a result, I can receive new glass after three days. 3) Buy a good one. I found a great blog about how to test degree of eyes and choose glass. So, I test eyes degree three times recently to get the accurate degree. I choose a brand of glass without fraud concerns and buy glass frame and lens online. English Podcast: practical, I need to keep the routine of listening everyday. Read and comment: more patience is necessary Books: I cannot read much. I will try more about podcast and books in the next week. Summary It’s essential to maintain a backup glass for high-degree person, even the invisible glass. This week Triton Google translate extension English Exercise Next week Triton Update PopTranslate Google translate extension English Exercise</summary> </entry> <entry><title>Cross Entropy Loss of Triton</title><link href="https://wa008.github.io/posts/weekly-19-Triton-Liger-Kernel-cross-entropy-with-backward/" rel="alternate" type="text/html" title="Cross Entropy Loss of Triton" /><published>2025-01-05T00:00:00+08:00</published> <updated>2025-01-05T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-19-Triton-Liger-Kernel-cross-entropy-with-backward/</id> <content src="https://wa008.github.io/posts/weekly-19-Triton-Liger-Kernel-cross-entropy-with-backward/" /> <author> <name>Benson</name> </author> <summary>Cross Entropy idea of fast cross entropy Based on previous knowledge on fast cross-entropy, realizing it by triton doesn’t spend too much. There are only 1e-7 difference between Pytorch and my Triton kernel, But the speed is significantly lower. Liger-Kernel Getting advise on gpumode discord group, I can read how it realized in other great Triton kernel repository. Liger-Kernel is the best option, but the speed is still lower than Pytorch, one result of them is 3053.16ms vs 0.04ms, even it save a lot of memmory, result is 0.51 vs 1.25 Attorch is another Triton kernel repository, withou any adobt, there aren’t much difference among My previous Triton kernel, Liger-Kernel and Attorch. Pytorch is 1000x faster than Triton kernel which I have ever tried, it’s unreasonable. There should be another reason except core kernel code, but I cannot find it. With help of friend in gpumode discord server, I found the environment variable is the root reason of self-made triton kernel. After realise the backward, the result as below picture show: code: @triton.jit def loss_kernel(input_ptr, target_ptr, output_ptr, M, N, BLOCK_SIZE_N: tl.constexpr, ): pid_m = tl.program_id(0) input_ptr += pid_m * N target_ptr += pid_m output_ptr += pid_m offsets_cols = tl.arange(0, BLOCK_SIZE_N) target = tl.load(target_ptr) max_val = -float(&amp;quot;inf&amp;quot;) sumexp = 0.0 allcurx = 0.0 for index in tl.range(0, N, BLOCK_SIZE_N): offsets_input = (offsets_cols + index) mask_input = (offsets_cols + index) &amp;amp;lt; N input_val = tl.load(input_ptr + offsets_input, mask=mask_input, other = -float(&amp;quot;inf&amp;quot;)) if index == 0: new_max_val = tl.max(input_val) else: new_max_val = tl.maximum(max_val, tl.max(input_val)) sumexp /= tl.exp(new_max_val) sumexp *= tl.exp(max_val) sumexp += tl.sum(tl.exp(input_val - new_max_val)) max_val = new_max_val if (target &amp;amp;gt;= index) and (target &amp;amp;lt; index + BLOCK_SIZE_N): curx = tl.load(input_ptr + target) allcurx += curx for index in tl.range(0, N, BLOCK_SIZE_N): offsets_input = (offsets_cols + index) mask_input = (offsets_cols + index) &amp;amp;lt; N input_val = tl.load(input_ptr + offsets_input, mask=mask_input, other = -float(&amp;quot;inf&amp;quot;)) target_1d = (offsets_cols + index) grad = tl.div_rn(tl.exp(input_val - max_val), sumexp) - tl.where(target_1d == target, 1, 0) tl.store(input_ptr + offsets_input, grad, mask = mask_input) output = tl.log(sumexp) + max_val - allcurx tl.store(output_ptr, output) def triton_loss(input: torch.Tensor, target: torch.Tensor, bm = 1, bn = 256): output = torch.empty(target.shape, dtype = torch.float32, device = input.device) grid_loss = (input.shape[0], ) loss_kernel[grid_loss](input, target, output, M = input.shape[0], N = input.shape[1], BLOCK_SIZE_N = bn) return output</summary> </entry> <entry><title>Weekly-#18 Cross Entropy Loss of Triton</title><link href="https://wa008.github.io/posts/weekly-18-Triton-cross-entropy/" rel="alternate" type="text/html" title="Weekly-#18 Cross Entropy Loss of Triton" /><published>2024-12-29T00:00:00+08:00</published> <updated>2024-12-29T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-18-Triton-cross-entropy/</id> <content src="https://wa008.github.io/posts/weekly-18-Triton-cross-entropy/" /> <author> <name>Benson</name> </author> <summary>Product Implementation of Triton I tried to realise better cross entropy loss by Triton, but failed, still trying to find the reason… PopTranslate Update to 3.2, replace self-hosted translation server with Google Gemini 2.0 experimental Thought I met three great table tennis coaches recently in table tennis room. They have different styles to teach people, one of them are strict but another of them always say good things to their student. last one is patient and really nice, he can taught everyone with different levels with enough patience. Summary When I have a idea, do it as quick as possible. Weekly blog is becoming shorter and shorter, not a good trend. This week Triton: cross entropy loss Google translate extension Youtube: Exercise: 6 Next week Triton Google translate extension Youtube Exercise</summary> </entry> <entry><title>Weekly-#17 Triton Puzzles</title><link href="https://wa008.github.io/posts/weekly-17-Triton-Puzzles/" rel="alternate" type="text/html" title="Weekly-#17 Triton Puzzles" /><published>2024-12-22T00:00:00+08:00</published> <updated>2024-12-22T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-17-Triton-Puzzles/</id> <content src="https://wa008.github.io/posts/weekly-17-Triton-Puzzles/" /> <author> <name>Benson</name> </author> <summary>Product Triton-Puzzle This is a project tearch you how to use Triton, which is a new open-source alternative language for cuda. It’s always hard to understand and use it if you are not familiar with cuda-type language. This is definitly a great project for beginners, I thing every hard field should have this kind of toturial. Meanwhile it’s not possible for every filed to have, it’s luck for projects in computer science field. Almost finished it though about three days, using it in true product will be next and more important step. Reading The economist Thing explainer Harry Potter Thought Enjoy life This Tuesday, This is my first time felt that I have much interest in much different thing. First of all, I want to spent as much as time on table tennis, I played about average 3 hours everyday recently and enjoyed that so much. as a result, This’s the first time I felt knee pain due to the exercise, which prove I don’t have such much exercise in recent years. Secondly, After having a recoding video of Leetcode problem yesterday, I also want to do that again today, but I don’t have enough time, because I mush spent some time on triton, which is a new interesting project in LLM acceleration. Thirdly, after spending two hours on triton puzzles, I found some similarity between C++ and triton, which can totally control the most basic hardware. This trigger my interest, as least right now. Last but not least, after buying book thing explainer, which explain everything science products by simple words, also attract me a lot. Just like the economist, I like read this kinds of articles. Sociality I planed go to Canada next friday, So, I eta dinner with three groups of friends, talk a lot about life and feature. Everyone have differnet work, life and status. It’s hard to say which is better. I thing hope is the most important thing all over the world, but there’re still some presure for living. Working hard to pursure what I want can make my current life and experience more worthy. Summary When I do everythig, do it 100 percentage. This week Summer internship: hold Triton: finished Triton Puzzles Google translate extension Youtube: 2 RW Exercise: 2 Next week Triton Google translate extension Youtube RW Exercise</summary> </entry> <entry><title>Weekly-#16 AutoBuilder</title><link href="https://wa008.github.io/posts/weekly-16-AutoBuilder/" rel="alternate" type="text/html" title="Weekly-#16 AutoBuilder" /><published>2024-12-15T00:00:00+08:00</published> <updated>2024-12-15T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-16-AutoBuilder/</id> <content src="https://wa008.github.io/posts/weekly-16-AutoBuilder/" /> <author> <name>Benson</name> </author> <summary>Product AutoBuilder Almost spend half of this week on AutoBuider, finish it and use it to build another project, ID_confuser, which programmed totally by AutoBuilder and spend only ten minutes. Summer internship submit 53 applications this week, still no interview. Reading The economist: recent issue and three issues(China part) in 2019 Harry potter Economy of China from fupeng Thought Table tennis After playing table tennis two weeks, almost two hours everyday, my fat abdomen really became small and loss some weight. Meanwhile, I can play with more great player, really enjoy. Summary half of this week on AutoBuilder and another half on confusion about visa and plan. The next week will be important. This week Summer internship: 53 application AutoBuilder Triton: Not start Youtube: 0 Reading and Writing Exercise: 6 Next week Summer internship Triton Google translate extension Youtube RW Exercise</summary> </entry> <entry><title>Weekly-#15 Starting of tanble tennis</title><link href="https://wa008.github.io/posts/weekly-15-start-of-pingpang/" rel="alternate" type="text/html" title="Weekly-#15 Starting of tanble tennis" /><published>2024-12-08T00:00:00+08:00</published> <updated>2024-12-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-15-start-of-pingpang/</id> <content src="https://wa008.github.io/posts/weekly-15-start-of-pingpang/" /> <author> <name>Benson</name> </author> <summary>Product AutoBuilder I want to build AutoBuilder which can build simple product totally by AI model, like static websites. Compared copilot or cursor, AutoBuilder and see the result base on the current code after we build and run them. As a result, AI image model can provide feedback for current code, which can help text model to be better. First version is too ideal. After I show the static website, I must input sth and click one button to test the result of function, it’s hard to implement this process automatically. So I change to another direction. I think developer should involve more in the process of programming and building. Developer can be the role of evaluation, he can provide feedback for the result of websites. Meanwhile some of the reasons I do this are I realize the weaknesses of AI model, so, more work of developer are necessary to build a mature product. What’s more, I can update the process if my though works, This is important lesson I learnt from this project. Think about below points when you design the road of your new product. Start project from point where ROI is highest, low cost and high benefit. Make it iterable when there are more features. Triton Find a great project for me to learn Triton, which is Triton-Puzzles Reading second year without a job generator all uuid IMG-0001 Thought Table tennis I enjoy table tennis a lot this week, shows the importance of positive feedback. That’s why I think money also can be important when working. Evaluation of AI Evaluation seems became the most important thing in AI period. Most people talked about the importance of prompt, but the sound is less and less with the development of AI. The existing of prompt engineer show the weaknesses of AI in the initial period of development, reinforcement learning from human feedback can totally solve this kind of problem, but this is relative expensive, Google queries are also great option to meet this kind of problem. When I use ChatGPT, I also realize this’s not big deal. As a result, How to Evaluate the validation of response of AI models becomes the only issue. Evaluation is a high level task than generations, the straightforward method is the done by human. Many product are produced in this kind of form, like AI coding assistant. Actually, human evaluation and feedback can be the bridge between AI model and mature products. When AI models are not mature enough, human can provide feedback one time again and again, that’s why we called AI as an assistant. How to check how much worked can be replaced by AI models? Try to find an automatic method of evaluation, if there is, it can be replaced finally. This remind me the work as an engineer in anti-fraud field. The most difficult part of my work is to determine whether if one user or flow a fraud. This is hard to be decide by AI model. Consequently, we can implement AI models in fields where there is solid evaluation method on. Coding is definitely first field. Competitive programming is also filed where I want to build a AI tool. It’s easy to get a solid bad case when wrong answer is returned for submitted code. I will try it after AutoBuilder. History news How about to read news happened in the past, like one year ago or three years ago. Like HackerNews one years ago content. We can know whether the thing are important or not, we know more how to evaluate whether one thing it’s important or not. What kinds of documents of news can be read The economist Hacker News v2ex News magazine Internet is a great tool to realize that. Keyboard for iPad Today, I bought a new keyboard for my iPad, which is useful when I just brought a iPad outside. Actually, I don’t have a laptop since I was in the third years in my university. Laptop is always not a good choice whether in any environment, it more likely an intermediate product. When people work in a stable place, like working environment or personal house, he usually need a huge monitor and comfortable keyboard, the original screen and keyboard of laptop is unused. In contrast, laptop is a little heavy to carry outside. For me, I don’t like carry such a huge thing outside. Of course, more important reason is that I don’t have a laptop right now and just have a iPad, which also can support my demand of outside temporarily. I don’t know why I have more patience to write something when I write towards a small screen, it’s an interesting phenomenon. Maybe it’s easy to concentrate for me when towarding a relative small screen. Summary Table tennis seems make my life better. Enjoy more. Spent less time on Phone and short videos, which is a great trend. This week Work visa: hold Summer internship: 15 application Triton: Not start Youtube: 1 Reading and Writing: read less but write more Exercise: 4 AutoBuilder: new project, 60% Next week Summer internship AutoBuilder Triton Youtube RW: Read history news Exercise</summary> </entry> <entry><title>Weekly-#14 Accident in life</title><link href="https://wa008.github.io/posts/weekly-14-accident-in-life/" rel="alternate" type="text/html" title="Weekly-#14 Accident in life" /><published>2024-12-03T00:00:00+08:00</published> <updated>2024-12-03T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-14-accident-in-life/</id> <content src="https://wa008.github.io/posts/weekly-14-accident-in-life/" /> <author> <name>Benson</name> </author> <summary>Product Visa Received a possible visa phone call, her tell me that my visa is not valid. All phenomenon show that it’s a fraud call except the offical-email, I cannot iamge that fraud group can steal the email-client of IRCC. This will interupt my rent plan, maybe I will still make a rent rencently, but really waster much of my time. Summer internship I realized that I should seek a summer internship just recently, there are not much time for preparation. It’s harder than expectation, do and prepare for that, come on! Reading search keyword recursively included pdf, .tar.gz, epub model context protocol: anthropic seems are thinking all method to break the boundaries of AI how to avoid block of wechat in xiaohongshu increasing of Submagic: just subtitle can creat huge demand of course we cannot totally trust ChatGPT how to choose a glass interviewer bot Thought model context protocol Anthropic seems are thinking all method to break the boundaries of AI ideas target groups: startups solved problems: how to connect local resource with AI by a easy way with permission of user How to use it: auto build websites, it seems that there are many related tools. Summary It’s hard to calm down when meeting some bad news. Maybe there will be more and more in the next 3-5 years, I need to keep a better mindset for them. Job-hunting or summer internship, this is the thing I should pay more attention, do it. This week work visa: documents ready Triton: todo Youtube: 2 Reading and Writing: read much Harry Potter except general document Exercise: 2 New project: xiaohongshu: fail apply summer internship Next week work visa apply summer internship Triton Youtube Reading and Writing Exercise</summary> </entry> <entry><title>Weekly-#13 Trying of xiaohongshu</title><link href="https://wa008.github.io/posts/weekly-13-1124-Trying-of-red-book/" rel="alternate" type="text/html" title="Weekly-#13 Trying of xiaohongshu" /><published>2024-11-24T00:00:00+08:00</published> <updated>2024-11-24T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-13-1124-Trying-of-red-book/</id> <content src="https://wa008.github.io/posts/weekly-13-1124-Trying-of-red-book/" /> <author> <name>Benson</name> </author> <summary>Product xiaohongshu It’s hard to get regular flow, business transformation is also hard than expectation to obtain. Trust seems a big gap for normal user because my old account get some real transformations but new account cannot even it had more view and likes. Try another week. Reading AI agent for twitter, discord… get QQ notes run and debug in one platform video creation State of the software engineering job market in 2024: job market start to become warm in 2024. Thought replace cost replace cost is always high because I realize increased value can not meet the replaced cost for new product in most situations. NotebookLM is a typical sample, I thinks it’s a geat product, but it definitely increased the cost. replaced cost is always than expectation. Competitive programming start to participant some contest in codeforces this week, making me enjoyable. Coding really make me happy, especially for this kind of contest. Instant feedback is the main reason, like earthworm, which is a instant-feeback english learning tool. Summary It seems that I read more long articles this week, especial in lobste.rs, continue to do that. Spent more time on long article, even books, this habits is important. This week Youtube videos: 6 LLM acceleration: finished, continued for 7 days Reading and Writing Exercise: 1 New project: xiaohongshu, harder than expectation work visa Next week work visa Triton Youtube Reading and Writing Exercise New project: xiaohongshu</summary> </entry> <entry><title>Weekly-#12 summary of LLM acceleration</title><link href="https://wa008.github.io/posts/weekly-12-summary-of-llm-acceleration-1119/" rel="alternate" type="text/html" title="Weekly-#12 summary of LLM acceleration" /><published>2024-11-19T00:00:00+08:00</published> <updated>2024-11-19T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-12-summary-of-llm-acceleration-1119/</id> <content src="https://wa008.github.io/posts/weekly-12-summary-of-llm-acceleration-1119/" /> <author> <name>Benson</name> </author> <summary>Product LLM acceleration Almost finish it xiaohongshu start the small business Reading lazy-leadership llm-server ShortMax: fill the space between TikTok and film. HARO shut down: typical influence to content industry from ChatGPT small company management tools focusing enough on the problems making plans for holidays M4 mini, most powerful CPU chip Amateur search engine build AI cluster with everyday devices at home self-hosted photo and video solution health monitor article-to-video markdown resume builder Thought Tips about how to use LLM Ensuring accuracy of AI-Generated contents is always challenging, running codes to check if it’s right is a common method in coding field. This works at least in competitive programming contest, if the solution is not corrent, we can feed in with corresponding test case, which will help it to correct the answer. More important, there is a 100 percent correct test cases system for the problem, which make AI works all the time. Taking this in the true world, All we need to are how to evaluate the work. Book - project manager methodology Anything existing must be reasonable, almost everythink has its reason. There should be a methodology for everythink, because even building product have one. Zootopia sloth is so cute. The world is a simplified animals world, with small differences. Some people will go to zootopia, other will stay in rabbit town. Lobste.rs Asking for several days, finally got one invitation. This blog definitely contribute more for it. Power of personal product. Summary of this week Read more, Do more, Think less This week Youtube videos: 6 LLM acceleration: almost finished Reading and Writing Exercise: 2 New project: xiaohongshu Next week Youtube LLM acceleration Reading and Writing Exercise New project: xiaohongshu work visa</summary> </entry> <entry><title>Outline of LLM acceleration</title><link href="https://wa008.github.io/posts/1111-LLM-acceleration-1021-summary/" rel="alternate" type="text/html" title="Outline of LLM acceleration" /><published>2024-11-11T00:00:00+08:00</published> <updated>2024-11-11T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/1111-LLM-acceleration-1021-summary/</id> <content src="https://wa008.github.io/posts/1111-LLM-acceleration-1021-summary/" /> <author> <name>Benson</name> </author> <category term="LLM" /> <summary>Summary Methods There are two main methods to acclerate LLM and another tricky methods low-rank: reduce dimension of matrix block: compute matrix with block trick: update model structure or change training process Reference xformers: collection of optimized transformers unsloth triton Liger-Kernel Flash-attention Megatron-LM from NVIDIA huggingface accelerate ColossalAI awesome LLM system Categories Low-rank LoRA Low-Rank of large matrices when fine-tune informaiton Jun 2021 70% note reference Measuring the Intrinsic Dimension of Objective Landscapes Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning Linformer SVD decomposition for large QKV projection matrices to reduce required memory Jun 2020 30% code: hold Performers low-rank projection with a novel method named FAVOR Sep 2020 10% code: hold Multi-head Latent Attention Project high dimension into low dimension for KV cache, which can reduct much memory ustage. Block FlashAttention Matrices multiplication by blocks note May 2020 70% code: updating Self-attention Does Not Need O(n2) Memory attention calculation with blocks Dec 2021 70% FlashDecoding++ FlashDecoding++: Faster Large Language Model Inference on GPUs, three parts Softmax with block and Unified Maximum Value, result of block softmax can be directly used and merging is unnecesary. Optimized from FlashAttention. Flat GEMM(small batch size when reference) Optimization with Double Buffering. [didn’t understand] Heuristic Dataflow with Hardware Resource Adaption, choose difference optimizaiton methods for different M value(batch size and sequence length) [didn’t total understand] reference cuBLAS / CUTLASS flat GEMM: method in current paper fastGEMV No code(2024.11) Cut cross entropy Main idea: Avoid to store final large matrix throught block computation, which can save lots of memory when vocabulary is large. Softmax matrix is sparse, when all values are smaller than precision of data type, computation are unnecessary. Basic Fast Cross Entropy Loss Matrix Multiplication Reduce data upcasting Bitsandbytes bfloat16 Parallelization 1) Medusa output top-k predictions for next multiple positions parallelly through adding LM heads for next several positons, which can reduce inference latency. 2) SnapKV compress KV cacha for long sequence tasks Infrastructure 1) triton An alternative language for cuda, designed for deep neural network published in 2019, purchase by OpenAI reasons why it’s great designed for deep neural network open-source, active project in Github clients, like unsloth, other in Github issues friendly to use and implentment, adding them into current Python code, Good to start support for other chips 2) Hardware Acceleration of LLMs: A comprehensive survey and comparison Simple introduce and compare different hardware acceleration method in terms of efficiency and performance collect all method from 2020-2024 comparison with the same process technology different choose for both efficiency and performance Trick 1) Inference with Reference Lossless Acceleration of Large Language Models: copy reference to inference because there many same text sentence between them to accelerate inference 2) SwitchHead Accelerating Transformers with Mixture-of-Experts Attention: select different experts matrices for every head in attention by input content to reduce computation and memory usage. + published: 2024 3) DropBP: Accelerating Fine-Tuning of Large Language Models by Dropping Backward Propagation: Drop Backward propagation based on sensitivity which is the difference between Backward update and not update. great idea! change model constructure to have a 2^n submodels when drop some submodels published: 2024 To Read Quantization Quantization for Neural Networks Optimizer APOLLO: SGD-like Memory, AdamW-level Performance RNN RWKV: RWKV is an RNN with transformer-level LLM performance Trick An Attention Free Transformer Long sequence IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs 2:4 Accelerating Transformer Pre-training with 2:4 Sparsity Pruning Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruning cache Dynamic Memory Compression: Retrofitting LLMs for Accelerated Inference trade-off AWQ: Activation-aware Weight Quantization for On-Device LLM Compression and Acceleration PE RoPE</summary> </entry> <entry><title>Weekly-#11 Copilot-type products</title><link href="https://wa008.github.io/posts/weekly-11-cpoilot-type-products/" rel="alternate" type="text/html" title="Weekly-#11 Copilot-type products" /><published>2024-11-10T00:00:00+08:00</published> <updated>2024-11-10T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-11-cpoilot-type-products/</id> <content src="https://wa008.github.io/posts/weekly-11-cpoilot-type-products/" /> <author> <name>Benson</name> </author> <summary>Product LocalPictureCompress Spent whole one day to build LocalPictureCompress, really enjoy the monent when I publish it. Try AI code assistants continue: open source product, supports OpenAI’s, Anthropic’s and open-source models interpreter: works in terminal, suitable prompts are necessary if you want write code into file gpt-coplit: Only support server’s model, like ChatGPT, Claude computer use: Read anything include screens, output anything. Claude key is necessary. Copilot: paied, supports ChatGPT Cursor: paied, supports ChatGPT, Claude. My conclusion: Copilot is best option for coding based on my investigate. computer use has stronger power than coding assistants. Reading more easy to sell product in america sponsor blockr for youtube: amzing product shortcuts for chrome in style of Vim: So great reading recommendation from naval thing explainer by Randall Munroe Poor Charlie’s Almanack The Day You Became A Better Writer grab attention in first sentence short / simple prefer active voice screenshot-to-code localsend Thought Copilot-type products Copilot can improve the efficiency fo coding when deep understanding is unnecessary, when I use it to build the LocalPictureCompress, the process likes: Write a framework for my idea, which contains much ugly design and broken function adjust the front-end design by copilot, Most of them can be done by copilot make the basic function works through copilot copilot can not understant a complex function in a specific situation, or, more efforts are neceesary to explain to make it understand. At this time, More broad possible questions, Google search, My own personal thinking are neceesary to solve it, like Using bitmap to solve quality of photo descreasing problem is the typical example in current case. 围城 - moive Moive always show different aspects of human, some show happiness, some show human nature. I think biology is the fundamental nature of human, all feeling and emotion are the result of biology. Maybe nothing is meaningful, if it’s let’s just taste the and enjoy the life. The end of LLM acceleration Is it will be using LLM in browser or local application? No, but possible Summary concentrate more on LLM acceleration This week Youtube videos: 4 LLM acceleration: one paper, less than expectation Reading and Writing Exercise: 2 New product Next week Youtube LLM acceleration Reading Exercise New product: Local Poster</summary> </entry> <entry><title>Weekly-#10 Preparation for next journey</title><link href="https://wa008.github.io/posts/weekly-10-weekofskip/" rel="alternate" type="text/html" title="Weekly-#10 Preparation for next journey" /><published>2024-11-04T00:00:00+08:00</published> <updated>2024-11-04T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-10-weekofskip/</id> <content src="https://wa008.github.io/posts/weekly-10-weekofskip/" /> <author> <name>Benson</name> </author> <summary>Product New ideas computer use by local models polish anything by local models YouTube Upload five videos this week Reading Google build-AI challenge OpenAI ask me anything anthropic auto computer use talk with computer Thought There are more local models recently, that indicates local model has enough ability to build something, It also have more potentiality because pravicy is always a huge concerns and local model can total solve it. Meanwhile, it cost nothing and there is not account and money cost for new users. Preparation for next journey cost too much time for this week, it’s nice it over temporarily. This week Youtube videos: 5 LLM acceleration Preparation for next journey Reading and Writing Exercise: 0 Next week Youtube LLM acceleration Reading Exercise</summary> </entry> <entry><title>Weekly-#9 Startup of YouTube</title><link href="https://wa008.github.io/posts/weekly-9-youtube-start-codeforces/" rel="alternate" type="text/html" title="Weekly-#9 Startup of YouTube" /><published>2024-10-27T00:00:00+08:00</published> <updated>2024-10-27T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-9-youtube-start-codeforces/</id> <content src="https://wa008.github.io/posts/weekly-9-youtube-start-codeforces/" /> <author> <name>Benson</name> </author> <summary>Product LLM acceleration read one paper Flash-attention: compute attention by blocks YouTube Upload five videos this week and start to try codeforces problems. Codeforces problems always contains more backgroupd information, which will practice more for my speaking ability, meanwhile, it has more users and can attract more viewers. PopTranslate two updates add speicial for chinese to reduce the pressure of service, works for most time don’t translate for numbers Reading Learning to learn: identify the foundational knowledge make a plan and avoid expert beginner work hard on first 15-25 hours and decelerate to a regular pace Tatto AI: photo in AI field have more opportunity yfinance: get finance from public API softr for notion: expand for notion AI interview question another producthunt If you want high-quality conversation, don’t talking in the most popular community, go to high-quality but unpopular community like HackerNews public research group in india and published papers: great way to research tinymid: great blog platform using github pages! Thought Finally receive visa, start to prepare for my education!! This week Youtube videos: 5 Projects LLM acceleration PopTranslate: optimize for chinese and worked again for most time Reading and Writing Exercise: 1 Next week Youtube LLM acceleration Preparation for next journey Reading Exercise</summary> </entry> <entry><title>Notes of flash-attention</title><link href="https://wa008.github.io/posts/notes-of-FlashAttention/" rel="alternate" type="text/html" title="Notes of flash-attention" /><published>2024-10-23T00:00:00+08:00</published> <updated>2024-10-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/notes-of-FlashAttention/</id> <content src="https://wa008.github.io/posts/notes-of-FlashAttention/" /> <author> <name>Benson</name> </author> <summary>Backgroud There are two common kinds of bound which limited the speed of training in deep learning. Memeory-bound: time spent on memeory-access is bottlenecked Computation-bound: time spent on computation is bottlenecked Introduction Inspiration: just tiling? Description: Split the Q, K, V into blocks and calculate output matrice O by block to avoid the store of softmax intermediate matrice which has size of seq_len * seq_len in HBM memory, which reduce the memory-bound, as a result, required memeroy of attention is almost linearly with senquence length of sentence. Novelty: Making attention memory-efficient Benefits 1) Faster model training, due to use SRAM more? 2) Higher quality modles in long sequence tasks. 3) New benchmarking attention, both faster and memory-efficient than existing attention method (2022.5) 4) Block-Sparse, only compute for no-zero block for attention_mask Further information 1) Algorithm 2) Flash-attention has higher FLOP count compared to standard attention but is still faster because attention is memory-access-bound and falsh-attention has fewer HBM accesses. Not finished Math about how to recalculate backward grad Summary 1) Purpose of auther? Using blocks method to make memory-bound network memroy-efficient and faster 2) Key of new method? Using block to avoid the store of large softmax attention maxtrice. 3) What is useful for me? Using block to trade-off between memory and computation, which can be use based on memory-bound or computation-bound 4) What references is necessary to read? Reformer: The Efficient Transformer: sparse-approximation to reduce the computation and memory requirements Rethinking Attention with Performers: low-rank approximation to do same thing 5) new idea What is the bottleneck right now, memory or computation? what is it for different models or module parts?</summary> </entry> <entry><title>How to learn knowledge in new fields?</title><link href="https://wa008.github.io/posts/how-to-read-paper-from-andrew-GN/" rel="alternate" type="text/html" title="How to learn knowledge in new fields?" /><published>2024-10-23T00:00:00+08:00</published> <updated>2024-10-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/how-to-read-paper-from-andrew-GN/</id> <content src="https://wa008.github.io/posts/how-to-read-paper-from-andrew-GN/" /> <author> <name>Benson</name> </author> <category term="General" /> <summary>Collect, summary and adjust to get the following tutorial from multi-sources in Reference. How to learn Very quickly identify what the foundational knowledge is Build a personal curriculum to become an expert and avoid the trap of the expert beginner. Sprint hard the first 15-20 hours to impress initial memory, then decelerate to a more regular pace. Reading Research Papers Collect related resource Not only paper NIPS / ICLR / ICML ML Subreddit Paperwithcode Arxiv Medium alphaxiv Google scholar Hugging Face Read a few of them and then decide which to read more Read again when you need it after first reading How many are need? After read 15-20 papers, you get a good understanding of any field/topic After read 50-100 papers, you get mastery in the area How to read one paper/document? Read Title/Abstract/Figures Most information summarized in one or two figures Get a good understanding without reading much text Read the Introduction/Conclusions/Figures(again) Read all and skip math Read all and skip that don’t make sense Deep understanding Maths Code Use it or realized it Questions to Keep in Mind What did the authors try to accomplish? What were the key elements of the approach? What can you use yourself? What other references do you want to follow? Is there new idea? Reference: Andrew NG’s video Learning to learn</summary> </entry> <entry><title>Weekly-#8 Start Reading</title><link href="https://wa008.github.io/posts/weekly-8-reading/" rel="alternate" type="text/html" title="Weekly-#8 Start Reading" /><published>2024-10-20T00:00:00+08:00</published> <updated>2024-10-20T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-8-reading/</id> <content src="https://wa008.github.io/posts/weekly-8-reading/" /> <author> <name>Benson</name> </author> <summary>Product LLM acceleration Matrix Multiplcation: Read more LoRA: start reading paper YouTube Upload four videos this week and receive 5 Subscribers Blog Update current blog to jekyll-theme-chirpy Updated commit Reading Searching content is the advanced ability compared reading from others flow is money, eliminating information gap can obtain money Product is the exchange of value Everyone should have a life like Ryan – from Saving Private Ryan Thought Reading is necessary for producing More cost are need for Plan B, it’s not the best time to pay for them. Working is a better way to start plan B. This week Plan B: hold Youtube videos: 4 Projects related with security clearance: done PopTranslate: save stript need for restart machine Reading and Writing Exercise: 1 Next week Youtube LLM acceleration Reading Exercise</summary> </entry> <entry><title>Notes of LoRA</title><link href="https://wa008.github.io/posts/paper-LoRA/" rel="alternate" type="text/html" title="Notes of LoRA" /><published>2024-10-20T00:00:00+08:00</published> <updated>2024-10-20T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/paper-LoRA/</id> <content src="https://wa008.github.io/posts/paper-LoRA/" /> <author> <name>Benson</name> </author> <summary>Introduction Inspiration: the change in weights during model adaptation have a low “intrinsic rank” Description: Change small matrices A and B when fine-tune, adding A * B to weight W, which significantly reduce the trainable number of parameters because r &amp;amp;lt;&amp;amp;lt; d Novelty: Reducing Fine-tuen cost without additional latency and quality reduction or changing input consturction at the same time Benefits 1) Efficiently switch models for different target tasks through switching LoRA matrices 2) Reduce consuming time and hardware requirement when Fine-tune 3) Without any inference lantency 4) Orthogonal with other adaptation method Further information 1) LoRA have better scalability and performances 2) Adapting more weight matrices is preferable than adapting a single type of weights with a larger rank, 2 or 4 is a great option 3) Similiarity of LoRA vectors among different rank(r) is higher when dimention is small, which prove (1)low-demension consists more information, (2) small r is enough 4) Matrices of LoRA is similiar with original weight mtraices, LoRA is a amplification of original information. Summary 1) Purpose of auther? reduce the cost of fine-tuen without any loss 2) Key of new method? change of adaptation have a low “intrinsic rank” 3) What is useful for me? large Matrices in LLM have a low “intrinsic rank”? New fine-tune method 4) What references is necessary to read? Where “intrinsic rank” comes from? Measuring the Intrinsic Dimension of Objective Landscapes Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning 1-4 from Andrew NG 5) new idea rand-deficiency of delta_w suggests that w could be rank-deficient as well, which can be a source of inspiration of future of works.</summary> </entry> <entry><title>Acceleration of LLM - Matrix Multiplication</title><link href="https://wa008.github.io/posts/try-of-torchview-to-accelerate-finetune-new/" rel="alternate" type="text/html" title="Acceleration of LLM - Matrix Multiplication" /><published>2024-10-17T00:00:00+08:00</published> <updated>2024-10-17T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/try-of-torchview-to-accelerate-finetune-new/</id> <content src="https://wa008.github.io/posts/try-of-torchview-to-accelerate-finetune-new/" /> <author> <name>Benson</name> </author> <summary>Background After read “Manual Autograd” in unsloth’s blog, I try to parse model and found more related point where we can optimize. torchview is a great similar tool to use. torchview what torchview can do I want to show what torchview can do after I try it. Model: torchview can parse model when inferencing and training, it support mlp, bert, Gemma, llama3.2. Node: the smallest node is tensor, module(like attention), function(like nn.funtion). Shape: show the input shape and output shape for every basic node. Edge: show the input and ouput relation between basic node. Showing node and related information: model = AutoModel.from_pretrained(&amp;quot;bert-base-uncased&amp;quot;) tokenizer = AutoTokenizer.from_pretrained(&amp;quot;bert-base-uncased&amp;quot;) inputs = tokenizer(&amp;quot;Hello world!&amp;quot;, return_tensors=&amp;quot;pt&amp;quot;) model_graph = draw_graph(model, input_data=inputs, save_graph = True, filename = &amp;#39;output&amp;#39;) print (len(model_graph.edge_list)) for a, b in model_graph.edge_list: print (a, b, type(a), type(b)) what torchview view can’t so far Attention: there are much softmax or activation functions in general model, the only three consecutive matrix multiplication is (maxtrix_intput * W_q) * (maxtrix_intput * W_k), but it can not be optimized because there is no much difference between $d_input$ and $d_hidden$. Parse module: torchview can not parse the specific module so far, there are so much special case in module, like llamaAttention. But, if we have specific input data, it can follow a specific path to execute the code, it seems that torchview works in this way because input data or input size is necessary for torchview, I didn’t research much more about that. Things worth explore Optmization of matrix multiplication still can be used in other module, like LoRA, as said in unsloth Autograd in backward, maybe Conclusion Failling on this indicate that I always think too much but read insufficiently. Simple idea can not work in most situations.</summary> </entry> <entry><title>Weekly-#8 Summary for two month</title><link href="https://wa008.github.io/posts/monthly-1/" rel="alternate" type="text/html" title="Weekly-#8 Summary for two month" /><published>2024-10-13T00:00:00+08:00</published> <updated>2024-10-13T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/monthly-1/</id> <content src="https://wa008.github.io/posts/monthly-1/" /> <author> <name>Benson</name> </author> <summary>Product Voice correction: failed, technology is not enough mature to meet this demand. PopTranslate: First available product. Cost of product with server is higher than expectation. unsloth: great start but just a start. Youtube: great start but just a start. Remote work: failed Security investage project: too much concerns that I didn’t realized in the past. Reflection can not concentrate enough Goals Youtube: insist on. Reading: Only deep reading and understanding can find deep demand. unsloth: long-term valuable project. side-project: making money through information gap new idea Weekly Thought The feedback after find jobs indicates that my ability is not enough to find a remote job right now, transfering to LLM project and taking a deeper learning is definitely better idea, I will try it after three months. concentrate more This week Plan B Remote jobs opportunities: hold Possibility to other countries: hold Youtube videos Projects related with security clearance PopTranslate Reading and Writing Exercise Next week Youtube unsloth reading</summary> </entry> <entry><title>Weekly-#7 Staying home</title><link href="https://wa008.github.io/posts/weekly-7/" rel="alternate" type="text/html" title="Weekly-#7 Staying home" /><published>2024-10-10T00:00:00+08:00</published> <updated>2024-10-10T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/weekly-7/</id> <content src="https://wa008.github.io/posts/weekly-7/" /> <author> <name>Benson</name> </author> <summary>Life I stay home for 14 days this time, it’s long. I spent the first seven days with my families and last seven days with friends. Everyone had different life, what are the same is that everyone have much pressure about life. Even though, there will be one or two friends who have much proactive atitude towards life, it’s so nice to talk with them. I want to be this kind of person. Product Visa Spent two days on my visa, finished the second step of injunction PopTranslate Replace Google Translation API with self-hosted translation service, This is the first time for me to use nginx, https. This week Injunction stage two Plan B Remote jobs opportunities Possibility to other countries Youtube videos Projects related with security clearance PopTranslate Next week Plan B Remote jobs opportunities Possibility to other countries Youtube videos Projects related with security clearance PopTranslate Reading and Writing Exercise</summary> </entry> <entry><title>Weekly-#6 Cost of PopTranslate</title><link href="https://wa008.github.io/posts/BackHome-weekly-6/" rel="alternate" type="text/html" title="Weekly-#6 Cost of PopTranslate" /><published>2024-09-29T00:00:00+08:00</published> <updated>2024-09-29T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/BackHome-weekly-6/</id> <content src="https://wa008.github.io/posts/BackHome-weekly-6/" /> <author> <name>Benson</name> </author> <summary>Product process PopTranslate This is a multi stages story. 1) Lost my free $300 in Google Account In order to join the YouTube Premium family account, I need to change my location from Canada to America. So, I delete my previous payment profile, which is used for Google Translation API but I didn’t realize that at that time. I create a new payment where I set the address in America and linked this payment with Google Translation API in order to continue use it. After two days, I realized I lost the free $300 for new account from Google and must pay billing by myself, it cost about $25 everyday and last two days, of course it’s too expensive. This is also the first time I realized it’s so expensive for Translation server. I link my card with another Google account and use the free $300 to creat a new api_key and use it in PopTranslte new version, I published new version immediately. This is almost the end of stage 1 and must pay about $50 in the end of the month. 2) Tranfer Translation from Google API to self hosted service. After I pubslished PopTranslate two week, the data is already stable, it shows as below: active users: 18 change: $27.12 requests: 11k average requests: 611 average characters per requests: 61 average QPS: 0.12 Google translation API price: $20/500k characters of course it’s too expensive even I make the extension paid for user. so, I must tranfer it to self hosted service. LibreTranslate is the best option I have found, I’m trying to hosted this on Google VM, but it always not a ideal option because VM cost $30 per month, I can use it at least 3 months because $300 from Google is valid in 90 days. I will find a better solution after that. self-hosted is complex, I’m still trying. YouTube Recording and Upload two videos in this week, leetcode problem has more views than atcoder resulting from keywords search. Daily 9.23: Analysis security project and submit more resume 9.24: Record one video and investigate countries 9.25: Deal with Google billing problems and submit more applications 9.26: Back home 9.27: finish google form API for security project and rest 9.28: Try LibreTranslate 9.29: rest Personal life Reading None Exercise two times Thought 1) Translation service is so expensive, maybe I can host one. 2) Plan B is more complex, maybe I should change the plan. This week Plan B Remote jobs opportunities Possibility to other countries Youtube videos Projects related with security clearance PopTranslate Reading and Wrting Exercise Next week Injunction stage two Monitor of PopTranslate Rest</summary> </entry> <entry><title>Weekly-#5 Updating of PopTranslate</title><link href="https://wa008.github.io/posts/LLM-weekly-5/" rel="alternate" type="text/html" title="Weekly-#5 Updating of PopTranslate" /><published>2024-09-23T00:00:00+08:00</published> <updated>2024-09-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/LLM-weekly-5/</id> <content src="https://wa008.github.io/posts/LLM-weekly-5/" /> <author> <name>Benson</name> </author> <summary>Product process PopTranslate Summary of promotion list of ways to publish promotion and is there response? ruanyifeng: Yes Product hunt: Yes Reddit: Yes HackerNews: No Twitter: No Discord: No pitchwall: No v2ex: No Users No much users Updating Got some feedbacks from users and update two versions, 1.1 -&amp;amp;gt; 1.2 -&amp;amp;gt; 2.0, details. It real make me happy when I found someone is using and like my product (One detailed and patient issue and one five star chrome extension store). The api break down for half hour when I deleted my previous payment profile in Google Pay because I need join a Youtube Premium family group. More attention is necessary when you do something that may influence your product. unsloth Validation of Fast Cross Entropy Loss in last blog YouTube Too much thing and no extra time to do this. Daily 9.16: Watching Breaking bad 9.17: Finish this great TV 9.18: Trying fast cross entropy loss validation 9.19: Finished and produce blog 9.20: Finished a assignment 9.21: Update PopTranslate to 1.2 9.22: Update PopTranslate to 2.0 Personal life Reading breaking bad: we should do what we good at, that can provide us with real satisfaction onlyfans finanafinancial report: weird demand Open soruce my brain: so cool Exercise Three times this week. There are too much sunshine after I get up on 8:00, it’s not suitable to run. I should try to do it in the evening even it’s hard to start. Thought 1) Useful product that can influence others really make me happy. 2) There is not further information about my study visa, I should start my plan B. 3) Uncertainty for future significantly influence the related plan, I should make enough good planB if uncertainty always exists. This week Focuse on unsloth Validation of thought Know more: pending Try new thought: pending Reading more Exercise Produce more valued content: validation of fce Next week Plan B Remote jobs opportunities Possibility to other countries Youtube videos Projects related with security clearance PopTranslate Reading and Wrting Exercise</summary> </entry> <entry><title>Validated example of LLM acceleration</title><link href="https://wa008.github.io/posts/validated-example/" rel="alternate" type="text/html" title="Validated example of LLM acceleration" /><published>2024-09-19T00:00:00+08:00</published> <updated>2024-09-19T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/validated-example/</id> <content src="https://wa008.github.io/posts/validated-example/" /> <author> <name>Benson</name> </author> <summary>Theory of Fast Cross Entropy Loss As a start of LLM acceleration project, I learnt Fast Cross Entropy Loss in unsloth, it shows a better realize solution of cross entropy loss than default pytorch code. As default, pytorch will use log_softmax to realize CE loss, it’s common for all solution, but, the target has only one valid value in the training process of LLM and other element are 0, this is the different part between LLM training and common CE, that’s why LLM acceleration solution works. So, we can update the calculate process of CE as below [\begin{align}\label{2} &amp;amp;amp; CT(x, y)_i = -y_i(log(softmax(x))) &amp;amp;amp; =-y_i(log(p_i)) &amp;amp;amp; =-(log(\frac{exp(x_y)}{sum(exp(x))})) &amp;amp;amp; =logsumexp(x) - x_y \end{align}] After optimizaiton, this can reduce time complexity from $O(4n)$ to $O(2n)$, which can reduce the cost of time and GPU memory for the best suitation. This is all the theory of solution Validation Taking finetuning Gemma2 as example, I tried to compare the result of new CE loss and default one, but I found some thing that I have never know before. (1) smoothed_loss There is a smoothed_loss which is used in CE Loss except traditional log_softmax, which is the first noise during my validation. But I also realize it throught new method. (2) A trick that subtracting the max-logit to make softmax more stable After I realize above code and fine-tune Gemma2, I found it can reduce fine-tune time by 4.8%, but loss of new code didn’t reduce by training step, so, I ask help in Machine Learning subreddit and get what I want. After applying subtracting max-logit to my code, it works, there almost zero differences for loss between default pytorch code and my new code, the loss as below: This can prove that My new code have the same result compare to default official code. Result default offical key code: # time complexity 2n for subtracting max-logit (max, subtract) log_probs = -nn.functional.log_softmax(logits, dim=-1) # time complexity 4n (exp, sum_exp, expx / sum_exp, + max) nll_loss = log_probs.gather(dim=-1, index=labels) # 1n smoothed_loss = log_probs.sum(dim=-1, keepdim=True, dtype=torch.float32) # 1n My new code: logitsmax = logits.max(dim = -1)[0].unsqueeze(-1) # 1n logsumexp = ((logits - logitsmax.repeat(1, 1, logits.shape[-1])).exp().sum(dim = -1).log()).unsqueeze(-1) + logitsmax # 3n nll_loss = logsumexp - logits.gather(dim=-1, index=labels) # 1n smoothed_loss = (logits.shape[-1] * logsumexp - logits.sum(dim = -1, keepdim=True, dtype = torch.float32)) # 1n PS: In theory, time complexity reduce from $8n$ to $6n$, I’m not 100% confirm this value right and it’s hard to prove that. In terms of time cost in finetune Gemma2, I only sample 100 sample(my fault) from yahma/alpaca-cleaned and run 60 steps two times for both official code and new code. offical CE Loss code New code differences 362.5s (average) 352.5s 2.8% Conclusion I validated the new method to calculate CE Loss and reduce time cost by 2.8%. In additional, using Triton to realize should have better performance. This is just a example for LLM acceleration, more similiar thing can be done to accelerate the process.</summary> </entry> <entry><title>Weekly-#4 First insight of LLM accelerate</title><link href="https://wa008.github.io/posts/LLM-accelerate/" rel="alternate" type="text/html" title="Weekly-#4 First insight of LLM accelerate" /><published>2024-09-15T00:00:00+08:00</published> <updated>2024-09-15T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/LLM-accelerate/</id> <content src="https://wa008.github.io/posts/LLM-accelerate/" /> <author> <name>Benson</name> </author> <summary>Product process PopTranslate Finally find the root reason why my chrome extension was rejected, I put the api_key in .gitignore file and it can’t upload to chrome extension store successfully when I upload the zip file. Actually I found the root reason thought the crx file generated by chrome extension. After I pointed out this reason, google extension team also responce to my email and tell me this reason, this make me feel valued. I also published this product on several media platforms, what left me a deep impression was reddit, I put my project so hard on this platforms, as a result, it banned my account after five hours, I deserve it. So I register another account, I need to culture it for several days to express myself more free. The result after publishing haven’t totally show, so, I will summary that in the next week. unsloth Learn “Fast Cross Entropy Loss” in unsloth blog, I already undertstood the theory. I also need to porve that based on my own code. This most important thing I have learnt in this week is I finally understand why llm-accelerate projects can work. Most of code of llm design and writed for common ustage, right now, loss function or transformers are used for million times with same format. As a result, we can make this code and theory more specific and make it can make the current network and task well, changing common function and theory to specific one always can improve the efficiency of training and finetune. YouTube I upload two videos about the solutions of leetcode problem this week, it have plenty of benefits, for example, practicing my english speaking ability, prepare for english interview, try to be a youtuber. Daily 9.9: running, prepare huggingface token 9.10: reproduce code, but result is different, maybe cause is the random seed 9.11: read related HN post and blogs about unsloth 9.12: read fast_crossEntropyLoss code to understand why it works 9.13: Try to solve another issue but failed 9.14: publish PopTranslate 9.15: Rest Personal life Reading alphaxiv: it’s perfect for both idea and value Front-end UI: many great design even typescript so many post tools with AI Exercise Runing five time this week, half hour every time, it’s a good start, If I can insist on this week, maybe I should price me some equipments. Thought 1) unsloth also reference some other paper, there are plenty works can be done about this topic, it’s also hard, I think it’s worth it. 2) publish new project is a great think, I can receive thank for others even it’s a small thank. Own proejct can give me a feeling of children, it’s totally different. This week Focuse on unsloth: less than expectation PR Reproduce Know the theory of acceleration and product a essay Reading: spend some time on papers Exercise: Running in the mornings: better than expectation Social account Next week Focuse on unsloth Validation of thought Know more Try new thought Reading more Exercise Produce more valued content</summary> </entry> <entry><title>Weekly-#3 PopTranslate</title><link href="https://wa008.github.io/posts/PopTranslate/" rel="alternate" type="text/html" title="Weekly-#3 PopTranslate" /><published>2024-09-08T00:00:00+08:00</published> <updated>2024-09-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/PopTranslate/</id> <content src="https://wa008.github.io/posts/PopTranslate/" /> <author> <name>Benson</name> </author> <summary>Product process PopTranslate I finally finish this project, it works on my computer and my gf computer, I like this project. Sad news is my review for this extension was rejected two times by google, I didn’t know the reason ans ask for further review. Other product attempts 1) Text-to-voice in-browser After know about transformer.js which aimed to bridge the gap between web and LLM, I tried this method to realize this project, but it failed again. I also meet some errors that I cannot solve in short time. In terms of the reason, transformer.js is not mature enough, more deep knowledge and techniqu in audio field are necessary to solve it. Maybe I will do that if I have free time in the future. Consequently, I hold this proejct again. 2) Analysis 500 startups supported by YC Due to the lack of fresh idea, I analyse the 500 startups supported by YC in 2024, some conclusion as below 50%+ is LLM or AI related based on title, real value is higher than that. 64% is belong to B2B category. This is majority area of AI application. 10% is belong to healthcare categoty as the second biggest part. Education is smallest category, occupying 1.2%. There will be more opportunity if AI became more accurate. Projects that are great and suitable for me unsloth: LLM finetune accelerate gpt-pilot: Making AI deveop like a real developer, this will be the next stage of AI code transformer.js: bridge the gap between web and LLM, from huggingface 3) LLM finetune accelerate Request my first PR for this project and got merged, meanwhile, it’s the 1000th PR, just a coincidence. The open source version of this project can accelerate most of open source models finetune stage 2x, pro version can provide more support, best performance is 30x. It worths more exploration. Daily 9.2: PopTranslate 9.3: Publish PopTranslate 9.4: Reading 9.5: Reading 9.6: Try to reproduce a specific issue of unsloth 9.7: submit PR of unsloth. Try transformers.js 9.8: Rest Personal life Reading limu’s speech in shjt universion: recommendation for five stars AI tools help you grow fans Greppability is an underrated code metric: Useful and practical for developer, especially for how worked in big company Interest-base community have great growth: I have the same sense, interest is the final way to socializing Cost of LLM will continue to decrease – Andrew NG: Moore’s law will work in the latest field. Raise 1B with one html – ssi Photo has more power than text in terms of creation Next product of openAI will charge 2k/month? Architecture is the main problem when traing 400B+ model – limu Exercise three times this week, sad news. But I start to running in the morning, just start in the monday. keep insisting. Thought 1) Creating new product is a hard problem, I realize this more after I start to do it. 2) Creating entertainment content is a difficult task even TikTok is so popular all over the world. Hot content always need all necessary thing, fresh idea, capturing details, and so on. This is hard to created that by AI. In other words, AI is not enough smart to produce content which can attarct consumers. Consequently, AI is suitable for small business, this is the majority ustage of AI. 3) I’m tried, but I enjoy. Next week Focuse on unsloth PR Reproduce Know the theory of acceleration and product a essay Reading: spend some time on papers Exercise: Running in the mornings Social account</summary> </entry> <entry><title>Weekly-#2 The fail of first product</title><link href="https://wa008.github.io/posts/The-fail-of-first-product/" rel="alternate" type="text/html" title="Weekly-#2 The fail of first product" /><published>2024-09-01T00:00:00+08:00</published> <updated>2024-09-01T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/The-fail-of-first-product/</id> <content src="https://wa008.github.io/posts/The-fail-of-first-product/" /> <author> <name>Benson</name> </author> <summary>Product process Voice correction From monday to wednesday, I finish the frist verison of my first product, which is voice correction. It always have several drawbacks duc to the lack of high performance of my computer. This price of cloud computer is high, that is the main reason I don’t continue this project temporary. The first version is available for me or my girlfriend, but it is too shy to share to public. There are several problems. some voice will not converted to text sometimes, because of the lack of high performance of computer. better computer can illeviate this issue. The order of text is not totally the same with voice, because I didnot reroder it after convert voice to text with multi threads, I have own the related techniques. I will do that if I restart this project in the future. the performance of voice-to-text and text correction models is not always good, bigger model and better machine can diminish this issue. I still learn a lot from this project, for examle The definition of async function and how to use that in python, it is essentail in stream or speaking scene. The price of machine and the need of LLM for machine How to use discord bot, which is powerful The potential of web-gpu, which make lots of LLM product possible Other product attempts Collection of web-tools The collection of web-tools, the define of web-tools is that this kind of product don’t rely serivce. This kind of product have low cost and are easy to copy, there are less powerdown or other related issues for that. After explore for several hours, I found there is a open source product named (it-tools](https://it-tools.tech/) which is great. I don’t need to do that again. I move my sight to web-tools of AI product, it is also not an ideal prodcut becuase most of LLM product are not abvailable in only-web. Text-base: there is a related porduct named mlc-llm, this is fine. image-base: more of image model are 12B, it is too big to run in-browser video-base: it’s more impossible compare to image-base audio-base: voice-to-text: whisper.wasm is great text-to-voide: there is not related proudct temporary, I can do that. Text-to-voice in-browser Influenced by My collection of web-tools idea, I want to make a text-to-voice product just like whisper.wasm, there are several advantages. service is not necessary, I can host it on github pages, it can be free for public. it run only in-browser, there are not privacy concerns. it is useful for public, for example, I need that when I prepare my ielts test Direct translation extension Inspired by the pop up windows of a english learning platform, I want to make a translation extension, it can show the translation after user double-click the content that he/she select. Compared to other related products, it can show translation directly with only one operation, other proudcts need two operation to trigger translation. Now, I finished the front-end code, I need to add requesting translation API funciton to my project. I forgot to push code to github again, I don’t know it is essential in the initial step of a product. Personal life ITLTS The review of ielts speaking have a result, I got the score that I need. This is a great thing because I can put more attention on my personal projects. Reading I didn’t read as much as last week, because my products gone not very well. The CEO of telegram was arrested by frence government. Telegram is always a wired proudct, it is famous by security but it don’t open e2e as default, there are so powerful other function in this platform which are not related with security like bot, channel. The small tools in whatsapp: There are several so simple product but can bring so much profits. The profits are not alwasy related with its complexity remove background in using web-gpu: I think this kinds product are powerful, It will be great if we can make web-gpu support more LLM, like models in huggingface. exercise I start to do small exercise this week, I did at least finve times in this week, this is a good start. Next week plan for next week product realize the direct translation extension publish it to public generate more ideas reading more exercise take part in social group</summary> </entry> <entry><title>Weekly-#1 First week of indie develop</title><link href="https://wa008.github.io/posts/First-week-of-indie-develop/" rel="alternate" type="text/html" title="Weekly-#1 First week of indie develop" /><published>2024-08-25T00:00:00+08:00</published> <updated>2024-08-25T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/First-week-of-indie-develop/</id> <content src="https://wa008.github.io/posts/First-week-of-indie-develop/" /> <author> <name>Benson</name> </author> <summary>Backgroud When I received my ielts score at 8.19, I still didn’t get my necessary score for speaking part, But the difference between this time and last several times are that I think I already try my best in the ielts speaking part. So, I don’t want to continue to prepare for ietls because it is expensive and filled with random factors. Meanwhile, My study visa havn’t passed till now and I confirmed I trigger security investigate which will spend more time than regular visa application. I will delay my master program with high possibility if there is no suprise in next week. It is wired it need so much time for ircc to process the visa application, maybe I need other preparations after next week. As a result, for english, Firstly, I had already ask for a score review for ielts speaking part, I had already submit the application for Cambridge English. In addition, I will change exam from ielts to duolinguo, whose price are more reasonable and are relative easy to pass the exam if I have at least two months to prepare for that. More important, I am able to start my personal deveop career right now. This week is the first week for my to develop by myself towards to my personal goal even I had quit my job for over three months. Product Idea source When I prepared for ielts speaking test, I asked help for enlish techer online, I found the best services from teacher to me are show the grammar issues of my speaking, actually, I can provide enough long sentence to answer the question because I have already practice these topics for several times. My major problem is is grammer issues, like past tense or present tense, singular or plural, I made so much these kinks of mistakes. So, I want to make a product to point out the mistakes that peole who are learning english made. I will made it as a discord bot first. Maybe I will build a app for website in the future. Realize receive audio file or real-time speaking audio convert audio to text message correct the errors in sentences display the errors and correction Process Right now, it can receive audio messages and output what I want it to display as a discord bot. I am trying to realize the real-time speaking input, which is the area that I am unfamiliar with, consequently, I need more time to learn some new knowledge. Obtained new information receive voice data is sensitive for playforms: there are not offical API for discord.py to receive real-time voice data, I need to ask help from extension, it’s luck that there is this kind of tool. Running LLM on only web is possible: it’s not suitable for every LLM, but it is a low-cost way to achieve some specific products. There are also great tools that support it, like web-gpu. There are plenty of LLM with small size, which are friendly for personal developer or small business. Discord API is so friendly, My love for discord is increasing as I know this platform more and more. cloud machine is expensive, I need to spend almost 200 every month if I want to run the product in the future. Alternative product Several products are great but there are always some drawbacks All of them are expensive All of them can not provide best correction display format Some of them cannot keep correction function for a long time day records 8.19: organize my though about this product 8.20: explore text-to-speech and text correction model 8.21: try only js solution and give up. start to connect discord bot ensure text correction model and start to development 8.22: realize the whole process though audio segment input 8.23: connect real-time speaking and save data, but it isn’t match the whole project. Another solution need. 8.24: rest Reading Reading can help me to maintain the connection with latest development of techniques, meanwhile, it can provide more fresh information to me. levelsio: indie hacker who pursue extreme freedom made numous products but only several of them achieve success, which are enough for him to living and pursue his goal without much life related pressure. most of his successful products are related with AI, which bring lots of opportunities to the internet. DeskHub: hardware product of github bars, so fun learning english though printing subtitle with youtube Run python code in javastript: I believe I will use this tool in the future Build products in several platforms though the same code What product are we building PDF to markdown: It use LLM to realize, which cost so much resources. discord music bot: for fun real-time face swap video: this is useful in xxx fields, wired. write two solutions for leetcode, I want to make some videos if I have extra time. Thought I am happy that I had started my product right now. The passion for new product will diminish and flucate with time, it is the most strong period before you start to realize it. It is hard and crucial to maintain the balance between passion and clear thought. I should push code to github, it seems like I take part in huge open source project. I am too heavy, I need to loss weight I start to write english content like this essay, it is nature and comfortable to continuous writing since I started. Plan for next week product: realize the real-time speaking make a landing page publish it in discord channel spend some time on exercises some time for duolinguo test reading and generate new ideas for next product record videos for leetcode solutions 2024.8.25</summary> </entry> <entry><title>slack迁移discord</title><link href="https://wa008.github.io/posts/slack2discord/" rel="alternate" type="text/html" title="slack迁移discord" /><published>2024-07-19T00:00:00+08:00</published> <updated>2024-07-19T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/slack2discord/</id> <content src="https://wa008.github.io/posts/slack2discord/" /> <author> <name>Benson</name> </author> <summary>背景 之前加入的一个slack留学群组，历史记录里有很多宝贵的经验和文件，但slack免费版本只能显示最近三个月的消息。 最近社区有网友提到了这个事，建议群主把历史信息迁移到discord平台，群主也把历史记录down下来了，就万事俱备了。 恰好呢，我7.16日刚考完雅思，等结果的这两天可以把这事儿搞一下。 迁移 之前调研过，有slack迁移discord的工具特别好用，几乎无缝衔接，让我比较惊叹的是，一条消息下的回复列表，也能按照原格式迁移，几乎是无损迁移了，有了这个关键点就能很大程度保证迁移后的用户体验，其他问题感觉就不那么重要了。 具体步骤按照原作者给的github的操作路径执行就可以，比较费事的是，怎么给discord群组按照一定权限加机器人，我找了半天，竟然是要自己构造一个链接，机器人的权限信息就在链接的参数里，访问这个链接点击确认，就加进去了，这个用户体验着实有点别扭。也可能是我没找对姿势吧。 主要问题 真正迁移的过程中，遇到的大问题就一个，每次程序跑了3-5小时，就会因为网络原因（或者其他原因，我看着像网络问题）断开，而且，整个程序是先初始化了 discord 的 client，再一条条把消息通过bot发到discord群组，网络原因嘛，第一方案就是重试，但发现只重试 “发送消息” 这个小步骤没有用，还会持续报一样的错误，这里我确实找不到原因了。 所以呢，就只能在最外层加重试，也就是每次失败后，重新初始化client，这样能解决失败的问题，引入的新工作量是，需要加一个缓存（姑且叫他缓存），记录下上次失败时迁移到哪个位置了，这次从这个位置继续，避免重新迁移。 所以最终运行的代码版本，相比原版，就增加了外层重试和缓存的逻辑，算是成功迁移了。最终版的代码，提了PR，但感觉加的功能比较挫，大概率不会merge，留在那儿给后人提个醒也行。 效果 支持能的功能如下 评论：每条消息下的评论，能按照原格式迁移，无缝衔接，很棒 内容：除了文字、链接，图片、附件也能正常显示；过大的文件无法迁移 用户：能迁移头像和用户名，太强了 时间：新平台的内容发送时间为迁移时间，非原消息的实际发送时间；新平台每条消息前面会附加真实的发送时间，作为替代方案，这是原工具的功能 附件：有附件的消息新平台会分成两条发送，第一条是附件以外的文字信息，第二条是附件 详细记录 这个过程总计耗时2天，程序跑了24小时左右，详细的调试过程如下 7.17 14:00 跑一个小时失败，网络不稳定，换香港服务器重跑 7.17 21:00 跑3.5小时失败，网络不稳定，给await加了10次重试，每次5分钟 7.18 07:40 跑了4小时失败，迁了一万条消息，运行时间、成功迁移的数量跟上次差不多；问题是上次加的重试覆盖范围不足，扩大了范围，9:45 重跑；关注下内存和cpu 7.18 12:32 跑到 college 申请群 2024-03-18 出错，跟上次出错不是同一个位置，非内容问题 修改成出错超过10分钟就跳过，重新跑，12:32 开始跑 结论：1）内存稳定，不是内存问题 2）内容跟上次出错位置不同，非内容问题 7.18 15:13 跑到 社区主频道 2022-11-01 出错； excption 代码逻辑出错导致，修改重跑, 15:36重跑 报错信息：疑似网络不稳定的问题 结论：重跑能成功，非内容问题 7.18 20:24 18:47 断了，跑了三个小时，未知原因， 7.19 8:38 添加外层重试和缓存，从主频道开始跑，跑了10个小时跑完 共72943条消息，社区主频道之后迁移失败消息有134条，一共预估300条左右，占比不到0.5% 致谢 感谢原作者的代码 感谢群主提供的机会</summary> </entry> <entry><title>雅思备考 2024Q3</title><link href="https://wa008.github.io/posts/ielts/" rel="alternate" type="text/html" title="雅思备考 2024Q3" /><published>2024-06-30T00:00:00+08:00</published> <updated>2024-06-30T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/ielts/</id> <content src="https://wa008.github.io/posts/ielts/" /> <author> <name>Benson</name> </author> <summary>方法 半吊子备考了一个月，6.18日成绩6.0（L 5.5, S 5.5, R 6.5, W 5.5），虽然确实投入的经历不够，但感觉也确实没找对方法，就重新梳理了复习方法。 听力：在朋友的建议下，开始精听。听完听力后，默写下来，跟原文对比，复习对不上的部分。再说，保证口音跟原音一致。 口语：练习的量不够，从最近两次考试的经验上看，需要练习60个part2可能能覆盖到近期的题目。另一方面也是纯粹练习口语能力。 阅读：分数已经够用了，暂时不专门复习阅读了 写作：9分学长的课感觉挺好用的，已经看完了，现在多练习，写完对比范文做完善。 记录 6.28: 听力：精听一个s2 口语：练习一个p2 写作：无 6.29: 听力：精听0.5个s2 口语：无 写作：练习一个t2 6.30: 听力：精听0.5个s2 口语：6个p2 写作：1个大作文 7.1: 听力：精听1个s2 口语：14个p2 写作：一大一小 7.2: 听力：一套听力测试，6.0，填空题做的不好；练习王陆听力单词 1/3，740词左右 口语：练习14个p2 写作：4/12 语料练习 7.3: 听力：一套听力测试，5.0，填空题格外差；练习王陆听力单词，进度 2/3 口语：14个p2 写作：8/12 语料练习；一个小作文 7.4: 听力：一套听力测试，7.0，选择题做的不好；练习王陆听力单词，进展3/3 口语：2个p2 写作：修改小作文，修改到6.5分，总结常见用法；12/12语料练习 7.5: 听力：一套测试，6.5；王陆听力单词复习，280个不熟悉单词 口语：12个p2 写作：文化话题复习，练习了两个单独的分论点，但无法批改，不太方便；同时语料中能用到的内容占比并不高，35%左右；一个小作文练习，未批改 7.6: 休息一天，出去骑车 7.7: 练习较少 听力：一套测试 口语：1个p2 写作：一个小作文 7.8: 听力：测试三套机经，均分6.5 口语：无 写作：一大一小；6.0 7.9: 听力：测试4套机经，均分5.5-6.0，又摸不着头脑了 口语：练习10个p2，练习完了一轮，明天开启第二轮 写作：两个小作文；5.0-5.5，感觉chatgpt估分不太准，唉 7.10: 听力：一套精听；三个机经 写作：两大作文，一个小作文，有足够时间能到6.0 7.11: 听力：5个机经，均分5.5-6.0 写作：两个大作文，还是写的慢 口语：1个p2 7.12: 听力：4个机经，均分5.75 写作：两个大作文；修改后6.0 口语：练习 7/50个 7.13: 听力：4个机经，done，均分5.75 写作：1个大作文，6.0 口语：二次练习高频题 25/50 7.14: 听力：复习5个机经 写作：一大一小 口语：二次练习高频提 50/50 7.15: 听力：复习一遍机经 写作：无 口语：又练习了一遍高频的50个p2 7.16: 考试 口语：p2果然命中50个高频话题了，但p3比较懵，基本每个问题都只回答了两三句，不太会扩展。中间说了三次sorry，问题太长的时候容易左耳进右耳出，听不全。 感觉要比上次好一些，6.0应该差不多。 听力：填空题做的还不错；选择题就比较完蛋，能听出来部分排除项，但基本没怎么听出来答案，比较看命了。 阅读：前两篇很有把握，第三篇基本就看不懂了，第三篇还有填空题，每空三个单词，难度有点高；跟以往持平，考个6.5应该没问题 写作：大作文花的时间比较长，47分钟，看完又review了一遍，比前几次都好一些；小作文写完只review了一半，就结束了，整体感觉比上次好一些，就看能不能提分了。 风险点太多，感觉比较难直接过。 考完感觉身体被掏空，头昏脑胀的，最近备考的压力太大了，需要休息一下；一切都等周五出结果之后再说吧。 7.19: 出分，6.0 听力：6.0，还不错，但是不太有信心，接下来还要复习 写作：6.0，ChatGPT批改就是比较严格，保持这个水平即可。 口语：5.5，最差，感觉就是p3占的比重太高了，这是接下来复习的重点 阅读：6.5，没有提升，争取下次7.0 7.20: 决定7.31日重考 口语：作为复习重点，报名一对一练习，大量练习p3 听力：上一节课，继续精听，争取提分 阅读：学技巧，练习，争取提分 写作：练习，加快速度，保持住6.0 7.21: 口语：确定课程，买了10节一对一口语课；开始练习p3，练习了6/18页； 听力：上一节课，跟读0.5篇文章；读王陆的时间、日期等等 7.22 口语：上一节课，复习，p3练习10.5/18 听力：精读一个 s2, s3 写作：p1练习，chatgpt 4omini 竟然打分6.5 7.23 口语：上一节课，p3练习15/18 听力：精读一个 s2, s3 阅读：练习+批改一套，6.0，太辣鸡了 7.24 口语：上课练习p1，p3练习18/18页，补充了6个p3 阅读：练习一套，6.5，27道，要把握好时间 7.25 口语：练习10个p3话题 阅读：练习一套，超时15分钟，6.5，感觉技巧把握的还不够好 听力：练习一套，5.5，填空题做的太差了，需要再背单词 7.26 口语：练习5个p3话题，上一节口语课 阅读：练习一套，6.5 听力：练习一套，5.0，水平飘忽不定 7.27 口语：练习10个p3，一节口语课，模拟考试6.0，置信度不高 阅读：练习一套之前做过的，7.0 听力：练习+精听一套 7.28：报名8.1重考 口语：练习10个p3，一节口语课 作文：一篇大作文，6.0 7.29 口语：练习5个p3，一节口语课 阅读：一套，6.5，差一道题7.0，可惜 听力：一套练习+粗听，6.0，差一道题6.5，可惜 7.30 口语：模拟考试，5.5分，练习5个p3 阅读：一套练习，6.5 听力：一套练习+粗听，6.5 7.31 口语：一节口语课；练习剩余的p3，一共复习了54个p3；把54个p3的一分钟笔记练习了一遍；复习了比较难的p2 阅读：一套练习，6.5 听力：一套练习+粗听，6.0 8.1 考试 口语：p2命中”买便宜东西的人”，但是he和she还是容易弄混。p3第一个问题回答的还可以，后面的部分听不懂在问什么，剩余4分钟都在掰扯了，一片混乱，5.5可能性偏大。5.0也有可能 听力：手机号码最后一段没听出来，perfume 少了最后的e，正常发挥；第二篇很不错，第三篇极差；第四篇正常发挥。6.0的可能性比较大 阅读：前两篇基本都看懂了同意替换，第三篇有三个空是懵的，剩下的平均水平。感觉7.0的可能性偏大 写作：先写了小作文，用了27分钟，策略失误了。大作文production, consumption 实在想不到同意替换，写完re了半篇结束了，正常发挥，感觉6.0 结论：出结果之后，看是完全重考，还是单科重考口语。 8.2 收集到的建议： 多听问题 多看问题和答案，有利于理解问题 how问题可以从多个角度回答，多看答案，补充idea 多练习 口语：收集part3问题，生成音频，听了500个问题 其他：给对象做了个分号的工具 8.3 口语：练习了3个p3话题回答；又收集了500个当季的p3问题，问题比昨天更难一些，听了一遍+复习不熟悉的问题 8.4 出分，想比上次，听力下降了0.5，懵逼。。。买了多邻国的教程，想考多邻国了 8.5 多邻国太难了，还是雅思吧，不要慌，先复习，大不了延期，不能有太大心里压力 复习方法： 口语：复习听力，保证能听懂；练习口语 听力：精读+背数字+背单词+练习+总结 阅读：尽量每天练习一篇 写作：不练习，稳住就行 练习 口语：练习3个p2 听力：复习3套+总结；听力单词生成句子和听力，多听几遍 8.6 口语：练习5个p3话题 听力：读一遍数字；背一遍单词，减少60个单词；练习3套+2遍精听 阅读：三篇文章时间分配应该是 12/18/25，练习p3，25min对12道 8.7 口语：练习5个p3话题，2个小时 听力：练习3套+1遍精听，感觉有提升；读一遍数字；背单词，减少15个 阅读：练习两篇，带上之前做的，耗时 15/21/25，7.0，勉强达标 8.8-8.11：回家休息了4天，平均每天练习半小时听力 8.12 口语：练习2小时 听力：练习了三套+一遍精听，两个6.0，一个6.5；读了一遍数字 阅读：练习一套，新策略7.0 8.13 口语：练习两小时 听力：两篇练习，两个6.5；读一遍数字 阅读：两篇，一个7.0，一个5.5 8.14 口语：练习8个p2，大概5个p3；一个mock test 6.0 听力：一篇练习6.0 阅读：一篇练习7.0 8.15 口语：练习了将近30个p3话题 听力：无 阅读：无 8.16 考试 口语：说的很多，考官也不打断，p3似乎就问了三个问题就结束了，说明我说的真的很长，但用的高级词汇并不是很多；大概率要上6.0了 听力：第一篇四道固定选择题，第二篇的6道填空题，第三篇的5道固定选择题，感觉答的都不错，其他选择填空答的比较一般，感觉6.0和6.5五五开 阅读：第一篇耗时16分钟，太久了，这次三篇的难度差异没有上次那么大，答的还可以，但每篇都不是特别好，感觉大概率要6.5了 写作：好久不写了，果然手生；先写大作文，用了45分钟，还没时间review；小作文写的比较拉夸；大作文感觉还可以，应该还能维持6.0 8.19，出分 口语：还是万年5.5，无法相信，过几天打算申请复议了 听力：7.5，题目对口，也有运气加成，简直了 阅读：6.5，符合预期 写作：6.0，符合预期 日期 听力 阅读 写作 口语 总成绩 2024.8.16 7.5 6.5 6.0 5.5(复议6.0) 6.5 2024.8.1 5.5 6.5 6.0 5.5 6.0 2024.7.16 6.0 6.5 6.0 5.5 6.0 2024.6.18 5.5 6.5 5.5 5.5 6.0 2024.1.21 6.0 6.5 5.5 5.0 6.0 2023.12.24 5.5 5.5 5.5 5.0 5.5 8.23 申请复议 为什么申请复议 这一次说的比前四次都好非常多，说的更多，停顿更少；词汇更好 提前模拟四项目评分标准都是6.0 这已经是我最好的状态了 如果复议失败，可能导致失败的原因有 p2 答案形式比较单一，一直是 I 作为主语，但感觉这个影响不那么大 词汇不够高级，准备的有高级词汇，但要根据话题来看，很大概率用不上 语法错误，老毛病了，很难短时间内修正 再提升难度比较大了，不管结果怎么样，都转战多邻国了 8.30 收到复议结果，口语 5.5-&amp;amp;gt;6.0 努力之后有回报的感觉，太爽了</summary> </entry> <entry><title>中文博客合集</title><link href="https://wa008.github.io/posts/zhblog/" rel="alternate" type="text/html" title="中文博客合集" /><published>2024-06-29T00:00:00+08:00</published> <updated>2024-06-29T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/zhblog/</id> <content src="https://wa008.github.io/posts/zhblog/" /> <author> <name>Benson</name> </author> <summary>背景 V站发布了新功能VNXA，有网友多次呼吁站长添加评论功能，似乎一直没下文。感觉是个非常好的思路。 浏览了几天VNXA，发现收录的博客比较少，每天更新的只有10篇左右，还在慢慢增长 于是我就想自己做一套这个系统，但评论需要用后端，比较耗时间，就降级先做个类似VNXA的功能，用 github pages 部署，不用自己搭建服务端，能支持自己平常摸鱼刷博客就行。 点赞 github pages，真的太好用了。 动手 主要通过两个功能来查找博客 独立博客集合 友链扩散 找到博客后，通过rss订阅找到博文，这样就能自循环不断添加新的博客了。 成果：zhblog，目前每天8篇博客左右，数量还比较少。 本着先做出mvp的原则，原始功能是都实现了，还有一些问题以后再看要不要完善吧。 友链扩散逻辑很粗暴，目前扩散了2.3万友链，但目前运行3小时，只能请求2000个，想把2.3万友链全部请求的话，得考虑加缓存或者多线程。 rss请求+解析失败率60%，感觉需要 by case 优化了 评论功能，需要搭建个服务端才行 滑稽 抛开评论系统不谈，做完了发现市面上已经有同类产品了，最好的当属 BlogFinder，它似乎是手动收录的博客，因此质量比我的高很多，很赞了。 感受 最近还在准备雅思考试，但抑制不住冲动，还是花了两整天的时间在这件事上，如果时间充足的话，我应该很高兴能做类似的产品。 离职后除了准备雅思，这是做的唯一一个成型的项目，收获了久违的满足感，果然还是动手做起来最重要！ 考完雅思后继续加油。 附录 成果：https://informal.top/zhblog 代码：https://github.com/wa008/zhblog BlogFinder: https://bf.zzxworld.com 同类产品，积薪：https://firewood.news 中文独立博客：https://github.com/timqian/chinese-independent-blogs</summary> </entry> <entry><title>English Diary in May</title><link href="https://wa008.github.io/posts/diary/" rel="alternate" type="text/html" title="English Diary in May" /><published>2024-05-08T00:00:00+08:00</published> <updated>2024-05-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/diary/</id> <content src="https://wa008.github.io/posts/diary/" /> <author> <name>Benson</name> </author> <summary>I start learning english with a plan, I don’t have writing task everyday, so, I think this place will become my Enlish Diary to make me writing something everyday in english. 5.8 The hourse I rent now will be out of date in june, I looked for the next apartment for my girlfriend and I, of course, my gf is the main memeber to stay in the new apartment. It is a complex process to pick a suitable apartment, we look six apartment but niether of that is suitable for us. In the afternoon, The learning process is hard, I can’t help to play my Phone when I am learning. Anyway, I still finish my reading task today, in the evening, I ride my electric bike to take my gf back home, the air temperature make the weather great, I am also full of satisfaction because of the finished task in the afternoon, That moment make the hard process in the afternoon worthwhile. It will be better tomorrow. Good night. 5.11 The day before yesterday, I finish a ielts reading task, thereafter, I read the translation carefully. The essay says a story about art, specificly, it talk about the painting. For most people, we always go to museum to enjoy the famouse painting when we want to see some. But for novel, we don’t usually look the original handwriting version, instead of that, we will read the copy version of that. Nowdays, the copy technology is good enough to copy a painting with all characteristic. The essay express that the owner of original painting is one of the reason to encourge perple to enjon orginal painting instead of copy version, that can keep the value of original, not just owner of painting, the owner of museum, relative to original painting may all have this thought. I don’t know if this message is true or not, what impress me deeply is that there are so much critical thought and essay when I read english essay. Critical thinking is helpful for seeking facts and essiential for the society. 5.12 Finally, my body total recover from the trip to huang mountain. restart to running today even it don’t last long time. 5.14 Today, I already studyed with a cycle plan, subsequently, I reviewed what I learned in the last seven days, I find that I don’t learn that well, I don’t have enough patience when I did some task. This plan is not good enough, at least is not suitable for me. Tomorrow, I will change my learning plan of preparing my IELTS test, hope next plan is better. 5.17 Since quit from job, I don’t have much press in daily life and always made heated and much long dream when sleep in night. I feel so tried after I wake up every morning, It made the bad effect to my whole day. I search much solution about this problem, finally I find a effective one. I will read book rather than playing Phone half hour before I go to sleep, that will make me have just a little dream, what’s more, The dream I had is not so heated, that make feel better in the whole day. The original plan is finish a set IELTS test everyday, of course I can’t do that much actually. Every time I finish one of the four parts task, I will give myself a break, That’s why I write these words. Writing words is better watching short video at least. 5.19 I was burned by boiling water, it ached so much at that moment because you can run away from that pian. We went go hospital immediately and doctor give me some treat. Today it become better, but there are some bubbles on my right arms, I must update the drugs on my right arms a few times in the next few days. What a special experience. 5.20 One of the most important skill about english listen is you can understand the meaning of a sentence when don’t need read it again, This is also a big characteristic of speaing, you can only listen essay one time.In reading, I can still practice the skill, I can mind myself to read to sentence one time, don’t read it back again. This’s also useful to make you read artical more quick. Learning ielts reading passages really expand my horizon, in most situation, only male deer have antlers and female don’t have, that’s is part of the reason I give a wrong answer for one question. 5.23 Stop update the Top Hacker News from today 5.24 I’m stay on the life with enough time for almost a month, I still spend much time on social media, that can not bring me satisfaction. I think I was tired of watching news on social media already, since yesterday, I control myself against the news on social media, I feel better rencent two days. Keep insist on that.</summary> </entry> <entry><title>五一游记</title><link href="https://wa008.github.io/posts/travel20240506/" rel="alternate" type="text/html" title="五一游记" /><published>2024-05-06T00:00:00+08:00</published> <updated>2024-05-06T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/travel20240506/</id> <content src="https://wa008.github.io/posts/travel20240506/" /> <author> <name>Benson</name> </author> <summary>出发 没赶上高铁，1000块解锁了新知识，黄牛是可以把直接把你带进站的，车开走之后直接补票就可以，对，没有票也可以直接补票，列车长已经习以为常了，平常赶不上车着急的话也可以找黄牛。 有需求的地方就有生意，高铁规则下也有暗地里的产业链。 武汉 武汉空气湿度很大，气温高的时候很难受，气温合适的话，就太舒服了。 武汉地铁广告没有北京那么多，商业化还有继续发展的空间，广告商们有预算的话，可以参考北京增加广告位。 地铁里乘客笑脸比北京多多了，幸福指数比北京高很多，但也可能跟五一节假日有关。 住的酒店离武汉站18公里，但附近的居民楼、饭店都挺多的，还有不少别墅，感觉武汉发展的很均衡，不像北京几乎是严格按照环往外发展的。 武汉地铁站已经修道18号线了，北京已开通的最大数字是19，发展的真好。 晚上吃了武汉的鱼，种类很多，具体已经记不得了，但味道很不错，不愧是水资源丰富的城市。 东湖真的大，绿道简直是自行车爱好者的福音，有这样的环境，感觉附近绝大多数小孩都会爱上骑自行车的。因为东湖太大，五一游客也多，缆车排队太久，都没有爬山，没有逛具体的景区，只在湖边骑了一圈车，不过周围的风景也很不错了。 远远望了一下黄鹤楼，看不到什么奇妙之处。受长安上万里电影的影响，崔颢写的黄鹤楼是真好。更喜欢的高适的一句话，“只要黄鹤楼的诗在，黄鹤楼就在”，一切物质的东西都无法永存，艺术（诗歌）才能。 武汉长江大桥1670米，我们去的可能不是特指的那座长江大桥，但看起来也很壮观了，能在一千米宽的河上建一座桥，仅仅8个桥墩，建造工艺确实令人惊叹。 晚上去了朋友家，买房后的生活，幸福水平真能提高不少。 上学时大家都是一样的学生，一别五年，每个人的生活状态和规划都不同，真是有趣，不知道再过五年后又会是什么样子。 黄山 送我们去名宿的司机师傅很有趣，特别喜欢开玩笑，幽默的人自带一种魅力，让人不自觉产生好感，幽默的人也一定热爱生活，因为只有热爱生活的人才有精力去幽默。 黄山景区外的商业街很长，所以物价还好。臭鳜鱼味道还不错，毛豆腐实属一般，笋也是特产，但饭店老板说都是苦笋，就没有尝。晚上吃了当地的浇头面，经典浇头里面有竹笋、香菇、平菇、豆干好多种食材，味道很鲜美，这样口味的菜就像一个低调的富二代。烧饼味道也不错，离开的时侯还带了一些。商业街隔一段就有一家兰州拉面，连这种地方也有这么多兰州拉面，真是惊到我了，兰州人真是挺会做生意的。 第二天爬山，5:30起床已经不属于最早的那一批了，太卷了。因为下雨，上山的索道上看不到什么景色，周围雾茫茫的一片。上山的过程中有一段还挺堵的，大家都是这个点上山的。 黄山上的松树是真的多，不少松树都长在悬崖上，还要经受风雨的摧残，也难怪古人都称之为劲松。很意外还看到了两只松鼠，不由得觉得松鼠和松树之间，应该是有什么联系。 大部分时间山里都是雾茫茫一片，可见度极低，看不到什么景色，全程有那么两分钟，不知是出了点太阳还是怎么得，雾被吹走了不少，露出了光秃秃的石头山，景色确实不错，拍到了今日最佳，哈哈哈哈。 除了正常的上下片，还徒脚走到了谷底看大峡谷，又重新爬山去，所以晚上回去的时候，腿和脚已经累的不行了。 第二天，整个下半身都是酸爽的痛感，好久没有经历过这么大的运动量了。</summary> </entry> <entry><title>开始休假</title><link href="https://wa008.github.io/posts/%E5%BC%80%E5%A7%8B%E4%BC%91%E5%81%87/" rel="alternate" type="text/html" title="开始休假" /><published>2024-04-24T00:00:00+08:00</published> <updated>2024-04-24T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%BC%80%E5%A7%8B%E4%BC%91%E5%81%87/</id> <content src="https://wa008.github.io/posts/%E5%BC%80%E5%A7%8B%E4%BC%91%E5%81%87/" /> <author> <name>Benson</name> </author> <summary>工作收尾 从这周一开始就休假了，今天周三，已经是第三天了。不工作之后，感觉每天时间挺充足的，能做很多事情。 周一一大早，先把最近两年的工作内容整理了一下，写了一个总结，以后找工作整理简历的时候可能需要用。单看总结的话，感觉自己真是做过不少业务，但细看里面的内容，实在是缺少一些系统性的规划，更多是走到哪儿算哪儿，本质来说还是缺少对一个业务的深入理解，就缺少了把控感。 跳出公司的范围看，在大厂工作确实比较像个螺丝钉，大厂的五年我已经做了很多项目，做过很多不同的业务，了解上下游和对应的技术栈，但终归都只到了解这个层面，实操起来肯定是无从着手。 好的点在于我已经见过很多不同业务的技术栈了，像在线服务、流式系统、离线等技术框架，业务的报警、处理、值班等模块，如果现在需要我做一个产品，或者负责一个业务，至少心里有个框架直到要怎么做，这就是这五年的收获吧。 生活 不工作之后有大把的时间做各种事，比如骑车、跑步，跟朋友约饭，当然也是离职的同事，哈哈哈。也有更多时间去买菜做饭了，今天还做了午饭给对象送过去。 不工作之后的生活，仿佛回到了更原始的阶段，远离了餐厅、外卖、班车，回归到买菜、做饭、健身上面，仿佛是在提前适应去加拿大之后的生活 英语 最近两个月最重要的事情就是学英语了，六月底英语是一定要考到6.5的，否则估计就要延迟入学了。 学语言不像学习其他知识，它不是固定的内容，既要保证学习的灵活程度，又要真能提高语言能力（考试分数） 今天开始看英文书，这本书之前看过纸质版的了，书名 《show your work》，前几章在讲无论每天做了什么，都要尽量挑一些内容做一下总结和分享，每天分享自己的成果，当以后求职时，这就是最好的能力的证明，也就是看到这里，我开始打开电脑写下这篇播客，哈哈哈哈。 插个题外话，写到这里的时候想起来一个事儿，最近有一个 reddit 上的网友私聊我，问我要不要租OTU附近的房子，他应该是根据我发的帖子看到的我，说他们有个house，3个bedroom，目前只有他和他的老婆在住，问我要不要租其中的一个房间，还提醒我说一楼就有洗衣房，虽然我不懂这个提醒有什么用，但能说明是个很nice的人。我从他的发帖记录上看，也是个老网民了，人挺nice的。无厘头的，我能从他身上感到他对我的好意（因为那个房子挺好的，他完全可以去其他平台上找租户，没必要自己费劲找），我感觉他大概率是浏览了我历史的发帖记录，看我也是个很nice的人 （回去check了一下，原来是有回复我在学校论坛发的帖子），所以才这么私聊我的。 这个房源800CAD，骑车到学校15分钟，如果他不是个骗子的话，我是可以租的。人还没到就遇到这么nice的人，再加上我一个在多伦多读书的同事和他介绍的同事都是很nice的人，让我感觉那边全都是很nice的人，期待！</summary> </entry> <entry><title>learning english in April</title><link href="https://wa008.github.io/posts/learn-english/" rel="alternate" type="text/html" title="learning english in April" /><published>2024-04-24T00:00:00+08:00</published> <updated>2024-04-24T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/learn-english/</id> <content src="https://wa008.github.io/posts/learn-english/" /> <author> <name>Benson</name> </author> <summary>I start writing something again on my blog platform. 4.24 The topic today is about city, city is a common topic in ielts(International English Language Test System), for many other topic, it’s still relvative to city. First is about transportation system, transportation system is one of the most important part for a city, it decides how convient and fast people can move from one place to another place. For people who is employee in the company, the convenient transportation can make them having more chooses when they are seeking a job or considersing change a job. for beijng which is almost the most biggest city in china, people who living in bejing can work in any company as long as it’s located in bejing, the apartment of one of my pre-colleague is away 33km from our company, it only take one and half hour on the road becuase beijing has the most convenient subway system in the world. Second is price, In rencent years, it’s getting increaseingly expensive to do or buy anything, include the necessity, people must pay more to buy something than in the past. so, people must earn more mongy to deal with the expenses. This situation is more serious in the big city relative to small city and town. Third, it’s about job oppotunity, there are more and better jobs in big city, that is why more people will leave their hometown and go to big city. The population in big city is going up in rencent yeats. It’s not convenient to take care of their parents for the people who settle in another city rather than their hometown, especially when their parents becoming older. It’s a serious problem that the government should pay attention to. 4.25 Part is today’s topic, park is a great place to walk and enjoy nature view for people lived in the city. The summer park is the most famous park in beijing city in my heart. It’s built about sixty years ago. in history, emperor usually spend summer season in summer park becuase summer park is a special palce which can provide cold environment in summer, That’s why it is called summer park. There is a big lake called kunming lake in the center of park, which occupied senventy-five percentage of the whole erea of summer park, This is one of the main reason summper park is relatively cold in summer. There is a little mountain in the north of the park, many temples are built on the mountain, people visited summer park usually ask for good luck in these temples. summer park is also full with trees and grassland in the other place, that make the air cold in summer. There are lots of people visited summer park every day, in summer, they can enjoy the cool environment in park, in winter, they also can enjoy the beautiful lake view standing on the mountain. The great park not only attract local people to visit, but also foreigners, you can often see foreigner when you are walking in summer park. Chaoyang park is the biggest park in the east of beijing, The day before yesterday, my colleagues ask me to go to the biggest book market in beijing which is hold in chaoyang park, it lasts for eleven days. There are lots of selling book stall, I never ever see so large palce which is just selling books. beijing book market also have very long history and the scala of beijing book market twenty years ago is ten tieme than it is right now according the information from one of my colleague who lived in beijing many many years. Information cocoon room is a popular word rencent years, it mean people always stay in a small and stable information, they can’t touch other information. Book market is a great place to break the information cocoon, There are all kind of different books in book market, There is a possibility for everyone to touch the book which is inaccessible in their daily life. But with the development of computer, like personal computer and smartphone, people are spending more and more attention on social media like tiktok, They don’t have much time to hang out on book market and read books. In my previous thought, I should wirte nature view about the park topic. But I write many my thought about the society and life, writing is so great way to help people to deeply think, and it’s not hard to do that. I should insist on that. I can talk more nature view next time. Now is half past ten, it’s time to make lunch. 4.27 Writing is good habit. It will be great if I can write something everyday about today before go to sleep. As I readed from twitter, There is no smart people in the world, just the prople who have some good habit. Yesterday, I receive the bone conduction headphones I buy from xianyu platform which is a platform for buying and selling old thing that owner don’t need. It not only support song which is storage in itself, but also can connect Phone by bluetooth as a general headphones. I can listen the sound from environment at the same time when I’m listening the sound from headphones. It’s a great tool for me when I do some sport like running, swimming, riding. It not only make my enjoy the music, when some bad thing happend and make some sound, I can listen that sound and responce to make me safer. Afternoon, I go to company to sovle the last question from my colleague who take my previous work. As same as the old situation, there are so much little thing they must solve, I have the old and similar feelings, It seems that I back to work again. In the evening, I have dinner with some fiends who were my colleagues two years ago, everyone have their different path to future. Talking is always making people happy. One of my colleague give me some advice about my path to canada, there are so much uncertainty about my future, I have concern too, Anyway, I think I should have a try. The only require from my university about my ielts is overall score, they don’t have special require for more specific test score, like speaing, listening, reading, writing. So I start take the ielts test question which is the really question in ielts in the past again. In the evening, I go to run as the day before yesterday, the running people less than last, maybe because today is Saturday. 4.28 ielts writing test It is important for children to understand the difference between right and wrong at the early age. Punishment is necessary to help them learn this distinction. I total agree with that it is necessary to punish children to make them distingush the right thing and wrong thing when they are young. Firstly, the teacher and parents should give some small punishment to children to make them understand that they do wrong thing. For exmaple, if they waste food when eating or make the desk, floor dirty on purpose, techer and parents can stop them and tell them that is wrong. food is precious resource in the world, it is wrong to waste them. dirty floor will make other person easily get sick and give more work to cleaner. Teacher and parents can let children read relative books and tell right thing to them, ever more, they can give some small tasks relative to food and cleaning, that can help children understand the value of food and cleaning. Secondly, the prupose of punishment should be make children understand the right thing better. At the same time, punishment should be achieveable for children. Teacher and parents can do the punishment to children if it can meet the two condition. Finally, if techers and parents don’t give punishment to children, it is hard to make children understand and remember what they are doing is wrong when they do wrong thing. The effective and appropriate punishment is a suitable way to make children understand wrong thing and help them avoid that when they meet the similar thing again. In summary, appropriate punishment is absolute/definately necessary to help children distinguish the right thing and wrong thing, techer and parents can use them to educate children and make them better. The toppic todya is hard, I don’t think I can get a high score if it is the real test. The answer have the different opinion with me, so it doesn’t have much value for my answer. today Today, I spend most of my time on reddit and discord, I want improve my english commucation skill by chatting with english speaker. After trying about four hours, I find I don’t have much content or question to chat or share, at the same time, it is not very efficient to learn english compared to reading english artical and wrting egnlish blog or ielts test. For chatting with english speaker, the more important point is find what topic do I like most. After I have a discuss in a topic that I’m skilled and interested in, that is possible that discuss can last longer and be deeper. coding is obvious a good thing to do. codeforces, advant of code, llm.c are good options for me. I should pick one to start tomorrow. 2.29 I start solve problem on advant of code, 2023 25 is the last question on this website and I try it first, I have never thought it will be so hard for me. This is a problem about gragh, I spend the entir afternoon and can’t find a way to solve that. This is a similar feeling, reming me the time I prepare the icpc acm contest in 2018. Of course, I don’t learn any english about ielts today, bad thing! 2.30 The advent of code problem I picked is hard for me, that nedd a algorithm named Karger algorithm, I try to learn and write code to describe this algorithm, in one of test, I test code with vim, I delete the code that I speed two hours to wirte and it can’t recover, I hate vim much at that moment. After that, I still don’t find a good way to recover code after close vim. But what i learned is that i should return to console from vim by click ctrl+z, and click f+g to return vim edit, what I update can be recover base on this behavior, this is not a perfect solution but it can solve problem at some times. The real solution is be careful when I update code.</summary> </entry> <entry><title>离职前的状态</title><link href="https://wa008.github.io/posts/%E7%A6%BB%E8%81%8C%E5%89%8D%E7%9A%84%E7%8A%B6%E6%80%81/" rel="alternate" type="text/html" title="离职前的状态" /><published>2024-04-06T00:00:00+08:00</published> <updated>2024-04-06T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%A6%BB%E8%81%8C%E5%89%8D%E7%9A%84%E7%8A%B6%E6%80%81/</id> <content src="https://wa008.github.io/posts/%E7%A6%BB%E8%81%8C%E5%89%8D%E7%9A%84%E7%8A%B6%E6%80%81/" /> <author> <name>Benson</name> </author> <summary>工作 今天是2024.4.6日，本是清明节最后一天假期，但因我们小组负责了一个重要的运营活动，今天要在公司值班，就在公司写下了这篇博客。 计划明天就要提离职了，所以近期工作的心态更开放了，对待曾经不喜欢的老板和工作都更宽容了，能更多看到好的一面。现在回头看，压力才是造成这恶劣的工作状态的根本原因，过度的压力下，个人想法、工作目的都变形了。 成长/创业/工作的过程，要打造一个循环，从宽广的视角思考，不断拆解，去验证去实现；从而回收结果，继续这个循环。但在公司过度的压力下，很多东西都变形了，比如 回收结果、向上汇报等等，同时规划的时候也会很畏难，因为担心规划实现不了带来的差绩效；丧失了互联网企业原始的自由和创造力。 当然，丧失创造力的一个本质原因，是能力的缺乏，因为无休止的工作填满了日常的时间，没有充足的额外时间去学习、思考，那创造力就无从谈起，似乎又把这个问题怪罪于无休止的工作。 读书 因为有了更多时间，也开始看书，几乎一周的时间就看完了《UNIX传奇》，大牛们的人生经历总是那么朴实而又光彩夺目，即使他们并不具备普遍性。书中讲述了UNIX系统、C语言、shell、管道、awk这些常用的工具，如果不是这本书，我只会觉得这些工具都是一些很trick的小玩意，不会想到是专门有人开发的这些工具，不会想到他们也是有作者的。这是我第一次这么完整的了解Linux的历史。 术中还有一些有趣的故事，比如开发出UNIX的第一台机器，购买时并不是为了开发UNIX系统，而是为了开发文本编辑软件，让贝尔实验室的工作人员编写专利申请文档时，效率更高，因为他们几乎每天都会申请一个新专利。似乎很多伟大的作品被创造时，他的原意都不是为了创造这个作品，只是个当时的副产品。 读书带来的满足感，真是陌生又熟悉。 未来 没有离职的时候会畅想，如果自己离职了会学习XX、XX等等等等，近期就尝试了一下，学习新领域的知识总是个艰难的过程，需要从0学起，脚踏实地，所获得的满足感自然就没那么强烈和直接，但要尝试去享受这类事情。 依然很庆幸自己有这个机会gap几个月，有这个机会重新开始一段人生，正常情况下，以后应该不会再有这样的机会了。</summary> </entry> <entry><title>2024-01-01</title><link href="https://wa008.github.io/posts/first-day-new-year/" rel="alternate" type="text/html" title="2024-01-01" /><published>2024-01-01T00:00:00+08:00</published> <updated>2024-01-01T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/first-day-new-year/</id> <content src="https://wa008.github.io/posts/first-day-new-year/" /> <author> <name>Benson</name> </author> <summary>回顾 回看2022年给自己定的目标 1）学好英语：其实现在已经打开了新世界的大门，那2023希望能在英文的世界里无障碍畅游。 结论：时不时在读经济学人，也在玩reddit，但流利地使用英文还差的很远。下半年有开始准备雅思，这时候才是真正投入精力学习，半吊子学习压力太大了，还是得定个目标。12月份雅思考了5.5，明年怎么说也得考到6.5吧。 2）处理好感情：对象要毕业了，毕业之后面临的问题很多，希望能处理好。 感觉处理的蛮好的，未来的目标也大概达成统一了 3）保持健康：游泳和骑行坚持下来，再考虑下羽毛球 6月份换了房子之后，跟骑友们距离就远了，今年几乎没怎么骑车，游泳因为各种原因就更荒废了，好可惜。如果不是留学这个事儿，应该能坚持一个体育爱好的。 4）做精一件小事：比如kaggle的一个比赛 今年似乎没学啥东西，精在这儿胡思乱想了，想明白了留学这件事，明年一定要干好。 5）专业学习：AGI，强化学习，风控底层技术 无 6）读书：多读书，少刷视频 无，很难 7）影视：Netflix会员已入，come on 无 8）晚上早睡：唉 6月搬家之后，迫于通勤时长，必须早睡了 9）其他 播客：2022年写了34篇博客，2023年只写了11篇，很差劲 做了自己的第一个产品：top Hacker News)。但发现自己看的频率也不高，那就降低一下内容数量吧，或许能提高看的频率。 总结 感觉2022年的目标太多了，大部分都没办成，明年应该少定一些目标。 能完成的目标基本是外力催动，说明执行力还是比较差劲。 感觉是想清楚了留学这件事，明年一定要办成。 回忆一下，今年有什么记忆点呢？跟对象搬家，考雅思留学，就这两个了，记忆点太少了，虚度的一年。 2024 新的一年 雅思6.5，留学 健身 学习，学点新技术，虽然现在还没想好 读书、看电影，补充点文化 当每年的总结都成了流水账，不知道是否还有必要记录，2024年的目标，跟2023也没有差太多，感觉就像工作的OKR，每次都是那些。所以明年还是尽量要执行号，2025才能定一些新目标。</summary> </entry> <entry><title>duckdb 看懂的第一个PR</title><link href="https://wa008.github.io/posts/duckdb-%E7%9C%8B%E6%87%82%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AAPR-copy/" rel="alternate" type="text/html" title="duckdb 看懂的第一个PR" /><published>2023-10-22T00:00:00+08:00</published> <updated>2023-10-22T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/duckdb-%E7%9C%8B%E6%87%82%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AAPR-copy/</id> <content src="https://wa008.github.io/posts/duckdb-%E7%9C%8B%E6%87%82%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AAPR-copy/" /> <author> <name>Benson</name> </author> <summary>背景 duckdb 是关注到的第一个我自己平常能用到，也不是那么（四声）庞大的开源项目，刚好最近想尝试新的技术，所以就深入了解了一下。 duckdb对我的用法，就是能以本地文件为数据源，用sql语言进行查询、分析数据；平常类似的需求我都用python来解决，但远没有sql来的高效，所以duckdb还是很好地提升了我的工作效率。 第一次看duckdb issue 的时候就看到了这个，比较简单的一个bug，有人最小化复现了这个问题，就是使用 map 时，where 的限制条件无法对 map 字段生效，比如： create table data as from ( values ([1], [3]), ([2], [9]), ([3], [15]), ([4], [21]), ) as t(l, r); -- this works select l[1], r[1], map(l, r) from data; -- map output ignores where filter. select l[1], r[1], map(l, r) from data where r[1] != 15; Output: ┌───────┬───────┬───────────────────────┐ │ l[1] │ r[1] │ map(l, r) │ │ int32 │ int32 │ map(integer, integer) │ ├───────┼───────┼───────────────────────┤ │ 1 │ 3 │ {1=3} │ │ 2 │ 9 │ {2=9} │ │ 3 │ 15 │ {3=15} │ │ 4 │ 21 │ {4=21} │ └───────┴───────┴───────────────────────┘ ┌───────┬───────┬───────────────────────┐ │ l[1] │ r[1] │ map(l, r) │ │ int32 │ int32 │ map(integer, integer) │ ├───────┼───────┼───────────────────────┤ │ 1 │ 3 │ {1=3} │ │ 2 │ 9 │ {2=9} │ │ 4 │ 21 │ {3=15} │ └───────┴───────┴───────────────────────┘ 当时我只是挑了几个好上手 &amp;amp;amp; 有趣的issue，就放下这事儿了，打算一周后有时间了再来看看怎么修复，但一周后再来看的时候，这个issue已经被人修复了，过来然开源社区的活跃度还是太强了。 想解决其他的issue，但看了半天都没有头绪。。。。于是就想看看当时这个map的issue是怎么解决的，看了半天也还是看不懂，就花了大概两个周末的时间研究了一下（一共可能花了1天），截止现在，终于看懂了核心内容。 历程 中间主要在 debug，想看看每个变量内具体的内容是什么，帮助理解代码，然后也就知道bug在哪儿，自然就知道怎么修复了。 duckdb 比较好的点是，没有依赖什么外部模块，花了点时间修了一个环境问题，我一次性就编译成功了。 进入主目录之后，执行 make debug 进行编译，./build/debug/duckdb 就是新编译好的文件，执行这个文件就进入了新编译的 duckdb中。 代码里可以用 printf 打印想要的debug日志，debug过程还比较顺利，能把 debug 信息打印出来，我就有信心能看懂这个代码了。 debug过程中，主要是在找哪个变量里存储的是核心的数据，过程中主要很多变量不知道要怎么打印，代码自定义了很多基础的类，需要翻代码，特别是 Vector 变量，还是个指针 Vector：自定义的向量类型，可以通过 *(vector.GetData() + i)打印第 i 个元素的值；通过 vector.GetType().ToString().c_str() 打印type Vector 还指定了不同的数据类型，我暂时还不知道要怎么按照特定类型打印，默认是 unsigned int8 类型，指针每次 +1 只移动 8 个字节。 PR 先说结论，其实核心就是最后的四行代码 if (key_vector.GetVectorType() == VectorType::CONSTANT_VECTOR) { // 省略 map_key_vector.Reference(expanded_const); value_vector.Flatten(count); map_value_vector.Reference(ListVector::GetEntry(value_vector)); } else if (value_vector.GetVectorType() == VectorType::CONSTANT_VECTOR) { // 省略 map_value_vector.Reference(expanded_const); key_vector.Flatten(count); map_key_vector.Reference(ListVector::GetEntry(key_vector)); } else { // 核心变更 key_vector.Flatten(count); // 对 key_vector 根据filter信息进行截断 value_vector.Flatten(count); // 对 key_vector 根据filter信息进行截断 map_value_vector.Reference(ListVector::GetEntry(value_vector)); // 把中间结果 value_vector 复制给最终结果 map_value_vector map_key_vector.Reference(ListVector::GetEntry(key_vector)); // 把中间结果 key_vector 复制给最终结果 map_key_vector } 第一次接触类似项目的人（两周前的我），很难看懂这四行代码对应的含义，我也是花了很久的时间定位到这里的。 结论 第一次完整看懂了一个 cpp 项目的PR，了解了完整的流程，比如 编译、debug、测试。 但除了核心数据，大部分的代码工作量都在补全其他类型的变量，这些需要对项目非常熟悉，才能补充的比较完整，需要对项目非常熟悉才行。</summary> </entry> <entry><title>learning english in October</title><link href="https://wa008.github.io/posts/english-05/" rel="alternate" type="text/html" title="learning english in October" /><published>2023-10-07T00:00:00+08:00</published> <updated>2023-10-07T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/english-05/</id> <content src="https://wa008.github.io/posts/english-05/" /> <author> <name>Benson</name> </author> <summary>10.7 The holiday is so so great, I almost fogot all thing except family, friends. in the first three days, I meet my family, relative and friends, the feeling that meet old friends is great. in the two days after that, I meet my gril friend’s family, talk thing about marriage, everyone is happy. in the last two days of holiday, we return back to beijing, clean up the apartment, cook and eat lunch. today, new life is beginning, I have to work back. Hope everything is fine. 10.29 I know I havn’t accept english as my day-to-day langague, because when I’m free, I like reading or watching media using chinese languge more than english, reading english text is a little hard for me, If I can’t push myself read it, I won’t do it. The good thing is that I already insist on memorizing english word for twenty-three days, It’s a big progress. duckdb have a few issue recently, it’s a complex project for beginner, so, I want discover some other project to develop, I try kaggle competition, there are two competitons that are interesting for me, but I don’t have time to explore them. I find another interesting project, I can convert podcast to text using speech-to-text tools, in some time, we don’t have the suitable environment to listen voice, in the most time, we can read text, and reading is more efficient for some person. If we want the information of podcast, reading text is a great path to get that. I try some open source tools, I can do this work using github actions and whisper.cpp open source tool for free, I don’t need pay for it. It’s great, I will do this work as my highest quality project. In summary, I have tried serveral project, Maybe I should list them in a specific page, show their status and priority. I write english notes fewer and fewer, do more and keep going!</summary> </entry> <entry><title>learning english in September</title><link href="https://wa008.github.io/posts/english-04/" rel="alternate" type="text/html" title="learning english in September" /><published>2023-09-05T00:00:00+08:00</published> <updated>2023-09-05T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/english-04/</id> <content src="https://wa008.github.io/posts/english-04/" /> <author> <name>Benson</name> </author> <summary>9.5 Yesterday, I take a deep talk with my friendly boss, she will take care more of my colleague, so, I can spend more time on myself thing. It’s great for me. I watch a video about travling, their english are great, I think I can’t travling like them now. I also want I can speak english like them, that is more free. There will be more thing I can do, more place I can go, more work I can do, more person I can be friend with. Think back, I don’t have much friend now, Maybe because I don’t like have make friends? I don’t know. Maybe I have much thing to learn. Maybe I don’t have much time because of this work. So, If I can only work for eight hours, everything will be better. english is the most important part of change work. I must have a plan for learning english, I have three to five month to learn it. after five month, I should try find the new work. the time is enough for me in theory. I should spend more time in that. 9.9 Yesterday, one of my colleague have married recently, She invite some of colleague to have launch, we talk much about life, work, marriage for long time, till to one clock in the morning, talking will make people happy, this let me remember some words I have read long time ago, relationship with families and friends is the keypoint to decide how happy you will be. I also don’t know what I like most like, what I most want do, I speed so much time to seek, But the result is disappointing. what make me happy is english, I still can spend more time in the english. The only achievement of seeking is data analysis of hacknews, data analysis is the advanage of my ability, what I need to do is think more about this project, I need seek some point that worth analysising. 9.16 I student have a idea about learning english, just learning is dull for most people, if we can set some interesting goal to achieve with learning English, it’s much easy to learn. specifically, we can list some picture to make learner to describe it, publish some task to let learner solve that, they can imporove english skill when solving these problem. I find some public image api from gihub and get three product. https://pixabay.com/api/docs/ https://unsplash.com/developers https://wallhaven.cc/help/api But, Even I have some picture, It’s still hard to complete this work. I must buy a server and request the api to get image, then, push the picture to telegram channel or discord, after that, I can describe that at any time. before do that, I think I should try some picture and test if it really work for leaning english or if I can insist on it. I should try some image first. ten minutes later… I try two picture, I talk much word about these picutre, But it’s also dull. This idea will be more great if the picture is interesting. Designing task also have this ploblem, the key point of this idea is design a interesting task to guide learner to talk and continue to take part in ths task. Maybe Game is a Good channel to do this, Is there a game with the purpose of leanring english? Most game with learning english is simple. the game with AI for english learner is great. a few month ago, I get some information from friends, the npc in the game will added AI power, npc with LLM talking ability will talk to gamer, this not just fun for playing, It also improving english skill. 9.17 Today is also hard day, I don’t know hwat I should do, something is doll for me, some other thing is too hard to do for me. It’s hard to make me statisfied. Talk old word again, learning english is the first task, keep reading newest news, keep looking, I will find what I like. 9.29 There is a news recently, someone live in china work for international boss, he use the internetnation network when he is working, it’s illegal in china, the money he earned will be taken back. Bad news. Today is the first day of holiday, I will have a eight-days holiday, this worth celebrating. I just readed a twitter, after eight days, you will find that holiday have pass quickly, you will take back time, do something that haven’t do, that is truelly and absurd. hope i can do something that deserve this holiday. Finally, I find a suitable open source project for me. This is duckdb that we can query data using sql from different data format, such as csv, parquet, json, It’s very useful in my daily work. This project is already much naturely, It don’t have much bug to fix, I read the issue of the first page about 25 issues, It’s too hard to understand for me about much of these, I reply two issues, hope that’s helpful. There also three issues that I can understand, maybe These all are hard to fix for me, But at least, I can try it. First, map bug, the result is not correct, is a bug, someone also pull a pull request but it isn’t merged, I can continue to research it. Partatioin issue, This is not very urgent, this don’t need too much code to write, but this problem is related to core feature, repairing it requires caution. performance optimazaiton, this is core problem in duckdb because it’s related to performance, I can’t repaire it with my current abilities. The best thing for me is I finally find a good open source project that is not only usefule for me but also that is in the field that I’m familiar, even I can’t repaire these issue for a while in the future. Good night!</summary> </entry> <entry><title>learning english in August</title><link href="https://wa008.github.io/posts/english-03/" rel="alternate" type="text/html" title="learning english in August" /><published>2023-08-16T00:00:00+08:00</published> <updated>2023-08-16T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/english-03/</id> <content src="https://wa008.github.io/posts/english-03/" /> <author> <name>Benson</name> </author> <summary>8.16 Recently, I start learning english again, I find a learning english YouTube channel from a tg group, yestarday, I read the same video of this channel in my road from home to work for about forty-minutes, This is the first time I do one thing in my road for so long time, I think this video is very great. Maybe it’s the result of so many people want learn enlish. This video taught me a lot. First, I should write junery every day in english to describe my thought, I’m much agree with this thougt in the past time, I think if you want learn speaking, you must lean writing first. wriing can give you enough time to organize your ideas and express that, but speaking can’t give you much time. reading and listening is a slow process, you must do that for a long time, after you have the ability of writing, reading, listening, you can speaking well naturally. you don’t need write much, just insist on do that every day, at least five minutes, habit is very important. Second, you should talk something in english with a camera toward to you, you should watch your video after you finish talking, you can get your disadvantage of you speaking, then correct it by youself. Maybe it’s awkward but I think it’s a good method to import the ability of speaking, even i haven’t try it. There are mant thing you can talk, yourself, your friends, thing in your room, thing happend yesterday, thing you want do today. Third, I don’t remember…but, there are 7 points in this video, I will watch that again today. I will do the first one thing every day in my plan, But I only have time in the morning, so, the much thing I writed happend yesterday. English is common skill in the world, the hardest part of leaning english is insisting on leaning. 8.19 In the past few days, I’m very busy at work, There are three group cheater in my work, I’m busy to stop them from obtaining illegal benifits from my company. In a sense, they are not only enemy but also friends in the anti-fraud field. we must fight each other to improve our ability. I come home from company at eleven o’clock very night in recent three days and fall in sleep at one clock, I also must get up eight o’clock in the morning because my girl friend must get up at that time to work. I’m tired in recent days, I want take a day off but I’m too busy to do that. I have some free time to do my thing until today, so I writing something again in english. when I writing some specific thing about myself, it’s hard to write, because I have litter word and phrase to use, learning language is a slow thing, everyone can’t learnt a new language in short time, again, insisting is ths most important thing in the road of learning language. Also, the useful method of learning english is imitating, I can imitating other word or phrase or sentence, when I can use them skillful, I get it. so, reading is the base of writing. I often read The Economists in the subway from home to company, I’m thinking if I can intensive read The Economists and share and translate the chinese version, share and writing point, I will get some positive feedback from that to get more power to reading The Economists. The most people are clever, But a few people can insist on something. The key point is getting positive feedback in the early stage of things. The positive feedback can help you insisting on doing something. Reading and sharing english magazine is a great idea, it worth considering. 8.20 Yesterday, me and my girl friend ride bike outside, I want ride to tiananmen for exerise and enhance our body, there twelve kilometers in the road, it’s too long for riding for her. we just ride seven kilometers and come back. But it’s also a good start of exerise. we both have a lots of sweat. Today, my work still have much problem, we don’t fight the cheater sucess, so, we gather my work mate together to solve the problem. It still solving. 8.25 I’m so busy recently, My leader ask for leave because of some issue of her family, so many things have come into my hands, It’s so tired for me. So I don’t have time to write something in english. Yesterday, My girlfriend let doctor take over her two wisdom teeth, She is in much pain and call me to home. so I leave work and go home early, and ask for leave for today. After go home, her have eat end pain drug and the drug already affect on her teeth. she is already fine. Yesterday, I went home at senven o’clock, the sky hadn’t gone dark, weather is so comfortable for me. I think I will be so happy if I can go home at seven clock very day, I can’t image what wonderful that life will be. English is the most basic and important ability to open the new world, just keep learn it 8.28 Yesterday, I had a dream, my work have a another issue or case in my dream, It’s bad for me, I can’t sleep well, even I’m thinking how to solve that in my dream, I’m tired in my dream, I don’t like that. when I know today it Monday, I don’t want wake up. I have so much pressure recently, I don’t know how to handle the relationship with my colleagues, It’s hard for me. I don’t want be a middle person between my boss and my colleagues, in some time, my work is get some commend from my boss and split that to my colleagues, after my colleagues finish that by his thought and give that message to me, I also give that message to my boss. If my boss have other idea, we must do that again. I don’t like the work style. My manage is a person who like push you, push work harder, I don’t like that style. Maybe everyone have himself work style, I’m sad that I don’t have a mature style, I don’t know what I like. I can understand and accept the most work style, in the same time, I don’t have the special work style. I must go to work now, I hope I can insist on learn english, and find my suitable work style. 8.29 My boss back to work yesterday, I feel better, speaking have strong ability, after talked with my colleague, I feel much better that last week. I haven’t aware of the energy. I should talk more with my friend and colleague to improve my ability. This make me think a sentence back, the happiness depend on the relationship amoung people around you, according to survey. How to talk is a big topic, the key point is how to tell story to others, big story or small story. Is there some story about me? First story, Youtube is great place to learn english, I watch few video about learn english yesterday than before, youtube recommend much more high quality video to me, Youtube have much high quality video that made by so much people. everyone can also get it for free. Much good thing don’t need pay, we can try to use it as much as possible. Second story, I think listening have the more priority than learn vocabulary, the key point of learn english is speeding enough time on that, if you can spend all time in learning vocabulary, it’s hard to insist on. So, I think the good path is listen enligh more and more, after you can insist on it, You can spend time to other thing, listening is easy to insist on. 8.30 Yestarday, I have coflict with my manage, I don’t like his suggestion, I think we should focus on things has deeper technoloy, But manage always want make work more perfect. I think if you want stay well in a big company, you must do some thing you don’t like, you should accept it, therwise, you will feel uncomfortable for that. 8.31 I have the new feel everyday. My colleague are looking for a job have the normal work time in state owned enterprise. I’m looking for a job in a foreign company. we also want a job having the normal working time, we can off work about at six clock.</summary> </entry> <entry><title>top hack news 收集</title><link href="https://wa008.github.io/posts/top-hack-news%E9%A1%B9%E7%9B%AE/" rel="alternate" type="text/html" title="top hack news 收集" /><published>2023-08-06T00:00:00+08:00</published> <updated>2023-08-06T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/top-hack-news%E9%A1%B9%E7%9B%AE/</id> <content src="https://wa008.github.io/posts/top-hack-news%E9%A1%B9%E7%9B%AE/" /> <author> <name>Benson</name> </author> <summary>背景 Hack News 的新闻质量一直是毋庸置疑的，但榜单更新太快，主页也过于简单，为此很多人做了相关的扩展。 比如 Hack News 根据 score 进行 rss 订阅、hackNews 客户端分类型的top榜单。 结合从个人开发者论坛学到的”个人项目要从维护成本考虑，比如能不用server就不用server”，想到利用 github pages 刚好可以做一个定时爬取，静态展示的页面。 实现 1. 读取 利用 github action 功能，例行调用 hacknews 的API，定时获取最新的top1新闻， 具体用 shell 实现，hack news 的 API 是真的简洁。但简单的 API 已经足够用了。 编码实现：https://github.com/wa008/wa008.github.io/blob/main/topHackNews/runHackNews.sh 2. 存储 读取后存储到github 仓库中。 github action 确实做的丝滑，action中每次push代码默认不需要输入token，直接push就行，体验很棒。 代码实现：https://github.com/wa008/wa008.github.io/blob/main/.github/workflows/getHackNews.yml 3. 展示 利用 github pages 进行内容展示，就生成了历史所有的 hacknews 最热的内容榜单。 这其中主要是要跟原来的博客分开，需要做一个分类功能，其实就是把根目录的 _posts 文件夹转移到特定的分类下，比如 topHackNews 中。 整完了发现rss订阅也会订阅 hacknews的内容，这肯定不行，rss订阅的频率也太高了。原来rss订阅用的kekyll-feed 插件，但它的分类功能一直无法生效，直接无解。。 最终重新自定义了 rss 订阅文件，解决了这个问题，hacknews更新的订阅，以后需要了再搞吧 工具总结 Hack News: 提供内容来源，能提供简洁的API github action: 定时运行任务，不需要自己提供server github pages: 展示内容 API archive: 还发现了一个非常帮的免费API库，以后有需求了都可以找找 结论 成果：https://informal.top/topHackNews 第一次做项目还挺有意思的，现在的各种工具都太齐全了，甚至不需要自己搭server，都能部署自动更新的网站。 现在缺少的只是好的创意。 不需要部署server，这项目应该能存活挺长时间的吧</summary> </entry> <entry><title>大模型调研</title><link href="https://wa008.github.io/posts/LLM/" rel="alternate" type="text/html" title="大模型调研" /><published>2023-06-21T00:00:00+08:00</published> <updated>2023-06-21T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/LLM/</id> <content src="https://wa008.github.io/posts/LLM/" /> <author> <name>Benson</name> </author> <summary>背景 ChatGPT 2022.11 月问世之后引起的轰动一直在上升，但类似的做法和能力，在bert 2018年出现的时候基本就有了，一般认为 ChatGPT 的出现，是大模型大到一定程度后，能容纳的知识更加丰富，能力产生了质变，能应用几乎所有的对话类任务。 ChatGPT的训练成本过高，传言预训练一次需要200w美金，这应该也是openai 能在这个领域一骑绝尘的原因，并不是每个公司都有眼光和胆魄愿意花费这么大成本训练一个模型。 调研 如此大的模型和高昂的训练成本，使个人很难低成本参与进去，圈内玩家基本是各个巨头公司。但偶发发现最近开了一大批大模型相关的项目，就调研看了看。 开源/公开 Auto-GPT: 用户输入目标，Auto-GPT 利用 ChatGPT 生成一个机器人，利用各种prompt让GPT理解用户输入的目标，制作能实现目标的计划，一步步实施。本质还是用 prompt 扩展 ChatGPT 的使用边界。 Open-Assistant: 开源大模型，通过用户收集高质量数据，来微调模型 AgentGPT: Auto-GPT 的界面版本，让普通用户能更直接使用 llama: mate 公开 llama 65B 预训练模型，可用于研究，不可用于商业使用；给大模型的开源届提供了基石 stanford_alpaca: 斯坦福基于mate公开的大模型微调出的语言模型，命名为羊驼 lm-sys FastChat: lm-sys 参考羊驼训练的语言模型，效果逼近ChatGPT，最小的7B版本可以在单卡 28G显存的卡上微调 Lm-sys score borad: lm-sys 大语言模型榜单，模型对比竞技场 非公开 ChatGPT: ChatGPT 发布 ChatGPT plugins: 插件，丰富AI生态 GPT4: GPT4 发布，吊打各大榜单 Claude: openAI 原班人马创业训练的大模型，是目前最逼近GPT4效果的模型 不足 6个月暂定大模型研究: 大模型发展太快，相应的风险措施跟不上，开始呼吁暂停大模型的研究 无法避免大模型胡说八道：模型的预训练方式应该还是基于自回归，模型架构是 transformer，更多利用的还是基于语言的统计信息，逻辑推理能力较弱；简言之，大模型知识储备虽然吊打1000个人，但它输出的准确性并不是100% 现在的大模型架构无法支持走向AGI：现在大模型的归因和规划能力（逻辑能力）还不够，不足以走向AGI（强人工智能） 如果让大模型可控、安全 结论 大模型现在未解决的主要问题就是 逻辑能力，如果大模型已有的架构能解决此问题，那就直接实现了AGI。否则 AGI 需要另外一种新的架构，我个人稍微倾向于后者。 基于多个原因，我暂时还是看看我的自动驾驶项目吧 大模型需要的GPU门槛稍高，反正我现在没有；借用公司的也不太好 对大模型并没有什么idea要尝试；代码层面的改动也比较少 大模型缺乏逻辑能力，很难走向AGI 强化学习才是走向AGI的必经之路！</summary> </entry> <entry><title>自动驾驶的小玩具</title><link href="https://wa008.github.io/posts/auto-driver/" rel="alternate" type="text/html" title="自动驾驶的小玩具" /><published>2023-04-25T00:00:00+08:00</published> <updated>2023-04-25T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/auto-driver/</id> <content src="https://wa008.github.io/posts/auto-driver/" /> <author> <name>Benson</name> </author> <summary>从多个方面来讲，我一直觉得强化学习是解决自动驾驶问题的一个非常好的思路，于是就动手做了一个小demo，总耗时一个月左右，现在遇到了瓶颈，来记录一下 原由 强化学习在之前的博客中有介绍过，如果不引入神经网络，他是个可解释的模型，缺点是，不容易用可枚举的方式来表达当前的状态，但某些场景下，尽量用可枚举的方式表达当前的状态，强化学习就可行了。 以自动驾驶为例，当前的状态就是车所看到的所有信息，比如路灯、正前方、侧方的信息等信息，可以用基础的基础的计算视觉技术做识别，识别出车周围物体都有啥，比如路障、行人、自行车，把这些信息作为当前的状态，就能用强化学习建模了。 建模 以当前的状态为key，不断优化不同key下应该采取的最优的action（行为），所有的key-action 对，存在一个表里，就是强化学习中的 q_table；通过不断模拟action，获得反馈结果，来不断修正每个key对应的 action，也就是优化 q_table，只到 q_table 稳定 优点 可解释 可控 可模拟 其实可以类比AlphaGo，AlphaGo在和棋手做对抗，自动驾驶就是多个车和这个现实世界做对抗，通过不断模拟，优化这个系统 实现 原始的强化学习框架参考莫凡大佬的demo，可视化用 tkinter实现，已实现的功能： 强化学习框架 路线的可视化 提前模型，多辆车之间不能碰撞；主要是来避免无意义的action，长期来看，可以把碰撞作为一种惩罚 example: https://user-images.githubusercontent.com/29834520/232979083-2706dddb-43e2-41fd-ab37-ade04a40b127.mp4 github: https://github.com/wa008/reinforcement-learning todo tkinter 做可视化，需要保证基础的行列不超过25，就限制了只能有10条路左右，再大单机就跑不动了，所以需要效果更好的可视化工具，通过网友求助，已知的有 SumoPy，还有两个挺好的工具在网友的评论里，这会儿去看的时候已经被删了，emmm，晚上回家找找浏览器的搜索记录，看还在不 性能问题解决之后，就能继续了 使用更大的地图 加宽路线，改双向车道，设计路口转弯规则 加快车的速度 添加路人、自行车 添加车能看到的信息，比如周围一定距离的物体 最近想看看大语言模型开源的几个项目了，过段时间再回来搞这个</summary> </entry> <entry><title>旅游 扬州+苏州</title><link href="https://wa008.github.io/posts/travel20230405/" rel="alternate" type="text/html" title="旅游 扬州+苏州" /><published>2023-04-05T00:00:00+08:00</published> <updated>2023-04-05T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/travel20230405/</id> <content src="https://wa008.github.io/posts/travel20230405/" /> <author> <name>Benson</name> </author> <summary>day1 扬州（广陵路、大运河） 了解一个城市，找旅游攻略的时候，感觉播客要比网上的内容质量好很多，因为没那么多功利的内容，或许可以考虑把播客转成文字，发表出来，做各个城市的专栏 去酒店路上，遇上一个外地的司机，我就提了扬州生活节奏慢的话题，司机师傅觉得道理很明显，因为大部分本地人都有钱，自然生活节奏慢，生活的比较舒适。感觉……跟唐山的情况如出一辙，果然经济水平是决定生活方式的主要原因，至少对大多人来说是这样。 酒店去广陵路，遇到了司机师傅2，也是个外地人，来扬州不久，不太了解扬州本地的生活，但是人很好，给我推荐了几个好去处，比如湿地公园，虹桥坊，还有荷花池。最终荷花池用上了 广陵路非常棒，路不宽，只有普通的双向车道，两边有两排很老的树，也不好加宽，路上非常多的电动车，非常非常多，想过个马路都有点费劲，机动车走起来更费劲，所以也没什么机动车。路边的商贩各种各样，有新开的绚丽的甜品店，隔壁是老式鞋店，再隔壁，甚至在卖脚气灵 房子的排列跟店铺类似，有新有旧，各种不同的商贩和房子错综地排列在这条街上，极其繁华，并不觉得多违和，只感受到了这座城市强大的包容能力。跟北京禁止路边摊，防止影响市容市貌的行为，形成鲜明对比。意外的是，这条街非常干净，让他看起来并不想一个小县城。消费人群的活跃程度，让这条街，极具生活气息，特别有味道。棒极了👍 广陵路上还有很多小而深的胡同，跟北京的胡同有一拼，有些胡同里面，是明清时期大户人家的宅子，里面有假山，水池，竹林，占地不大，但五脏俱全，用官方的话来说，这这员外简直把中国古代的建筑艺术和园林艺术融合到了极致，宅子留存到现在，就变成了景区。可见古代的盐商是多么富有，这宅子的水平，或许跟雍和宫比不上，但这等级的宅子轮数量的话，怕是比北京多不少。 大运河边上有两个唱歌的小哥，也就20来岁吧，一弹一唱，唱的特别好，路人就坐在前面的台阶上听，惬意极了。 唱完歌，有个看起来有点社会的大哥去跟他们聊了会儿，加了微信，感觉是在谈啥项目。收拾完东西，小哥就跟他们的女朋友一起离开了，幸福极了。 坐古运河的游船，大概40分钟左右，吹着河风感觉像海风，夏天的海风舒服的地方在于，空气凉爽，且很清新，这一点在夏天的每个清晨都能获得，只需要早起就可以了 想了想我为什么喜欢水，因为它透明，无边界，水纳万物，但他并不刚硬，甚至还有无数生物依靠它生存，会游泳的人也能跟他和谐相处 下船后又看到了三个唱歌的大哥，刚开场，一个还在收拾，一个弹电吉他，一个边弹吉他边唱，但……他唱的实在不怎么样，感情太多，于是就离开了。 河边的夜景是真好看，小风吹着，特别适合晚上散步 回酒店遇到了司机师傅3， 他觉着扬州人主要是娇生惯养惯了，吃不了苦，干粗活总是干不过四川，贵州的，所以显得生活比较轻松。当然背后还有个本质原因，以前娇生惯养，现在家底应该也挺厚实的，没什么生活压力。 扬州炒饭和干丝，是真好吃啊，价格还便宜。但狮子头很一般。 住的酒店在四楼，它二楼是个KTV，晚上能听到一点点歌声，也不算特别吵，就这样在海阔天空的歌声中入睡了 day2 扬州（瘦西湖、大明寺、荷花池、三湾） 早起吃早餐，本地人大部分都在吃面，很多还是没有任何菜的干拌面，我一个爱吃面的人早上都受不了。看到一个大爷在静静的梭面，感觉贼香，场面特别幸福，如果我胆子再大一点，就给他拍张照了。 本来计划从东门进的，出租车路过北门，就直接从北门进了，门口几乎没什么人。后来发现，原来大部分人是从东门和西门进来的，去看24桥和白塔，果然人多的就是最出名的地方。实际上呢，南北向沿湖的水路也很棒，扬州水多，花开的就特别好，桃花，樱花，丁香，都开得很灿烂。我更喜欢的是水，随处可见的湖，不像颐和园的昆明湖，这里有很多小湖，链接在一起，水和陆地的分布，融合的很彻底，就很适合观景。南北这条道，人还不多，看起来就贼舒服。 扬州水多，听司机师傅说，之前有个市委书记，特别喜欢修建公园，水多，每个公园几乎都有湖，类似的景点就几乎覆盖了全市。比如瘦西湖往北两公里，就是住的酒店，那像是一片郊区，住在哪里就能把瘦西湖当后花园了。 这两只鸭子，过上了我梦想中的生活。 这个地方吹风，简直太爽了 想象来扬州生活的可能性，最主要的问题，应该是能在扬州找到一个获得满足感的事儿，工作。除了现在的工作，希望能找到一个更通用的获得满足感的赚钱途径。比如写博客，个人开发者。 瘦西湖边上的一个亭子，在这儿歇会儿去大明寺。从亭子上往下看 大明寺，似乎没有很特别的内容。早上体力比较好，到了下午，体力已经耗尽了，赏景的能力直线下降。 宋夹城，大型体育场聚集地。 路上竟然能看到崩爆米花的。 骑车了来了荷花池公园，不太出名，这里就没那么多外地人了。果然，又是好多小湖+一个大湖，也可能公园都是围绕着湖建的吧。最让我意外的是，里面有个扬州图书馆的荷花池分院，里面有四张供人看书的桌子，每一张能容纳四个人，其中四个人坐了三张桌子，一张桌子是空的，还有一个人在书架那边看书。藏书并不多，似乎只有两排书架，每排也就4米左右，但大家都在安静的看书，人也不多，环境好极了。 三湾风景区，河边开的灯比较少，晚上看不到河边的景。又看到了一个书城，人比牡丹园的还少，地儿更大，还有非常好的视野。城市里人少，真的挺方便的。 day3 扬州（个园） 苏州（平江路、山塘街） 今天降温，上午风很大。 早上吃到了扬州的拌面，能吃出来的有酱油和香油，还有一点点小葱，味道很淡，面是扁平的湿面，形状有点像挂面，但口感要比挂面更劲道，口感吃起来很像干丝，因为都是整齐的细丝，口感很棒，味道呢，调的特别合适。 上午去了个园，园林是古代商人的宅院，由竹林，假山，居住区三部分组成，园主人酷爱竹子，里面有三分之一的土地都种上了竹子，大概有两万株。第一次见从根部变异的竹子，名叫龟甲竹，挺好看的。中间的假山和后面的庭院，足以看出来园主人当年是多有钱，能把院子修饰的如此别致。 整体上能看的东西没那么多，门票定但50属实不能再多了。 下午到苏州，苏州的司机师傅接到了我这个小单，有点烦躁，开车很猛，感觉他的状态都不太好了，希望这个城市不都是这个样子。苏州的第一印象，就是车好多啊，老城区非常堵。 从酒店去平江路，遇到了司机师傅2，是个东北人，果然够刚的，差点因为别车，跟别人吵起来。他整体上比较消极一点，感觉是事业发展不顺，才来的苏州。 平江路这一带果然就是我理想里水乡应该有的样子，水的两侧都是房子，或者街道，水横穿在整个城市里，生活在这里就像生活在水里一样。 从平江路骑车回山塘街，路上走的小路，过一段就能看到水道，感觉这里的房子都是建在水上的，也太美好了，写到这里，感觉自己羡慕水乡其实是在羡慕这里的空气，水上的空气，总是很新鲜，不知道是不是潮湿带来的错觉。 山塘街入口，有个很大的三叉水道，河边开了各种风，夜景很漂亮。但山塘街里面人实在是太多，走了20米就退回来了。沿着河边往酒店的方向走，一遍看河边的夜景，晚上回去前能在河边走走，特别舒服。 day4 苏州（同里古镇、狮子林） 上午起大早去同里古镇，实景跟我向往水乡几乎完全一致，下面这个景当时给我的触动还挺大的。风吹树动，小雨滴打在水面，树弯弯下垂，覆盖了天空的位置，包裹住了这条河，河边的朴素住宅，住宅的主人每天都生活在这种地方，一定能文采著人，长命百岁吧。 这一刻的感觉，不能更好了 下午跟家里的朋友一块玩，一起去了狮子林，狮子林里的假山真的太壮观了，好几大块的假山连通在一起，假山里甚至还有空间用来打扑克，夏天用来乘凉简直爽极了。世界上应该没有更壮观的假山了吧。 晚上叫了一群人一起喝酒吃饭，玩到凌晨3点多。每个人真的都不一样，家家都有本难念的经。 day5 返程 第五天睡醒就10点钟了，吃了烩面，回酒店拿东西，赶火车，差一分钟没赶上车…… 返程～ 返京的高铁上，有个大叔很热情的帮两个女士放行李箱，行为举止也很优雅，车上还看到了好几个很酷的女生。下车后，有种高素质，大城市感觉冲击到了我，感觉周围的人确实都很有气质，小孩们也都很酷，这种感觉就跟扬州的舒适一样，很吸引人。 扬州和北京并不互斥，我们完全可以喜欢他们各自好的部分。扬州的出现只是让生活多了一种选择，并不是让我来排斥北京的。即使定居在北京，偶也也可以去扬州旅游，让生活多一些调剂。看懂生活后能依然热爱生活，感觉我朝这个方向迈了一步。 那么，其他城市还有多美好呢？ 总结 扬州：炒饭、拌面、干丝都很好吃。自然环境好，生活方式安逸 苏州：典型的水乡。节奏相对北京慢很多，但不像扬州那么安逸，感觉像北京和扬州的结合体</summary> </entry> <entry><title>learning english in April</title><link href="https://wa008.github.io/posts/english-02/" rel="alternate" type="text/html" title="learning english in April" /><published>2023-04-01T00:00:00+08:00</published> <updated>2023-04-01T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/english-02/</id> <content src="https://wa008.github.io/posts/english-02/" /> <author> <name>Benson</name> </author> <summary>4.1 There were two ways of making friends, when we were children, we make friend with person that live near with me, when we grow up, we make friend base on interest, the Reddit is the right place to make friends now Be the person that you like, that you want to be I should control myself more, I need more regulation What can we do if there is a chance for tool can generate video from text, is there some good idea? every can be a director using it. 4.14 Today, I talk with my leader in erp, he think there are so many girl in my group, girls are more interested in discussing with gossip than boys, so there will be more conflict that happen in my group, it’s distressing. This is my first time I hear this idea so real, I’m be keenly aware of why the job market is biased for girls.</summary> </entry> <entry><title>small talk of learning english</title><link href="https://wa008.github.io/posts/english-01/" rel="alternate" type="text/html" title="small talk of learning english" /><published>2023-03-30T00:00:00+08:00</published> <updated>2023-03-30T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/english-01/</id> <content src="https://wa008.github.io/posts/english-01/" /> <author> <name>Benson</name> </author> <summary>3.26 Ride a bike I like ride bike, I ride bike twice in this weekeed for about senventy kilometers, there are many reason that i like it, I enjoy the feeling of freedom when I’m ride, It’s like I can go to anywhere if I want, I like the wind, the smell of air outdoor. yestarday, I find the other thing that I can get from riding a bike, that is the scene of river, I like river of sea very much, they are boundless, the water is transparent and clean, that will make me peaceful, I enjoy that feeling well.</summary> </entry> <entry><title>新年新气象-碎碎念</title><link href="https://wa008.github.io/posts/new-year/" rel="alternate" type="text/html" title="新年新气象-碎碎念" /><published>2023-02-12T00:00:00+08:00</published> <updated>2023-02-12T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/new-year/</id> <content src="https://wa008.github.io/posts/new-year/" /> <author> <name>Benson</name> </author> <summary>想开了很多，心情要比两个月前好多了。要把生活的重心放在具体要做的事情上，无论是工作，还是一个人玩、跟朋友玩，跟对象一起玩。 现在非常喜欢尝试新的事情，比如播客脱口秀、滑板、搓澡等等，体验是活力的体现，感觉又年轻了似的。 成长就是接受自己是个普通人的事实，逐渐慢慢接受了，但也在教导自己，即使作为普通人，也不影响自己追求喜欢的技术，自己热爱的事情。 多做复利的事情，即能重复获利的东西，比如学英语，写播客，提高技术能力。而不只是用时间换取价值，即工作。 眼睛疼，疼的时候才意识到眼睛多重要，更准确的说，是在去医院滴了散瞳之后，在大街上睁不开眼的时候，才意识到眼瞎是多么的恐怖，眼睛是多么的重要，所以开始控制手机使用时长，开始看书，看点学习的内容。 看了《黄金时代》，作者在文革的年代，都能自由洒脱的生活，21世纪的我，又为什么不能呢。都说2019年是最好的一年，但2019年的人，也会觉得2015年更好吧，每个时代都应该有他的特点，这才是乐观的心态。 当理性遇到感性，当数学遇到文学，当经济学遇到心理学，这些不相关甚至冲突的内容会体现在同一个个体身上，或者体现在同一群人身上；他们不冲突，只是讲述了不同的道理。心理学更多针对个体，期望个体在群体中要如何表现，才能变得更好；经济学描述群体行为，揭示不同个体组合在一起后形成的群体规律。 我们要做的是保持理性，表达感性，了解群体规律，保持个性特点。 life is today, not tomorrow, not yesterday</summary> </entry> <entry><title>2022年总结</title><link href="https://wa008.github.io/posts/2022%E5%B9%B4%E6%80%BB%E7%BB%93/" rel="alternate" type="text/html" title="2022年总结" /><published>2022-12-31T00:00:00+08:00</published> <updated>2022-12-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/2022%E5%B9%B4%E6%80%BB%E7%BB%93/</id> <content src="https://wa008.github.io/posts/2022%E5%B9%B4%E6%80%BB%E7%BB%93/" /> <author> <name>Benson</name> </author> <summary>又到了一年一度的总结时间 健康 回头看看，2021年竟然把健康列在了第一位，说明那时候真没啥烦恼，只有没烦恼才会这么看重健康。 原计划是要跑步和游泳，跑步没有坚持下来，不太喜欢室内跑，6月室外跑的多，在记录的420分钟，相当于每周一个半小时，后来因为有疫情，慢慢就少了，9月只有100分钟，10月就停下了。后来跑步就替换成了骑车，能翻到照片的有5次，总觉得骑了更多的才对，可能是有几次没有拍照，每次骑行得有100公里左右，感觉运动量还是挺大的，骑行也是今年很不错的一个尝试，体验很棒，很喜欢接触大自然的感觉。 贴一张今年最喜欢的骑行图 十一之后天就很冷了，开始考虑游泳，狠下心办了游泳卡，游了三四次，11月中的北京疫情就爆发了，我停止了一切的运动活动。 总结：抛开疫情的客观因素，今年运动还行吧。前半年在忙工作，后半年还不错。好的点是比去年好多了，当然能有个记录也比较好。 英语 今年学的很差，投入的时间不够多。看过各种方法，最重要的问题还是要投入大量的时间，掌握了主要的方法，再去追求更好方法能带来的边际收益就很小了。 总结：没必要聪明反被聪明误，投入大量时间去 听、看、说、写 就好了。 学习 说起来今年学习范围挺多的，期间看了图模型、模型解释性、强化学习，但都不深，浅尝辄止。 主要是因为迷茫，对深度学习没有信心，感觉用深度学习达成AGI不太现实，总觉得这个行业走错了路。感觉AGI还是得靠强化学习，2023如果有时间搞点啥的话，就搞这个了。 读书 今年看了不少书，这是对自己最满意的一个方面。按照看的时间排序，与重要性无关。 《1984》是种反乌托邦的讽刺性小说，读了55页就看不下去了，毛骨悚然。 《大脑》人进化的第一目标是生存，因此会存在生理和客观真理的冲突，比如生理上人会愿意吃很多甜食，吃超过身体所需要的食物，但显然这样是不健康的。 《刷新》关键词：同理心、激情、文化、求知欲、成长性思维（变通）。 《被讨厌的勇气》做好自己，不要干预别人。 《智能时代》1）时代的浪潮不是个人能干预的，我们要做的是争做新浪潮中的2%。2）强如作者，觉得高瞻不多，当下要做的事情还很多。平凡的自己要更认识到自己思维的不足。3）新技术+老行业=新行业。打败搜索的不一定是搜索，会是另外一个能满足搜索需求的平台。 《show your work》 《时空》读了两章就读不下去了，总觉得是本有大智慧的书，但超过了我的理解阈值。 《美国陷阱》一位法国的企业高管，被美国利用海外腐败法监禁25个月，背后真实的原因是美国想要遏制该公司的发展，最终完成对该公司的收购。 《幸福的方法》幸福大多来源于社会关系，那社恐的人怎么办呢？还是说社恐是在逃避问题？不知道 《老人与海》读了英文版，也没读多少页。书中有太多跟钓鱼有关的物品，不能理解哎 《人类简史》 狩猎时代-农业时代-工业时代，很难说人类有没有变得更快乐。 人类的生活水平有极大提升，但快乐受期望的影响，现代人期望更高，获取的相对快乐并不多。 1）快乐在生理上指多巴胺的分泌，但它始终会回归正常值。2）生物学/心理学认为快乐来自内心。3）但佛教更深一层，认为要抛弃简单的主观感受，达到心灵澄明、自在的境界，才能保持快乐。 《二手时间》 看了 100/570，讲述1991年苏联解体后人民的生活现状，趁机去维基百科看了下苏联解体的历史，政治体制和经济体制都不适用于当时的社会，引发了一系列的社会问题，还有切尔诺贝利核电站的泄露，引发了苏联解体。书中以采访的形势，描述当时人民的生活状态，战争的残酷，经济崩溃，货币系统崩塌，没有食物导致大量人民饿死，混乱不堪。书中更多描述的底层人民的生活状态和细节，书其实比较晦涩，不那么有趣味，读了100页感觉大概明白意思了，没有继续往下读。 《一只特立独行的猪》 王小波的杂文集，以作者在云南下乡为背景，描述其感悟。看完没啥收获，只觉得作者很，自由？不知道这是不是就是自由 《沉默的大多数》 作者给人的感觉，1）写出来的话极其真实，接地气，没有丝毫的故事性渲染。2）可能是因为提前打了预防针，作者的思想确实很自由，不会受任何传统的限制。 看到最后几页的时候，想起来点什么，看完了就忘记了。有些想法真的是稍纵即逝。 还有两本在读的，王小波的《黄金时代》，不知道谁写的《KLARA AND THE SUN》 不过有很多书都没看多少页，特别是老人与海，哈哈哈哈哈 关于书，最喜欢的一句话是罗翔老师说的「书嘛，读就好了，不一定非要收获点什么」，大概这么说的，感觉很受用。 电影 也看了不少电影，不知道以前是没记录还是咋滴，总觉得相比今年，往年跟啥都没看似的。最喜欢的是前三部作品。 《硅谷》 创业不易，会遇到各种意想不到的事情。但剧里面戏剧性的场景挺多的。 技术很多，从硬件到软件，我学到的知识还很少，很浅。 创造 真的很让人开心。 《大空头》戳破泡沫的，是银行的坏账率。 《浪潮》 狂热会导致极端主义，集体荣誉感也是纳粹的必需品，但说不上来集体荣誉感是不是就一定很坏。但崇尚自由是没问题的，对一个社会来讲，还是要提升民众的幸福感，才不会引发狂热，避免极端主义。 集体荣誉感是为了满足心理的某种需求，人只有无助的时候才需要依附于集体，趋于同质化，这些都不像是正常的需求，幸福感提升了，就不需要集体荣誉感了。集体荣誉感是从小的教育给我们的认知，但人类真的需要这个东西吗？ 《Pulp Fiction》不是很能欣赏的来。1）跳舞的桥段好有趣，想学跳舞。2）好人可能做坏事儿，坏人可能做好事儿。 《失控玩家》比较一般 《扬名立万》电影讽刺情结很多；有点悬疑 《落叶归根》 《你好，李焕英》 《气球》 《华尔街之狼》如何卖一支笔。股票经纪人的工作就是销售，想尽办法销售股票。 《飞越疯人院》讲述了自由的可贵，结局的时候酋长把呆滞的墨菲杀死了，有点震撼。 总结 本以为自己写个人博客了，就能自由输出了，但还是很胆小，有些内容不敢让上写。 2022年发生了太多事，今天很喜欢的一句话是，「2022是会被人经常提起的一年，是被人提起时都会沉默的一年」 本以为2021年的规划里会有旅游这一项，没想到是没有的，回想一下，也就6月左右的时候很想出去旅游，那段时间过得还比较开心，可能旅游的欲望只有在比较放松的时候才会产生吧。今天本来计划旅游的，但因为有其他事儿压着，旅游的欲望就没那么多了。 个人OKR：包括五项，早上是否按时起床、早、中、晚是否学习了、晚上是否按时睡觉，坚持了一年，完成率也只有50%左右，最主要的问题还是晚上不按时睡觉，不知道要怎么办。 2023 学好英语：其实现在已经打开了新世界的大门，那2023希望能在英文的世界里无障碍畅游。 处理好感情：对象要毕业了，毕业之后面临的问题很多，希望能处理好。 保持健康：游泳和骑行坚持下来，再考虑下羽毛球 做精一件小事：比如kaggle的一个比赛 专业学习：AGI，强化学习，风控底层技术 读书：多读书，少刷视频 影视：Netflix会员已入，come on 晚上早睡：唉</summary> </entry> <entry><title>刷剧</title><link href="https://wa008.github.io/posts/watch-TV-play/" rel="alternate" type="text/html" title="刷剧" /><published>2022-12-11T00:00:00+08:00</published> <updated>2022-12-11T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/watch-TV-play/</id> <content src="https://wa008.github.io/posts/watch-TV-play/" /> <author> <name>Benson</name> </author> <summary>已经好久好久没刷过剧了，前两天头疼的厉害，就开了一个新剧《来自星星的你》，但当天一集都没看完，主要是从昨天开始看到，看到今天，把它刷完了。 剧虽然有点狗血，但刷剧确实很快乐，快乐来自于对美好的追求，谁又不喜欢美好的事物呢。 想想自己喜欢的美剧，大多有一个特点，剧里的角色性格非常鲜明，极其鲜明，但现实中大多人的性格都是偏”中性”的，这里实在找不到一个合适的词来描述了。 另一个特点是，主角们都会有明确的要去追求的目标，很纯粹的单一目标，通过展示追求目标的过程和结果，让观众感觉喜悦。现实中呢，大多数人并没有一个特别渴望的目标，这就造成了现实的不快乐。 这两个特点或许有一定的关联性，人有了目标还要去追求，放弃其他事情去纯粹的追求一个目标，能做到的话也就先显得性格特别鲜明，这都很纯粹，或许纯粹才是让人快乐的事情。 现实中大多数人，或许说是我（发现我总喜欢用大多人数来指代我。。），缺少的是这种纯粹，有一个纯粹的目标，纯粹的去追求它，少把时间放在其他不重要的事情上，追求的越深，能收获的正反馈才更多。 其实有纯粹的目标是比较难的，因为这个世界五彩缤纷，我们怎么会只有一个目标呢？但尽力去追求重要的目标，是可以做到的，这样生活才会更有意义吧。</summary> </entry> <entry><title>感染新冠</title><link href="https://wa008.github.io/posts/get-covid/" rel="alternate" type="text/html" title="感染新冠" /><published>2022-12-08T00:00:00+08:00</published> <updated>2022-12-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/get-covid/</id> <content src="https://wa008.github.io/posts/get-covid/" /> <author> <name>Benson</name> </author> <summary>没想到这么快就中招了。 12.6 核酸 12.6日时已经9天没有做核酸了，北京宣布放开，就去做了一次核酸。 12.7 出现症状 12.7日去公司上班，发现核酸没出结果，中午看了下还没出，正跟对象打电话聊这事儿呢，就收到十混一阳的电话了，说让回家等上门核酸，于是就回家了。 这时候才想起来早上一直嗓子疼，但我总觉得是前几天吃辣吃多了导致的，还没想到是新冠。知道自己迟早都会感染，但没有想到来的这么块。 下午回家的时候发现室友也嗓子疼，楼上的同事也嗓子疼，都有相同的症状，室友还说上门核酸来的时候给他也做一个，他觉得他可能也要阳。但上门核酸等到晚上一直没等到。 下午6点的时候室友开始发烧，量了一下38.5，已经烧的挺厉害了。晚上9:30的时候，我工作完了，才感觉自己也有点不舒服，量了体温就已经38度了，一直尝试睡觉，从 9:30 躺倒了 12:30 才睡着。 当天晚上因为烧的并不厉害，也好久不发烧了，感觉发烧还挺好玩的。自己身体，特别是头部，会有一阵一阵的波浪，就好像大海的波浪，或者一阵阵的风在吹动云彩。也因为自己一直想看看防范了三年的新冠到底是什么样子，不觉得难受，反而觉得有点兴奋。 12.8 症状加重 早上6:30就醒了，一直睡不着，量了体温升高到了 38.5，主要是头疼很难受，身体会轮流某一个部位疼一下疼一下的，感觉嗅到了死亡的味道，这时候已经不觉得感染新冠好玩了，只觉得难受，感觉新冠还是挺可怕的，至少比预期的症状严重很多。 因为上门的核酸没有做，今天一直没有我的阳性证明，所以公司的同事们也没办法算作密接，一直在犹豫需要不需要去公司。找了一圈的抗原，同事给送的抗原11:30才能送到，外面的药店抗原也得11点才有货，美团买的抗原也得12点才能到，但同事们10点就得决定要不要去公司了。无奈之下，又跟行政的人沟通，他们同意让跟我密切接触的几个人回家，一共5个人，但他们中3个人已经去公司了，希望我这一波不会扩散出去。对了，特别是跟我一起开了会的leader，她没打疫苗，还挺危险的。 解决了同事们的事，上午就可以安心躺着了，上午难受了一上午，期间收到了好几个同事的安慰，还挺开心的。中午提问已经上升到了 38.7 ，难受的不行，起床吃了几口饭，吃了个药，就继续睡了。 虽然请假了，但下午两点得做一个串讲，准备了一周了，业务也比较着急，于是就正常串讲了，串讲的时候还可以，可能脑子在思考东西，会忽略疼痛。 下午测了抗原，但手法不对，棉签进试管的时候忘记挤了，测了个弱阳性，不管怎么说总算是有阳性证明了。 晚上6点测体温下降到了38度，感觉好多了，就起来在博客上记录一下这个感染的过程。。。 12.9-14 减轻转阴 第三天（12.9）睡醒之后已经没有发烧的感觉了，就没再继续量体温。只感觉嗓子巨疼，不知道是症状到了，还是跟昨晚的卤子咸有关系，主要难受的点就在嗓子上，偶尔也会少流点鼻涕。 第四天、第五天 嗓子疼慢慢缓解，流鼻涕越来越严重，就持续的喝水、擦鼻涕、上厕所，不断重复这个循环，感觉后面应该不会有更严重的症状了。 12.11日下午测了抗原，强阳性，就没再想办法测核酸了，明天应该可以凭这个居家了。 截止到今天已经5天没出过门了，感觉也没有很影响生活，就是买药啥的更贵了，接单也慢了，明显应该是骑手少了很多。 12.12：喝水喝的并不多，恢复的并不快，还是嗓子疼，流鼻涕。 晚上睡觉的时候，头的右后方会疼，跟里面有个钉子似的，最后吃了布洛芬才睡着，有点害怕是不是新冠的后遗症。 12.14：测了抗原，转阴性了，但还会咳嗽，流鼻涕 12.15-12.19 恢复上班 12.15：公司越来越多人阳了，但也有一些人还没阳，感觉还是先不要去公司的话，下周再去吧。 12.19：周一来公司了，还有一些人没阳，还挺厉害的。 跟我类似的人比较多，阴性之后还是有点感冒，属于没完全好。</summary> </entry> <entry><title>强化学习简介</title><link href="https://wa008.github.io/posts/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0%E7%AE%80%E4%BB%8B/" rel="alternate" type="text/html" title="强化学习简介" /><published>2022-11-16T00:00:00+08:00</published> <updated>2022-11-16T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0%E7%AE%80%E4%BB%8B/</id> <content src="https://wa008.github.io/posts/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0%E7%AE%80%E4%BB%8B/" /> <author> <name>Benson</name> </author> <summary>概念 强化学习是机器学习的一个分支，指模型输出结果后从环境中获取反馈，从而优化自身的一种学习方法。 人类的学习过程就是学习知识，然后根据环境的反馈不断提升自己。最典型的比如开车，可以通过现实的反馈得知当前操作是否合理。再比如数学推理，人类本身就可以证明某个数学结果的真伪，当然这个证明过程或许比较长，但至少是可证明的。 最著名的案例是 DeepMind 的 AlphaGo 击败围棋世界冠军李世石，生成对抗网络GAN也属于强化学习的一种。 Q-learning Q-learning 是不断维护一个 Q[status][action]=value 的二维数据表，value 代表当前 status 下执行 action 能获取到的奖励。 通过不断地学习、试错，来更新这个Q表，使得Q表的取值越来越合理，这样无论对于任意一种状态，都能选择到Q值最大的action进行操作。 实际的更新过程中，会认为当前action的收益 + 下次status的Q值是当前 status-action 的实际Q值，以此作为基准来不断更新当前的预测值，即当前的 Q[status][action]，具体逻辑可以参考莫烦大佬的样例。个人理解这种更新逻辑不一定最好，只是为了得到最合理的Q表的一种手段。 Saras Saras 和 Q-learning 比较类似，区别在于，Q-learning 计算实际Q值时，取的是使value最大的action，但实际执行时，下次动作不一定是这个action（因为要保证探索性，下次action有一定的随机性），而对于 Saras，选择的是下次实际动作的action，而不是最大的action，这样就能更好地保证随机性，对需要结果多样性的场景来说更加合适。 Sarsa(lambda) 默认的场景里，当前的状态离最优状态都很远，只有等第一次遇到最优态的时候才能获取到收益，才能真正更新Q值，那么这时候要更新前面多少步的status对应的Q值呢？lambda 就是起这个作用的，lambda 范围[0, 1]，取0时只更新当前步骤的Q值，取1时更新从初始状态到当前状态的所有Q值，当然距离当前状态越远，更新的权值就越小。 Deep Q Network 现实很多情况中 status 的状态是无法枚举的，于是就有了 DQN，使用隐式向量作为 status 的表征，Q 表用神经网络模型来替换，从而把Q-learning 和 神经网络融合在一起，解决了 status 无法枚举的问题。DQN 主要有两点值得提一下，1）历史的 Q 表学习样本可以累积，也可以重复使用，累积一段时间之后再去更新模型。2）DQN 造了两个结构一样的模型，分别叫做估计模型和现实模型，估计模型参数不断更新，现实模型隔一段时间会同步估计模型的参数。现实模型的输入的是下一步的status，占有先机，因此不需要持续更新也能创造比较准确率的Q值。原文中交替更新的两个相同结构的模型是DQN的一大亮点，但我还无法理解。。总觉得一起更新的话效果会更好一点。 Double DQN：使用 Q_max_predict (s, a) 来替代 Q_max_target (s, a) ，防止实际结果过大，加快收敛速度。ps：这不就是说明 predict 模型要比 target 模型更好嘛！ Prioritized Experience Replay (DQN)：跟 Sarsa(lambda) 的作用比较类似，能获取到收益的步骤很少，因此要高效利用这个步骤，DQN中，会根据误差（Q预估-Q收益）对样本进行带权采样，当前步骤获取到收益时，预估的误差会很大，那被采样的概率就很高。 Dueling DQN：把Q值分成两部分，status 本身固有的值 和 action-status 的增益。目的是为了让Q值更加符合实际的场景。 Policy Gradients Q-learning 中 action 取值都是离散型的，Policy Gradients 就是适配 action 是连续取值的情况。 这样每次的学习目标就不再是误差，而是每个action对应的 收益了。 进阶 Actor Critic：将环境反馈也用神经网络替代，解决 Policy Gradients 只能回合更新，而不能单步更新的问题。 soft-Actor Critic：让Q模型不只关注收益，也关注输出值的熵，提高模型的探索能力。 已经越来越像生成对抗网络了。 很有意思的案例，回头再搞一搞: https://github.com/Farama-Foundation/Gymnasium 总结 强化学习的优势在于，面对业务场景，只要能把场景的状态和验证机制描述清楚，就能利用多次交互来获得最优的模型效果。比如 AlphaGo。还有其他可行的场景吗？比如自动驾驶、机器人、游戏、数学推理。很值得探索。 这也特别贴合人的学习过程。现在文本、视觉、语音等各个小模块的效果已经比较成熟，缺点是解释性不够，用一个无法解释的模型来达成AGI几乎是不现实的，一个可能的解决办法是，用一个可解释、可控的框架把不同的功能模型组合起来，从而达成AGI。这个可解释的框架，会是强化学习吗？ 参考 莫烦教程 推理 sota Soft Actor-Critic论文笔记 rl-book-Applications</summary> </entry> <entry><title>特殊的日子</title><link href="https://wa008.github.io/posts/move-typecho-to-github-pages/" rel="alternate" type="text/html" title="特殊的日子" /><published>2022-11-12T00:00:00+08:00</published> <updated>2022-11-12T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/move-typecho-to-github-pages/</id> <content src="https://wa008.github.io/posts/move-typecho-to-github-pages/" /> <author> <name>Benson</name> </author> <summary>博客迁移 博客从 Typecho 迁移到了 github 上，域名不变。 搭建的 Typecho 博客到期了，服务器续费一个月80，域名续费一年29，服务器杀熟太狠了，所以只续了域名。 无奈把迁移到了 github 上，今天搞了一天才搞定。挑主题的时候总觉得别人的主题太花哨，想找一个极极极简的，没找到，于是就自己参考各种教程搭建了一个极简风格的。可能有点丑吧，但我的极简的目的达到了。 Typecho 导出功能也有点麻烦，本来别人写好的有脚本可以导出的，但服务器上python环境还少库，搞起来很麻烦。于是自己写了个脚本解析的 Typecho 备份dat文件，也花了点时间。 html 0基础，有些内容一边查一边试，就比较花时间，反正弄出来了一个我觉得没啥大问题的版本，先跑一段时间看看吧 还有一些问题没解决，比如加评论很麻烦、RSS订阅还没搞、github page 公式解析需要接住外部服务、访问量统计也需要外部服务。毕竟不是自己的服务器，也没办法。github page 能提供这个级别的服务已经很不错了，特别是 action 的功能，能自动构建，速度也挺快的，感觉很棒。 去年写了31篇文章，感觉还不错，域名续费了3年，github page 短期也不会倒闭，这个方案起码能保底至少跑3年了。 生日 昨天生日，今天就是26岁+1天了，过生日本来挺开心的，但一想到自己马上27岁了，就感觉老了还一事无成，很难过。 想了想原因，感觉一方面是年龄大了，更重要的原因是年龄在强迫我接受 自己个普通人 的这个事实，年少的时候总有干大事的梦想，现在梦想逐渐破灭。即使如此，仍然无法接受这个事实，再努力一下，即使明年不得已要接受这个事实，也希望那时候的遗憾会少一点。 ICPC world final 2022 今年的 final 在孟加拉的首都达卡举办，似乎好多队伍因为疫情的原因没去成，比如清华，ITMO去的好像也不是最强的队。 最终 MIT 11题夺冠，北大10题亚军，东京大学9题季军，首尔大学9题第四，tourist好像是 solo 11题，恭喜大佬们！看比赛总是能唤起自己对这件事的热情，ACM是这样，LOL也是。这些事情都很纯粹，做纯粹的事情就很开心。</summary> </entry> <entry><title>神经网络解释性</title><link href="https://wa008.github.io/posts/%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E8%A7%A3%E9%87%8A%E6%80%A7/" rel="alternate" type="text/html" title="神经网络解释性" /><published>2022-11-06T00:00:00+08:00</published> <updated>2022-11-06T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E8%A7%A3%E9%87%8A%E6%80%A7/</id> <content src="https://wa008.github.io/posts/%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E8%A7%A3%E9%87%8A%E6%80%A7/" /> <author> <name>Benson</name> </author> <summary>列举几个解释神经网络的方法。 Learned Features 主要针对图像领域，对图像的不同层、channel、unit 进行可视化，解释模型的每个模块分别学到了什么。 Pixel Attribution (Saliency Maps) 1、基于模型梯度进行解释 2、对输入（图片像素）添加扰动，观察输出结果的变化 作者建议：尽量少发明新的方法，多关注如何验证各个解释性的好坏。 Detecting Concepts 利用模型中间层数据，做一些可解释性的检测，具体没有太看懂。 原论文 Adversarial Examples 通过生成对抗样本发现模型的缺点。主要在图像领域用的比较多。 对抗样本和实际的应用场景相关性较大，场景是什么，就在对应的场景上提供更多对抗样本，提高对应的解释能力。比如无人驾驶、垃圾邮件检测等等。 Influential Instances 剔除一个样本，重新训练模型，看模型预测指标的变化，归因样本和模型的关系。 只使用对模型重要性高的样本做训练。 重训模型成本太高，文中提到针对”有梯度”的模型，也可以提前预估样本剔除对模型参数的影响，从而直接微调模型参数，不需要重训模型，减小该部分的成本。 小结 模型解释性整体思路 剔除/添加 某个 样本/特征，从而挑选重要的特征/样本，或者观察特征/样本对模型的重要性。 通过模型梯度，来解释 通过可视化模型的中间层，解释模型。 但天然存在的一个问题是，模型足够大的时候，这些变化都很微弱，很难观测到比较置信的解释性。 一个可行的思路是将模型参数从小往大做，每一步充分保证解释性，比如词向量，可以用大量的数据集充分验证其效果，从而保证解释。 解释性一个重要的作用是为了辅助达成AGI(通用人工智能)，当然或许可以创造其他解释性更好的技术(非神经网络)实现AGI，科学家们加油！ 参考：https://christophm.github.io/interpretable-ml-book/pixel-attribution.html</summary> </entry> <entry><title>全局的模型无关解释方法合集</title><link href="https://wa008.github.io/posts/%E5%85%A8%E5%B1%80%E7%9A%84%E6%A8%A1%E5%9E%8B%E6%97%A0%E5%85%B3%E7%9A%84%E8%A7%A3%E9%87%8A%E6%96%B9%E6%B3%95%E5%90%88%E9%9B%86/" rel="alternate" type="text/html" title="全局的模型无关解释方法合集" /><published>2022-11-04T00:00:00+08:00</published> <updated>2022-11-04T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%85%A8%E5%B1%80%E7%9A%84%E6%A8%A1%E5%9E%8B%E6%97%A0%E5%85%B3%E7%9A%84%E8%A7%A3%E9%87%8A%E6%96%B9%E6%B3%95%E5%90%88%E9%9B%86/</id> <content src="https://wa008.github.io/posts/%E5%85%A8%E5%B1%80%E7%9A%84%E6%A8%A1%E5%9E%8B%E6%97%A0%E5%85%B3%E7%9A%84%E8%A7%A3%E9%87%8A%E6%96%B9%E6%B3%95%E5%90%88%E9%9B%86/" /> <author> <name>Benson</name> </author> <summary>这几个看的比较糙，就写到一起了。 Functional Decomposition 函数分解 把模型做因式分解 [f(x1, x2, x3) = f(0) + f(x1) + f(x2) + f(x3) + f(x1, x2) + f(x1, x3) + f(x2, x3) + f(x1, x2, x3)] 尽量拆解变量之间的关系，进行简化。方案比较理想。 Permutation Feature Importance 删除一个特征，看模型预测值的变化，来衡量特征重要性 用训练集还是测试集实验呢？测试集 如果用训练集：模型过拟合的话，训练集上也会显示误差较大，会误以为特征比较重要。 如果用测试集：优点是，特征即使和预测值没有线性关心，只要被用到，依然会表现出合理的重要性取值。 优点 好理解，解释性强。 有全局视角 耗时短：不需要重训模型，重训对比的是不同的模型，而我们想解释的应该是当前的模型，不应该重训。 缺点 优点3是优点也是缺点，要看具体的应用场景。如果目标只是纯粹衡量特征的好快，与模型无关，那此方法就不合适。 当模型预测结果和 ground truth 差别较大是，误差大可能更优，误差大就可能代表不了特征不重要。 对相关性强的特征很不友好。比如两个身高和体重，可能都能衡量人的体型大小，但具体哪个特征重要，取决于模型使用了哪个特征，这个缺点在树模型中更加显著。 Global Surrogate 描述：训练一个可解释的模型去拟合原模型，通过解释「可解释模型」来解释原模型。 看法：在原模型不可变的情况下比较适用。比如线上模型出故障了排查原因、线上模型由于各种原因不能修改。 Prototypes and Criticisms 描述：挑选原数据集中具有代表性的点（Prototypes），再挑选Prototypes 代表的不好的点Criticisms，利用这些代表点来解释模型，看是否被模型正确判定。 看法： 是一个从数据角度解释的方式，并不是解释模型。 选点比较类似聚类 参考：https://christophm.github.io/interpretable-ml-book/global-methods.html</summary> </entry> <entry><title>社区发现算法概览</title><link href="https://wa008.github.io/posts/%E7%A4%BE%E5%8C%BA%E5%8F%91%E7%8E%B0%E7%AE%97%E6%B3%95%E6%A6%82%E8%A7%88/" rel="alternate" type="text/html" title="社区发现算法概览" /><published>2022-10-23T00:00:00+08:00</published> <updated>2022-10-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%A4%BE%E5%8C%BA%E5%8F%91%E7%8E%B0%E7%AE%97%E6%B3%95%E6%A6%82%E8%A7%88/</id> <content src="https://wa008.github.io/posts/%E7%A4%BE%E5%8C%BA%E5%8F%91%E7%8E%B0%E7%AE%97%E6%B3%95%E6%A6%82%E8%A7%88/" /> <author> <name>Benson</name> </author> <summary>背景 计算机能处理的大部分是结构化数据，拥有规范的行和列，但世界上有大量的数据以关系的方式存在，比如社交网络中的朋友关系、交通中各个路口的关系、推荐系统中人和物品的关系。 这就需要图数据结构来描述这种关系，用来进行数据分析。 社区算法举例 Louvain louvain 是最常用的社团发现算法，它以优化模块度为目标对群体进行划分。 page rank：https://zh.m.wikipedia.org/zh-hans/PageRank Lpa 通过将有标数据的标签传播给邻居节点，从而给无标数据打上标签。 https://www.cnblogs.com/LittleHann/p/10699988.html DBSCAN 通过核心点+扩散的思路划分社区 fraudar 二部图中，寻找最优的待删除的行或列，剩余的子图组成社区 Page rank Page rank 是 Google 网页排名最早、最著名的算法，以 Google 两位创始人之一 Larry Page 的名字命名。 Page rank 根据网页之间的超链接关系，能计算出网页的重要性排名，原则是有越多的高质量网页能链接到当前网页，那这个网页的质量就更高。 参考 知乎综述：https://zhuanlan.zhihu.com/p/141401358 csdn综述：https://eason.blog.csdn.net/article/details/91352358 CS224W：http://web.stanford.edu/class/cs224w/ 杂谈 不涉及深度学习的社团算法，都比较好解释和应用。当融入了神经网络之后，解释性就会成为效果提升的壁垒，这么看的话还是得先搞明白解释性的问题。</summary> </entry> <entry><title>图神经网络入门（GNN）</title><link href="https://wa008.github.io/posts/%E5%9B%BE%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%85%A5%E9%97%A8-GNN/" rel="alternate" type="text/html" title="图神经网络入门（GNN）" /><published>2022-10-23T00:00:00+08:00</published> <updated>2022-10-23T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%9B%BE%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%85%A5%E9%97%A8-GNN/</id> <content src="https://wa008.github.io/posts/%E5%9B%BE%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%85%A5%E9%97%A8-GNN/" /> <author> <name>Benson</name> </author> <summary>顾名思义，就是把神经网络应用到图结构上 1、Semi-supervised Classification with Graph Convolutional Networks 图卷积的广义理解： 1）卷积：两个函数的一种运算，输入两个函数，加入时间变量做累计，输出一个新函数。 2）考虑CNN（卷积神经网络）怎么做的：函数看做矩阵，输入原始图像和卷积核（两个函数），拿卷积核遍历原始图像，做计算（点乘、求 和），生成新矩阵（输出新函数）。 3）图卷积：图卷积最基本的问题是，输入”原始图像”形状并不固定，不同节点的邻居节点数量不同，怎么办？ 利用邻接矩阵，每个节点信息都输入，把不连接的节点信息置为0就好了。加大复杂度来让这个问题可解。 图卷积过程： 1）通过图的邻接矩阵获得拉普拉斯矩阵 2）拉普拉斯矩阵分解，特征向量作为正交基，作为傅立叶变换的基 3）利用正交基进行傅立叶变换，乘积之后求逆变换，得到两个函数的卷积 卷积的一个输入为原始图结构，另一个是卷积核，作为参数训练。 基础概念： 1）傅立叶变换 每个函数由多个周期性函数组合而成，每个周期函数可以看做正交基为 $1,sin(x),cos(x),sin(2x),cos(2x)…sin(nx),cos(ns)$的组合，这些函数互相垂直（相互的乘积积分为0），根据欧拉公式，正交基变成 $e^{wnx}$，其中w标识周期函数的频率。傅立叶变换是指将一个函数拆解为多个三角函数的和，每个三角函数用频率和振幅描述，即将函数从时域（时间为横轴，信号大小为纵轴）变到频域（频率为横轴，振幅为纵轴）。 2）卷积定义和傅立叶变换 两函数傅立叶变换之后的乘积，等于卷积之后的傅立叶变化，那么两函数的卷积，就等于，各自傅立叶变换后乘积的逆傅立叶变换。 3）拉普拉斯算子 目的：在图上找到一组正交基，结合傅立叶变换做卷积。 传统拉普拉斯算子，是欧式空间中的二阶微分：$\triangledown f=f(x-1,y)+f(x+1,y)+f(x,y-1)+f(x,y+1)-4*f(x,y)$ 图结构利用邻接矩阵就能求出对应的拉普拉斯矩阵，进行矩阵分解，得到的特征向量可以看作傅立叶变换的基，从而完成图上的傅立叶变换。 图上的拉普拉斯矩阵：$L=D-A$，$D$ 表示顶点度矩阵，$A$ 表示邻接矩阵。 拉普拉斯矩阵是 实对称矩阵 -&amp;amp;gt; 能对角化 -&amp;amp;gt; 找到正交基 图卷积优化 1）矩阵分解复杂度太多，用特征值的多项式代替卷积核，就不需要做矩阵分解了。 2）切比雪夫近似 2、Can Abnormality be Detected by Graph Neural Networks? 文中认为GNN会平滑节点之间的特征，正常节点的特征平缓（低频），而异常节点特征陡峭（高频），GNN平滑节点之间信息之后，会降低异常节点的信息表达。 因此提出使用不同频次的滤波器，抽取特征，再通过attention机制做信息融合，更好地表达异常节点的特征，效果提升明显，达到新的 sota 效果。 疑问： 1）GNN只能提取低频特征：暂时来看，是低频特征的传播比较有效，从而反证GNN只提取了低频特征。 2）高低频特征怎么理解： 图上的一组信号，可以被表示为图拉普拉斯矩阵特征向量的一组线性组合。 特征向量对应的特征值越大，该特征向量越“振荡”，反之越平滑。 而对于对图特征x，其在高频特征向量上的分量越大，可以说该特征具有更多高频的特征，反之亦然。 3、Revisiting Graph Neural Networks: All We Have is Low-Pass Filters 对结果有效(能提升节点分类效果)的都是低频滤波器。 验证：不断添加频率分量，重新构建特征，添加到一定比例时，效果开始下降。 参考 博客 欧拉公式 离散傅立叶变化：进行傅立叶变换和逆变换，时间复杂度 $O(N^2)$ 快速傅立叶变换：降低复杂度到 $O(Nlog(N))$</summary> </entry> <entry><title>我的第一款 iOS APP</title><link href="https://wa008.github.io/posts/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AC%BE-iOS-APP/" rel="alternate" type="text/html" title="我的第一款 iOS APP" /><published>2022-10-13T00:00:00+08:00</published> <updated>2022-10-13T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AC%BE-iOS-APP/</id> <content src="https://wa008.github.io/posts/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AC%BE-iOS-APP/" /> <author> <name>Benson</name> </author> <summary>萌生想法 大约是一年前吧，有一次要找我的身份证号，我知道手机相册里一定有身份证照片，但里面有几千张图片，看一遍的时间太长了，就从app store 里找了找有没有从图库中根据文字搜索图片的，找了半天果然没有，于是就第一次萌生了写这样一个APP的想法。 可行性 我知道iOS的图库提供了图片生成文字的功能，因为单张是可以用的，后来查了查 swift 的文档，果然提供的有类似的接口，截止到这里就知道这事能做，可行性是有的。 只不过平常时间很多，还要学算法的内容，如果冷不丁写一个iOS APP，也是现学现写，跟自己长远的规划并不一致，所以搁置了很久，等找个特殊的机会再写。 开搞 今年十一本来计划要出去玩的，因为疫情等各种原因没去了。就打算十一期间写一下这个APP。这里还有一个原因是之前看过大佬王登科的一篇文章，利用春节七天上架了他的第一款APP，这个APP做的很棒，很难想象这是一个人的第一个该领域的作品。十一计划写这个APP也是想效仿一下大佬，看看自己能做到什么水平。 可惜实际上十一期间净干别的事儿了，只有最后两天搞了一下这个，这个APP上花的时间差不多总共一周。说起来是一周做了一个APP，但实际上功能过于简答，并没有系统得学 swift UI 相关的内容，主要是”抄”别人的代码，添加自己的功能，这么来做的。 本来觉得这个功能简单，应该挺好做的，但实际操作中细节还挺多的。 第一次上架 iOS 商店，还要注册苹果开发者账户，自己默认的 apple id 用不了（不知道为啥），又单独注册了个微软邮箱用来注册苹果开发者账号，提交注册申请后还要审核…等审核完再看吧，第一次确实麻烦很多 各种代码细节，还裁剪了很多功能 应用名、图标 成品 默认界面只有一个搜索框 搜索之后出图片 图标：我自己画的，很开心，哈哈哈哈哈哈 中道崩殂 拿到我自己手机上测试，发现苹果提供的API只在文字很大的时候效果较好，文字小的时候就不行了，即使是身份证照片，也提取不出来任何信息。 感觉提建议让苹果更新API的话也会比较艰难，果然个人做项目不知道会遇到什么奇怪的问题。 可惜了我刚买的苹果开发者会员，心疼。 TODO 待解决的问题和需求 搜索之后默认的图片和搜索框之间有很大的距离，还不知道要怎么去掉 时间范围可选 语言、模型可选 添加查找进度 添加用户反馈 / 邮件反馈</summary> </entry> <entry><title>AtCoder Beginner Contest 268</title><link href="https://wa008.github.io/posts/AtCoder-Beginner-Contest-268/" rel="alternate" type="text/html" title="AtCoder Beginner Contest 268" /><published>2022-09-11T00:00:00+08:00</published> <updated>2022-09-11T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/AtCoder-Beginner-Contest-268/</id> <content src="https://wa008.github.io/posts/AtCoder-Beginner-Contest-268/" /> <author> <name>Benson</name> </author> <summary>想打比赛的时候刚好 AtCoder 有场比赛在进行，就加入了，有两道题目挺有意思的。 E - Chinese Restaurant (Three-Star Version) 题目链接：https://atcoder.jp/contests/abc268/tasks/abc268_e 问题：n个人围在一个圆桌上，每人前面有一个带有编号的盘子，p[i] 代表第i个人前面盘子的编号，编号范围[0, n-1]，不重复，每个人的惩罚为跟自己有相同编号的盘子和自己之间的距离。你可以顺时针移动所有盘子任意次（保证盘子之间的相对顺序不变），使得所有人的总惩罚最小，问最小惩罚是多少？ 案例：如下图，顺时针移动3个单位获得最小惩罚，惩罚为2 思路：求初始状态下，每个人的盘子和自己的距离，绘制距离和惩罚之间的关系，是一个单峰的函数，当盘子进行旋转时，该函数不断向右移动，如下图中 黑色-&amp;amp;gt;红色-&amp;amp;gt;蓝色的移动，此时左侧的递增部分惩罚减小一个单位，右侧递减部分惩罚增加一个单位，be1, en1, be2, en2 为惩罚减少和增加的端点，根据人数的奇偶性不同，最大值可能是一个或两个，端点可能会变化一个单位，如下两个图对比： 初始的惩罚可以在 O(N) 复杂度内计算，每次移动时，可以根据前缀和求得实际距离在两个区间内的人数，每次移动的复杂度为 O(1)，则整体的时间复杂度为 O(N) 代码：https://atcoder.jp/contests/abc268/submissions/34763908 F - Best Concatenation 题目链接：https://atcoder.jp/contests/abc268/tasks/abc268_f 描述：定义字符串只包含 0-9 和 ‘X’，每个字符串的得分为：针对每个不为 ‘X’ 的字符，当前得分为该字符左侧 ‘X’ 的数量 * 当前字符的数字大小，对每个得到求和即为字符串得分，比如 “XXX1X359” 的得分为 3 * 1 + 4 * 3 + 4 * 5 + 4 * 9 = 71。 给定n个字符串，将n个字符串随意排列后拼接，使得拼接后的新字符串得分最大。 案例：给定三个字符串 1X3 59 XXX 得分最大的拼接方式为：XXX1X359，最大得分71 思路：按照得分逻辑，对所有字符串进行排序，排序后的顺序即为使得得分最大的顺序。 如果只有两个字符串，比较好理解，那多个为什么也满足这个逻辑呢？盲猜的，不知道要怎么证明。。。 代码：https://atcoder.jp/contests/abc268/submissions/34774715 小结 E题并不是比赛时间内解出来的，赛中写了半天的线段树发现思路错了，赛后看大佬代码没看懂，但启发了这个解法。果然，我这个水平的瓶颈还是在解题思路和实现速度上，并不是一些复杂的算法。</summary> </entry> <entry><title>人的信息输入方式对比</title><link href="https://wa008.github.io/posts/%E4%BA%BA%E7%9A%84%E4%BF%A1%E6%81%AF%E8%BE%93%E5%85%A5%E6%96%B9%E5%BC%8F%E5%AF%B9%E6%AF%94/" rel="alternate" type="text/html" title="人的信息输入方式对比" /><published>2022-09-10T00:00:00+08:00</published> <updated>2022-09-10T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E4%BA%BA%E7%9A%84%E4%BF%A1%E6%81%AF%E8%BE%93%E5%85%A5%E6%96%B9%E5%BC%8F%E5%AF%B9%E6%AF%94/</id> <content src="https://wa008.github.io/posts/%E4%BA%BA%E7%9A%84%E4%BF%A1%E6%81%AF%E8%BE%93%E5%85%A5%E6%96%B9%E5%BC%8F%E5%AF%B9%E6%AF%94/" /> <author> <name>Benson</name> </author> <summary>看和听 我一般会在上班路上、跑步的时候听音频。吃早饭的时候理论上我还在听路上听的播客，但还是觉得眼睛是闲着的，想看文字内容。就想到，人总是在最大化自己的信息输入，显然「看」获得的信息量大于「听」。 但某些播客质量很高的，听能带来的信息也很多，反而是看，一般不会在吃饭的时候看一些很干货的内容，以后值得注意下。再聊回去，看&amp;amp;gt;听 似乎是人的本能，本能总是有一些「肤浅」的规律，仔细想想是需要克服的。 学习时选文档还是视频 偶然看到这样一篇文章，说人应该放弃看视频的方式来学习，而应该看文章来学习。个人觉得这个话题还比较清晰。 1）视频：在你要新入门一个领域，或者看博客、论文看不懂的时候，适合看视频。视频更容易理解。 2）文字：你已经熟悉了一个领域时，要深入学习或者有小问题的时候适合看文字，比如博客、文档、论文。 文中也提到，当你在你熟悉的领域有个小问题时，视频的缺点在于无法快速准确定位你要找的知识在哪个部分，不像文档，可以快速定位，不会浪费时间。 其实现在B站、Youtube很多视频都会在下方列个一级目录，哪个时间段播放的内容是什么，如果这个目录更详细的话，比如是二级目录、三级目录，这样就能解决视频教程的这个缺点了，当然这样视频的性质也会往博客上靠拢。不知道以后视频领域会不会朝着这个方向「卷一卷」。 碎片化的时间 播客补足了人不方便眼睛看内容的时间，比如通勤路上、跑步、游泳等等，一方面这增加了人获取信息的时间，另一方面也减少了人脑袋置空的时间，但整体来说，音频的作用还是利远大于弊的。只是这个弊让我想到商人总会抢占人在各个时间段的时间，你不方便的看的时候找内容让你听，你不方便听的时候呢？找其他内容代替，但我并没有想到很多这种例子。 一个显著的例子是短视频、快消内容，补足了我的碎片时间，甚至在扩大我的碎片时间，买东西排队时、下楼倒垃圾时、离计划睡觉的时间还有5分钟时，没事干总会想看看手机，导致我很久没有脑袋置空思考一些事情了。 听说有人会定期冥想，甚至是每天冥想，或许现在的我更需要。 少输入垃圾内容，多思考。</summary> </entry> <entry><title>重叠社区检测</title><link href="https://wa008.github.io/posts/%E9%87%8D%E5%8F%A0%E7%A4%BE%E5%8C%BA%E6%A3%80%E6%B5%8B/" rel="alternate" type="text/html" title="重叠社区检测" /><published>2022-09-08T00:00:00+08:00</published> <updated>2022-09-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E9%87%8D%E5%8F%A0%E7%A4%BE%E5%8C%BA%E6%A3%80%E6%B5%8B/</id> <content src="https://wa008.github.io/posts/%E9%87%8D%E5%8F%A0%E7%A4%BE%E5%8C%BA%E6%A3%80%E6%B5%8B/" /> <author> <name>Benson</name> </author> <summary>背景 同构图是指每个节点的类型相同，那么其他属性的数据只能通过人工刻画的方式融入到节点特征或边的信息中；而异构图能把其他属性的数据直接定义到图结构中，不依赖人工，更好地刻画实际情况。 但在异构图中做社区检测时，同一个节点可能属于不同的社区，就要用到重叠社区检测算法，本文简单介绍下。 举例 LinkComm Linkcomm 是边划分（Link partition）方法中的代表，以边而不是点为基本元素进行社区划分，就能使同一个点属于不同的社区。其他原理类似 louvain 的做法。 边-边相似度的定义：两条边非公共节点的邻居节点交并比。 如果考虑边权，就用用平方和融入到公式中。 社团密度定义（社团划分的好坏）：(社区实际的边数 - 要连通的基本边数) / (全连接社区边数 - 基本边数) 按照边-边相似度大小排序进行边的合并，选出使得社团整体密度最大的分团状态作为最终状态。 跟 Louvain 对比 | - | link comm | louvain | | —- | —- | | 优点 | 按边边相似度顺序合并 | 随机 | | 缺点 | 每次合并两个社团 | 每次移动一个节点 | | 缺点 | 一次迭代求最优 | 多轮迭代直至收敛 | CPM-派系过滤 CPM是Clique Percolation(团渗透)类方法的代表，包含两步： 1.寻找 k 个节点的完全子图，每个完全子图成为一个 k-派系 2.两个k-派系如果有k-1个公共节点，那他们就属于同一个社团，按此方式连边组成的k-派系的联通分支集合，就是一个社团。 特点 1.超参k由人工设置，4-6，社团的划分结果比较依赖该值。 2.主要适用于联通子图较多的场景。 3.复杂度较高，能支持节点数量不多，要根据实际数据情况适配建图方式。 4.不能加入边权信息 SLPA 便签传播算法拓展，利用周围节点的标签给当前节点标签不断赋值迭代，直至稳定。 初始化：每个节点都属于唯一不同的标签 迭代T次：随机选择一个节点，将邻居节点的标签汇总，挑选频率最高的，作为本轮当前节点的标签。将每轮的标签结果存储下来，当需要当前节点贡献标签时，就从历史多轮的标签中，按频率抽样输出。 成团：每个节点保留占比 &amp;amp;gt; x 的标签作为当前节点的标签，可能存在多个。同一标签的节点则属于同一个社团。 特点： 1.迭代成本高 2.猜测：初始化每个节点属于不同的社区，导致比较难收敛，收敛之后精度应该很高，召回不高。 LEMON LEMON是种子扩张类算法的代表，已知部分节点和所属的社区，来扩充同属于该社区的其他节点。扩大召回的使用场景偏小，细节待了解。 特点：用来做扩召回比较合适。 参考 综述类 link communities-2010-nature link communities code link communities-2013-plosone link comm online 优化 CPM原文 CPM博客 SLPA</summary> </entry> <entry><title>人穷极一生到底在追求什么</title><link href="https://wa008.github.io/posts/%E4%BA%BA%E7%A9%B7%E6%9E%81%E4%B8%80%E7%94%9F%E5%88%B0%E5%BA%95%E5%9C%A8%E8%BF%BD%E6%B1%82%E4%BB%80%E4%B9%88/" rel="alternate" type="text/html" title="人穷极一生到底在追求什么" /><published>2022-08-29T00:00:00+08:00</published> <updated>2022-08-29T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E4%BA%BA%E7%A9%B7%E6%9E%81%E4%B8%80%E7%94%9F%E5%88%B0%E5%BA%95%E5%9C%A8%E8%BF%BD%E6%B1%82%E4%BB%80%E4%B9%88/</id> <content src="https://wa008.github.io/posts/%E4%BA%BA%E7%A9%B7%E6%9E%81%E4%B8%80%E7%94%9F%E5%88%B0%E5%BA%95%E5%9C%A8%E8%BF%BD%E6%B1%82%E4%BB%80%E4%B9%88/" /> <author> <name>Benson</name> </author> <summary>听播客，嘉宾提到，人都想在财富自由之后出去旅游、打游戏、看电影，做任何自己想做的事情，但真辞职了之后，并不能每天都做这些，日常还是需要做一些自己觉得有价值的事情，就像你不能每天都吃牛肉，但可以每天都吃米饭。 那么人财富自由之后，每天做的事情并不是旅游、打游戏，是这样一件事，每天做完并不会立即感到开心，但这件事做了一年，获得了你当初想要的价值，会让你感到愉悦，这种愉悦感是这一年的坚持带来的，就像吴军老师说的延迟满足感。 如果你现在做的事就能达到这种目的，那你跟财富自由的人没什么区别，普通人，总要在生活和理想之间做平衡，但要始终记得，做自己认为有价值的事，这或许就是我们的终极追求 播客中的嘉宾可能没有真的实现财富自由，但相比普通人要自由很多了，延伸的观点不绝对，但思路值得参考。</summary> </entry> <entry><title>重拾生活规划</title><link href="https://wa008.github.io/posts/%E9%87%8D%E6%8B%BE%E7%94%9F%E6%B4%BB%E8%A7%84%E5%88%92/" rel="alternate" type="text/html" title="重拾生活规划" /><published>2022-08-28T00:00:00+08:00</published> <updated>2022-08-28T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E9%87%8D%E6%8B%BE%E7%94%9F%E6%B4%BB%E8%A7%84%E5%88%92/</id> <content src="https://wa008.github.io/posts/%E9%87%8D%E6%8B%BE%E7%94%9F%E6%B4%BB%E8%A7%84%E5%88%92/" /> <author> <name>Benson</name> </author> <summary>坚持 2022.1月开始我会给自己制定生活计划，每天每个时间段计划要做什么，比如是否按时睡觉、什么时间看论文、看电影、健身之类的，周末和月底会统计完成率，维持生活规律，这个记录从一月坚持到了六月。 放弃 七月份工作和生活突然都有点忙，之前的规划完成率也很差，只有40%左右（不过睡觉也不会晚太多），感觉记录起来有点麻烦，也感觉习惯应该形成了，放弃了应该也没啥影响，多个原因叠加，就想放弃一下试试，然后七八两个月就没再记录，明显感觉生活状态差了很多，晚上睡觉平均在 12:30，晚上也不跑步健身了，也不看英文了，最近学了什么东西也回忆不起来了（少、零碎），有点一团糟。 重拾 今天看 tinyfool 学英文的视频的时候，就想着规划还是得捡起来，虽然完成率不高，但有一定督促作用，也能更好地把握自己的生活。 总结 翻翻之前的规划记录，竟然记了6个月，印象里以为只有4个月，果然潜意识都会低估长时间坚持的小事。记录了6个月感觉还是很不错的。 虽然断了两个月，但也算是体验吧，挺好的，体验过中断以后才能更坚定地坚持下去。</summary> </entry> <entry><title>路在何方</title><link href="https://wa008.github.io/posts/%E8%B7%AF%E5%9C%A8%E4%BD%95%E6%96%B9/" rel="alternate" type="text/html" title="路在何方" /><published>2022-08-08T00:00:00+08:00</published> <updated>2022-08-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E8%B7%AF%E5%9C%A8%E4%BD%95%E6%96%B9/</id> <content src="https://wa008.github.io/posts/%E8%B7%AF%E5%9C%A8%E4%BD%95%E6%96%B9/" /> <author> <name>Benson</name> </author> <summary>互联网增速大跌，未来路在何方？ 百度，从市值从全国第一到20名开外，肯定是有大失误的，但反过来说，他依然有400多亿的市值，头条、微信、搜狗的搜索依然没有威胁百度的份额。为什么？因为搜索技术存在壁垒，门槛高，后来者很难超车。 微信、淘宝、美团、滴滴：这些产品上技术壁垒不高，但先入为主，生态做好了壁垒就建起来了。 互联网经历了2000-2015年的飞速发展，现在的增速已经大不如以前，计算机的这个基础技术没有突破性的变革，它能给社会带来的价值基本被发掘的差不多了，无论是像百度的技术还是腾讯的服务，市场上留下的机会越来越少，当然抖音就是发生了的小概率事件。以后的状态很可能是，大产品拼细节，小产品做垂类，企业和个人，心态都要稳住，慢慢打磨细节，慢慢提升用户量。 自知水平有限，看到的内容都很表面。 个人 落实到我个人，还是要把精力集中到极少数的事情上，沉淀技术。 ✓: 模型解释性社团发现 ×: 独立开发者 ×: Web3 自我觉得我暂时认知的广度已经挺广了，这个阶段更需要的是 舍弃 的决心，力所能及的条件下，挑x个最感兴趣的方向来探索。从最近的情况看，x=1，要大大方方承认，让后把这个 1 做好。</summary> </entry> <entry><title>社区发现算法 - Louvain</title><link href="https://wa008.github.io/posts/%E7%A4%BE%E5%8C%BA%E5%8F%91%E7%8E%B0%E7%AE%97%E6%B3%95-Louvain/" rel="alternate" type="text/html" title="社区发现算法 - Louvain" /><published>2022-08-08T00:00:00+08:00</published> <updated>2022-08-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%A4%BE%E5%8C%BA%E5%8F%91%E7%8E%B0%E7%AE%97%E6%B3%95-Louvain/</id> <content src="https://wa008.github.io/posts/%E7%A4%BE%E5%8C%BA%E5%8F%91%E7%8E%B0%E7%AE%97%E6%B3%95-Louvain/" /> <author> <name>Benson</name> </author> <summary>概述 图是由节点和节点之间的边构成的一种结构，比如社交网络中人与人之间的关系、全球各个城市的交通连接情况，都可以表达成一个图结构。 社区发现是指图结构中存在聚集的一个节点集合，比如社交网络中的一个个人际圈子会组成一个个社团，在交通的图结构中，每个国家的城市集合就可以表达为一个社团。 社区发现发现算法就是依据图结构数据，来寻找聚集性社区的算法，正确的社区划分对下游业务应用有重要意义。louvain 是最常用的社区发现算法，以优化模块度为目标对群体进行划分。 模块度定义 模块度是对社区划分好坏程度的一种度量，当社区内部的点之间连边越多，社区之间的点连边越少时，模块度越大，表示当前的社区划分情况越好，公式定义如下： [Q=\frac{1}{2m}\sum_{i,j}{(A_{i,j}-\frac{k_ik_j}{2m})\delta(c_i,c_j)}] 其中 $m=\sum\limits_{i,j}{A_{ij}}$ 表示所有边权和，$A_{ij}$ 表示节点 $i$ 和 $j$ 之间的权重，$k_i=\sum\limits_{j}{A_{ij}}$ 表示与 $i$ 相连的所有边的权重和，$c_i$ 表示节点 $i$ 所在的社区，$\delta(x, y)$ 表示 $x$ 和 $y$ 是否相同，是的话为 1，否则为 0。 公式并不好直接理解，进行一定的变换可得 \(\begin{align} Q &amp;amp;amp;=\frac{1}{2m}\sum_{i,j}{(A_{i,j} * \delta(c_i,c_j) - \frac{k_i * k_j * \delta(c_i,c_j)}{2m})} \\ &amp;amp;amp;= \frac{\sum\limits_c{in_c}}{2m} - \frac{\sum\limits_c{tot_c^2}}{2m} \end{align}\) 其中 $c$ 表示社团，$in_c = \sum\limits_{i{\in}c}{\sum\limits_{j{\in}c}{A_{i,j}}}$ 表示社区 c 中所有节点的之间的边权和，$tot_c=\sum\limits_{i{\in}c}{k_i}$ 表示社区 c 中所有节点与其他节点的边权和。 模块度前一项描述的是社团内节点之间的边权，该值越大，模块度越大。第二项描述每个社团中所有节点的边权和平方，分母为常量，当所有节点（严格来说是节点的度，即边权）在不同社区中分布越均匀，第二项越小，模块度越大。（第二项重要程度与社团实际的分布情况有关，比如风控场景社团大小分布极不均匀，就会导致第二项结果偏大，模块度偏小，导致模块度的优化目标与实际场景冲突） Louvain - 模块度优化 louvain 以最大化模块度为优化目标，根据模块度公式，整个社区的模块度可以以各个社区为单位计算后求和得到，louvain算法的流程如下 初始化 将社团中每个节点都看做一个单独的社区。 阶段1：节点合并 遍历所有节点，计算当前节点脱离当前社区，且加入到邻居节点所在社区时，带来的模块度增益，把当前节点移动到增益最大的邻居节点社区中。 每次计算节点 i 从社团 D 移动到社团 C 中时，根据模块度计算公式可知，此时产生的模块度变化只与当前C、D社区相关，不与其他社区相关，因此计算成本较低，将节点 i 从社区 D 转移到 C 中带来的模块度增益为： \(\begin{align} {\Delta}Q &amp;amp;amp;= {\Delta}Q(C \rightarrow i) + {\Delta}Q(i \rightarrow C) \\ &amp;amp;amp;= \Delta Q(C \rightarrow D) \\ &amp;amp;amp;= (\frac{in_{D+i}}{2m} - \frac{tot_{D+i}^2}{2m}) + (\frac{in_{C-i}}{2m} - \frac{tot_{C-i}^2}{2m}) - (\frac{in_{D+i}}{2m} - (\frac{tot_D^2}{2m}) - (\frac{in_C}{2m} - (\frac{tot_C^2}{2m}) \\ &amp;amp;amp;= \frac{in_{D+i} + in_{C-i} - in_D - in_C}{2m} - \frac{tot_{D+i}^2 + tot_{C-i}^2 - tot_D^2 - tot_c^2}{4m^2} \\ &amp;amp;amp;= \frac{(in_{D+i} - in_D) + (in_{C-i} - in_C)}{2m} - \frac{(tot_{D}+k_i)^2 - tot_D^2 + (tot_{C}-k_1)^2 - tot_c^2}{4m^2} \\ &amp;amp;amp;= \frac{\sum\limits_{i \in D}A_{i,j} - \sum\limits_{i \in C}A_{i,j}}{2m} + \frac{k_i*(tot_C - tot_D)}{2m^2} \end{align}\) 从模块度增益公式中可以看出，节点 $i$ 与社区 D 中节点的边权比与社区 C 中的边权大的越多，越容易使节点 $i$ 转移到 D 中。第二项代表当社区 C 比社区 D 大的越多，越容易发生节点 $i$ 从 C 到 D 的转移，使得社团的整体分布更均匀。 直至节点移动不再产生增益，阶段1停止。 阶段2：社区聚合 将同一个社区的多个节点，融合为一个新的节点，社区内节点之前的权重后续不再使用，当前社区与其他社区之间的权重为两个社区所有节点的权重和，从而构建出新的图结构。 回到阶段1不断迭代，直至图结构不再产生改变。 louvain基于贪心算法实现，阶段1不断进行节点移动的尝试，复杂度可能超过 O(max(M, N))，因此整体最坏的复杂度不好预估，实际情况中的平均复杂度为 O(nlog(n))，当每一轮迭代中节点数量降低一半时，能达到平均复杂度。 整体流程如下： 优缺点 优点 平均时间复杂度较低，计算速度相对较快。 支持定义边权 包含层次结构的社团，可以依据社团大小、社团特殊属性来限制最后形成的社团。类似决策树中根据增益、叶子节点数量来限制节点分裂 缺点 多轮迭代，不支持流式系统 最差时间复杂度较大，小概率遇到边界数据时，耗时较长。 实际情况中数据分布不均匀时，模块度定义的第二项会产生一定负干扰。 优化思路 模块度的最优求解本身是个 NP 问题，即时间复杂度为 O(M!)，常规数据中无法在短时间内求到最优解。louvain就是利用贪心算法对求解过程做了一定优化，但在 louvain 的基础上，或许还可以做以下优化： 在阶段1只进行一次节点合并，保证获取的结果更优，但时间复杂度上升到为稳定的 O(M*N) 利用边介数的概念对社团中的边进行关于合并优先级的排序，边介数定义为：社团中任意两个点的最短路径通过该边的次数。边界数越大，越应该更早进行该边的合并。但边介数的计算方式需要计算任意两点的最短路径，复杂度为 O(M*N)，计算完毕后节点合并的复杂度为 O(M)，则整体复杂度为 O(M*N)。 此方案虽然整体复杂度较高，但因不需要多次迭代，相比 louvain 更容易适配到流式计算系统中，每次新增一个节点和边时，需要的计算量为 O(M)。 实际数据中社团分布不均匀时，建议降低模块度中第二项的权重。 以上思路暂未实现考证，欢迎读者实践、讨论。 参考 原始paper：https://arxiv.org/abs/0803.0476 stanford keynote：http://web.stanford.edu/class/cs224w/slides/14-communities.pdf louvain：https://towardsdatascience.com/louvain-algorithm-93fde589f58c 模块度优化：https://www.cnblogs.com/fengfenggirl/p/louvain.html</summary> </entry> <entry><title>《幸福的方法》</title><link href="https://wa008.github.io/posts/%E5%B9%B8%E7%A6%8F%E7%9A%84%E6%96%B9%E6%B3%95/" rel="alternate" type="text/html" title="《幸福的方法》" /><published>2022-08-04T00:00:00+08:00</published> <updated>2022-08-04T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%B9%B8%E7%A6%8F%E7%9A%84%E6%96%B9%E6%B3%95/</id> <content src="https://wa008.github.io/posts/%E5%B9%B8%E7%A6%8F%E7%9A%84%E6%96%B9%E6%B3%95/" /> <author> <name>Benson</name> </author> <summary>很多事情都很重要，但要抓到重点，重要性排序可能是下面这样： 做自己想做的事儿。1）找自己能做 2）从里面挑想做的 3）挑非常想做的 4）挑最想做的 获得快乐、幸福、意义 获得金钱、别人的认可 大多事情只能短暂影响生活节奏，比如晋升涨薪、工作不顺、感情不和。更要关注的是能长期提升幸福值的事情，比如1 有具体的方法可以帮助提升幸福感 每天记下来让自己快乐的事和不快乐的事，多做快乐的，少做不快乐的。 记录每天的时间都花费在哪些事情上了。 值得长期投入的事情 健康 学一门外语 学习</summary> </entry> <entry><title>读《人类简史》有感</title><link href="https://wa008.github.io/posts/%E8%AF%BB-%E4%BA%BA%E7%B1%BB%E7%AE%80%E5%8F%B2-%E6%9C%89%E6%84%9F/" rel="alternate" type="text/html" title="读《人类简史》有感" /><published>2022-07-31T00:00:00+08:00</published> <updated>2022-07-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E8%AF%BB-%E4%BA%BA%E7%B1%BB%E7%AE%80%E5%8F%B2-%E6%9C%89%E6%84%9F/</id> <content src="https://wa008.github.io/posts/%E8%AF%BB-%E4%BA%BA%E7%B1%BB%E7%AE%80%E5%8F%B2-%E6%9C%89%E6%84%9F/" /> <author> <name>Benson</name> </author> <summary>缘由 偶尔听同事提起来这本书，就买来读了读。 物种灭绝的罪魁祸首 读了大概1/4的样子，读到人类才是导致物种灭绝最严重的罪魁祸首，当人类踏足了澳大利亚，美洲，都在同时间内发生了大量的物种灭绝，比如双门齿兽、地懒、长毛象，这一类生物体型庞大，生育周期长，只要定期猎杀就能导致出生率&amp;amp;gt;死亡率，几千年后避免不了物种灭绝。 物竞天择 仔细想想，其实这也是物竞天择、适者生存的结果，当人类和长毛象生活在一个生态里，人类为了进食和自我保护，必然要猎杀他们，从而引发物种灭绝。但其实在现代，人类的安全和生存都基本能得到保障，少数人开始考虑物种多样性、保护濒临灭绝东西的问题。但同时，人类的很多行为依然会导致其他物种的生存困难，比如工业污染环境，海洋污染，为了满足人类的欲望，或者说为了人类进步，短期牺牲了环境，缩小了其他生物的生存空间，那么理想中良好的生态是怎样的呢？ 人口爆炸 我觉得造成如今局面的问题在于人类的过度繁衍，人类数量太多，导致生存需要的资源就更多，压缩了其他物种的生存空间，所以正常生态下人口数量应该更少，才能和其他物种和谐共存。书中提到衡量一个物种进化好坏的一个指标是其DNA结果被复制的数量，这明显是个很极端的指标，人类的智慧已经足够称霸地球了，不需要再靠数量来展示它的高度进化。 和谐共存 想到一个UP主说在新加坡的窗外经常能看到松鼠，这在国内几乎是不可能的，或许就因为国内人口密度太大，生活中已经没有其他物种的生存空间了。 想象一下，如果生态丰富，我们每天都能接触到各种不同的动物，就想虹猫蓝兔七侠传里森林里那样，也是很美好的！</summary> </entry> <entry><title>妙峰山骑行</title><link href="https://wa008.github.io/posts/%E5%A6%99%E5%B3%B0%E5%B1%B1%E9%AA%91%E8%A1%8C/" rel="alternate" type="text/html" title="妙峰山骑行" /><published>2022-07-30T00:00:00+08:00</published> <updated>2022-07-30T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%A6%99%E5%B3%B0%E5%B1%B1%E9%AA%91%E8%A1%8C/</id> <content src="https://wa008.github.io/posts/%E5%A6%99%E5%B3%B0%E5%B1%B1%E9%AA%91%E8%A1%8C/" /> <author> <name>Benson</name> </author> <summary>缘由 买公路车一个月了，只骑过一次，第一次去了故宫，来回70公里并不觉得特别累，想挑战下妙峰山，就约朋友上路了。 出发 从住的地方到妙峰山单程57公里，但妙峰山路段本身单程21公里，主要是离得太远了。 9.30出发，在公司碰头出发，骑20公里的时候遇到了爬坡，曾一度以为我们已经在上山了，因为那个路段的坡太像爬山了，爬的途中差点中暑，眼前的东西一片模糊，已经看不太清楚了，还产生了掉头回去的想法，但休息了一会儿之后感觉能打的自己又回来了，就继续往前走。到妙峰山之前休息了两次，都是在爬坡之后休息的，爬坡比想象的累多了，干蹬不走，就跟轮胎没气了似的，体会到了什么叫被骑车榨干。 上山 到了妙峰山门前，听热心大爷说，前半段7公里是缓坡，后半段是陡坡，当时我就觉得大概率是爬不了后半段了。补充了点水和食物，就出发了，前半段确实还好，坡不多，也不是连续的坡，会带点平路，进山之后能贴着山脚骑，景色还是很不错的，当明显感觉到全是陡坡的时候，就知道到了大爷说的后半段了，连续的陡坡，不怎么见平路，陡坡骑了一公里就不行了，我申请好几次休息，休息之后也只能骑一小会儿，就这样断断续续休息了三四次，到了骑行服务区，我也知道自己已经到极限了，也还得留体力骑回去，我就不继续往上走了，让朋友继续往上骑，我在服务区等他。服务区确实很舒服，大概30度的样子，凉风在呼呼吹，阳光也不是很强烈，在休息区坐着发呆就非常舒服，大概等了20分钟，朋友回来了，继续往前骑了三公里，也顶不住了，一起休息了会儿就往回赶了。 下山 下山超级爽，从海拔400米下到200米，速度最快飙到了45km/h，还是很顶的。 山脚下看到三个人在把他们的公路车车装到轿车上，准备回去，看他们的公路车长相很特别，搜了下，19w/辆，都算是很专业的选手了吧，还挺吃惊的，世界之大，真的有各种各样的人。大多时候我们想象中世界的样子都只是管中窥到的豹罢了。 返途 返途的最后15公里，都是平路，但明显体力不支了，腿也没有力气，跟出发时完全不是一个状态，回来的时候已经5点了，这一趟骑了一天。 感想 这次去的晚了，有点晒，因为手套漏了一个洞，手背上被都晒黑了一个椭圆，看起来特别搞笑。10点的时候就看到好多热骑完往回赶了，应该是早鸟局，下次去得早点出发了。 好久没有体会过耗尽体力的感觉，特别是在快中暑的那一次，离生理极限又近了一步。整体来说耗尽体力还是非常累的，不适合常做，慢慢锻炼身体吧，提升耐力，下次有空了再去挑战。</summary> </entry> <entry><title>黑客帝国</title><link href="https://wa008.github.io/posts/%E9%BB%91%E5%AE%A2%E5%B8%9D%E5%9B%BD/" rel="alternate" type="text/html" title="黑客帝国" /><published>2022-07-28T00:00:00+08:00</published> <updated>2022-07-28T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E9%BB%91%E5%AE%A2%E5%B8%9D%E5%9B%BD/</id> <content src="https://wa008.github.io/posts/%E9%BB%91%E5%AE%A2%E5%B8%9D%E5%9B%BD/" /> <author> <name>Benson</name> </author> <summary>在公司专心工作，面对27寸大屏一顿操作，突然觉得做的事情似曾相识，以前做过类似的事情，但又实在想不起来了，脑子中突然蹦出了黑客帝国电影，如果我们都是机器人，那我此时此刻就是发生了内存泄露类的错误，赶紧记忆下来，防止这段记忆消失。以后会不会有一天，以人类的能力也能创造出类似地球似的一个生态，生态里的”人类”再不断进步、成长，创造出新的地球生态……。 那么，我们所在的世界，可能真的是一个别人普通的玩具。 2022.7.28 14:57</summary> </entry> <entry><title>特征交互</title><link href="https://wa008.github.io/posts/%E7%89%B9%E5%BE%81%E4%BA%A4%E4%BA%92-Feature-Interaction/" rel="alternate" type="text/html" title="特征交互" /><published>2022-07-10T00:00:00+08:00</published> <updated>2022-07-10T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%89%B9%E5%BE%81%E4%BA%A4%E4%BA%92-Feature-Interaction/</id> <content src="https://wa008.github.io/posts/%E7%89%B9%E5%BE%81%E4%BA%A4%E4%BA%92-Feature-Interaction/" /> <author> <name>Benson</name> </author> <summary>介绍 特征交互是要衡量两组特征之间的相关性，即在特征1 和特征2 分别取某个值时，对模型结果是否有特殊的影响。 基本假设：当两个特征完全独立，即没有任何相关性时，我们认为$PD_{jk}(j,k)=PD_j(j) + PD_k(k)$，特征有一定相关性时，等号不成立。那么就可以用等号前后的两个函数的差异，衡量特征之间的相关性。 那么就可以用一下公式来衡量两个特征的相关性： \(H_{j,k}^2=\frac{\sum_{i=1}^n[PD_{j,k}(x_{j}^{(i)},x_{k}^{(i)})-PD_j(x_{j}^{(i)})-PD_k(x_{k}^{(i)})]^2}{\sum_{i=1}^nf(x)^2}\) 使特征 k = all - j，就可衡量特征 j 与其他所有特征的相关性。 案例 1）计算每个特征与其他所有特征的相关性，挑出相关性最强的特征。 2) 从第一步挑出的特征中，两两计算相关性，挑出相关性最强的组合。 优缺点 优点 可以统计任何形式的特征关系 可以统计 &amp;amp;gt;= 3 维的特征关系 缺点 https://christophm.github.io/interpretable-ml-book/interaction.html</summary> </entry> <entry><title>特征工程</title><link href="https://wa008.github.io/posts/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/" rel="alternate" type="text/html" title="特征工程" /><published>2022-07-07T00:00:00+08:00</published> <updated>2022-07-07T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/</id> <content src="https://wa008.github.io/posts/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/" /> <author> <name>Benson</name> </author> <summary>1. 数据清洗 缺失值处理：1）缺失。2）填充0、均值、中位数 无效值：1）只有一个取值。2）无区分度。 2. 特征构建 2.1 单特征处理 分类特征：label encoder，oneHot encoder，target encoder 特征衍生：绝对值、平方、对数。对树模型作用不大。 特征分箱：等频、等距、卡方 时间：年、月、日、时、分； 2.2 特征组合 统计特征：计数、最大、最小、均值、求和、方差、中位数 多项式特征：特征组合，组合的特征数量随 degree 指数增长，可参考 sklearn.preprocessing.PolynomialFeatures N-to-N：核函数，比如直角坐标转极坐标 时序特征：密度、连续上升/下降次数 文本特征：NLP 图像特征：CV 特征扩散：引入拓扑关系 2.3 不同的特征工程方法在不同模型上的表现 本文对比了不同模型构造不同特征的能力。 模型：DNN, SVR, RF, GBM 特征：计数、求和、标准差、剪发、分布、log、max、多项式、指数、二元方式根的距离、r_diff、r_poly、比例、平方根、欧式距离。 四种模型构造 r_diff 特征的能力都最弱 $$ y=\frac{x_1-x_2}{x_3-x_4} $$ 表现最好的是DNN，学习能力最差的依次是 r_diff, max, dev SVR表现最差，但适合跟DNN搭配。 RF和GBM表现非常类似 3. 特征选择 过滤法：单特征看区分度，IV值 包装法：不断加入/删除特征，看模型指标的变化 嵌入法：看特征权重，可以考虑引入正则。 模型相关：数模型看分裂增益 稳定性：直接影响模型稳定性，考虑以正则的方式加入模型 解释性 Exploratory Data Analysis 特征相关性：主成分分析；相似度；聚类 4. 参考 DONE 特征工程的10个案例：https://www.kdnuggets.com/2018/12/feature-engineering-explained.html polynomial feature：https://machinelearningmastery.com/ polynomial-features-transforms-for-machine-learning/ spark 特征工程：提供了一些特征分桶、特征标准化的一些接口 featuretools：特征扩展包，通过名字描述特征勾走Exploratory Data Analysis autogluon：自动机器学习库 神秘网友：https://hg95.github.io/sklearn-notes/Chapter5/%E8%BF%87%E6%BB%A4%E6%B3%95%E6%80%BB%E7%BB%93.html TODO 潮汐实验室：https://chengzhaoxi.xyz/19ff6f0a.html</summary> </entry> <entry><title>累计局部效应图</title><link href="https://wa008.github.io/posts/%E7%B4%AF%E8%AE%A1%E5%B1%80%E9%83%A8%E6%95%88%E5%BA%94%E5%9B%BE-Accumulated-Local-Effects-(ALE)-Plot/" rel="alternate" type="text/html" title="累计局部效应图" /><published>2022-07-05T00:00:00+08:00</published> <updated>2022-07-05T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%B4%AF%E8%AE%A1%E5%B1%80%E9%83%A8%E6%95%88%E5%BA%94%E5%9B%BE-Accumulated-Local-Effects-(ALE)-Plot/</id> <content src="https://wa008.github.io/posts/%E7%B4%AF%E8%AE%A1%E5%B1%80%E9%83%A8%E6%95%88%E5%BA%94%E5%9B%BE-Accumulated-Local-Effects-(ALE)-Plot/" /> <author> <name>Benson</name> </author> <summary>从PDP优化 M-plots PDP 把当前特征值代入所有样本中，会出现部分样本在实际情况中不可能存在的问题，于是就有 M-plots，计算当前特征值对应的预测期望时，只考虑数据集合中存在的样本。 ALE ALE 取同一区间内，预测值的变化作为特征的影响，不同区间累计，构建特征和预测值之间的关系。与 M-plots 不同的是，ALE取预测值的变化作为特征影响，而不是取预测值的均值。 影响：特征在一个小区间内不同取值，模型预测值的差异，或者说预测对特征的导数，作为当前区间的影响。 局部：差异定义在当前的小区间内，只具有局部意义 累计：将影响累计起来，构建特征-预测之间的散点图。 使用 单特征 特征划分区间，针对当前特征区间的样本，将特征值分别改为区间最大值和最小值，进行预测，把预测值的平均值求差，作为当前区间的影响。 两特征 当描述两个特征时，ALE描述特征2在特征1的基础上，对预测值的影响，下图为例，用 $(f(d) - f(c)) - (f(b) - f(a))$ 作为特征 2 在特征 1 的基础上对预测值的影响。 当特征1和2相互独立，该值依然和预测值保持线性关系，当不独立时，能在消除相关性之后考虑特征-预测值之间的关系。 类别型特征 类别特征和数值特征不同的是没有顺序，那给他们排一个顺序就好了。 方法：针对类别特征中任意两个取值，根据其他特征的分布判断这两个取值的相似度，即可以获得类别特征两两取值的相似度矩阵，可以通过 multi-dimensional scaling 降维，降低到一维，从而对类别特征做了排序。 举例：现在对季节这个类别特征做数值化，可用的数值特征为温度 取季节中 春、夏 两个取值，根据「春」和「夏」对应的温度分布计算他们的相似度 同时计算季节中 春夏秋冬四个取值任意两个之间的相似度，得到季节之间的相似度矩阵 对矩阵降维到一维，完成类别特征的数值化 案例 案例1：右下角的极端情况，会出现 PDP 获取了实际中不存在的样本，而 ALE 展示的效果就很好 案例2：特征之间用线性回归做预测，以衡量特征的相关性。（为什么突然提这个？ 案例3：特征相关性较高，单特征看到的影响并不置信。 特点 优点 ALE 是无偏的，即使特征之间存在相关性，也是有效的。 ALE 效率更高，时间复杂度 O(n)，PDP复杂度应该在 O(n*m) 量级 解释性很清晰：1）表达预测值的相对变化。2）以0为中心，每个点都是相对平均值的贡献度。3）2D ALE 显示特征间的关系。 缺点 局部：不同区间所用到的样本都不相同，解释具有局部性。而且在特征极度相关时，单维度的 ALE 是无效的。 和LR不吻合：当特征相关时，ALE 的解释数据和LR的参数不吻合？ 波动大：但划分的区间数据量过多，ALE曲线波动较大，当区间数量较少，结果并不置信。没有完美的方案。 没有ICE曲线：PDP 有ICE去曲线。ICE曲线是啥？ Second-order effect plots can be a bit annoying to interpret 实现更复杂且不直观 特征强相关时，仍然不好解释：分析两个特征同时变化时才更有意思，而不是单特征的变化？ 特征不相关时，PDP更好 缺点很多，但使用法则：使用ALE而不是PDP。emmm 应用 PDP：考虑所有样本，包括实际中不存在的样本，比如房价问题中，房子大小=10平米，房间数量=100个。 ALE：仅考虑数据集中存在的样本，数据集取决于你认为适用的集合。 参考 https://christophm.github.io/interpretable-ml-book/ale.html https://github.com/SeldonIO/alibi https://github.com/christophM/iml https://github.com/blent-ai/ALEPython” 中文翻译：https://github.com/MingchaoZhu/InterpretableMLBook 原文github：https://github.com/christophM/interpretable-ml-book</summary> </entry> <entry><title>模型解释性-PDP</title><link href="https://wa008.github.io/posts/%E6%A8%A1%E5%9E%8B%E8%A7%A3%E9%87%8A%E6%80%A7-PDP/" rel="alternate" type="text/html" title="模型解释性-PDP" /><published>2022-06-26T00:00:00+08:00</published> <updated>2022-06-26T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E6%A8%A1%E5%9E%8B%E8%A7%A3%E9%87%8A%E6%80%A7-PDP/</id> <content src="https://wa008.github.io/posts/%E6%A8%A1%E5%9E%8B%E8%A7%A3%E9%87%8A%E6%80%A7-PDP/" /> <author> <name>Benson</name> </author> <summary>介绍 理想定义 PDP(Partial Dependence Plot) 局部依赖图，定义单特征和目标之间的关系，即函数 $\hat{f}X(x_S)$ \(\hat{f}_S(x_S)=E_{X_C}[\hat{f}(x_S,X_C)]=\int{\hat{f}(x_S,X_C)dP(X_C)}\) $x_S$ 标识当前特征 $S$ 的特征值，$X_C$ 表示出了 $S$ 以外的其他特征，$E{X_C}$ 表示给定 $X_S$ 时，模型 $\hat{f}$ 对特征 $X_C$ 的期望。 约束在特定的数据集上 求期望需要枚举 $X_C$，但枚举所有值算力消耗过高，而且某些特征取值的组合不一定有意义，因此取特定数据集中的特征值，模型 \(\hat{f}_S(X_S)=\frac{1}{n}\sum_{i=1}^n{\hat{f}(x_S, X_C^{(i)})}\) 当分析的单特征类型为类别型特征，直接看不同取值即可。 至此，就可以根据PDP对模型的单个特征做出人为可理解的解释。 单值衡量特征重要性 有了PDP的特征-结果关系函数 $\hat{y}(x)$ 之后，对数值型特征，可以将方差作为特征重要性的衡量。 对类别型特征呢？可以将 $\frac{max(f(x)) - min(f(x))}{4}$ 作为方差的近似。因为在正太分布中，95%的数据都满足 $x {\pm} 2 * var = mean$ 优点 直观 容易应用 适用于任何黑盒模型 缺点 PDP只能做 &amp;amp;lt;=2 个特征的解释，严格说这不是方法的缺点，而是人类的理解能力只能在 &amp;amp;lt;=2 维度上 PDP依赖数据分布，可以加个散点图来解决 有特征独立的假设 某些影响可能会被隐藏：多类数据特征解释性相反，合并在一起就会变现为特征没有作用。其实和特征独立的假设是一个问题。 应用 scikit-learn.PDPBox 参考 https://christophm.github.io/interpretable-ml-book/pdp.html</summary> </entry> <entry><title>模型解释性</title><link href="https://wa008.github.io/posts/%E6%A8%A1%E5%9E%8B%E8%A7%A3%E9%87%8A%E6%80%A7/" rel="alternate" type="text/html" title="模型解释性" /><published>2022-06-22T00:00:00+08:00</published> <updated>2022-06-22T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E6%A8%A1%E5%9E%8B%E8%A7%A3%E9%87%8A%E6%80%A7/</id> <content src="https://wa008.github.io/posts/%E6%A8%A1%E5%9E%8B%E8%A7%A3%E9%87%8A%E6%80%A7/" /> <author> <name>Benson</name> </author> <summary>概览 模型解释性作为整个系统的最上层，从模型中提取信息，供人来理解。 解释性的作用 业务需要，保证结果可归因。 提升模型效果。 利于达成AGI（通用/强人工智能） 总得来说，解释性的作用还是为了提升最终的效果。 参考 模型解释性：https://christophm.github.io/interpretable-ml-book/ 神经网络解释性：http://colah.github.io/posts/2014-03-NN-Manifolds-Topology/</summary> </entry> <entry><title>Web3 入门科普</title><link href="https://wa008.github.io/posts/Web3-%E5%85%A5%E9%97%A8%E7%A7%91%E6%99%AE/" rel="alternate" type="text/html" title="Web3 入门科普" /><published>2022-06-04T00:00:00+08:00</published> <updated>2022-06-04T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/Web3-%E5%85%A5%E9%97%A8%E7%A7%91%E6%99%AE/</id> <content src="https://wa008.github.io/posts/Web3-%E5%85%A5%E9%97%A8%E7%A7%91%E6%99%AE/" /> <author> <name>Benson</name> </author> <summary>背景 web1: 网民只能从网络上读内容 web2: 网民可以在网络上写内容 web3: 网民将拥有内容所有权，类似版权。 比特币的兴起引发了 web3 的热潮。 特点 信任 利用签名 + 区块链的方式，保证网民的操作是可信的，比如交易场景，可以用程序来替代可信任的第三方公司。 去中心化 网民创造的内容不再由巨头（平台）拥有，网民有所有权，可以自由创作、修改、删除，获得全部的收益。 去中心化的服务谁来运行？ 短期：已有的项目还是私有化 中期：社区共同投票维护，所有代码开源，集资部署在巨头的服务器上。比如谷歌已经起项目支持 web3 B端服务了。 长期：使每个网民的电脑都有运行服务的能力。 怎么跨链 怎么把相同用户在不同产品（区块链）上的内容结合起来，感觉需要指定一种公共协议。 跨链才能将不同的产品结合起来，从而构建丰富的生态。 加密货币怎么跟现实货币换算 肯定是需要跟现实换算的，但稳定币暴跌，冲击信心，还不了解其逻辑。猜测是生态不成熟引发的问题。 使用场景猜测 1. 内容分发 当作者拥有内容的所有权后，就可以获得内容产生的所有收益。 现有模式：作者将内容发不到今日头条、百家号、B站、Youtube等平台上，产生的收益由平台和作者瓜分。 参考Medium：Medium的文章分会员和非会员两种，作者在发布时可以二选一，会员文章只有付费订阅的会员才能看，根据会员观看的不同 会员文章时长按比例将收益分配给不同的作者。其中Medium肯定要抽一部分收益维护平台运转。之前网上看到的，未证实。 理想模式：如果 web3 系统能替代 Medium，不断降低项目的运行成本，就能将更多的收益瓜分给作者，使作者的收益尽量达到上限，从而 刺激更多的创作，达成更健康的生态。 本质：通过去中心化，降低巨头三方的权利和收益，从而提升作者收益，丰富生态。 案例：https://mirror.xyz/ 2. 系统工具 将一个系统工具内容拆解，创作了不同模块的作者获取对应的分成。 现有模式：以微信APP为例，为这个APP做工作的人，只是员工，公司具有微信的所有权，员工只是用时间换取了工资。 理想模式：完美计算什么人对微信APP做了多少贡献，根据微信产生的收益，分成给这些用户。 难点：不好计算贡献。现有模式下，贡献的大小由企业自上而下决定，也没什么大问题，大产品的成功与否原因过于复杂，代码在其中占的比重不多，其他原因很难自动化衡量，所以这个项目感觉搞不了。 结论：过于复杂的产品无法自动化衡量贡献度，仅限于比较简单的项目可以拆分来做。 参考 MSD中文白皮书：https://www.msd.best/pdf/MSD_zh.pdf a16z英文白皮书：https://a16z.com/wp-content/uploads/2021/10/How-to-Win-the-Future-1.pdf 内容分发项目：https://mirror.xyz/ Solidity：为实现智能合约而创建的高级编程语言</summary> </entry> <entry><title>总结 2022.4</title><link href="https://wa008.github.io/posts/%E6%80%BB%E7%BB%93-2022.4/" rel="alternate" type="text/html" title="总结 2022.4" /><published>2022-05-31T00:00:00+08:00</published> <updated>2022-05-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E6%80%BB%E7%BB%93-2022.4/</id> <content src="https://wa008.github.io/posts/%E6%80%BB%E7%BB%93-2022.4/" /> <author> <name>Benson</name> </author> <summary>整体 月度OKR完成 32% 健身：4次 博客：1篇 ACM：1场 电影：4个 早睡早起：10/26=38% 早睡早起没有执行好，白天看手机比较多，主要还是手机的问题。 想法 为什么人喜欢晚睡晚起？ 睡觉代表一天的结束，我们都喜欢在结束之前尽量再做些事情，抓住一天结束的尾巴。这种心理源自我们对时间规划的不准确，如果要规划这一天，又好像生活比较机械化，失去了未知的快乐。但”客观”来讲，人做的大部分事情都是可预测的，只有少量的事情是未知的，比如旅游、遛弯。所以规划大部分可预测的事情就行，比如上午要看 paper，看书，学会从做的事情中寻找快乐，规划和快乐并不冲突。 人又喜欢晚起，这完全就是拖延症的表现了，至少我自己是这么想的：”反正一天很长，多刷这一会儿手机也没什么” “不可改变”的社会问题是不是要关注？ 阮一峰的一个周刊中聊到，面对疫情、裁员、战争这种我们不可改变的事情，应该”随他去”，安静地沉淀自己就好。 这些信息看多了会突增焦虑，”普通人” 很难改变什么，但总觉得还是得适当了解，这些 “大事儿” 的影响难免会在一段时间后波及自己。如果站在道德制高点，那就更得了解下了。 国内的互联网巨头会变成传统行业的样子吗？ 短期看是存在某些行业优于其他行业，比如15年互联网优于传统行业，但长期看，由于供需关系，好的行业从业者越来越多，差的行业从业者越来越少，大家都会趋于普通水平。 最近caoz的一篇文章，表达”创新就是试错”这个观点，感觉很受启发。硅谷当年为什么那么多人提”财富自由”这个词，因为成功的收益是巨大的，也因此，投资者愿意投入大量的资金去刺激企业试错，用高成本投资低概率高收益的事情。15年之前的国内互联网就是硅谷的缩版。现在大家发现这些试错成功的概率变低了，收益也没以前明显了，就开始缩减成本，也就是我们看到的裁员，这么搞下去也比较像朝着传统行业的路子走。 - 互联网 传统行业 优点 工资高 工资低 缺点 工时长，不稳定 工时短，稳定 那会不会几年以后，互联网行业工时也短了，工作也稳定了呢？ 本来以为是会的，但细想感觉不可能。因为互联网公司的收益率过高，相比传统行业他可以付出更多成本刺激员工工作，工资高了，工时和稳定性就很难有保障了。 作为企业，他有能力刺激员工工作；作为员工，想要拿高工资，就要付出时间和稳定性的代价；客观来看很合理，而且这类企业的存在也给从业者提供了更多的选择。至于我们平常的抱怨，只不过是没有深入思考的主观心理活动罢了。 自我激励与满足感的冲突 每想到这世界上有大量的知识我不知道，有大量的 paper 我没看，就会很不爽。 即使花了大量时间看了一篇 paper，也觉得杯水车薪，带来的满足感并不多。 以后应该更关注自己学到的东西，尽量完全接受”世界上的知识是学不完的”这个观点。 多关注当下在做的事情 Whatever you do, do it 100%. When you work, work. When you laugh, laugh. When you eat, eat like it’s your last meal –《绿皮书》 写东西真是挺话时间的 比如这篇博客写了一个小时 创新是建立在对已有事物大量的重复之上的 毕业之后，准确的说是高中毕业后，很少会重复的读同一段文字，很少重复推到同一段公式。 没有了重复，也就没有了对知识的熟练掌握，太浮躁了，不足以支撑自己重复阅读、思考，切忌。 下个月 早睡早起，享受早起的快乐 从当下做的事情中获得满足感</summary> </entry> <entry><title>孪生网络做 query 相似度任务</title><link href="https://wa008.github.io/posts/%E5%AD%AA%E7%94%9F%E7%BD%91%E7%BB%9C%E5%81%9A-query-%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%BB%BB%E5%8A%A1/" rel="alternate" type="text/html" title="孪生网络做 query 相似度任务" /><published>2022-05-31T00:00:00+08:00</published> <updated>2022-05-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%AD%AA%E7%94%9F%E7%BD%91%E7%BB%9C%E5%81%9A-query-%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%BB%BB%E5%8A%A1/</id> <content src="https://wa008.github.io/posts/%E5%AD%AA%E7%94%9F%E7%BD%91%E7%BB%9C%E5%81%9A-query-%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%BB%BB%E5%8A%A1/" /> <author> <name>Benson</name> </author> <summary>起因 工作中做一个 query 相似度任务时，偶然看到孪生网络的一片经典论文，《Learning Text Similarity with Siamese Recurrent Networks》，用来做同类文本预料的相似度任务是极好的。 介绍 这篇文论主介绍孪生网络的基本思想，对于 query 相似度任务（同类型实体的相似度任务，比如图片、语音），可以设计一个网络结构 net，将两个 query 都经过相同的 net 投影到对应的空间，再该空间中对 net(x) 和 net(y) 求取相似度， net(x) 可以看到 x 在高纬空间的表征。 原 paper 中用 BiLSTM 网络结构来表征 query，模型结构如下： 实验 数据取自百度千言的文本相似度评测数据 bq_corpus 数据集。 该论文的 loss 比较像 MSE 的变种，判定正负例的阈值对超参 m 有明显影响，从试验结论看该值设置的越小越好。 版本 训练集acc 验证集acc 说明 bert 0.979 0.841 bert基准版本 mse m = 0.4 0.60 0.59 原loss mse m = 0 0.723 0.724 降低超参m比较有用 mse m = 0 学习率3e-4 0.81 0.758 调整学习率，最优版本 norm + cos 0.722 0.721 norm 没啥效果 BCEloss 0.637 0.641 修改loss效果不大 |-|-|-|- 以上 acc 的预测阈值为 0.5，即预测值 &amp;amp;gt; 0.5 算正例，否则算负例。 小结论如下： 从实验数据看，需要根据预测阈值，来调整一个合适的超参 m，本文是越小越好。 设置合适的学习率，参考别人的结论设置 3e-4 较好，本文没有试验很多。 做cos之前添加 norm，没有明显提升，猜测是与具体的语料相关。 修改 loss 为 -log 损失函数，也没有明显提升，难道不应该梯度越大，收敛的越好吗？这个很奇怪。 孪生网络与 bert 验证集相差 9 个点左右。 结论 孪生网络不同于 bert 把两个 query 合并在一起求二分类任务，定义了另一种解决相似度任务的方式。虽然从时间上看孪生网络的提出时间要更早一些。 另一个角度看孪生网络，更像是把一个构造 query 向量的任务，可以从这个角度寻找更多有意思的解法。 进阶 很多用 CNN 来做 query 理解的，很有意思，值得学习下 参考 [1]、https://aclanthology.org/W16-1617.pdf [2]、https://mp.weixin.qq.com/s/UDG5z4lcOiRquRN0H6ELCQ</summary> </entry> <entry><title>学习 2022.4</title><link href="https://wa008.github.io/posts/%E5%AD%A6%E4%B9%A0-2022.4/" rel="alternate" type="text/html" title="学习 2022.4" /><published>2022-05-31T00:00:00+08:00</published> <updated>2022-05-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E5%AD%A6%E4%B9%A0-2022.4/</id> <content src="https://wa008.github.io/posts/%E5%AD%A6%E4%B9%A0-2022.4/" /> <author> <name>Benson</name> </author> <summary>1、dropout 和 cos 组合使用带来的问题 孪生网络中，如果 dropout 这一层用于 cos 计算相似度的话，预测阶段的输出值会比训练阶段的值更大，相差一个 dropout 值：$sim_score_{predict} = sim_score_{train} / dropout$ 这是训练和预测阶段 dropout 用法不一致带来的问题。 但这个问题包含一个假设：即 dropout 层所有神经元大小相差不多，正常用法中训练和预测要保持一致性也需要这个假设。 2022.4.3 2、Radam 和 adamW Radam：adam + warmup，动态调整学习率，在训练初期降低学习率，解决 adam 总是找到效果不好的局部最优解的问题。 adamW：adam + 参数L2正则，取名跟 Radam 比较容易搞混。 2022.4.3 3、Xavier 参数初始化 Xavier 参数初始化能够保证神经网络输入层和输出层的方差保持一致，使得输入空间和输出空间的稀疏程度相似，梯度更加稳定。 图片来自：https://cs230.stanford.edu/section/4/ 因为输入层和输出层维度不同，取平均，即 var=2/(dim_in + dim_out) 问题：那么，应该保证参数矩阵的哪一个维度 var=2/(dim_in + dim_out)呢？ 我觉得保证 dim_in方差一定即可，但使用pytorch做实验发现两个维度的方差都是固定的该值，何必多此一举呢？很奇怪。 pytorch 实验代码 import torch import torch.nn as nn torch.manual_seed(2022) w = torch.empty(100, 200) x = nn.init.xavier_normal_(w) var = torch.var(x, axis = 0) print (var.shape, torch.mean(var), torch.std(var), &amp;#39;\n&amp;#39;) var = torch.var(x, axis = 1) print (var.shape, torch.mean(var), torch.std(var)) output: torch.Size([200]) tensor(0.0067) tensor(0.0010) torch.Size([100]) tensor(0.0067) tensor(0.0007) reddit提问被删，stackoverflow和知乎还没人回复，好惨。https://stackoverflow.com/questions/71747402/the-variance-of-which-dimension-is-2-dim-in-dim-out-in-xavier-parameter-init 苏神另外一个视角：从几何的角度看初始化策略，以一定均值和方差初始化参数矩阵时，参数矩阵是一个正交矩阵，正交矩阵一个重要的特点就是保证向量的模长不变，即 $||Wx||^{2}=||x||^{2}$，证明了以一定均值和方差初始化参数的有效性。但 Xavier 参数初始化的目标是保证输入和输出向量的方差不变，苏神几何视角是保证模长不变，当向量均值为0时，方差和模长只相差一个常数因子，目标是等价的，很棒。 https://spaces.ac.cn/archives/7180 2022.4.5 4、DEBERTA 论文：DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION 源码： 1、self-attention 中求注意力向量时，将上下文关系和相对位置的关系分开计算 atenntion 注意力分数。 2、注意力增强：decode 中，将绝对位置编码加入到 Transformer 块之后、softmax 之前。 3、样本干扰：常规的对抗样本干扰比较类似样本增强的做法，微调样本使得模型保持结果不便，在NLP任务中，我们微调 embedding 层而不是输入样本，但随模型参数量增大（embedding 层增大？），干扰操作带来的抖动就越严重。该论文发现在 embedding 层进行 Layer Normalization 之后加入干扰，对模型效果提升比较明显，特别是在 large 模型中。 2022.4.16</summary> </entry> <entry><title>Imagen</title><link href="https://wa008.github.io/posts/Imagen/" rel="alternate" type="text/html" title="Imagen" /><published>2022-05-31T00:00:00+08:00</published> <updated>2022-05-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/Imagen/</id> <content src="https://wa008.github.io/posts/Imagen/" /> <author> <name>Benson</name> </author> <summary>背景 Imagen 是谷歌做的一个输入文本，自动生成对应图片的工具，突然看到 Imagen 的宣传，感觉 UGC 离现实生活越来越近了。 之前 GPT-3 生成的一篇文章登顶 hacknews，引发一波热潮，但总觉得文本的 UGC 落地感觉还比较难，因为文本的理解成本高，审核成本高，但图像，是一个生成成本高、理解成本低的内容，特别是在视频横行的现在，现在生成成本可以让模型自动化来做了，落地应该也不远了。 机器自动生成文本或许不能完全替代摄影师，但应该还是会抢一些摄影社的饭碗，普通网民应该是没办法区分图片是自动生成的还是真人拍摄的，自动生成的效率一定比真人拍摄高，长久以往，网上大量的图片可能都是机器生成的了。 或许过几天就会有个 text-to-video 的论文出来。 论文 文本表征 通过语言模型将本文信息用 Embedding 表征，论文中用冻结的 T5 来做文本理解和表征。 作者发现提升 LM 的复杂度，相比提升扩散模型的复杂度能给 text-to-iamge 任务带来更多提升，说明该任务的瓶颈在于文本理解，也从一定角度说明文本理解还有一些提升空间。 扩散模型 利用扩散模型将 Embedding 生成为图像，进一步提升清晰度，输出结果。 扩散模型跟大名鼎鼎的 GAN 同属于生成网络，通过N步迭代，每一步以特定高斯分布采样噪音，添加到原始图像上，使其逐步变为 Embedding 隐变量，训练参数主要是生成噪音的正态分布的均值和方差。 原文还提出动态阈值的方法提升图片的真实度和清晰度；提出更简单高效的扩散模型结构 Efficient U-Net；在已有评测数据上达到 sota；提出新的评测数据。 出于安全和滥用的考虑，谷歌没有对外开源代码和模型工具。 参考 https://www.zhaoyabo.com/?p=7675 https://arxiv.org/abs/2205.11487</summary> </entry> <entry><title>DeBERTa</title><link href="https://wa008.github.io/posts/DeBERTa/" rel="alternate" type="text/html" title="DeBERTa" /><published>2022-05-31T00:00:00+08:00</published> <updated>2022-05-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/DeBERTa/</id> <content src="https://wa008.github.io/posts/DeBERTa/" /> <author> <name>Benson</name> </author> <summary>背景 微软的发表的一篇文章，主要提出将文本的语义编码和位置编码，在计算 attention 时分别两两计算再求和，是个有趣的思路。 复现 参考原 bert 参数，A100 机器上跑一轮得3个小时，算力是在顶不住，放弃了。 所以就只用 paddle 实现一下 DeBERTa，跑通 demo 锻炼下编码能力，过程中主要是 disentangled attention 实现起来有点复杂。 def _process_qkv(self, x): x = paddle.reshape(x = x, shape = [0, 0, self.nhead, self.dim_head]) x = paddle.transpose(x = x, perm = [0, 2, 1, 3]) return x def MultiHeadAttention(self, input, p, ptq): qr = self._process_qkv(self.wqr(p)) kr = self._process_qkv(self.wkr(p)) qc = self._process_qkv(self.wqc(input)) kc = self._process_qkv(self.wkc(input)) vc = self._process_qkv(self.wvc(input)) qc_kr = paddle.matmul(qc, paddle.transpose(x = kr, perm = [0, 1, 3, 2])) qc_kr_ = [] for i in range(self.max_len): qc_kr_.append(paddle.gather(qc_kr[:, :, i, :], axis = 2, index = ptq[i, :])) qc_kr = paddle.to_tensor(qc_kr_) qc_kr = paddle.transpose(qc_kr, perm = [1, 2, 0, 3]) kc_qr = paddle.matmul(kc, paddle.transpose(x = qr, perm = [0, 1, 3, 2])) kc_qr = paddle.transpose(kc_qr, perm = [0, 1, 3, 2]) kc_qr_ = [] ptk = paddle.transpose(x = ptq, perm = [1, 0]) for i in range(self.max_len): kc_qr_.append(paddle.gather(kc_qr[:, :, :, i], axis = 2, index = ptk[:, i])) kc_qr = paddle.to_tensor(kc_qr_) kc_qr = paddle.transpose(kc_qr, perm = [1, 2, 0, 3]) weight = paddle.matmul(qc, paddle.transpose(x = kc, perm = [0, 1, 3, 2])) + qc_kr + kc_qr val = paddle.matmul(F.softmax(weight * ((self.dim_head*3)**0.5)), vc) val = paddle.transpose(x = val, perm = [0, 2, 1, 3]) val = paddle.reshape(x = val, shape = [0, 0, self.d_model]) return val 其他 数据集过大 可以逐行读入，代码中自己设置随机 def __iter__(self): azip = zipfile.ZipFile(self.intpus) self.cache = [] self.cache_cnt = 10000 # 缓存池大小 for fi in azip.namelist(): if fi.endswith(&amp;#39;/&amp;#39;): continue for line in azip.open(fi): line = json.loads(line.decode(&amp;quot;utf-8&amp;quot;, &amp;quot;ignore&amp;quot;)) text = line[&amp;#39;title&amp;#39;].strip(&amp;#39;\n&amp;#39;) + &amp;#39; &amp;#39; + line[&amp;#39;text&amp;#39;].strip(&amp;#39;\n&amp;#39;) self.cache.append(text) if len(self.cache) &amp;amp;gt; self.cache_cnt: text = random.choice(self.cache) self.cache.remove(text) idx, mask_token, mask_idx = self.__process__(text) yield idx, mask_token, mask_idx while len(self.cache) &amp;amp;gt; 0: text = random.choice(self.cache) self.cache.remove(text) idx, mask_token, mask_idx = self.__process__(text) yield idx, mask_token, mask_idx 逐行读入：DataLoader提供了IterableDataset 自己写随机逻辑：感谢神秘网友的答案 gather 问题 DeBERTa 实现起来比较复杂的两个步骤 pytorch 中有对应的 gather 接口可以简单实现，但 paddle 的 gather 函数实现原理不同，paddle 中的 index 只能是一个一维函数，重定向 index 时无法参考其他维度的值，这样实现起来就更复杂一些。详细对比 其他优化 绝对位置编码：attention中引入了相对位置编码，除此之外，mlm 预测时还引入了绝对位置编码，缺一不可。 样本扰动：传统机器学习实验时可以添加输入扰动提升模型鲁棒性，但 nlp 中 word太多、参数量太大（个人觉得主要还是 word多的原因）导致扰动的试验效果不稳定，原文发现在 layer normalized 之后的 embedding 上添加扰动，对提升扰动训练的稳定性很有帮助。</summary> </entry> <entry><title>读论文</title><link href="https://wa008.github.io/posts/%E8%AF%BB%E8%AE%BA%E6%96%87/" rel="alternate" type="text/html" title="读论文" /><published>2022-04-03T00:00:00+08:00</published> <updated>2022-04-03T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E8%AF%BB%E8%AE%BA%E6%96%87/</id> <content src="https://wa008.github.io/posts/%E8%AF%BB%E8%AE%BA%E6%96%87/" /> <author> <name>Benson</name> </author> <summary>1、Sentence Representations from Natural Language Inference Data 大意：利用有监督的自然语言推断数据训练句向量，利用句向量的拼接、求差做分类进行训练。求得的句子向量在情感分析等12项任务上进行测试，句向量+dense进行分类。对比了RNN、LSTM、GRU、CNN、self-attention等句向量表征结构，BiLSTM + max pooling 效果最好。相比之前最好的无监督 SkipThought 方法有明显提升。 有意思的点 BiLSTM-max pooling 相比 mean pooling 在训练任务上提升6个点，迁移任务上提升2个点。隐层应该是在学习不同的信号，通过max 来传递到下一层。 动态调整学习率，当验证集 acc 下降时，降低学习率。attention 的论文中也有动态调学习率的做法。 Adam 相比 SGD 速度更快，但效果更差，因为Adam能更好的捕捉训练任务细节，在迁移任务上表现的不好。存疑。 训练任务上表现得好，不一定在迁移任务上表现就好。比如attention 比 BiLSTM 在训练任务上更好，但迁移任务上更差。猜测是attention 更关注具体的训练任务，而不是学习到一个更通用的句向量。 参考资料 SkipThought vector 训练方法 FastSent 无监督句向量训练 layer-norm 2022-01-16 2、SkipThought vector 提出了无监督训练句向量的一种方法，bow+seq2seq 的训练方法，利用中间的 sentence 来预测周围的 sentence。 seq 模型文中使用的是 GRU 2022-01-23 3、FastSent 对比了几种训练句向量方法的效果。但具体方法还要看对应论文。 结论：句向量的评估和使用主要有两种，加入下游有监督任务 和 距离度量求相似度。更深更复杂的模型在有监督的任务中往往效果更好；shallow log-linear model 在空间距离度量中效果最好。 2022-02-23 4、layer normalization 对比之前提出的 batch normalizaiton ，提出了 layer norm。 batch norm：1）相比全量 norm，资源消耗少，速度更快。2）随机性相当于给训练过程添加了正则，提升鲁棒性。 layer norm：1）解决 batch norm 应用到 RNN 上时，测试样本长度比训练样本长度更长，无法获取 norm 参数的问题。2）没有 batch 的限制，能用于 online learning task 和 batch 较小的场景。3）试验验证 laryer norm 在 RNN 结构的模型中效果较好，提升时效和效果。 2022-03-05 5、softmax 变种 主要增加了当前类别的识别，提升难度。（提高梯度？） https://www.jianshu.com/p/06cc3f84aa85 2022-04-03</summary> </entry> <entry><title>用CNN做query相似度任务</title><link href="https://wa008.github.io/posts/%E7%94%A8CNN%E5%81%9Aquery%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%BB%BB%E5%8A%A1/" rel="alternate" type="text/html" title="用CNN做query相似度任务" /><published>2022-01-08T00:00:00+08:00</published> <updated>2022-01-08T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/%E7%94%A8CNN%E5%81%9Aquery%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%BB%BB%E5%8A%A1/</id> <content src="https://wa008.github.io/posts/%E7%94%A8CNN%E5%81%9Aquery%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%BB%BB%E5%8A%A1/" /> <author> <name>Benson</name> </author> <summary>背景 从公司大佬哪儿得知，CNN在query理解上有难以被超越的效果（当然除了bert类的巨无霸模型），就尝试了下。 做法 仍然使用 上一篇博客 中的query相似度任务和数据，同样用孪生网络来做，不过表征query向量的LSTM替换成了CNN，对比CNN和LSTM在query理解上效果的差异，CNN结构参考14年的一篇 paper 来做。 CNN结构先用多个滤波器做卷积，滤波器的某一维与词向量维度大小保持一致，做一维卷积。对每个样本和每个滤波器，都会产生一个一维向量，再做max pooling，得到隐层向量。多个滤波器得到的隐层向量concat起来，再过一个fc全连接层，得到最终的query向量。 网络结构如下 一维卷积比较有趣，必须保证滤波器能接受到完整的词向量，所以卷积操作的结果一定是个一维的。 不同滤波器的大小可以理解为对当前窗口内的term做的一个映射，从这些term中提取出局部特征输出，后续的max pooling 则取到当前窗口的有效值。假如滤波器大小为2，就是对每两个相邻的term做一个特征提取，如果是3，就是每相邻的3个term做特征提取。试验大多是用的(2,3,4,5)四个滤波器，有尝试过(3,5,7,9)，效果并没有显著提升。 实验数据如下： |实验内容|训练集acc|验证集acc| |–|–|–| |LSTM | 0.810 | 0.758 | |cnn base| 0.851 | 0.751 | |Embedding层参数可调| 0.960 | 0.771 | |提高dropout到 0.6| 0.874 | 0.786 | 滤波器用的(2,3,4,5)，调整无明显的提升。试验的数据基本是在10个epoch内选择验证集最优的结果。 数据中term数量呈大概的正态分布，以6为中心，分布在[0, 20]之间 结论 一维卷积比较有趣。卷积提取局部特征，在短语料场景会比较有效。 Embedding 层调整大约有2个点的提升。 整体相对于LSTM提升3个点。 思考 验证集78%，效果不够好的掣肘在哪里？Embedding 层做成可调，那么w2v向量应该不会是效果差的原因。CNN的网络结构不够好？滤波器太短？但是已经做实验了长的滤波器没有显著提升。</summary> </entry> <entry><title>2021年度总结</title><link href="https://wa008.github.io/posts/2021%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93/" rel="alternate" type="text/html" title="2021年度总结" /><published>2021-12-31T00:00:00+08:00</published> <updated>2021-12-31T00:00:00+08:00</updated> <id>https://wa008.github.io/posts/2021%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93/</id> <content src="https://wa008.github.io/posts/2021%E5%B9%B4%E5%BA%A6%E6%80%BB%E7%BB%93/" /> <author> <name>Benson</name> </author> <summary>读书 1、《微观经济学》：一直以为读的是宏观经济学，读完了才发现是微观的。经济学从经济体的角度考虑，怎么让生活变得更加美好，以达到全局最优。印象最深的是关于交易的一个例子，两个经济体 A 和 B，都会制造两种物品 x 和 y，即使 A 对 x 和 y 的产能都落后于 B，如果 A 和 B 之间产生交易的话，也能增加整体的产能。比如 A 的产能是 20x/年（代表 A 拿一年时间都去生产 x 的话，能产出20个单位的 x），10y/年，B 的产能是 100x/年，20y/年。假如 A 和 B 各用一半的时间去生成 x 和 y，那么每年总产量就是 10x + 5y + 50x + 10 y = 60x + 15y。假如A只生产y，一年生产10y，B一年只生产5个y，剩余时间生产x，一年的产量为75x + 5y，那么AB总产量为 75x + 15y，结果 &amp;amp;gt; 60x+15y，总产能就提升了。为什么让A只生产y更高效呢？因为A生产一个 y 的成本可以生产两个 x，而对B来说，生产一个 y 的成本可以生产 5 个 x，相对比B来说，A生产 x 的成本更高，生产 y 的成本就更低。简单从某个角度解释了为什么我们国家要加入世贸组织、为什么改革开放能促进我国的经济发展。（2022-12-31日补充：当然并不是说我们国家各行各业都比别人差，只是说明贸易的作用是巨大的。） 2、《博弈与社会》：看了1/3，社会是一个团体博弈组成的结果，迟早会达到某一个均衡状态，这种状态下所有的工作将没有优劣之分，但显然这个状态不会那么快到来。 3、《追风筝的人》：看了1/3，看到了当年自己的影子。 4、《浪潮之巅》：重温了部分篇章。一个伟大的公司应该是能对社会做出一些改变，为社会创造价值的公司。 买了不少书，看的断断续续的。 工作 1、经历了一些风波。 2、即使是有工作，也要不断提升自己，能力才是自己的核心竞争力。 3、带了一个校招同学，试用期没有过，很遗憾。要敏感，要明白对别人来说什么才是重要的，培养换位思考的能力。 生活 1、学会了自由泳，但蛙泳和自由泳都还需要练习，跑步没有坚持下来。 2、换了Mac Mini，戒了LOL，买了switch，玩一些稍微peace点的游戏，降低分泌多巴胺的阈值，还没有很适应。 3、ACM 中途断了，以后要捡起来，养成习惯，当成兴趣培养。 4、给女朋友买了微单，希望是她的兴趣，也要努力找自己的兴趣。 5、英语基本没有提升，阅读 和 听力都没有坚持下来。 2022 1、健康：跑步、游泳 2、英语：阅读，听力 3、学习：读paper，做试验，提升理解深度 4、读书：看一些行业外的书 5、看电影：IMDb top 250 希望疫情早点结束，希望生活越来越好。</summary> </entry> </feed>
