TensorFlow basis (e) - (optimized) loss function

Common activation function:

The complexity of the neural network

 

First, the loss function

1.1 mean square error codes to predict product sales:

result:

Y is calculated based on obtained prediction results of w1:

                                                                       0.98x1 + 1.02x2 y =

And generating the formula y

                                                                              y = x1 + x2

Close, so prediction accuracy.

1.2 custom loss function forecasting sales of yogurt:

Code:

result:

1.03x1 + 1.05x2 y =

2.3 cross entropy

Guess you like

Origin blog.csdn.net/qq_37764129/article/details/94390912