Premium problem58. Manual Sigmoid Implementation

Easy Locked

Implement the sigmoid function by hand using the formula 1 / (1 + exp(-x)), rather than a built-in activation call.

Input

tensor([-2.0000, -0.5000,  0.0000,  1.0000,  3.0000])

Output

tensor([0.1192, 0.3775, 0.5000, 0.7311, 0.9526])

Premium problem

This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.

Implement solve(...)