自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 leetcode 872 Leaf-Similar Trees

python:class Solution: def leafSimilar(self, root1, root2): """ :type root1: TreeNode :type root2: TreeNode :rtype: bool """ def leaf(root): ...

2018-09-28 09:52:59 167

原创 leetcode 202 Happy Number

python:class Solution: def isHappy(self, n): """ :type n: int :rtype: bool """ check = [n] while (n != 1): t = 0 for j in...

2018-09-27 10:47:36 135

原创 leetcode 645 Set Mismatch

python:class Solution: def findErrorNums(self, nums): """ :type nums: List[int] :rtype: List[int] """ l = len(nums) res = [] res.append(s...

2018-09-13 15:09:11 312

原创 TensorFlow(六)——MNIST分类之自动编码器

import input_dataimport tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltmnist = input_data.read_data_sets('data/', one_hot=True)#设置训练超参learning_rate = 0.01training_epochs = ...

2018-09-13 10:34:08 823

原创 TensorFlow(五)——MNIST分类值RNN

import input_dataimport tensorflow as tfimport numpy as npmnist = input_data.read_data_sets('data/', one_hot=True)#设置训练超参数lr = 0.001training_iters = 100000batch_size = 128#设置神经网络参数n_input...

2018-09-12 22:20:32 251

原创 leetcode 859 Buddy Strings

python:class Solution: def buddyStrings(self, A, B): """ :type A: str :type B: str :rtype: bool """ if A == B: return len(set(A)) !=...

2018-09-12 15:41:16 195

原创 TensorFlow(四)——MNIST分类之CNN

import input_dataimport tensorflow as tfimport numpy as npmnist = input_data.read_data_sets('data/', one_hot=True)trX, trY, teX, teY = mnist.train.images, mnist.train.labels, mnist.test.images,...

2018-09-12 14:21:00 269

原创 TensorFlow(三)——MNIST分类

import input_dataimport tensorflow as tfmnist = input_data.read_data_sets('data/', one_hot=True)#定义回归模型x = tf.placeholder(tf.float32, [None, 784])w = tf.Variable(tf.zeros([784, 10]))b = tf.Va...

2018-09-11 21:51:04 284

原创 leetcode 804 Unique Morse Code Words

python:class Solution: def uniqueMorseRepresentations(self, words): """ :type words: List[str] :rtype: int """ m = [".-","-...","-.-.","-..&quot

2018-09-11 16:41:09 209

原创 TensorFlow(二)——第一个程序

import tensorflow as tfimport numpy as npx_data = np.linspace(-1,1,300)[:, np.newaxis]#np.linspace 返回等差数列#np.newaxis == Nonenoise = np.random.normal(0, 0.05, x_data.shape)#加入噪点y_data = np.squ...

2018-09-11 16:09:31 211

原创 leetcode 118 Pascal's Triangle

python:class Solution: def generate(self, numRows): """ :type numRows: int :rtype: List[List[int]] """ res = [] arr = [1]*numRows ...

2018-09-10 16:52:25 165

原创 TensorFlow(一)——conda版安装

1.安装anaconda:从https://repo.continuum.io/archive/index.html选择相应版本,我选择的是最新的版本5.2.0:wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh之后直接进行安装:bash Anaconda3-5.2.0-Linux-x86...

2018-09-07 20:45:23 350

原创 leetcode 88 Merge Sorted Array

python:class Solution(object): def merge(self, nums1, m, nums2, n): """ :type nums1: List[int] :type m: int :type nums2: List[int] :type n: int :...

2018-09-07 19:02:18 155

原创 leetcode 69 Sqrt(x)

python:class Solution: def mySqrt(self, x): """ :type x: int :rtype: int """ left = 0 right = x while (left <= right): mid...

2018-09-03 14:52:14 175

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除