谷歌# -*- coding: utf-8 -*- """ Created on Wed May 20 10:20:00 2020 @author: 1052668570 """ import numpy as np import matplotlib.pyplot as plt import keras.backend as K from keras.models import Sequential from keras.layers import Dense, Activation from keras.optimizers import Adam from keras.utils.np_utils import to_categorical from keras.callbacks import EarlyStopping from sklearn.metrics import accuracy_score, confusion_matrix, classification_report from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from keras.datasets import mnist (X_train, y_train), (X_test, y_test) = mnist.load_data() # Checking data X_train.shape # (60000, 28, 28) y_train.shape # (60000,) X_test.shape # (10000, 28, 28) y_test.shape # (10000,) # Plotting some examples for i in range(9): plt.subplot(3, 3, i+1) plt.imshow(X_train[i], cmap='gray') plt.axis('off') # Reshaping data X_train = X_train.reshape(-1, 28*28) X_test = X_test.reshape(-1, 28*28) # Scaling data X_train = X_train/255 X_test = X_test/255 # One hot encoding y_train_cat = to_categorical(y_train, 10) y_test_cat = to_categorical(y_test, 10) # ============================================================================= # Building the model # ============================================================================= K.clear_session() model = Sequential() model.add(Dense(512, input_dim=28*28, activation='relu')) model.add(Dense(256, activation='relu')) model.add(Dense(128, activation='relu')) model.add(Dense(32, activation='relu')) model.add(Dense(10, activation='softmax')) model.compile(Adam(lr=0.01), loss='categorical_crossentropy', metrics=['accuracy']) model.summary() h = model.fit(X_train, y_train_cat, batch_size=128, epochs=10, verbose=2, validation_split=0.3) plt.plot(h.history['accuracy']) plt.plot(h.history['val_accuracy']) plt.legend(['Training', 'Validation']) plt.title('Accuracy') plt.xlabel('Epochs') test_pred = model.predict_classes(X_test) test_pred print(accuracy_score(y_test, test_pred)) print(confusion_matrix(y_test, test_pred)) print(classification_report(y_test, test_pred))
Laila Kearney
纽约,8月18日(路透社)——谷歌(GOOGL.O),打开新标签页与Kairos Power公司共同宣布,已选择美国田纳西州作为先进核电站的选址,该电站预计将从2030年起为谷歌的数据中心供电。大型科技公司正需要大量电力来扩展其生成式人工智能的数据处理能力。这些创纪录的能源需求正将美国电力消费推向新高,并推动新一代核能等新能源的发展。
广告·继续滚动田纳西州反应堆是谷歌去年宣布战略中首个部署的项目,旨在从多个小型模块化反应堆采购核能。
该计划将支持500兆瓦先进核能容量,足以为约35万户家庭供电,由总部位于加州的Kairos核能公司开发。
这座50吉瓦的小型模块化核电站将建在田纳西州橡树岭,根据与公用事业公司田纳西河谷管理局(TVC.N),打开新标签页签订的长期购电协议,为谷歌在本地及阿拉巴马州的数据中心供电。广告 · 继续滚动该项目标志着美国公用事业公司首次签署了第四代核能购电协议,企业表示,这通常是在开发中最可持续且最安全的核能技术形式。
“部署先进核反应堆对于美国在人工智能领域的优势及能源领导地位至关重要,”美国能源部长克里斯·赖特在一份声明中表示。
目前,美国尚无商业化运营的先进核电站。
((圣保罗编辑部翻译,55 11 56447753))
路透社 AAJ
- 推荐主题:
- 科技