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
""" | |
This script creates an HTML file that displays success probabilities for Changeling the Dreaming 20th Anniversary Edition. | |
See lines 27-34 for parameters that you might want to change. Note that large num_attempts will slow down the script. | |
You can run the code in a Jupyter Notebook or similar to display the roll table interactively in your notebook. | |
CtD20 differs from prior editions: willpower success can be cancelled by a "1" and speciality grants two successes on 10. | |
If you want to change how this works (e.g. VtM 3e willpower can't be cancelled), find and modify def roll_dice(...) below. | |
License: do whatever you want with this file, see Unlicense for details https://en.wikipedia.org/wiki/Unlicense | |
""" | |
import random |
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
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
Loading
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
import time | |
from math import isfinite | |
import pandas as pd | |
import selenium.webdriver | |
data = pd.read_csv('avtomaticheskaia-obrabotka-tekstov-2020-autumn - avtomaticheskaia-obrabotka-tekstov-2020-autumn.csv') | |
# ^-- file format: https://docs.google.com/spreadsheets/d/1GcdT7eID_wNMjjxV0v6T0kOBRHn6Bg79qO80vFY_zgg/edit#gid=781547499 | |
assignment_title = 'Week9 - Word alignment' |
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
# authors: jheuristic, qwicen | |
import torch | |
import torch.nn as nn | |
import threading | |
device = 'cuda' if torch.cuda.is_available() else 'cpu' | |
class TrainableSparseMatrix(nn.Module): | |
def __init__(self, indices, values, **kwargs): | |
""" |
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, torch.nn as nn, torch.nn.functional as F | |
import numpy as np | |
class OneCycleSchedule: | |
""" A simplified torch lr schedule that updates learning rate before every opt.step """ | |
def __init__(self, optimizer, **kwargs): | |
""" | |
:type optimizer: torch.optim.Optimizer | |
:param kwargs: see self.update_learning_rate |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder