Effective Go 摘记
本文是 Effective Go 中的一些摘记,主要涉及 golang 中的语法、技巧、风格等。为了尽可能保持原文意思,会通过英文记录相关的知识点。
本文是 Effective Go 中的一些摘记,主要涉及 golang 中的语法、技巧、风格等。为了尽可能保持原文意思,会通过英文记录相关的知识点。
最近在总结之前做的文本分类实验的一些经验和 tricks,同时也参考了网上的一些相关资料 (见文末),其中有些 tricks 没尝试过,先在这里记下,或者日后能用上。
最近看到一篇关于 MLE (Maximum Likelihood Estimation) 和 MAP(Maximum A Posteriori) 的文章,写的很好,非常值得一看,文章链接为 聊一聊机器学习的 MLE 和 MAP:最大似然估计和最大后验估计,本文几乎不加修改地转载了文章,侵删。
Recently I came across a great article about MLE (Maximum Likelihood Estimation) and MAP (Maximum A Posteriori). It’s very well written and worth reading. The article link is 聊一聊机器学习的 MLE 和 MAP:最大似然估计和最大后验估计. This article is reposted almost without modification (deleted upon infringement).
本系列文章是学习课程 6.824: Distributed Systems 时的一些学习笔记,整个课程的相关材料已整理至 DistributedSystemInGo。本文是 LEC3 的内容,介绍了分布式文件系统 GFS,GFS 为 MapReduce 提供了存储,同样是出自 Google,同样是年代久远,但是其中的一些设计思想同样值得我们参考。
本系列文章是学习课程 6.824: Distributed Systems 时的一些学习笔记,整个课程的相关材料已整理至 DistributedSystemInGo。本文是 LEC2 的内容,主要介绍了 RPC 的概念并通过 RPC 实现了一个简单的 c / s 架构的 kv 数据库;同时介绍了多线程编程并通过两种方式实现了一个多线程爬虫。
一直都想系统性地学习一下分布式系统的一些理论,所以打算开个坑学习一下 MIT 的课程 6.824: Distributed Systems 。本文主要是 LEC 1 中的内容,简单介绍了分布式系统的几个核心问题,以及经典的分布式计算框架 - MapReduce, 虽然这是耳熟能详的一个框架(或者说是编程范式)了,但是其设计思想至今还是非常值得参考的。
EE (Exploitation & Exploration) 问题在计算广告 / 推荐系统中非常常见,甚至在更广义的范围上,任意决策问题都会牵涉到 EE 问题。简单来说,这个问题就是要解决的是在决策时到底是根据已有经验选择最优的策略 (Exploitation),还是去探索一些新的策略来提升未来的收益 (Exploration)。本文主要介绍解决这个问题的三种比较常见的方法:随机方法,UCB 方法,Thompson sampling 方法,侧重于方法的具体流程和基本思想。
The EE (Exploitation & Exploration) problem is very common in computational advertising/recommender systems. More broadly, any decision-making problem involves the EE problem. Simply put, this problem addresses whether to choose the optimal strategy based on existing experience (Exploitation) or explore new strategies to improve future returns (Exploration) when making decisions. This article mainly introduces three common methods to solve this problem: random methods, UCB methods, and Thompson sampling methods, focusing on the specific procedures and basic ideas of each method.
题目有点拗口,其实就是给定一个数组,要求给出某个元素作为最小值或最小值的那些 continous subarrays 中最长的长度,如对于数组 [1, 2, 5, 6], 元素 5 作为最大值的 continous subarrays 有三个: [5], [2, 5], [1, 2, 5],长度最长的是 3。遍历的解法找出一个元素要 \(O(n)\) 的时间复杂度,找出所有元素则需要 \(O(n^2)\) 的时间复杂度,而通过栈能够在 \(O(n)\) 的时间复杂度内解决这个问题。