Calculus – Learning principles of machine learning

limit

define

A variable in A certain function, in the permanent change process of becoming larger or smaller, gradually approaches A certain value A continuously, the change of the variable is artificially defined as “always close to and never stop”, and there is A “trend of constantly very close to point A”, which is called limit

Limit case

Divide the numerator and denominator by x^3

Molecule: 2 + (6 / x) + (1 / x ^ 3)

Denominator: 5 + (7/x^2)

Because as x goes to infinity, the x terms in the numerator and denominator go to 0

So as x goes to plus infinity, y goes to 2/5

Plug in x equals 0

Molecule: 1

The denominator: 1

As x goes to 0, y goes to 1

derivative

define

The derivative of a function at a certain point describes the rate of change of the function at that point

Derivation of case

The answer is 2

The answer is 4

Derivatives and extremum points

Applications of derivatives in machine learning

Gradient descent

See follow-up courses for details

integral

Indefinite integral

The antiderivative is the function before you take the derivative

Definite integral

Find the sum of the areas enclosed by the function

The relationship between definite and indefinite integrals

Commonly used formula

Examples of integral applications

The code field

(1) substitute x=10:

Total cost: C(10) = 2070

Average cost: C(10)/10 = 207

Marginal cost :C(11)-C(10) = 9.2

(2)

Average cost: f (x) = C (x)/x) = 2000 + 0.2 x/x + 5 f (x) ‘= – 2000 / (x ^ 2) + 0.2

F (x)’=0 x = 100 or -100 x > 0 so x = 100

The code for problem two


import numpy as np
import matplotlib.pyplot as plt


def f(x):
    return 1 / 3 * x ** 3 - x


x = np.linspace(1, 10, 1000)

y = f(x)

plt.plot(x, y)
plt.show()

area = np.sum(y*(10-1)/1000)
print(area)


Copy the code