- 博客(6)
- 收藏
- 关注
原创 Ruby on Rails
$ rails new blog $ bin/rails generate controller Welcome index $ bin/rails generate controller Articles $ bin/rails generate model Article title:string text:text $ bin/rails db:migrate Rails....
2018-10-23 12:38:55
213
1
原创 MVC + Routes
Controller flash[:notice]="xxx" redirect :root render new render guide filter: before_action Model callbacks: before_save: encrypt_password validatations class Person < App...
2018-10-23 08:29:53
158
原创 Ruby Module, Class,Methods, Blocks
Block #!/usr/bin/ruby def test puts "You are in the method" yield puts "You are again back to the method" yield end test {puts "You are in the block"} You are in the method You are in ...
2018-10-22 10:37:31
239
原创 Rails
$ bin/rails server To create a new controller, you will need to run the "controller" generator and tell it you want a controller called "Welcome" with an action called "index", just like this: $ ...
2018-10-22 08:45:40
128
原创 Ruby
Variables in a Ruby Class Ruby provides four types of variables − Local Variables − Local variables are the variables that are defined in a method. Local variables are not available outside the...
2018-10-22 04:47:45
173
转载 Stochastic Gradient Descent vs Batch Gradient Descent vs Mini-batch Gradient Descent
梯度下降是最小化风险函数/损失函数的一种经典常见的方法,下面总结下三种梯度下降算法异同。1、 批量梯度下降算法(Batch gradient descent)以线性回归为例,损失函数为BGD算法核心思想为每次迭代用所有的训练样本来更新Theta,这对于训练样本数m很大的情况是很耗时的。BGD算法表示为 或者表示为 其中X(m*n)为训练样本矩阵,α为学习速率,m为样本数,y(m*1)为样本结...
2018-03-04 17:55:51
174
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅