Hi! Here we will compute the gradient of an arbitrary cost function and display its evolution during gradient descent. All the code is available on my GitHub at this link.
pip install numpy
pip install matplotlib
import numpy as np
import matplotlib.pyplot as plt
import math
from math import *
First, we define our cost function :
def f(x1, x2):
return 0.5*x1**2 + (5/2)*x2**2 - x1*x2 - 2*(x1 + x2)
We then manually compute the gradient of our function :
To run the jupyter you can download the Github repository.
pip install jupyter_contrib_nbextensions
After the installation, it is possible that you have to restart jupyter for the Nbextensions menu to be visible.
Nbextensions appears in the Jupyter menu as shown in the picture below :
Quand on fait de la Science des Données (Data Science) on peut être amené à réaliser un Notebook (un programme comprenant du code et du texte) avec Jupyter notamment. Je vais vous montrer les raccourcis clavier qui m’ont sauvé un temps fou sur Jupyter Notebook.
ps : Certains de ces raccourics fonctionnent sur d’autres types de notebooks comme Kaggle & Google Colab.
Tous les raccourcis que je vais vous montrer se font sur des cellules “en mode action” ou “mode commande”. Attention rien de compliqué c’est juste que la cellule doit être séléctionnée (encadrement bleu) et non pas active, comme…
In this article, I show you how to plot a function of ℝ² in ℝ from the point of view of its level circles. Here are some examples of visualizations that you will be able to generate :
If you have already followed the tutorial “3D visualization of an ℝ² function in ℝ with Python”, you can go straight to the “Visualization” part of this tutorial because the preprocessing of data is the same.
First of all, there are some python libraries to install/import:
pip install numpy
pip install matplotlib
import…
In this tutorial, we will see how to display a function from ℝ² into ℝ in 3 dimensions and interactively, with python. Here I use Jupyter Notebook.
If you want to run the code directly you can download the notebook on my repo.
First of all, some libraries are necessary:
pip install numpy
pip install matplotlib
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits
from mpl_toolkits.mplot3d import Axes3D
if you encounter difficulties with the import of mpl_toolkits, try run :
!pip install — upgrade matplotlib
import mpl_toolkits
Let be a function f from ℝ² into ℝ. …
Dans cet article je vous montre comment représenter une fonction de ℝ² dans ℝ du point de vue de ses cercles de niveau. Voici quelques exemples de visualisations que vous serez capables de générer :
PS : Si vous avez déjà suivi le tutoriel “Visualisation 3D d’une fonction de ℝ² dans ℝ avec Python”, vous pouvez passer directement à la partie “Visualisation” de ce tutoriel car la préparation des données est la même.
Tout d’abord il y a quelques librairies python à installer/importer :
pip install numpy
pip install matplotlib
import…
Dans ce tutoriel nous allons voir comment représenter une fonction de ℝ² dans ℝ en 3 dimensions et de manière interactive avec python.
PS : Si vous avez déjà suivi le tutoriel “Visualisation des cercles de niveau d’une fonction réelle”, vous pouvez passer directement à la partie “Visualisation” de ce tutoriel car la préparation des données est la même.
Tout d’abord quelques librairies sont nécessaires :
pip install numpy
pip install matplotlib
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits
from mpl_toolkits.mplot3d import Axes3D
Si vous avez une erreur…
A TLE (two-line element set) is a two-line text containing information about the movement of an object in orbit around the Earth at a given time (noted “epoch”). It looks like this:
ISS (ZARYA)
1 25544U 98067A 14273.50403866 .00012237 00000–0 21631–3 0 1790
2 25544 51.6467 297.5710 0002045 126.1182 27.2142 15.50748592907666
On line 0 we have the object’s name. Lines 1 and 2 are the payload of the TLE. Here are the elements given in a TLE :
Link to the GitHub repo to download the notebook on my Github.
What is a TLE?
Where and how to get TLE files?
What information can we get from it?
Position & velocity vectors of a satellite from its TLE with the python module sgp4, example with one TLE and then a bunch of TLEs.
Hi! I am a last year student in an engineering school and I am passionate about data science. Whatever the type of data, I love to dig in!