This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import os | |
from tensorflow.examples.tutorials.mnist import input_data | |
data = 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.Variable(tf.zeros([10])) | |
y=tf.nn.softmax(tf.matmul(x,W)+b) | |
y_=tf.placeholder("float",[None,10]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import os | |
from tensorflow.examples.tutorials.mnist import input_data | |
data = 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.Variable(tf.zeros([10])) | |
y=tf.nn.softmax(tf.matmul(x,W)+b) | |
y_=tf.placeholder("float",[None,10]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import os | |
from tensorflow.examples.tutorials.mnist import input_data | |
data = 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.Variable(tf.zeros([10])) | |
y=tf.nn.softmax(tf.matmul(x,W)+b) | |
y_=tf.placeholder("float",[None,10]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow.examples.tutorials.mnist import input_data | |
from PIL import Image | |
import numpy as np | |
#路径要写全 | |
MNIST_data_folder="D:\MNIST\mnist" | |
mnist=input_data.read_data_sets(MNIST_data_folder,one_hot=True) | |
print(mnist.train.images.shape, mnist.train.labels.shape) | |
print(mnist.test.images.shape, mnist.test.labels.shape) | |
print(mnist.validation.images.shape, mnist.validation.labels.shape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
import matplotlib.pyplot as plt | |
num_points=1000 | |
vectors_set=[] | |
for i in range(num_points): | |
x1=np.random.normal(0.0,0.55) #横坐标,进行随机高斯处理化,以0为均值,以0.55为标准差 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.parse | |
import urllib.request | |
import sys | |
import ssl | |
import base64 | |
access_token = '' | |
url = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general?access_token=' + access_token | |
# 二进制方式打开图文件 | |
f = open(r'C:\Users\R\Desktop\QQ截图20190309100002.png', 'rb') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests_html | |
import time | |
from requests_html import HTMLSession | |
session=HTMLSession() | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36' | |
} | |
file1=open("C:\\Users\\R\\Desktop\\笑话.txt","w",encoding='utf-8') | |
def get_c(url): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import turtle as t | |
# 绘制小猪佩奇 | |
# ======================================= | |
t.pensize(4) | |
t.hideturtle() | |
t.colormode(255) | |
t.color((255, 155, 192), "pink") | |
t.setup(840, 500) |