As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
import numpy as np | |
def smith_waterman(a: str, b: str, alignment_score: float = 1, gap_cost: float = 1) -> float: | |
""" | |
Compute the Smith-Waterman alignment score for two strings. | |
See https://en.wikipedia.org/wiki/Smith%E2%80%93Waterman_algorithm#Algorithm | |
This implementation has a fixed gap cost (i.e. extending a gap is considered | |
free). In the terminology of the Wikipedia description, W_k = {c, c, c, ...}. | |
This implementation also has a fixed alignment score, awarded if the relevant |
import numpy as np | |
import tensorflow as tf | |
# Create function to apply a grey patch on an image | |
def apply_grey_patch(image, top_left_x, top_left_y, patch_size): | |
patched_image = np.array(image, copy=True) | |
patched_image[top_left_y:top_left_y + patch_size, top_left_x:top_left_x + patch_size, :] = 127.5 | |
return patched_image |