(Too big for a single gist, so see first reply for the rest)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# I added all the imports by hand | |
import torch | |
from torchvision.datasets import ImageFolder | |
from torchvision import transforms,models | |
from torch import nn,optim | |
# For all functions including this one, I wrote the name and docstring, and sometimes also the param names | |
def finetune(folder, model): | |
"""fine tune pytorch model using images from folder and report results on validation set""" | |
if not os.path.exists(folder): raise ValueError(f"{folder} does not exist") |
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 fastcore.utils import * | |
host = 8888,'localhost' | |
sock = start_server(*host) | |
print(f'Serving on {host}...') | |
while True: | |
conn,addr = sock.accept() | |
with conn: | |
data = conn.recv(1024) | |
print(data.decode()) |
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 fastcore.all import * | |
from typing import _SpecialForm,_GenericAlias,Optional,Union | |
@patch | |
def __instancecheck__(self:_SpecialForm, typs): return isinstance(self, typs) | |
@patch(cls_method=True) | |
def __subclasscheck__(self:_SpecialForm, cls): return type.__subclasscheck__(self, cls) | |
@patch | |
def __subclasscheck__(self:_GenericAlias, cls): | |
return issubclass(cls.__origin__ if isinstance(cls, _GenericAlias) else cls, self.__origin__) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<body> | |
<h1>Claire's Number Line</h1> | |
<table> | |
<thead> | |
<tr> | |
<th style="text-align:left"> ones<br/>tens</th> | |
<th style="background-color:hsla(284, 84%, 59%, 1)">0</th> | |
<th style="background-color:hsla(347, 87%, 78%, 1)">1</th> | |
<th style="background-color:hsla(46, 100%, 79%, 1)">2</th> | |
<th style="background-color:hsla(166, 70%, 84%, 1)">3</th> |
For a version without the collapsible details sections (so you can search the whole thing in your browser), click here.