This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Any | |
def flatten_list(list_of_lists: List[List[Any]]) -> List[Any]: | |
"""Merge/flatten a list of lists into one single list. | |
Example: [[1, 2, 3],[4, 5, 6]] --> [1, 2, 3, 4, 5, 6] | |
Args: | |
list_of_lists (List[list]): List of lists to be merged/flattened. | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from tqdm import tqdm | |
from datasets import load_dataset | |
def download_n_eb_articles(n: int) -> pd.DataFrame: | |
"""Extract n Ekstra Bladet articles from the Danish subset | |
of the mC4 dataset. | |
Args: | |
n (int): Number of articles to extract. | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Train a neural network to implement the discrete Fourier transform | |
""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.models import Sequential | |
N = 32 | |
batch = 10000 |