Live coding 13

@Daniel thank you for taking the time to make these notes! they are amazing and amazingly helpful to possibly hundreds of people like me (if not thousands!) , So, thank you!!

3 Likes

Thanks Mike, this is very encouraging!

I will do my best to make the notes more readable and useful for discussion and reference here in the forum. All suggestions and questions about the notes are very appreciated.

4 Likes

Hi Jeremy, after tried to write a note on both obsidian and forum, I still would like to try the possibility to automate the replacing my note image links with forum updated image links. Please see the image below for the detailed formats of two types of links, and you can also see the unfinished note on forum

I am doing search and replace on vscode, and it sorts of takes 5-7 actions for me to replace a single image link and put them into a hide details to make them collapsible by hand. I can imagine there will be more images when I update my notes when I revisit the videos. So I think it is a good idea to be able to automate the process as much as I can.

According to previous walkthrus, I know we can use vim to do search on every line of the file for some pattern, but here I kinda need a small loop program to loop through each my forum-uploaded-image link and search for my-obsidian-image-link and replace it with the former link. Is it possible to achieve such automation with vim?

If such automation is not feasible in vim, then how can I use vim to automate the process as much as I can? Could you give me some guidance on this? Thanks

Sure let’s write a script to do it. Can you attach in a reply the text file of the obsidian version of the unfinished note? Then tomorrow in the walkthru we can write a script to fix it up for you! I just need those two versions of the post.

1 Like

Wow! Thanks Jeremy, this is wonderful and I am very much looking forward to watching the live coding! (unfortunately, I won’t be able to join the live session)

I have posted the unfinished post in live coding 15 and you can go to it by the link in the quote above. You can find all the forum uploaded images at the bottom of the note. I have also made the unfinished note post into a wiki in case it is needed so.

1 Like

I think this regex would extract the file names but I’m not sure how to pass it to the grep.

(?<=\[\[).+?(?=\|)

Screen Shot 2022-06-30 at 9.00.51 AM

But using less sophisticated means, I was able to extract the file names from the list of files at the end, but I haven’t gotten around to using these to index into the post with the filenames and then replace the placeholder with the entry that would show the image.

% grep '\!\[\[' daniel-fastaiforum-post1.txt | cut -f 1 -d '|' | cut -f 3 -d'[' | cut -f 1 -d']' | sort

Datasets.dataloaders-parameters.png
add-to-class.png
create-issue.png
dblock-datasets-first.png

1 Like

Hi Mike, thanks for trying to help!

1 Like

Hi Folks,

I came across an error when playing with Pets classification when at the output I have 2 categories:

db = DataBlock(blocks=(ImageBlock, CategoryBlock, CategoryBlock), ...)

the error happens when I try to interpret the results. For example:

learn.show_results() result in AssertionError: Match length mismatch

Interpretation.from_learner(learn) result in TypeError: loss_func() got an unexpected keyword argument 'reduction'

Did anyone have the same problems with multiple Categories at the output of the model?

Notebook to play with: FastAI Errors: Vision learner with 2 outputs | Kaggle

I could not reproduce Jaremy’s error rate either - did you figure out why?

This wasn’t a lesson - it was an interactive live coding discussion. If you’re looking for something that has more of a “flow” you’d be best off sticking with the lessons, not live coding.

1 Like