Commit 3e0c7693 authored by Erik Senn's avatar Erik Senn
Browse files

Replace notebooks_general.ipynb

parent 68284817
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
%% Cell type:markdown id: tags:

# General Remarks on the Notebooks

**General principle** we try to follow:
1)  We implement small components in more manual fashion (e.g. a tokenizer) to improve *understanding*,
2)  then learn how to use a library (torch, transfomers) to *implement* the same task (more efficiently).


**Structure**
  - Setup & data, including info whether GPU is required.
  - Content of the chapter
There are text (markdown) cells and code cells where you can run python code.

**Code remarks:**
- If a package is not installed, run: pip install packagename
- If a package is not installed, run: *pip install {packagename}*
- If a dataset cannot be loaded: check that the file is available and the path is correct.
- Make sure that imported function files (e.g. utils.py) are located in the same directory. These contain functionalities we want to use, but not focus on.
- Make sure that imported function files (e.g. *utils.py*) are located in the same directory. These contain functionalities we want to use, but not focus on.

**Section remarks**
- Show (and extend) the topic of the lecture part.
- The descriptions are sometimes very short. Check the slides and ask the lecturer for more details.
- Feel free to also change / experiment with codes here!
- A **"*"** denotes optional components (tasks and sections)
- A **"*"** denotes **optional components** (tasks and sections)

**Tasks Sections**
  - Tasks are for you to write code yourself.
  - Other codes from the notebooks and all online help can and should be used to solve them.
  - Simply add your own code cell and start solving. There is no "one correct" solution.
  - There are example solutions provided for most non-optional tasks. Check them only if you are really stuck!


**Note on library usage**
We use libraries because:
- working with libraries is faster and removes many details to focus on the key elements,
- in the course time, we will not be able to combine our self-written functions together to an entire well performing LMs.

%% Cell type:markdown id: tags:

# Examples

%% Cell type:markdown id: tags:

This is an example Markdown Cell

We can write **text** and equations $a^2+b^2 = c^2$ (and many more things) here.

%% Cell type:code id: tags:

``` python
# Example Code Cell
import numpy as np  # imports

a = np.array([1, 2, 3, 4, 5])
for i in a:
    print(i)
```

%% Output

    1
    2
    3
    4
    5