- 先 Fork 感兴趣项目,即
dmlc/gluon-cv
- Clone 到本地,
git clone git@github.com:YimianDai/gluon-cv.git
- 添加源项目
dmlc/gluon-cv
作为upstream
源,git remote add upstream https://github.com/dmlc/gluon-cv.git
- 禁止直接向
upstream
源 push,因为我们不是 dmlc 的人,没有 push 的权限,要提交代码必须通过 Pull Request,git remote set-url --push upstream no_push
- 创建并切换到本地的新分支
fixMixSoftmaxCrossEntropyLoss
,git checkout -b fixMixSoftmaxCrossEntropyLoss
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.