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 torch.distributions.kl import _KL_REGISTRY | |
def view_kl_options(): | |
""" | |
Displays all combinations of distributions that can be used in | |
torch's kl_divergence function. Iterates through the registry | |
and prints out the registered name combos. | |
""" | |
names = [(k[0].__name__, k[1].__name__) for k in _KL_REGISTRY.keys()] | |
max_name_len = max([len(t[0]) for t in names]) |
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 random | |
import seaborn as sns | |
def random_colors(n_colors, palette='hls', xkcd_colors=[]): | |
""" | |
Generates list of random RGB colors. | |
Args: | |
n_colors (int): Number of random colors to return. |
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/env python | |
import sys | |
import rospy | |
from matplotlib import colors | |
from geometry_msgs.msg import Point, PoseStamped | |
from visualization_msgs.msg import Marker | |
# Log levels | |
INFO = 0 | |
WARN = 1 |