热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

machinelearningweek6诊断机器学习算法的性能各种学习曲线来判断学习算法是过拟合或欠拟合

先贴上作业的答案linearRegCostFunction.mfunction[J,grad]linearRegCostFunction(X,y,theta,l

先贴上作业的答案

linearRegCostFunction.m

function [J, grad] = linearRegCostFunction(X, y, theta, lambda)
%LINEARREGCOSTFUNCTION Compute cost and gradient for regularized linear 
%regression with multiple variables
%   [J, grad] = LINEARREGCOSTFUNCTION(X, y, theta, lambda) computes the 
%   cost of using theta as the parameter for linear regression to fit the 
%   data points in X and y. Returns the cost in J and the gradient in grad

% Initialize some useful values
m = length(y); % number of training examples

% You need to return the following variables correctly 
J = 0;
grad = zeros(size(theta));

% ====================== YOUR CODE HERE ======================
% Instructions: Compute the cost and gradient of regularized linear 
%               regression for a particular choice of theta.
%
%               You should set J to the cost and grad to the gradient.
%
J=(1/(2*m))*sum((X*theta-y).^2)+(lambda/(2*m))*sum(theta(2:end,:).^2);

n=size(X,2);
for i=1:n
A(i,1)=(1/m)*sum((X*theta-y).*X(:,i));
end
theta(1,:)=0;
B=(lambda/m)*theta;
grad=A+B;
% =========================================================================

grad = grad(:);

end


learningCurve.m

function [error_train, error_val] = ...
    learningCurve(X, y, Xval, yval, lambda)
%LEARNINGCURVE Generates the train and cross validation set errors needed 
%to plot a learning curve
%   [error_train, error_val] = ...
%       LEARNINGCURVE(X, y, Xval, yval, lambda) returns the train and
%       cross validation set errors for a learning curve. In particular, 
%       it returns two vectors of the same length - error_train and 
%       error_val. Then, error_train(i) contains the training error for
%       i examples (and similarly for error_val(i)).
%
%   In this function, you will compute the train and test errors for
%   dataset sizes from 1 up to m. In practice, when working with larger
%   datasets, you might want to do this in larger intervals.
%

% Number of training examples
m = size(X, 1);

% You need to return these values correctly
error_train = zeros(m, 1);
error_val   = zeros(m, 1);

% ====================== YOUR CODE HERE ======================
% Instructions: Fill in this function to return training errors in 
%               error_train and the cross validation errors in error_val. 
%               i.e., error_train(i) and 
%               error_val(i) should give you the errors
%               obtained after training on i examples.
%
% Note: You should evaluate the training error on the first i training
%       examples (i.e., X(1:i, :) and y(1:i)).
%
%       For the cross-validation error, you should instead evaluate on
%       the _entire_ cross validation set (Xval and yval).
%
% Note: If you are using your cost function (linearRegCostFunction)
%       to compute the training and cross validation error, you should 
%       call the function with the lambda argument set to 0. 
%       Do note that you will still need to use lambda when running
%       the training to obtain the theta parameters.
%
% Hint: You can loop over the examples with the following:
%
%       for i = 1:m
%           % Compute train/cross validation errors using training examples 
%           % X(1:i, :) and y(1:i), storing the result in 
%           % error_train(i) and error_val(i)
%           ....
%           
%       end
%

% ---------------------- Sample Solution ----------------------
for i=1:m
   %利用X(1:i,:),y(1:i),trainLinearReg(),来训练参数theta
   theta=trainLinearReg(X(1:i,:),y(1:i), lambda);
   %You should evaluate the training error on the first i training examples (i.e., X(1:i, :) and y(1:i)).
   %训练误差计算只用X(1:i,:), y(1:i)
   [error_train(i),grad]=linearRegCostFunction(X(1:i,:), y(1:i), theta, 0); 
   %交叉验证用上所有的验证集,即Xval, yval
   %For the cross-validation error, you should instead evaluate on the _entire_ cross validation set (Xval and yval).
   [error_val(i),  grad]=linearRegCostFunction(Xval, yval, theta, 0);
end
% -------------------------------------------------------------

% =========================================================================

end

validationCurve.m

function [lambda_vec, error_train, error_val] = ...
    validationCurve(X, y, Xval, yval)
%VALIDATIONCURVE Generate the train and validation errors needed to
%plot a validation curve that we can use to select lambda
%   [lambda_vec, error_train, error_val] = ...
%       VALIDATIONCURVE(X, y, Xval, yval) returns the train
%       and validation errors (in error_train, error_val)
%       for different values of lambda. You are given the training set (X,
%       y) and validation set (Xval, yval).
%

% Selected values of lambda (you should not change this)
lambda_vec = [0 0.001 0.003 0.01 0.03 0.1 0.3 1 3 10]';

% You need to return these variables correctly.
error_train = zeros(length(lambda_vec), 1);
error_val = zeros(length(lambda_vec), 1);

% ====================== YOUR CODE HERE ======================
% Instructions: Fill in this function to return training errors in 
%               error_train and the validation errors in error_val. The 
%               vector lambda_vec contains the different lambda parameters 
%               to use for each calculation of the errors, i.e, 
%               error_train(i), and error_val(i) should give 
%               you the errors obtained after training with 
%               lambda = lambda_vec(i)
%
% Note: You can loop over lambda_vec with the following:
%
%       for i = 1:length(lambda_vec)
%           lambda = lambda_vec(i);
%           % Compute train / val errors when training linear 
%           % regression with regularization parameter lambda
%           % You should store the result in error_train(i)
%           % and error_val(i)
%           ....
%           
%       end
%
%

for i=1:length(lambda_vec)
    lambda=lambda_vec(i);
    theta=trainLinearReg(X,y, lambda);
    [error_train(i),grad]=linearRegCostFunction(X, y, theta, 0); 
    [error_val(i),  grad]=linearRegCostFunction(Xval, yval, theta, 0); 
end


% =========================================================================

end

ex5.m(ex5.m后面包含了作业的可选部分,已全部完成,答案也是对的,有兴趣可以去拷下来实验一下)
%% Machine Learning Online Class
%  Exercise 5 | Regularized Linear Regression and Bias-Variance
%
%  Instructions
%  ------------
% 
%  This file contains code that helps you get started on the
%  exercise. You will need to complete the following functions:
%
%     linearRegCostFunction.m
%     learningCurve.m
%     validationCurve.m
%
%  For this exercise, you will not need to change any code in this file,
%  or any other files other than those mentioned above.
%

%% Initialization
clear ; close all; clc

%% =========== Part 1: Loading and Visualizing Data =============
%  We start the exercise by first loading and visualizing the dataset. 
%  The following code will load the dataset into your environment and plot
%  the data.
%

% Load Training Data
fprintf('Loading and Visualizing Data ...\n')

% Load from ex5data1: 
% You will have X, y, Xval, yval, Xtest, ytest in your environment
load ('ex5data1.mat');

% m = Number of examples
m = size(X, 1);

% Plot training data
plot(X, y, 'rx', 'MarkerSize', 10, 'LineWidth', 1.5);
xlabel('Change in water level (x)');
ylabel('Water flowing out of the dam (y)');

fprintf('Program paused. Press enter to continue.\n');
pause;

%% =========== Part 2: Regularized Linear Regression Cost =============
%  You should now implement the cost function for regularized linear 
%  regression. 
%

theta = [1 ; 1];
J = linearRegCostFunction([ones(m, 1) X], y, theta, 1);

fprintf(['Cost at theta = [1 ; 1]: %f '...
         '\n(this value should be about 303.993192)\n'], J);

fprintf('Program paused. Press enter to continue.\n');
pause;

%% =========== Part 3: Regularized Linear Regression Gradient =============
%  You should now implement the gradient for regularized linear 
%  regression.
%

theta = [1 ; 1];
[J, grad] = linearRegCostFunction([ones(m, 1) X], y, theta, 1);

fprintf(['Gradient at theta = [1 ; 1]:  [%f; %f] '...
         '\n(this value should be about [-15.303016; 598.250744])\n'], ...
         grad(1), grad(2));

fprintf('Program paused. Press enter to continue.\n');
pause;


%% =========== Part 4: Train Linear Regression =============
%  Once you have implemented the cost and gradient correctly, the
%  trainLinearReg function will use your cost function to train 
%  regularized linear regression.
% 
%  Write Up Note: The data is non-linear, so this will not give a great 
%                 fit.
%

%  Train linear regression with lambda = 0
lambda = 0;
[theta] = trainLinearReg([ones(m, 1) X], y, lambda);

%  Plot fit over the data
plot(X, y, 'rx', 'MarkerSize', 10, 'LineWidth', 1.5);
xlabel('Change in water level (x)');
ylabel('Water flowing out of the dam (y)');
hold on;
plot(X, [ones(m, 1) X]*theta, '--', 'LineWidth', 2)
hold off;

fprintf('Program paused. Press enter to continue.\n');
pause;


%% =========== Part 5: Learning Curve for Linear Regression =============
%  Next, you should implement the learningCurve function. 
%
%  Write Up Note: Since the model is underfitting the data, we expect to
%                 see a graph with "high bias" -- slide 8 in ML-advice.pdf 
%

lambda = 0;
[error_train, error_val] = ...
    learningCurve([ones(m, 1) X], y, ...
                  [ones(size(Xval, 1), 1) Xval], yval, ...
                  lambda);

plot(1:m, error_train, 1:m, error_val);
title('Learning curve for linear regression')
legend('Train', 'Cross Validation')
xlabel('Number of training examples')
ylabel('Error')
axis([0 13 0 150])

fprintf('# Training Examples\tTrain Error\tCross Validation Error\n');
for i = 1:m
    fprintf('  \t%d\t\t%f\t%f\n', i, error_train(i), error_val(i));
end

fprintf('Program paused. Press enter to continue.\n');
pause;

%% =========== Part 6: Feature Mapping for Polynomial Regression =============
%  One solution to this is to use polynomial regression. You should now
%  complete polyFeatures to map each example into its powers
%

p = 8;

% Map X onto Polynomial Features and Normalize
X_poly = polyFeatures(X, p);
[X_poly, mu, sigma] = featureNormalize(X_poly);  % Normalize
X_poly = [ones(m, 1), X_poly];                   % Add Ones

% Map X_poly_test and normalize (using mu and sigma)
X_poly_test = polyFeatures(Xtest, p);
X_poly_test = bsxfun(@minus, X_poly_test, mu);
X_poly_test = bsxfun(@rdivide, X_poly_test, sigma);
X_poly_test = [ones(size(X_poly_test, 1), 1), X_poly_test];         % Add Ones

% Map X_poly_val and normalize (using mu and sigma)
X_poly_val = polyFeatures(Xval, p);
X_poly_val = bsxfun(@minus, X_poly_val, mu);
X_poly_val = bsxfun(@rdivide, X_poly_val, sigma);
X_poly_val = [ones(size(X_poly_val, 1), 1), X_poly_val];           % Add Ones

fprintf('Normalized Training Example 1:\n');
fprintf('  %f  \n', X_poly(1, :));

fprintf('\nProgram paused. Press enter to continue.\n');
pause;



%% =========== Part 7: Learning Curve for Polynomial Regression =============
%  Now, you will get to experiment with polynomial regression with multiple
%  values of lambda. The code below runs polynomial regression with 
%  lambda = 0. You should try running the code with different values of
%  lambda to see how the fit and learning curve change.
%

lambda = 1;
[theta] = trainLinearReg(X_poly, y, lambda);
%[J, grad] = linearRegCostFunction(X_poly_val, ytest, theta, lambda)
% Plot training data and fit
figure(1);
plot(X, y, 'rx', 'MarkerSize', 10, 'LineWidth', 1.5);
plotFit(min(X), max(X), mu, sigma, theta, p);
xlabel('Change in water level (x)');
ylabel('Water flowing out of the dam (y)');
title (sprintf('Polynomial Regression Fit (lambda = %f)', lambda));

figure(2);
[error_train, error_val] = ...
    learningCurve(X_poly, y, X_poly_val, yval, lambda);
plot(1:m, error_train, 1:m, error_val);

title(sprintf('Polynomial Regression Learning Curve (lambda = %f)', lambda));
xlabel('Number of training examples')
ylabel('Error')
axis([0 13 0 100])
legend('Train', 'Cross Validation')

fprintf('Polynomial Regression (lambda = %f)\n\n', lambda);
fprintf('# Training Examples\tTrain Error\tCross Validation Error\n');
for i = 1:m
    fprintf('  \t%d\t\t%f\t%f\n', i, error_train(i), error_val(i));
end

fprintf('Program paused. Press enter to continue.\n');
pause;

%% =========== Part 8: Validation for Selecting Lambda =============
%  You will now implement validationCurve to test various values of 
%  lambda on a validation set. You will then use this to select the
%  "best" lambda value.
%

[lambda_vec, error_train, error_val] = ...
    validationCurve(X_poly, y, X_poly_val, yval);

close all;
plot(lambda_vec, error_train, lambda_vec, error_val);
legend('Train', 'Cross Validation');
xlabel('lambda');
ylabel('Error');

fprintf('lambda\t\tTrain Error\tValidation Error\n');
for i = 1:length(lambda_vec)
	fprintf(' %f\t%f\t%f\n', ...
            lambda_vec(i), error_train(i), error_val(i));
end

fprintf('Program paused. Press enter to continue.\n');
pause;
%%---------------------------------------------------------------------------
%%Optional (ungraded) exercise: Computing test set
lambda=3;
theta=trainLinearReg(X_poly,y, lambda);
[error_test,grad]=linearRegCostFunction(X_poly_test, ytest, theta, 0); 
fprintf(' %f\n',error_test);
%%-------------------------------------------------------------------------
%%Optional (ungraded) exercise: Plotting learning curves with randomly selected examples
% m=size(X_poly,1);
% X_poly_y=[X_poly,y];
% X_poly_val_y=[X_poly_val,yval];
% lambda=0.01;
% error_train = zeros(m, 1);
% error_val   = zeros(m, 1);
% for i=1:m
%    error_train_sum=0;
%    error_val_sum  =0;
%    for k=1:20                           %50次迭代
%         rand_seq=round(rand(1,i)*(m-1))+1;%生成i个随机序列 0~m
%         rand_X_poly_y=X_poly_y(rand_seq,:);
%         rand_X_poly_val_y=X_poly_val_y(rand_seq,:);
%         X=rand_X_poly_y(:,1:end-1);
%         y=rand_X_poly_y(:,end);
%         Xval=rand_X_poly_val_y(:,1:end-1);
%         yval=rand_X_poly_val_y(:,end);
%         theta=trainLinearReg(X,y,lambda);
%         [error_train_val,grad]=linearRegCostFunction(X, y, theta, 0);
%         [error_val_val,  grad]=linearRegCostFunction(Xval, yval, theta, 0);
%         error_train_sum=error_train_sum+error_train_val;
%         error_val_sum=error_val_sum+error_val_val;
%    end
%    error_train(i)=error_train_sum/20;
%    error_val(i)=error_val_sum/20;
% end
% plot(1:m, error_train, 1:m, error_val);
% title(sprintf('Polynomial Regression Learning Curve (lambda = %f)', lambda));
% xlabel('Number of training examples')
% ylabel('Error')
% axis([0 13 0 100])
% legend('Train', 'Cross Validation')
% fprintf('Polynomial Regression (lambda = %f)\n\n', lambda);
% fprintf('# Training Examples\tTrain Error\tCross Validation Error\n');
%%-------------------------------------------------------------------------

以上就是作业的源代码,接下来是我对于week6的一些总结,总结的顺序主要是根据andrew Ng的PPT来进行的,强烈建议看此节课,非常有用。

一、优化方案
       当建模之后发现使用新的数据进行测试的时候,预测结果非常不理想,这个时候,可以尝试下面的方法进行重新建模:
       1. 使用更多的训练数据
       2. 尝试使用较少的属性
       3. 或者尝试更多的属性
       4. 尝试使用属性值的多项式形式
       5. 增大常数项参数
       6. 减小常数项参数



一般情况下,可以将数据集分为:训练集和测试级 7:3的比例。


利用训练集数据去训练出参数,然后用测试集去测试性能。



过拟合:简单的理解就是参数太多,训练集太少,过拟合的结果是训练误差会非常小,因为我们的参数很多,可以很好的拟合几乎所有的训练数据,但是,过拟合情况下,模型的泛化能力就很差,会导致训练误差比较大。

下面的就是过拟合的一个典型图像:




       其实:一般情况下,数据集应该分为训练集,交叉验证集,测试集,因为,我们能会假设有好几种可能的模型,然后用数据集分别去训练这几个模型,然后利用交叉验证集去选择一个比较好的模型,最后用测试集去测试选出最优模型的性能。

      如果,我们只假设了一个模型,那么就没有选择模型这个过程,那就把数据集分为训练集,测试集就可以了,训练集训练模型,测试集测试模型。


关于训练误差,代价误差,交叉误差的说明。


注:我们在训练模型的过程中,要使用代价函数,我们使用的代价函数必须是上面这个式子,如果,你加入了正则化的话,一定要加入正则項。


但是,我们在模型训练完,计算训练误差,交叉验证误差,测试误差的时候,即使有正则化参数,也不必加进去,只需按照上面的式子计算各种误差即可,很容易理解,就是比较训练结果与实际结果的差异。



现在开始讲述:偏差(Bias)和方差(variance)的概念

解释:偏差就是欠拟合,简单来讲就是参数太少,数据太多,不足以拟合参数,欠拟合情况下,训练误差会比较大,测试误差也会比较大。

          方差就是过拟合,简单来说就是参数太多,训练数据太少,参数过分拟合数据,导致泛化能力非常差,过拟合情况下,训练误差比较小,但是因为模型没有泛化能力,所以,测试误差会比较大。


解释:  左图就是参数太少,不足以拟合训练数据的情况-欠拟合。

            右图就是参数太多,过分拟合训练数据的情况   -过拟合

            中图刚好合适,即比较好的拟合数据,又具有较好的泛化能力。




解释:继续解释上面的那个多项式拟合,d代表拟合的参数的个数,我们关注一下训练误差曲线Jtrain(θ)和交叉验证曲线Jcv(θ),随着

d的增大,我们用更多的多項式,参数来拟合训练数据,刚开始d比较小时,是欠拟合,训练误差会比较大,当d增大时,就会拟合得越来越好,所以,我们看到训练误差曲线是呈下降的趋势。

        对于交叉验证曲线,d比较小是,欠拟合状态,模型拟合效果很差,所以,交叉验证误差会比较大,当d增大时,交叉验证误差会先逐渐减少,但是,当d过分大时,就进入了过拟合状态,模型的泛化能力也会比较差,所以,交叉验证误差又会逐渐增大。

所以,交叉验证误差的谷点,最小值就是我们该选择的d值。



接下来是关于学习曲线的绘制,只有绘制学习曲线,能帮助我们选择参数和判断算法现在是处于什么状态,高偏差(欠拟合),高方差(过拟合),或者两者都有。


解释:正则化参数的大小是来调节过拟合,欠拟合状态的,正则化参数是抑制参数大小的因子,当正则化参数比较大时,模型的参数值会变得比较小,极端情况下,很多参数会变零。就导致了欠拟合状态。

          当正则化参数比较小时,其抑制参数大小的能力就几乎等于没有,所以,如果本身模型的参数比较多,那么就容易进入过拟合状态。

           左图对应的是large lambda 欠拟合

           右图对应的是small lambda 过拟合

           

解释:此学习曲线,训练误差和交叉验证误差关于正则化参数的学习曲线。

          当lambda比较小是,是过拟合状态,所以,训练误差比较小,随着lambda的增大,进入了欠拟合状态,训练误差增长,所以

Jtrain(θ)是上升的曲线。

          当lambda比较小时,过拟合,所以泛化能力差,交叉验证误差会比较大,当lambda比较大时,欠拟合,交叉验证误差也会比较大,所以交叉验证误差曲线Jcv(θ)是抛物线型的曲线(理想情况下)。

          所以,合适的lambda还是对应Jcv(θ)的谷点。


接下来要讲述的是训练误差关于训练样本规模的学习曲线

         先讲结论,对应高偏差(欠拟合)情况下,增加样本的规模对于提高模型的性能其实一点帮助都没有,因为模型本身拟合得不好,增加数据集没用,本来就处于参数过多,样本过少的情况,增加训练样本,只会增大欠拟合的程度。

        当处在高方差(过拟合)情况下,增加样本的规模对于提高模型的性能是有帮助的,因为过拟合是处在参数过多,样本过少的情况下,所以,增加样本的数目对于改善过拟合情况是非常有帮助的。

     

解释:对于high bias情况下,从error-m图中可以看出,随着训练样本m的增大,交叉验证误差很快就达到水平,下降极其缓慢,

所以,增加样本的规模也无济于事。总结,对于high bias的情况,Jtrain(θ)和Jcv(θ)都会比较大,且比较靠近。


解释:对于高方差的情况下,Jtrain(θ)是缓慢增长的,且数值比较小。而Jcv(θ)会比较大,随着样本规模的增大,持续下降,说明一点,在高方差情况下,Jtrain(θ)和Jcv(θ)还是有一段距离(gap)的。所以增大样本的规模,会减少Jcv(θ)。


当我们画出了曲线,诊断出高方差还是高偏差的问题时,那么就要对症下药了。下面提供,对待不同问题该使用的方法:


1、使用更多的训练样本      -解决过拟合问题

2、使用更少的特征             -解决过拟合问题

3、使用更多的特征             -解决欠拟合问题

4、增加使用多项式             -解决欠拟合问题

5、减小正则参数lambda    -解决欠拟合问题

6、增大正则参数lambda    -解决过拟合问题


接下来就是关于神经网络的学习曲线


解释:神经网络除了可以画出 代价函数-样本规模  代价函数-正则参数  的学习曲线,还可以画出 代价函数-隐层结点数  代价函数-层数的学习曲线。

         神经网络也要使用正则参数去调节过拟合问题,如果神经网络的层数过多,隐层结点数过多,会导致过拟合,实际上会倾向于使用比较大型的神经网络,然后用正则参数lambda来调节过拟合。



          








推荐阅读
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了logistic回归(线性和非线性)相关的知识,包括线性logistic回归的代码和数据集的分布情况。希望对你有一定的参考价值。 ... [详细]
  • 不同优化算法的比较分析及实验验证
    本文介绍了神经网络优化中常用的优化方法,包括学习率调整和梯度估计修正,并通过实验验证了不同优化算法的效果。实验结果表明,Adam算法在综合考虑学习率调整和梯度估计修正方面表现较好。该研究对于优化神经网络的训练过程具有指导意义。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • 本文介绍了机器学习手册中关于日期和时区操作的重要性以及其在实际应用中的作用。文章以一个故事为背景,描述了学童们面对老先生的教导时的反应,以及上官如在这个过程中的表现。同时,文章也提到了顾慎为对上官如的恨意以及他们之间的矛盾源于早年的结局。最后,文章强调了日期和时区操作在机器学习中的重要性,并指出了其在实际应用中的作用和意义。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 本文介绍了在Python张量流中使用make_merged_spec()方法合并设备规格对象的方法和语法,以及参数和返回值的说明,并提供了一个示例代码。 ... [详细]
  • 背景应用安全领域,各类攻击长久以来都危害着互联网上的应用,在web应用安全风险中,各类注入、跨站等攻击仍然占据着较前的位置。WAF(Web应用防火墙)正是为防御和阻断这类攻击而存在 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
  • Gitlab接入公司内部单点登录的安装和配置教程
    本文介绍了如何将公司内部的Gitlab系统接入单点登录服务,并提供了安装和配置的详细教程。通过使用oauth2协议,将原有的各子系统的独立登录统一迁移至单点登录。文章包括Gitlab的安装环境、版本号、编辑配置文件的步骤,并解决了在迁移过程中可能遇到的问题。 ... [详细]
author-avatar
光陆光陆光陆
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有