conda create -n habitat_headless python=3.6 cmake=3.14.0
conda activate habitat_headless
cd ~/github/habitat-sim/
pip install -r requirements.txt
conda activate habitat_headless
| import torch | |
| import numpy as np | |
| # This will be share by both iterations and will make the second backward fail ! | |
| a = torch.ones(3, requires_grad=True) * 4 | |
| # Instead, do | |
| # a = torch.tensor(np.ones(3) * 4, requires_grad=True) | |
| for i in range(10): |
conda create -n habitat_headless python=3.6 cmake=3.14.0
conda activate habitat_headless
cd ~/github/habitat-sim/
pip install -r requirements.txt
conda activate habitat_headless
| import numpy as np | |
| from numpy.linalg import norm | |
| from scipy.special import erf | |
| def get_rotation_matrix(x): | |
| """ | |
| Get rotation matrix for the space that aligns vector x with y = [1, 0, 0, 0, 0, ..., 0] | |
| See: https://math.stackexchange.com/questions/598750/finding-the-rotation-matrix-in-n-dimensions | |
| """ |
| import numpy as np | |
| from PIL import Image | |
| np.random.seed(2) | |
| import torchvision | |
| import torch | |
| # torch.manual_seed(0) | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| from torchvision import transforms | |
| import tensorflow as tf |
| import numpy as np | |
| np.random.seed(0) | |
| import torch | |
| import torch.nn as nn | |
| import tensorflow as tf | |
| import matplotlib.pyplot as plt | |
| slim = tf.contrib.slim |
| import networkx as nx | |
| def to_directed(graph): | |
| G = nx.DiGraph(source=[], sink=[]) | |
| for node in range(graph.number_of_nodes()): | |
| neighbors = list(graph.neighbors(node)) | |
| neighbors.sort() | |
| if node < neighbors[0]: # input nodes | |
| G.graph['source'].append(node) |