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
if (Translator.BetterBibTeX) { | |
if (tex.has.doi) { | |
tex.remove("doi"); | |
} | |
if (tex.has.url) { | |
tex.remove("url"); | |
} | |
if (tex.has.issn) { | |
tex.remove("issn"); | |
} |
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
type: ActionsTagsBackup | |
author: jaeheelee | |
platformVersion: 7.0.0-beta.68+c31a40c74 | |
pluginVersion: 1.0.0-beta.35 | |
timestamp: '2024-03-26T09:55:19.478Z' | |
actions: | |
default0: | |
event: 1 | |
operation: 1 | |
data: /unread |
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
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesPackage{commenting}[2022/10/29 by Jae Hee Lee (http://jaeheelee.de)] | |
\RequirePackage{hyperref} | |
\RequirePackage{ifdraft} | |
\RequirePackage{graphicx} | |
\RequirePackage{xcolor} | |
\RequirePackage{xspace} | |
\RequirePackage{environ} | |
\RequirePackage{soul} | |
\RequirePackage{twemojis} |
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
model.zero_grad() # Reset gradients tensors | |
for i, (inputs, labels) in enumerate(training_set): | |
predictions = model(inputs) # Forward pass | |
loss = loss_function(predictions, labels) # Compute loss function | |
loss = loss / accumulation_steps # Normalize our loss (if averaged) | |
loss.backward() # Backward pass | |
if (i+1) % accumulation_steps == 0: # Wait for several backward steps | |
optimizer.step() # Now we can do an optimizer step | |
model.zero_grad() # Reset gradients tensors | |
if (i+1) % evaluation_steps == 0: # Evaluate the model when we... |
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
/*----------------------------------------------------------------------------- | |
| Copyright (c) Jupyter Development Team. | |
| Distributed under the terms of the Modified BSD License. | |
|----------------------------------------------------------------------------*/ | |
/* | |
The following CSS variables define the main, public API for styling JupyterLab. | |
These variables should be used by all plugins wherever possible. In other | |
words, plugins should not define custom colors, sizes, etc unless absolutely | |
necessary. This enables users to change the visual theme of JupyterLab |
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
{ | |
"shortcuts": [ | |
{ | |
"command": "notebook:toggle-all-cell-line-numbers", | |
"keys": [ | |
"Alt L" | |
], | |
"selector": ".jp-Notebook:focus" | |
}, | |
// Moving cells |
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 collections import OrderedDict | |
from torchvision import models | |
def gen_feature_extractor(model, output_layer): | |
layers = OrderedDict() | |
for (k, v) in model._modules.items(): | |
layers[k] = v | |
if k == output_layer: |
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
def flatten_json(json): | |
if type(json) == dict: | |
for k, v in list(json.items()): | |
if type(v) == dict: | |
flatten_json(v) | |
json.pop(k) | |
for k2, v2 in v.items(): | |
json[k+"."+k2] = v2 | |
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 torch | |
def hamming_score(pred, answer): | |
out = ((pred & answer).sum(dim=1) / (pred | answer).sum(dim=1)).mean() | |
if out.isnan(): | |
out = torch.tensor(1.0) | |
return out | |
answer = torch.tensor([[0, 1, 0], [0, 1, 1], [1, 0, 1], [0, 0, 1]]) |
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
{ | |
"title": "Emacs keys", | |
"rules": [ | |
{ | |
"description": "Change right_option + a to right_control + a", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "a", |
NewerOlder