My Dev Diary: Season 2 - TheEvergreenStateCollege/upper-division-cs-23-24 GitHub Wiki
SC Rustlings Assignment (Only check exercises folder)
-
Draw a hand-drawn digit in the first demo box and click "check digit".
-
Click on several of the input nodes (in the first layer) and see a corresponding pixel light-up yellow on your input hand-drawn digit.
- If you had to guess, describe in English one possible connection between nodes and pixels.
The node and the pixel correlate to each other position, pixel as in the drawing and node as in 2D array representation
- Click on several of the hidden nodes (in the second layer) and see two images pop up, one with all red/blue pixels, and one masked to just your hand-written digit.
- If you had to guess, describe in English what the two images might mean.
The first image is when the nodes are firing up through a specific recognition following an epoch of training and the second image is the shape of it
- See the incoming edges light up between your selected nodes and the input nodes in the first layer.
- What does a bright blue edge mean in terms of the numerical weight on that edge? Is it less than zero, greater than zero, or equal to zero?
In this case, a bright blue edge means the node at that position firing the strongest. In terms of numerical weight, it could be anywhere between 0.9 and 1. It's greater than zero.
- What does a bright red edge mean in terms of the numerical weight on that edge? Is it less than zero, greater than zero, or equal to zero?
A bright red edge means the node at that position doesn't fire at the weakest. It could be anywhere between 0 and 0.1. It's less than zero
- Answer the above questions for a slightly blue or slightly red edge.
For slightly blue or slightly red, it's firing at a neutral amount, not the strongest but not the weakest. it could be equal to zero or a little bit bigger or smaller than that, it could be anywhere between 0.1 and 0.9
- Click on your hand-drawn digit to reset the demo, and draw a new digit.
- Click on some hidden nodes (in the second layer). Do you think the color (weight) of these edges is the same as from your previous hand-drawn digit?
- Reset the demo and draw another hand-drawn digit to test your theory.
- Whether it's the same or different, describe in English why this is the case.
No, they're not, this is because each drawing is processed differently, each drawing firing a different node and processed with different information
- Reset the demo and draw a digit to be as ambiguous as possible (for example, halfway between a 4 and a 9).
- Run the network forward to check the digit. See if you can get a halfway gray color between two or more output nodes (in the last layer), indicating equal (un)certainty.
- What would you do in this case, if you needed this network to classify the digit definitely? (e.g. if you work for the U.S. Postal Service)
In this case, it looks like it tries to differ between 1, 2, 5, and 9 for some reason. The results gave out a 9 but if I need to classify the digit, I'll based on my recognition and say it's a 4. After all, it's not my fault that they want a 9 but write like a 4
- A machine learning model is trained from data like a binary executable file compiled from source files.
- In what ways could this be a valid analogy? Consider this prediction:
- if I give you a binary executable program that doesn't need the internet to run (for example, a tic-tac-toe game), and you airgap yourself from the internet, do you have everything you need to run the game?
If you have been taught how to play in the past or previously have access to it on the internet, that's all you need to play the game.
- if I give you an ML model and all input images that I need to have classified on the same computer, and you airgap yourself from the internet, do you have everything you need to classify the input images?
Depends on the technique and ways to solve, in general, it's needed more than that.
- Name some differences in this analogy; that is, how is an ML model trained from data different than a compiled binary file?
A compiled binary file is usually encapsulated with instructions on how to execute a function, for the ML model, it trains all by itself, the only thing we give is data, which is pictures with separate tags, and hope that it will generalize on a newer model. I would say it falls between supervised and unsupervised learning.
Although it was pretty late by now, I managed to finish the guide for saving yourself out of the sticky AWS situation where people got locked out of their instance using a misconfigured firewall that blocks ssh access or the lost of PEM files, which could only solve by create a new instance and switch volumes. Anyways, it was finished
Questions
-
If a value is Copyable (implementing the Copy trait) or is a primitive type, can it always be moved (ownership can be transferred in a function call)? primitive types like i32 are inherently copyable I don't think they're inherently the same, since copying is just giving the variable a reference, and moving is changing ownership. It can be transferred in a function call but that doesn't mean they're the same as Copying
-
Can we fix the Move/Copy error by passing a reference, "borrowing" ownership, and then returning it to the caller? I think so, we can technically "borrow" ownership for this
-
If so, how would you change the code below to use references? Change the argument in line 38 and use shadow in the function to assign a different variable
Today, we got to go outside and touch some grass, doing some small activities about gradient descent. It was fun, I understand more about how it works with the new epoch system unlike what we did a year ago. Timothy gave us a thought about what happens if we choose multiple starting points, I think it would be easier to approach to the minimum where it works best.
Today, we chose to assign ourselves to prototype 4, where we checked all the dependencies missing and trained our data, currently so far, we have 5 epochs running, with each increasing around 3-4% accuracy
Around the 10-11 epoch, we notice a slight decrease in the accuracy but then it goes back up again
it's over 3 pm and the training doesn't finish yet. we're currently at the 21-22 epochs now, the maximum cap we set is 50, and we're not even finishing halfway through
I estimate that we took at least 4 more hours to finish the iteration
This is how much we got so far:
Epoch 0: 4020 / 10000
Epoch 1: 5030 / 10000
Epoch 2: 5107 / 10000
Epoch 3: 5453 / 10000
Epoch 4: 5970 / 10000
Epoch 5: 5978 / 10000
Epoch 6: 6129 / 10000
Epoch 7: 6135 / 10000
Epoch 8: 6240 / 10000
Epoch 9: 6163 / 10000
Epoch 10: 6265 / 10000
Epoch 11: 6356 / 10000
Epoch 12: 6787 / 10000
Epoch 13: 6906 / 10000
Epoch 14: 6861 / 10000
Epoch 15: 6906 / 10000
Epoch 16: 7168 / 10000
Epoch 17: 7321 / 10000
Epoch 18: 7119 / 10000
Epoch 19: 7475 / 10000
Epoch 20: 7539 / 10000
Epoch 21: 7354 / 10000
Epoch 22: 7672 / 10000
Epoch 23: 7472 / 10000
Epoch 24: 7540 / 10000
Epoch 25: 7661 / 10000
Epoch 26: 7684 / 10000
Epoch 27: 7664 / 10000
Epoch 28: 7661 / 10000
Epoch 29: 7658 / 10000
This is what we did for today, identifying Strings type
fn string_slice(arg: &str) {
println!("{}", arg);
}
fn string(arg: String) {
println!("{}", arg);
}
fn main() {
string_slice("blue");
string("red".to_string());
string(String::from("hi"));
string("rust is fun!".to_owned());
string("nice weather".into());
string(format!("Interpolation {}", "Station"));
string_slice(&String::from("abc")[0..1]);
string_slice(" hello there ".trim());
string("Happy Monday!".to_string().replace("Mon", "Tues"));
string("mY sHiFt KeY iS sTiCkY".to_lowercase());
}
Today I made some changes to the training data we have. I also finished the data training, it was late and I also got burnt out and lazy so I didn't record the last portion of the training but published the model in the release section inside the repo. You can view it here.
import mnist_loader
import network
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
net = network.Network([784, 30, 10])
net.SGD(training_data, 30, 10, 3.0, test_data=test_data)
I got bored after finishing the city addresses Rust code so I propose this TokyoAddresser struct for the Tokyo Address System
pub struct TokyoAddresser {
// Based on the Japan address system, this is what I can think of
pub building: usize,
pub block: Vec<usize>,
pub coord: Vec<usize>,
pub direction: RoadDirection,
}
I learned that the zero-shot learning example is just using ChatGPT with no answer in particular since we can say anything without it being know
That's all I can remember. It's a while now but I should have record it in some semblance
I finalize the entire chapter code and compress them into this python notebook for archive purpose
I got the data loader finished down here:
import torch
import tiktoken
from torch.utils.data import Dataset, DataLoader
class GPTDatasetV1(Dataset):
def __init__(self, txt, tokenizer, max_length, stride):
self.input_ids = []
self.target_ids = []
# Tokenize the entire text
token_ids = tokenizer.encode(txt, allowed_special={"<|endoftext|>"})
# Use a sliding window to chunk the book into overlapping sequences of max_length
for i in range(0, len(token_ids) - max_length, stride):
input_chunk = token_ids[i:i + max_length]
target_chunk = token_ids[i + 1: i + max_length + 1]
self.input_ids.append(torch.tensor(input_chunk))
self.target_ids.append(torch.tensor(target_chunk))
def __len__(self):
return len(self.input_ids)
def __getitem__(self, idx):
return self.input_ids[idx], self.target_ids[idx]
def create_dataloader_v1(txt, batch_size=4, max_length=256, stride=128, shuffle=True, drop_last=True, num_workers=0):
# Initialize the tokenizer
tokenizer = tiktoken.get_encoding("gpt2")
# Create dataset
dataset = GPTDatasetV1(txt, tokenizer, max_length, stride)
# Create dataloader
dataloader = DataLoader(
dataset,
batch_size=batch_size,
shuffle=shuffle,
drop_last=drop_last,
num_workers=num_workers
)
return dataloader
and the process code, which takes from the book. Orignally, it's where I put my notes with the code in
import tiktoken
import torch
from importlib.metadata import version
from dataloader import create_dataloader_v1
print("PyTorch version:", torch.__version__)
print("tiktoken version:", version("tiktoken"))
with open("../data/The Complete Works of William Shakespeare.txt", "r", encoding="utf-8") as f:
raw_text = f.read()
excerpt = raw_text[810:2000]
tokenizer = tiktoken.get_encoding("gpt2")
encoded_text = tokenizer.encode(raw_text)
vocab_size = 50257
output_dim = 256
context_length = 1024
token_embedding_layer = torch.nn.Embedding(vocab_size, output_dim)
pos_embedding_layer = torch.nn.Embedding(context_length, output_dim)
max_length = 4
dataloader = create_dataloader_v1(raw_text, batch_size=8, max_length=max_length, stride=max_length)
for batch in dataloader:
x, y = batch
token_embeddings = token_embedding_layer(x)
pos_embeddings = pos_embedding_layer(torch.arange(max_length))
input_embeddings = token_embeddings + pos_embeddings
break
print(input_embeddings.shape)
I planned in 2 different ways to accomplish the question at 4.2
#[wasm_bindgen]
pub fn greet(name: &str) {
alert(&format!("Hello, {}", name));
// alert(format!("Hello, {}", name.to_string()).as_str());
}
I finish up until the 4.4 chapter for the implementation of GOL (listing out)
I make a mistake by let it train for too long with too many word
This is what I got
Ep 1 (Step 002975): Train loss 4.323, Val loss 5.185
Every effort moves you, And when I have aught, And when I have aught, And when I have aught, And to the world, And when I have aught, And when I have aught, And when
After a while it stops training, probably due to this limitation that Paul finds from StackOverflow regarding WSL default set of RAM
Ep 2 (Step 003545): Train loss 4.230, Val loss 5.160
Killed
I finished the Game Of Life until chapter 4.8, with 4.9 to make sure
I update the code using wslconfig, it works like a charm, albeit it took so long (listing out)
I finished training the model after 5 days
I came to the benchmark parts of the code and tried the features out, unfortunately, it doesn't work and the error message for the compiler's benchmark tool is giving a very vague response so I decided to switch everything back. In this case, the only difference between the author's machine and my machine is mine is stronger than his because the project is probably around 7-10 years old and PC standards were different back then, so the optimization portion doesn't provide a bigger change (and excitement, except the structure) unlike his, but knowing ways to optimize the game of life is still a great thing to learn, albeit in this case, it's more extra code with extra function, which is fine
My game of life is essentially fully complete at this point with the optimization customization for the code installed, benchmark's journey is listed here:
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ cargo bench | tee before.txt
warning: unused manifest key: dependencies.web-sys.console_error_panic_hook
Compiling proc-macro2 v1.0.82
Compiling unicode-ident v1.0.12
Compiling wasm-bindgen-shared v0.2.92
Compiling once_cell v1.19.0
Compiling log v0.4.21
Compiling bumpalo v3.16.0
Compiling wasm-bindgen v0.2.92
Compiling cfg-if v1.0.0
Compiling fixedbitset v0.5.7
Compiling scoped-tls v1.0.1
Compiling quote v1.0.36
Compiling syn v2.0.63
Compiling wasm-bindgen-backend v0.2.92
Compiling wasm-bindgen-test-macro v0.3.42
Compiling wasm-bindgen-macro-support v0.2.92
Compiling wasm-bindgen-macro v0.2.92
Compiling js-sys v0.3.69
Compiling console_error_panic_hook v0.1.7
Compiling wasm-bindgen-futures v0.4.42
Compiling web-sys v0.3.69
Compiling wasm-bindgen-test v0.3.42
Compiling wasm-game-of-life v0.1.0 (/home/chikathetougemaster/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life)
warning: unused import: `wasm_bindgen::prelude::*`
--> src/lib.rs:3:5
|
3 | use wasm_bindgen::prelude::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: method `warm_neighbor_count` is never used
--> src/lib.rs:79:8
|
57 | impl Universe {
| ------------- method in this implementation
...
79 | fn warm_neighbor_count(&self, row: u32, column: u32) -> u8 {
| ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function `alert` is never used
--> src/lib.rs:11:8
|
11 | fn alert(s: &str);
| ^^^^^
warning: `extern` block uses type `str`, which is not FFI-safe
--> src/lib.rs:11:17
|
11 | fn alert(s: &str);
| ^^^^ not FFI-safe
|
= help: consider using `*const u8` and a length instead
= note: string slices have no C equivalent
= note: `#[warn(improper_ctypes)]` on by default
warning: `wasm-game-of-life` (lib) generated 4 warnings (run `cargo fix --lib -p wasm-game-of-life` to apply 1 suggestion)
error[E0554]: `#![feature]` may not be used on the stable release channel
--> benches/bench.rs:1:12
|
1 | #![feature(test)]
| ^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `wasm-game-of-life` (bench "bench") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
warning: `wasm-game-of-life` (lib test) generated 4 warnings (4 duplicates)
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ cargo install cargo-benchc
mp
Updating crates.io index
Downloaded cargo-benchcmp v0.4.4
Downloaded 1 crate (104.6 KB) in 1.18s
Installing cargo-benchcmp v0.4.4
Updating crates.io index
Downloaded docopt v1.1.1
Downloaded is-terminal v0.4.12
Downloaded encode_unicode v1.0.0
Downloaded dirs-sys-next v0.1.2
Downloaded dirs-next v2.0.0
Downloaded prettytable-rs v0.10.0
Downloaded term v0.7.0
Downloaded proc-macro2 v1.0.85
Downloaded serde_derive v1.0.203
Downloaded serde v1.0.203
Downloaded regex v1.10.5
Downloaded syn v2.0.66
Downloaded regex-syntax v0.8.4
Downloaded unicode-width v0.1.13
Downloaded regex-automata v0.4.7
Downloaded libc v0.2.155
Downloaded 16 crates (3.1 MB) in 1.24s
Compiling proc-macro2 v1.0.85
Compiling libc v0.2.155
Compiling unicode-ident v1.0.12
Compiling memchr v2.7.2
Compiling serde v1.0.203
Compiling cfg-if v1.0.0
Compiling regex-syntax v0.8.4
Compiling lazy_static v1.4.0
Compiling encode_unicode v1.0.0
Compiling unicode-width v0.1.13
Compiling strsim v0.10.0
Compiling aho-corasick v1.1.3
Compiling quote v1.0.36
Compiling syn v2.0.66
Compiling dirs-sys-next v0.1.2
Compiling is-terminal v0.4.12
Compiling dirs-next v2.0.0
Compiling term v0.7.0
Compiling prettytable-rs v0.10.0
Compiling regex-automata v0.4.7
Compiling serde_derive v1.0.203
Compiling regex v1.10.5
Compiling docopt v1.1.1
Compiling cargo-benchcmp v0.4.4
Finished release [optimized] target(s) in 16.65s
Installing /home/chikathetougemaster/.cargo/bin/cargo-benchcmp
Installed package `cargo-benchcmp v0.4.4` (executable `cargo-benchcmp`)
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ wasm-pack build
Error: crate-type must be cdylib to compile to wasm32-unknown-unknown. Add the following to your Cargo.toml file:
[lib]
crate-type = ["cdylib", "rlib"]
Caused by: crate-type must be cdylib to compile to wasm32-unknown-unknown. Add the following to your Cargo.toml file:
[lib]
crate-type = ["cdylib", "rlib"]
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ cargo bench | tee before.txt
warning: unused manifest key: dependencies.web-sys.console_error_panic_hook
warning: unused import: `wasm_bindgen::prelude::*`
--> src/lib.rs:3:5
|
3 | use wasm_bindgen::prelude::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: method `warm_neighbor_count` is never used
--> src/lib.rs:79:8
|
57 | impl Universe {
| ------------- method in this implementation
...
79 | fn warm_neighbor_count(&self, row: u32, column: u32) -> u8 {
| ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function `alert` is never used
--> src/lib.rs:11:8
|
11 | fn alert(s: &str);
| ^^^^^
warning: `extern` block uses type `str`, which is not FFI-safe
--> src/lib.rs:11:17
|
11 | fn alert(s: &str);
| ^^^^ not FFI-safe
|
= help: consider using `*const u8` and a length instead
= note: string slices have no C equivalent
= note: `#[warn(improper_ctypes)]` on by default
warning: `wasm-game-of-life` (lib) generated 4 warnings (run `cargo fix --lib -p wasm-game-of-life` to apply 1 suggestion)
Compiling wasm-game-of-life v0.1.0 (/home/chikathetougemaster/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life)
warning: `wasm-game-of-life` (lib test) generated 4 warnings (4 duplicates)
error[E0554]: `#![feature]` may not be used on the stable release channel
--> benches/bench.rs:1:12
|
1 | #![feature(test)]
| ^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `wasm-game-of-life` (bench "bench") due to 1 previous error
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ rustup default nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2024-06-10, rust version 1.81.0-nightly (a70b2ae57 2024-06-09)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
65.9 MiB / 65.9 MiB (100 %) 34.8 MiB/s in 2s ETA: 0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
15.8 MiB / 15.8 MiB (100 %) 7.9 MiB/s in 2s ETA: 0s
info: installing component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 17.3 MiB/s in 1s ETA: 0s
info: installing component 'rustc'
65.9 MiB / 65.9 MiB (100 %) 17.5 MiB/s in 3s ETA: 0s
info: installing component 'rustfmt'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu installed - rustc 1.81.0-nightly (a70b2ae57 2024-06-09)
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ cargo bench | tee before.txt
warning: unused manifest key: dependencies.web-sys.console_error_panic_hook
Compiling proc-macro2 v1.0.82
Compiling unicode-ident v1.0.12
Compiling wasm-bindgen-shared v0.2.92
Compiling log v0.4.21
Compiling once_cell v1.19.0
Compiling bumpalo v3.16.0
Compiling wasm-bindgen v0.2.92
Compiling cfg-if v1.0.0
Compiling scoped-tls v1.0.1
Compiling fixedbitset v0.5.7
Compiling quote v1.0.36
Compiling syn v2.0.63
Compiling wasm-bindgen-backend v0.2.92
Compiling wasm-bindgen-test-macro v0.3.42
Compiling wasm-bindgen-macro-support v0.2.92
Compiling wasm-bindgen-macro v0.2.92
Compiling js-sys v0.3.69
Compiling console_error_panic_hook v0.1.7
Compiling web-sys v0.3.69
Compiling wasm-bindgen-futures v0.4.42
Compiling wasm-bindgen-test v0.3.42
Compiling wasm-game-of-life v0.1.0 (/home/chikathetougemaster/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life)
warning: unused import: `wasm_bindgen::prelude::*`
--> src/lib.rs:3:5
|
3 | use wasm_bindgen::prelude::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: method `warm_neighbor_count` is never used
--> src/lib.rs:79:8
|
57 | impl Universe {
| ------------- method in this implementation
...
79 | fn warm_neighbor_count(&self, row: u32, column: u32) -> u8 {
| ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function `alert` is never used
--> src/lib.rs:11:8
|
11 | fn alert(s: &str);
| ^^^^^
warning: `extern` block uses type `str`, which is not FFI-safe
--> src/lib.rs:11:17
|
11 | fn alert(s: &str);
| ^^^^ not FFI-safe
|
= help: consider using `*const u8` and a length instead
= note: string slices have no C equivalent
= note: `#[warn(improper_ctypes)]` on by default
warning: `wasm-game-of-life` (lib) generated 4 warnings (run `cargo fix --lib -p wasm-game-of-life` to apply 1 suggestion)
warning: `wasm-game-of-life` (lib test) generated 4 warnings (4 duplicates)
Finished `bench` profile [optimized] target(s) in 6.60s
Running unittests src/lib.rs (target/release/deps/wasm_game_of_life-ba6a50ff57b8b3fe)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running benches/bench.rs (target/release/deps/bench-1a45d5b5ed5be902)
running 1 test
panicked at /home/chikathetougemaster/.cargo/registry/src/index.crates.io-6f17d22bba15001f/web-sys-0.3.69/src/features/gen_console.rs:6:5:
cannot call wasm-bindgen imported functions on non-wasm targets
test universe_ticks ... FAILED
failures:
failures:
universe_ticks
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
error: bench failed, to rerun pass `--bench bench`
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ perf record -g target/release/deps/bench-1a45d5b5ed5be902 --bench
Command 'perf' not found, but can be installed with:
sudo apt install linux-intel-iotg-tools-common # version 5.15.0-1043.49, or
sudo apt install linux-nvidia-6.2-tools-common # version 6.2.0-1003.3~22.04.1
sudo apt install linux-nvidia-tools-common # version 5.15.0-1040.40
sudo apt install linux-tools-common # version 5.15.0-88.98
sudo apt install linux-nvidia-5.19-tools-common # version 5.19.0-1014.14
sudo apt install linux-nvidia-tegra-igx-tools-common # version 5.15.0-1005.5
sudo apt install linux-nvidia-tegra-tools-common # version 5.15.0-1018.18
sudo apt install linux-xilinx-zynqmp-tools-common # version 5.15.0-1023.27
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ sudo apt install linux-tools-$(uname -r) linux-tools-generic linux-tools-common
[sudo] password for chikathetougemaster:
Sorry, try again.
[sudo] password for chikathetougemaster:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-5.15.146.1-microsoft-standard-WSL2
E: Couldn't find any package by glob 'linux-tools-5.15.146.1-microsoft-standard-WSL2'
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ sudo apt install linux-too
ls-generic linux-tools-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
hwdata linux-tools-5.15.0-112 linux-tools-5.15.0-112-generic
The following NEW packages will be installed:
hwdata linux-tools-5.15.0-112 linux-tools-5.15.0-112-generic linux-tools-common linux-tools-generic
0 upgraded, 5 newly installed, 0 to remove and 18 not upgraded.
Need to get 8296 kB of archives.
After this operation, 28.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 hwdata all 0.357-1 [26.6 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-tools-common all 5.15.0-112.122 [312 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-tools-5.15.0-112 amd64 5.15.0-112.122 [7954 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-tools-5.15.0-112-generic amd64 5.15.0-112.122 [1790 B]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-tools-generic amd64 5.15.0.112.112 [2358 B]
Fetched 8296 kB in 2s (3686 kB/s)
Selecting previously unselected package hwdata.
(Reading database ... 78943 files and directories currently installed.)
Preparing to unpack .../hwdata_0.357-1_all.deb ...
Unpacking hwdata (0.357-1) ...
Selecting previously unselected package linux-tools-common.
Preparing to unpack .../linux-tools-common_5.15.0-112.122_all.deb ...
Unpacking linux-tools-common (5.15.0-112.122) ...
Selecting previously unselected package linux-tools-5.15.0-112.
Preparing to unpack .../linux-tools-5.15.0-112_5.15.0-112.122_amd64.deb ...
Unpacking linux-tools-5.15.0-112 (5.15.0-112.122) ...
Selecting previously unselected package linux-tools-5.15.0-112-generic.
Preparing to unpack .../linux-tools-5.15.0-112-generic_5.15.0-112.122_amd64.deb ...
Unpacking linux-tools-5.15.0-112-generic (5.15.0-112.122) ...
Selecting previously unselected package linux-tools-generic.
Preparing to unpack .../linux-tools-generic_5.15.0.112.112_amd64.deb ...
Unpacking linux-tools-generic (5.15.0.112.112) ...
Setting up hwdata (0.357-1) ...
Setting up linux-tools-common (5.15.0-112.122) ...
Setting up linux-tools-5.15.0-112 (5.15.0-112.122) ...
Setting up linux-tools-5.15.0-112-generic (5.15.0-112.122) ...
Setting up linux-tools-generic (5.15.0.112.112) ...
Processing triggers for man-db (2.10.2-1) ...
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ perf --version
WARNING: perf not found for kernel 5.15.146.1-microsoft
You may need to install the following packages for this specific kernel:
linux-tools-5.15.146.1-microsoft-standard-WSL2
linux-cloud-tools-5.15.146.1-microsoft-standard-WSL2
You may also want to install one of the following packages to keep up to date:
linux-tools-standard-WSL2
linux-cloud-tools-standard-WSL2
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ sudo apt install linux-tools-standard-WSL2 linux-cloud-tools-standard-WSL2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-standard-WSL2
E: Unable to locate package linux-cloud-tools-standard-WSL2
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ sudo apt install linux-tools-5.15.146.1-microsoft-standard-WSL2 linux-cloud-tools-5.15.146.1-microsoft-standard-WSL2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-tools-5.15.146.1-microsoft-standard-WSL2
E: Couldn't find any package by glob 'linux-tools-5.15.146.1-microsoft-standard-WSL2'
E: Unable to locate package linux-cloud-tools-5.15.146.1-microsoft-standard-WSL2
E: Couldn't find any package by glob 'linux-cloud-tools-5.15.146.1-microsoft-standard-WSL2'
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ perf record -g target/release/deps/bench-1a45d5b5ed5be902 --bench
WARNING: perf not found for kernel 5.15.146.1-microsoft
You may need to install the following packages for this specific kernel:
linux-tools-5.15.146.1-microsoft-standard-WSL2
linux-cloud-tools-5.15.146.1-microsoft-standard-WSL2
You may also want to install one of the following packages to keep up to date:
linux-tools-standard-WSL2
linux-cloud-tools-standard-WSL2
Optimization result before applying optimization
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ wc -c pkg/wasm_game_of_life_bg.wasm
24471 pkg/wasm_game_of_life_bg.wasm
Optimization result after applying optimization
chikathetougemaster@LAPTOP-8U2KT215:~/upper-division-cs/sc-24sp/assignments/AkinaS/wasm-game-of-life$ wc -c pkg/wasm_game_of_life_bg.wasm
18486 pkg/wasm_game_of_life_bg.wasm
not too much but it's the best
I just finished the Software Construction section of this class, my after-thought for the Rust programming language is it's fun but the syntax's very different from what I have learned so far, it looks like a mixed of C with Haskell, imperative programming to functional programming (They even have fold types, I haven't heard of that in like a year ago when I was learning Haskell in class). But it's fun in general.
Unrelated but I also learned that the Rustlings folder can't be deleted, same with the submodules system because it's a repo in another repo, it was embedded inside. I got tired of how to deal with them so I've updated the .gitmodules
to add ignore = all
for the Rustlings repo to not tag in with the main upper-division repo. Changes can be seen here.