<jupyter_start><jupyter_text>General Knowledge[Video Link](https://www.youtube.com/watch?v=tPYj3fFJGjk) Intro__A.I.__ : Artificial Intelligence => automate task that are normaly donne by humans (abit too generic tho). Ai can be simple or complex, just TicTacToe is A.I. or the ghost os the pacman game.__M.L.__ : Machine Learning => Fisrt field taht figgues out the rules rather then we code them ourself. We give it the input, and the output and **the machines thinks on its own to create the roles that are needed**.The goals for the models is to have the best accuracy possible__N.N.__ : Neural Networks => form of machine learning that uses layers representation of data. For neural networks we often have more then 2 layers.A.I. =contains=> M.L. =contains=> N.N.(Its not modeled after the brain) DataFor example student information |student|midterm1|midterm2|final||---|---|---|---||1|20|80|77||2|60|90|84||3|40|50|38|If i know the final ans midterm1 how can I now what the midterm 2 grade will be ?This is the input info, we always have it, called **features** (in our case Midterm1 and Final)The output is Midterm2 , we call it the **label****features => input****label => output**The more data the better, we are trying to come up with roles for a dataset, so the more we have, the better. But we need data where we haev all the feature dans the labels.**the data needd to be correct, input and output** Types of A.I. Supervised learningWe have some features and they corespond to some label(s). we passe the info to a modela dn later on we can pass a feature and it will give us the correct label.When we give it a feature, we lok at the label and see if it is correct and tweak it if it is not (supervising it).Most common type of learning and appicable to alot of data and algorithems**Advantage** : when there is a lot of information and output for that information Unsupervised learningWe only have features, no labels. we want the modal to come up with the labels for us. (for example dots on an x and y plane)We want to create a model taht can cluster theses together see diagram [here](https://youtu.be/tPYj3fFJGjk?t=1440)**Advantage** : when we have only the features Reinforcement learningWe dont have any data, we have an agent, an environment and a reward.For example  a game that can go to a flag. The player is the agent, the game is the environment and the reward can be for example be closer to the flag. The closer it get to the flag the more reward, the further it moves it looses reward.Its starts with no knowledge of the environment but it can explore on its own. The agent always wants to maximise the reward.  Intro to tensorflowOpen source Machine Learning library => limits the knowledge of math you need (yay!)What we can do :- Image- langage- reinforcement- .... How does it work ?2 main components : GraphsTF creates a graph : variables and all SessionsWay to execute parts or the entier graphs  Install TensorflowNormal install : `pip install tensorflow`Cuda GPU install : `pip install tensorflow-gpu` Import tensorflow and show version<jupyter_code>import tensorflow as tf  # now import the tensorflow module
print(tf.__version__)  # make sure the version is 2.x<jupyter_output>2.3.0<jupyter_text>What is a tensor ?It is a datapoint, or a vector. Its also basicly an array of base datatypes- 1D vector : 1 numbers- 2D vector : 2 numbers- 3D vector : 3 numbers<jupyter_code>## create a tensor

What kind of information is in the tensor ? (most of the time it is numbers)<jupyter_output><empty_output><jupyter_text>Creating tensorsThise have a scale of zero (also called a scalar), because it only contains one value in it<jupyter_code>string = tf.Variable("this is a test string", tf.string)
number = tf.Variable(5343, tf.int64)
floating = tf.Variable(451.445, tf.float64)

print(number)
print(floating)
print(string)<jupyter_output><tf.Variable 'Variable:0' shape=() dtype=int32, numpy=5343>
<tf.Variable 'Variable:0' shape=() dtype=float32, numpy=451.445>
<tf.Variable 'Variable:0' shape=() dtype=string, numpy=b'this is a test string'><jupyter_text>Rank / degree : number of dimentions in a tensorRank 1 is a 1 dimensions array (3 x 0)Rank 2 is a 2 dimention array (2 x 3)<jupyter_code>r1_tensor = tf.Variable(['test','Adrioen','OK'], tf.string)
r2_tensor = tf.Variable([['test','Adrioen','OK'],['test','Adrioen','OK']], tf.string)
print(r1_tensor)
print(r2_tensor)<jupyter_output><tf.Variable 'Variable:0' shape=(3,) dtype=string, numpy=array([b'test', b'Adrioen', b'OK'], dtype=object)>
<tf.Variable 'Variable:0' shape=(2, 3) dtype=string, numpy=
array([[b'test', b'Adrioen', b'OK'],
       [b'test', b'Adrioen', b'OK']], dtype=object)><jupyter_text>We can determine the rank of  atensor like this<jupyter_code>tf.rank(r2_tensor)<jupyter_output><empty_output><jupyter_text>Shapes of tensors<jupyter_code>r1_tensor.shape
r2_tensor.shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09415121255349501, 'fraction_numerical': 0.019563888322804156, 'mean_word_length': 5.135, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '431853', 'license': 'MIT', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1444, 'n_words': 660, 'path': 'FreeCodeCamp/Learning.ipynb', 'repo_name': 'Mrgove10/learning-AI', 'size': '4907'}