Beyond Vector Spaces: Compact Data Representation as Differentiable Weighted Graphs