Skip to content

Instantly share code, notes, and snippets.

View Marvinmw's full-sized avatar

Marvinmw

  • Moon and Earth
  • Moon and Earth
View GitHub Profile
@HarshTrivedi
HarshTrivedi / pad_packed_demo.py
Last active March 2, 2024 16:49 — forked from Tushar-N/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@hasanbayatme
hasanbayatme / README.md
Last active January 10, 2021 20:14
Fixes Ubuntu broken packages. Accepts an argument to what action to apply to broken packages. you can use upgrade and install commands, default action is remove.

Fix Broken

This script allows you to fix the broken ubuntu packages.

Most of the time the broken packages will be fixed by removing them.

Getting Started Documentation License

Getting Started

@geramirez
geramirez / texttopdftools.md
Created February 9, 2015 20:54
Command Line Text to PDF Tools