标签:example over 训练 mat compute case let The sig
Deep Learning models have so much flexibility and capacity that overfitting can be a serious problem,if the training dataset is not big enough. Sure it does well on the training set, but the learned network doesn‘t generalize to new examples that it has never seen!(它在训练集上工作很好,但是不能用于 它从未见过的新样例)
You will learn to: Use regularization in your deep learning models.
Let‘s first import the packages you are going to use.
# import packages
import numpy as np
import matplotlib.pyplot as plt
from reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, load_2D_dataset, predict_dec
from reg_utils import compute_cost, predict, forward_propagation, backward_propagation, update_parameters
import sklearn
import sklearn.datasets
import scipy.io
from testCases import *
%matplotlib inline
plt.rcParams[‘figure.figsize‘] = (7.0, 4.0) # set default size of plots
plt.rcParams[‘image.interpolation‘] = ‘nearest‘
plt.rcParams[‘image.cmap‘] = ‘gray‘
Improving DNNs Hyperparameter tuning-Regularization and Optimization(week2)Regularization
标签:example over 训练 mat compute case let The sig
原文地址:https://www.cnblogs.com/douzujun/p/13074312.html