摘要: import keras model = keras.models.Sequential([ keras.layers.Dense(4, activation='relu', input_dim=1, name='layer1', kernel_initializer='one'), keras.l 阅读全文
posted @ 2019-11-13 20:15 yytxdy 阅读(611) 评论(0) 推荐(1) 编辑
摘要: import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit def f_fit(x, a, b, c): return a * x ** 2 + b * x + c x = [1, 2 阅读全文
posted @ 2019-11-13 15:03 yytxdy 阅读(857) 评论(0) 推荐(0) 编辑
摘要: import numpy as np from sklearn.metrics.pairwise import cosine_similarity a = np.array([1, 2, 3, 4]) b = np.array([1, 2, 6, 8]) dot = np.dot(a, b) nor 阅读全文
posted @ 2019-11-11 17:10 yytxdy 阅读(434) 评论(0) 推荐(0) 编辑
摘要: import keras import matplotlib.pyplot as plt from keras.datasets import mnist (x_train, _), (x_test, y_test) = mnist.load_data() x_train = x_train.ast 阅读全文
posted @ 2019-11-10 17:38 yytxdy 阅读(1392) 评论(0) 推荐(0) 编辑
摘要: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <configuration> <archive> 阅读全文
posted @ 2019-11-09 15:48 yytxdy 阅读(339) 评论(0) 推荐(0) 编辑
摘要: import cv2 # 读取图片 img = cv2.imread("image.jpg") # 加载模型,模型可以从https://github.com/opencv/opencv/blob/master/data/haarcascades/haarcascade_frontalface_def 阅读全文
posted @ 2019-11-01 16:32 yytxdy 阅读(1330) 评论(3) 推荐(1) 编辑
摘要: import jieba.analyse as analyse import matplotlib.pyplot as plt from wordcloud import WordCloud data = open('data.txt', 'rt', encoding='utf-8').read() tags = analyse.extract_tags(data, topK=20, withWe 阅读全文
posted @ 2019-10-31 19:16 yytxdy 阅读(1069) 评论(1) 推荐(1) 编辑
摘要: Ag 形语素 形容词性语素。形容词代码为 a,语素代码g前面置以A。 a 形容词 取英语形容词 adjective的第1个字母。 ad 副形词 直接作状语的形容词。形容词代码 a和副词代码d并在一起。 an 名形词 b 区别词 c 连词 dg 副语素 d 副词 e 叹词 f 方位词 g 语素 h 前 阅读全文
posted @ 2019-10-31 17:09 yytxdy 阅读(1387) 评论(0) 推荐(1) 编辑
摘要: 1、当确定数据只有一条时,使用limit 1,避免全表扫描 2、避免使用select *,只查询指定字段 3、避免使用大SQL,可以将大SQL改成几十个小SQL 4、查询以及外键需要建立索引,不过过多的索引也会造成性能损耗 阅读全文
posted @ 2019-10-28 10:30 yytxdy 阅读(206) 评论(1) 推荐(1) 编辑
摘要: import time import keras from keras.utils import np_utils start = time.time() (x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data() rows = 28 cols = 28 CLASSES = 10 x_train = x_train 阅读全文
posted @ 2019-10-16 16:43 yytxdy 阅读(345) 评论(0) 推荐(1) 编辑