Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace System.Linq
{
public class KeyEqualityComparer<T> : IEqualityComparer<T>
{
private readonly Func<T, T, bool> comparer;
#%%
from fastai.tabular import *
from fastai.vision import *
from fastai.metrics import *
def _maybe_add_crop_pad(tfms):
assert is_listy(tfms) and len(tfms) == 2, "Please pass a list of two lists of transforms (train and valid)."
tfm_names = [[tfm.__name__ for tfm in o] for o in tfms]
return [([crop_pad()] + o if 'crop_pad' not in n else o) for o,n in zip(tfms, tfm_names)]