上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页

2017年12月11日

LeetCode: 18. 4Sum

摘要: 递归调用的例子,参考网上的实现https://discuss.leetcode.com/topic/46339/my-solution-generalized-for-ksums-in-java/5 阅读全文

posted @ 2017-12-11 00:46 Michael2397 阅读(120) 评论(0) 推荐(0) 编辑

2017年12月10日

LeetCode:15. 3Sum

摘要: 自己的解法,有问题,花费我三个小时 网上的解法 阅读全文

posted @ 2017-12-10 20:32 Michael2397 阅读(150) 评论(0) 推荐(0) 编辑

Leetcode:1. Two Sum

摘要: public class TwoSum1 { public static void main(String[] args) { int[] nums = new int[]{2, 7, 11, 15}; int target = 9; int a[] = new int[2]; a = twoSum(nums, targe... 阅读全文

posted @ 2017-12-10 17:00 Michael2397 阅读(129) 评论(0) 推荐(0) 编辑

2017年12月7日

tensorflow placeholder

摘要: placeholder 是 Tensorflow 中的占位符,暂时储存变量. Tensorflow 如果想要从外部传入data, 那就需要用到 tf.placeholder(), 然后以这种形式传输数据 sess.run(***, feed_dict={input: **}). 需要传入的值放在了f 阅读全文

posted @ 2017-12-07 10:53 Michael2397 阅读(359) 评论(0) 推荐(0) 编辑

Tensorflow变量

摘要: import tensorflow as tf state = tf.Variable(0, name='counter') # 定义常量 one one = tf.constant(1) # 定义加法步骤 (注: 此步并没有直接计算) new_value = tf.add(state, one) # 将 State 更新成 new_value update = tf.assign(sta... 阅读全文

posted @ 2017-12-07 10:48 Michael2397 阅读(132) 评论(0) 推荐(0) 编辑

tensorflow session会话控制

摘要: Session 是 Tensorflow 为了控制,和输出文件的执行的语句. 运行 session.run() 可以获得你要得知的运算结果, 或者是你所要运算的部分. 阅读全文

posted @ 2017-12-07 10:36 Michael2397 阅读(162) 评论(0) 推荐(0) 编辑

tensorflow第一个例子

摘要: import tensorflow as tf import numpy as np # create data x_data = np.random.rand(100).astype(np.float32) y_data = x_data*0.1 + 0.3 Weights = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) biases = t... 阅读全文

posted @ 2017-12-07 01:56 Michael2397 阅读(149) 评论(0) 推荐(0) 编辑

2017年12月6日

sklearn保存模型

摘要: 最后可以知道joblib在使用上比较容易,读取速度也相对pickle快。 阅读全文

posted @ 2017-12-06 23:18 Michael2397 阅读(167) 评论(0) 推荐(0) 编辑

sklearn解决过拟合的例子

摘要: Learning curve 检视过拟合 sklearn.learning_curve 中的 learning curve 可以很直观的看出我们的 model 学习的进度, 对比发现有没有 overfitting 的问题. 然后我们可以对我们的 model 进行调整, 克服 overfitting 阅读全文

posted @ 2017-12-06 22:57 Michael2397 阅读(3830) 评论(0) 推荐(0) 编辑

sklearn交叉验证法(Cross Validation)

摘要: 一般来说准确率(accuracy)会用于判断分类(Classification)模型的好坏。 一般来说平均方差(Mean squared error)会用于判断回归(Regression)模型的好坏。 阅读全文

posted @ 2017-12-06 22:12 Michael2397 阅读(840) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页

导航