原创 TensorFlow2.x 學習筆記(八)過擬合

過擬合與欠擬合 Model capacity 當模型的複雜度增強時,模型的表達性也隨之增強,以多項式爲例 y=β0+β1x+β2x2+...+βnxn+ϵy = \beta_0 + \beta_1x + \beta_2x^2 +

原创 TensorFlow2.x 學習筆記(七)Keras高層接口

Keras高層接口 這裏所指的均爲tf.keras Keras高層API metrics acc_meter = metrics.Accuracy() loss_meter = metrics.Mean() update_sta

原创 TensorFlow2.x 學習筆記(六)隨機梯度下降以及數據可視化

文章目錄梯度下降簡介梯度利用梯度優化AutoGrad with TensorflowGradientTapePersistent GradientTape2nd−order2^{nd}-order2nd−order激活函數及其梯度

原创 [LeetCode 1360~1363][周賽]周賽177題解

1360.日期之間隔幾天 題目鏈接 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(0); return

原创 TensorFlow2.x 學習筆記(四)高級操作

合併與分割 Merge and split tf.concat [class1-4, students, scores] [class5-6, students, scores] a = tf.ones([4,35,8]) b

原创 TensorFlow2.x 學習筆記(二)迴歸問題&分類問題

fθ:x→yf_{\theta}: x\rightarrow yfθ​:x→y yyy通常可以分爲兩類:離散或連續 連續時爲迴歸問題 linear regression loss function gradient descent

原创 [LeetCode 5344~5347][周賽]周賽178題解

5344.有多少小於當前數字的數字 題目鏈接 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(0); r

原创 TensorFlow2.x 學習筆記(三)基礎操作

數據類型 python Data Container list :消耗大 np.array :無GPU tf.tensor TF is a computing lib Creat tf.constant(1) # int tf

原创 [LeetCode 404, 405][簡單]左葉子之和/數字轉換爲十六進制數

404.左葉子之和 題目鏈接 static const auto io_speed_up =[](){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0

原创 [LeetCode 392,401][簡單]判斷子序列/二進制手錶

392.判斷子序列 題目鏈接 static const auto io_speed_up = [](){ ios::sync_with_stdio(false); cin.tie(NULL); cout.t

原创 [LeetCode 374,383][簡單]猜數字大小/贖金信

374.猜數字大小 題目鏈接 static const auto io_speed_up = []() { ios::sync_with_stdio(0); cin.tie(0); return 0; }(

原创 [LeetCode 367,371][簡單]有效的完全平方數/兩整數之和

367.有效的完全平方數 題目鏈接 static const auto io_speed_up = []() { ios::sync_with_stdio(0); cin.tie(0); return 0;

原创 [LeetCode 349,350]兩個數組的交集/兩個數組的交集 II

349.兩個數組的交集 題目鏈接 static const auto io_speed_up = []() { ios::sync_with_stdio(0); cin.tie(0); return 0;

原创 [LeetCode 344,345][簡單]反轉字符串/反轉字符串中的元音字母

344.反轉字符串 題目鏈接 static const auto io_speed_up = []() { ios::sync_with_stdio(false); cin.tie(0); return

原创 [LeetCode 326,342][簡單]3的冪/4的冪

326.3的冪 題目鏈接 比較好想的是取對數法。 class Solution { public: double eps = 1e-11; bool isPowerOfThree(int n) {