- A simple note for how to start multi-node-training on slurm scheduler with PyTorch.
- Useful especially when scheduler is too busy that you cannot get multiple GPUs allocated, or you need more than 4 GPUs for a single job.
- Requirement: Have to use PyTorch DistributedDataParallel(DDP) for this purpose.
- Warning: might need to re-factor your own code.
- Warning: might be secretly condemned by your colleagues because using too many GPUs.
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
// https://github.com/Bukkit/CraftBukkit/blob/7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2/src/main/java/net/minecraft/server/EntityPlayer.java#L596 | |
//Method to open an anvil inventory to a player | |
public static void openAnvil(Player player, Inventory inventory){ | |
//Get our EntityPlayer | |
EntityPlayer p = ((CraftPlayer) player).getHandle(); | |
//Create the AnvilContainer | |
AnvilContainer container = new AnvilContainer(p); |
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
package your-package; | |
import org.bukkit.ChatColor; | |
import org.bukkit.entity.Player; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.util.HashMap; | |
/** |
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
public static String romanNumerals (int value) { | |
String[] values = { | |
"M", "CM", "D", "CD", "C", "XC", | |
"L", "XL", "X", "IX", "V", "IV", "I" | |
}; | |
int[] correspondents = { | |
1000, 900, 500, 400, 100, 90, | |
50, 40, 10, 9, 5, 4, 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
How do I make an effect that spirals, becoming smaller as time goes on? | |
So, as we know a circle is defined by the equation: | |
r^2 = (x - a)^2 + (y - b)^2 | |
So that gets us the general equation with which we will be working. As a result, we should also know that: | |
as a->∞ = translation in the x, right | |
as b->∞ = translation in the y, up |
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
package com.comphenix.example; | |
import java.io.BufferedInputStream; | |
import java.io.DataInput; | |
import java.io.DataInputStream; | |
import java.io.DataOutput; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; |
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
#!/usr/bin/perl | |
use strict; | |
for my $i (1..16420) { | |
system("wget -O data/bf.$i.html 'http://forums.bukkit.org/members/?page=$i'"); | |
sleep 2; | |
} |
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
package com.comphenix.example; | |
import java.lang.reflect.Field; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.UUID; | |
import java.util.concurrent.ConcurrentMap; | |
import javax.annotation.Nonnull; | |
import javax.annotation.Nullable; |
NewerOlder