Question: Represent the text to find a very short summary (1-2 sentences max)

Question: Computer vision tasks such as image classification, image retrieval and few-shot learning are currently dominated by Euclidean and spherical embeddings, so that the final decisions about class belongings or the degree of similarity are made using linear hyperplanes, Euclidean distances, or spherical geodesic distances (cosine similarity). In this work, we demonstrate that in many practical scenarios hyperbolic embeddings provide a better alternative. Figure 1: An example of two-dimensional Poincaré embeddings computed by a hyperbolic neural network trained on MNIST, and evaluated additionally on Omniglot. Ambiguous and unclear images from MNIST, as well as most of the images from Omniglot are embedded near the center, while samples with clear class labels (or characters from Omniglot similar to one of the digits) lie near the boundary. High-dimensional embeddings are ubiquitous in modern computer vision. Many, perhaps most, modern computer vision systems learn non-linear mappings (in the form of deep convolutional networks) from the space of images or image fragments into high-dimensional spaces. The operations at the end of deep networks imply a certain type of geometry of the embedding spaces. For example, image classification networks use linear operators (matrix multiplication) to map embeddings in the penultimate layer to class logits. The class boundaries in the embedding space are thus piecewise-linear, and pairs of classes are separated by Euclidean hyperplanes. The embeddings learned by the model in the penultimate layer, therefore, live in the Euclidean space. The same can be said about systems where Euclidean distances are used to perform image retrieval (; ;), face recognition or one-shot learning . Alternatively, some few-shot learning , face recognition and person re-identification methods learn spherical embeddings, so that sphere projection operator is applied at the end of a network that computes the embeddings. Cosine similarity (closely associated with sphere geodesic distance) is then used by such architectures to match images. Euclidean spaces with their zero curvature and spherical spaces with their positive curvature have certain profound implications on the nature of embeddings that existing computer vision systems can learn. In this work, we argue that hyperbolic spaces with negative curvature might often be more appropriate for learning embedding of images. Towards this end, we add the recently-proposed hyperbolic network layers to the end of several computer vision networks, and present a number of experiments corresponding to image classification, one-shot, and few-shot learning and person re-identification. We show that in many cases, the use of hyperbolic geometry improves the performance over Euclidean or spherical embeddings. Motivation for hyperbolic image embeddings. The use of hyperbolic spaces in natural language processing (; ;) is motivated by their natural ability to embed hierarchies (e.g., tree graphs) with low distortion . Hierarchies are ubiquitous in natural language processing. First, there are natural hierarchies corresponding to, e.g., biological taxonomies and linguistic ontologies. Likewise, a more generic short phrase can have many plausible continuations and is therefore semantically-related to a multitude of long phrases that are not necessarily closely related to each other (in the semantic sense). The innate suitability of hyperbolic spaces to embedding hierarchies (a;) explains the success of such spaces in natural language processing . Here, we argue that similar hierarchical relations between images are common in computer vision tasks (Figure 2). One can observe the following example cases: • In image retrieval, an overview photograph is related to many images that correspond to the close-ups of different distinct details. Likewise, for classification tasks in-the-wild, an image containing the representatives of multiple classes is related to images that contain representatives of the classes in isolation. Embedding a dataset that contains composite images into continuous space is therefore similar to embedding a hierarchy. • In some tasks, more generic images may correspond to images that contain less information and are therefore more ambiguous. E.g., in face recognition, a blurry and/or low-resolution face image taken from afar can be related to many high-resolution images of faces that clearly belong to distinct people. Again natural embeddings for image datasets that have widely varying image quality/ambiguity calls for retaining such hierarchical structure. In order to build deep learning models which operate on the embeddings to hyperbolic spaces, we capitalize on recent developments, which construct the analogues of familiar layers (such as a feed-forward layer, or a multinomial regression layer) in hyperbolic spaces. We show that many standard architectures used for tasks of image classification, and in particular in the few-shot learning setting can be easily modified to operate on hyperbolic embeddings, which in many cases also leads to their improvement. Formally, n-dimensional hyperbolic space denoted as H n is defined as the homogeneous, simply connected n-dimensional Riemannian manifold of constant negative sectional curvature. The property of constant negative curvature makes it analogous to the ordinary Euclidean sphere (which has constant positive curvature), however, the geometrical properties of the hyperbolic space are very different. It is known that hyperbolic space cannot be isometrically embedded into Euclidean space , but there exist several well-studied models of hyperbolic geometry. In every model a certain subset of Euclidean space is endowed with a hyperbolic metric, however, all these models are isomorphic to each other and we may easily move from one to another base on where the formulas of interest are easier. We follow the majority of NLP works and use the Poincaré ball model. Investigating the alternative models that might provide better numerical stability remain future work (though already started in the NLP community (; b) ). Here, we provide a very short summary of the model. 1− x 2 is the conformal factor and g E is the Euclidean metric tensor g E = I n. In this model the geodesic distance between two points is given by the following expression: In order to define the hyperbolic average, we will make use of the Klein model of hyperbolic space. Similarly to the Poincaré model, it is defined on the set K n = {x ∈ R n : x < 1}, however, with a different metric, not relevant for further discussion. In Klein coordinates, the hyperbolic average (generalizing the usual Euclidean mean) takes the most simple form, and we present the necessary formulas in Section 4. From the viewpoint of hyperbolic geometry, all points of Poincaré ball are equivalent. The models that we consider below are, however, hybrid in the sense that most layers use Euclidean operators, such as standard generalized convolutions, while only the final layers operate within the hyperbolic geometry framework. The hybrid nature of our setups makes the origin a special point, since from the Euclidean viewpoint the local volumes in Poincare ball expand exponentially from the origin to the boundary. This leads to the useful tendency of the learned embeddings to place more generic/ambiguous objects closer to the origin, while moving more specific objects towards the boundary. The distance to the origin in our models therefore provides a natural estimate of uncertainty, that can be used in several ways, as we show below. Hyperbolic language embeddings Hyperbolic embeddings in the natural language processing field have recently been very successful (; . They are motivated by the innate ability of hyperbolic spaces to embed hierarchies (e.g., tree graphs) with low distortion (b;). The main in this area states that any tree can be embedded into (two dimensional) hyperbolic space with arbitrarily low distortion. Another direction of research, more relevant to the present work is based on imposing hyperbolic structure on activations of neural networks ). The task of few-shot learning, which has recently attracted a lot of attention, is concerned with the overall ability of the model to generalize to unseen data during training. A body of papers devoted to few-shot classification that focuses on metric learning methods includes Siamese Networks , Matching Networks , Prototypical Networks , Relation Networks . In contrast, other models apply meta-learning to few-shot learning: e.g., MAML by , Meta-Learner LSTM by , SNAIL by . While these methods employ either Euclidean or spherical geometries (like in ), there is no model extension to hyperbolic space. Person re-identification The task of person re-identification is to match pedestrian images captured by possibly non-overlapping surveillance cameras. Papers (; ; adopt the pairwise models that accept pairs of images and output their similarity scores. The ing similarity scores are used to classify the input pairs as being matching or non-matching. Another popular direction of work includes approaches that aim at learning a mapping of the pedestrian images to the Euclidean descriptor space. Several papers, e.g., use verification loss functions based on the Euclidean distance or cosine similarity. A number of methods utilize a simple classification approach for training (; ; ;), and Euclidean distance is used in test time. In our work we strongly rely on the apparatus of hyperbolic neural networks developed in. Hyperbolic networks are extensions of conventional neural networks in a sense that they generalize typical neural network operations to those in hyperbolic space using the formalism of Möbius gyrovector spaces. In this paper, the authors present the hyperbolic versions of feedforward networks, multinomial logistic regression, and recurrent neural networks. In Appendix A we discuss the hyperbolic functions and layers used in hyperbolic neural networks. Similarly to the paper, we use an additional hyperparameter c corresponding to the radius of the Poincaré ball, which is then defined in the following manner: D n c = {x ∈ R n : c x 2 < 1, c ≥ 0}. The corresponding conformal factor is then modified as λ c x = 2 1−c x 2. In practice, the choice of c allows one to balance between hyperbolic and Euclidean geometries, which is made precise by noting that with c → 0 all the formulas discussed below take their usual Euclidean form. Hyperbolic averaging One important operation common in image processing is averaging of feature vectors, used, e.g., in prototypical networks for few-shot learning . In the Euclidean setting this operation takes the form (x 1, . . ., x N) → 1 N i x i. Extension of this operation to hyperbolic spaces is called the Einstein midpoint and takes the most simple form in Klein coordinates: where are the Lorentz factors. Recall from the discussion in Section 2 that the Klein model is supported on the same space as the Poincaré ball, however the same point has different coordinate representations in these models. Let x D and x K denote the coordinates of the same point in the Poincaré and Klein models correspondingly. Then the following transition formulas hold. Thus, given points in the Poincaré ball we can first map them to the Klein model, compute the average using Equation, and then move it back to the Poincaré model. Practical aspects of implementation While implementing most of the formulas described above is straightforward, we employ some tricks to make the training more stable. • To ensure numerical stability we perform clipping by norm after applying the exponential map, which constrains the norm to not exceed (1 − 10 −3). • Some of the parameters in the aforementioned layers are naturally elements of D c n. While in principle it is possible to apply Riemannian optimization techniques to them (e.g., previously proposed Riemannian Adam optimizer ), we did not observe any significant improvement. Instead, we parametrized them via ordinary Euclidean parameters which were mapped to their hyperbolic counterparts with the exponential map and used the standard Adam optimizer. Gromov's δ-hyperbolicity A necessary parameter for embedding to Poincaré disk is its radius. In hyperbolic neural networks, one has a curvature parameter c, which is inversed squared disk radius:. For the Euclidean case, i.e., c = 0, the corresponding radius would be equal to infinity. The disk radius is closely related to the notion of Gromov's δ-hyperbolicity , as we will show later in this section. Intuitively, this δ value shows'how hyperbolic is a metric space'. For example, for graphs, δ represents how'far' the graph is from a tree, which is known to be hyperbolic . Hence, we can compute the corresponding δ-hyperbolicity value to find the right Poincaré disk radius for an accurate embedding. Formally, δ-hyperbolicity is defined as follows; we emphasize that this notion is defined for any metric space (X, d). First, we need to define Gromov product for points x, y, z ∈ X: Then, the δ is the minimal value such that the following four-point condition holds for all points x, y, z, w ∈ X: In practice, it suffice to find the δ for some fixed point w 0. A more computational friendly way to define δ is presented in . Having a set of points, we first compute the matrix A of pairwise Gromov products. After that, the δ value is simply the largest coefficient in the matrix (A ⊗ A) − A, where ⊗ denotes the min-max matrix product Relation between δ-hyperbolicity and Poincaré disk radius It is known that the standard Poincaré ball is δ-hyperbolic with δ P = log(1 + √ 2) ∼ 0.88. Using this constant we can estimate the radius of Poincaré disk suitable for an embedding of a specific dataset. Suppose that for some dataset X we have found that its natural Gromov's δ is equal to δ X. Then we can estimate c(X) as follows. Estimating hyperbolicity of a dataset In order to verify our hypothesis on hyperbolicity of visual datasets we compute the scale-invariant metric, defined as δ rel (X) = 2δ(X) diam(X), where diam(X) denotes the set diameter . By construction, δ rel (X) ∈ and specifies how close is the dataset to a perfect hyperbolic space. For instance, trees which are discrete analogues of a hyperbolic space (under the natural shortest path metric) have δ rel equal to 0. We computed δ rel for various datasets we used for experiments. As a natural distance between images we used the standard Euclidean distance between the features extracted with VGG16 . Our are summarized in Table 1. We observe that degree of hyperbolicity in image datasets is quite high, as the obtained δ rel are significantly closer to 0 than to 1 (which corresponds to total non-hyperbolicity), which supports our hypothesis. Embeddings are computed by a hyperbolic neural network trained for the MNIST classification task. We observe a significant difference between these distributions: embeddings of the Omniglot images are much closer to the origin. Table 2 provides the KS distances between the distributions. In our further experiments, we concentrate on the few-shot classification and person re-identification tasks. The experiments on the Omniglot dataset serve as a starting point, and then we move towards more complex datasets. Afterwards, we consider two datasets, namely: MiniImageNet and Caltech-UCSD Birds-200-2011 (CUB) . Here, for each dataset, we train four models: for one-shot five-way and five-shot five-way classification tasks both in the Euclidean and hyperbolic spaces. Finally, we provide the re-identification for the two popular datasets: Market-1501 and DukeMTMD . Further in this section, we provide a thorough description of each experiment. Our code is available at github 1. In this subsection, we validate our hypothesis which claims that if one trains a hyperbolic classifier, then a distance of the Poincaré ball embedding of an image can serve as a good measure of confidence of a model. We start by training a simple hyperbolic convolutional neural network on the MNIST dataset. The output of the last hidden layer was mapped to the Poincaré ball using the exponential map and was followed by the hyperbolic MLR layer. After training the model to ∼ 99% test accuracy, we evaluate it on the Omniglot dataset (by resizing images to 28 × 28 and normalizing them to have the same color as MNIST). We then evaluate the hyperbolic distance to the origin of embeddings produced by the network on both datasets. The closest Euclidean analogue to this approach would be comparing distributions of p max, maximum class probability predicted by the network. For the same range of dimensions we train ordinary Euclidean classifiers on MNIST, and compare these distributions for the same sets. Our findings are summarized in Figure 3 and Table 2. We observe that distances to the origin present a more statistically significant indicator of the dataset dissimilarity in 3 cases. We have visualized the learned MNIST and Omniglot embeddings on Figure 1. We observe that more'unclear' images are located near the center, while the images that are easy to classify are located closer to the boundary. Table 2: Kolmogorov-Smirnov distances between the distributions of distance to the origin of the MNIST and Omniglot datasets embedded into the Poincaré ball with the hyperbolic classifier trained on MNIST, and between the distributions of p max (maximum probablity predicted for a class) for the Euclidean classifier trained on MNIST and evaluated on the same sets. See further description in Subsection 5.1 and visualization on Figure 3. We observe that distance to the origin mostly presents a more statistically significant indicator of the dataset dissimilarity. We hypothesize that a certain class of problems -namely the few-shot classification task can benefit from hyperbolic embeddings. The starting point for our analysis is the experiments on the Omniglot dataset for few-shot classification. This dataset consists of the images of 1623 characters sampled from 50 different alphabets; each character is supported by 20 examples. We test several fewshot learning algorithms to see how hyperbolic embeddings affect them. In order to validate if hyperbolic embeddings can improve models performing on the state-of-the-art level, for the baseline architecture, we choose the prototype network (ProtoNet) introduced in the paper with four convolutional blocks in a backbone. The specifics of the experimental setup can be found in B. In ProtoNet, one uses a so-called prototype representation of a class, which is defined as a mean of the embedded support set of a class. Generalizing this concept to hyperbolic space, we substitute the Euclidean mean operation by HypAve, defined earlier in the Equation. Results are presented in Table 3. We can see that in some scenarios, in particular for one-shot learning, hyperbolic embeddings are more beneficial, while in other cases are slightly worse. Relative simplicity of this dataset may explain why have not observed significant benefit of hyperbolic embeddings. We further test our approach on more advanced datasets. MiniImageNet dataset is the subset of ImageNet dataset , which contains of 100 classes represented by 600 examples per class. We use the following split provided in the paper : training dataset consists of 64 classes, validation dataset is represented by 16 classes, and the remaining 20 classes serve as a test dataset. As a baseline model, we again use prototype network (ProtoNet). We test the models on tasks for one-shot and five-shot classifications; the number of query points in each batch always equals to 15. All implementation details can be found in Appendix B. Table 4 illustrates the obtained on MiniImageNet dataset. For MiniImageNet dataset, the of the other models are available for the same classification tasks (i.e., for one-shot and fiveshot learning). Therefore, we can compare our obtained to those that were reported in the original papers. From these experimental , we may observe a slight gain in model accuracy. The CUB dataset consists of 11, 788 images of 200 bird species and was designed for fine-grained classification. We use the split introduced in : 100 classes out of 200 were used for training, 50 for validation and 50 for testing. Also, following , we make the same pre-processing step by resizing each image to the size of 64×64. The implementation details can be found in B. Our findings on the experiments on the CUB dataset are summarized in Table 4. Interestingly, for this dataset, the hyperbolic version significantly outperforms its Euclidean counterpart. The DukeMTMC-reID dataset contains 16, 522 training images of 702 identities, 2228 query images of 702 identities and 17, 661 gallery images. Market1501 contains 12936 training images of 751 identities, 3368 queries of 750 identities and 15913 gallery images respectively. We report Rank1 of the Cumulative matching Characteristic Curve and Mean Average Precision for both datasets. We refer the reader to B for a more detailed description of the experimental setting. The are reported after the 300 training epochs. As we can see in the Table 5, hyperbolic version generally performs better than the baseline, while the gap between the baseline and hyperbolic versions' is decreasing for larger dimensionalities. We have investigated the use of hyperbolic spaces for image embeddings. The models that we have considered use Euclidean operations in most layers, and use the exponential map to move from the Euclidean to hyperbolic spaces at the end of the network (akin to the normalization layers that are used to map from the Euclidean space to Euclidean spheres). The approach that we investigate here is thus compatible with existing backbone networks trained in Euclidean geometry. At the same time, we have shown that across a number of tasks, in particular in the few-shot image classification, learning hyperbolic embeddings can in a substantial boost in accuracy. We speculate that the negative curvature of the hyperbolic spaces allows for embeddings that are better conforming to the intrinsic geometry of at least some image manifolds with their hierarchical structure. Future work may include several potential modifications of the approach. We have observed that the use of hyperbolic embeddings improves performance for some problems and datasets, while not helping others. A better understanding of when and why the use of hyperbolic geometry is justified is therefore needed. Also, we note that while all hyperbolic geometry models are equivalent in the continuous setting, fixed-precision arithmetic used in real computers breaks this equivalence. In practice, we observed that care should be taken about numeric precision effects (following, we clip the embeddings to minimize numerical errors during learning). Using other models of hyperbolic geometry may in more favourable floating point performance. The ing formula for hyperbolic MLR for K classes is written below; here p k ∈ D n c and a k ∈ T p k D n c \ {0} are learnable parameters. For a more thorough discussion of hyperbolic neural networks, we refer the reader to the paper ). Omniglot As a baseline model, we consider the prototype network (ProtoNet). Each convolutional block consists of 3 × 3 convolutional layer followed by batch normalization, ReLU nonlinearity and 2 × 2 max-pooling layer. The number of filters in the last convolutional layer corresponds to the value of the embedding dimension, for which we choose 64. The hyperbolic model differs from the baseline in the following aspects. First, the output of the last convolutional block is embedded into the Poincaré ball of dimension 64 using the exponential map. The initial value of learning rate equals to 10 −3 and is multiplied by 0.5 every 20 epochs out of total 60 epochs. miniImageNet For this task we again considered ProtoNet as a baseline model. Similarly, number of filters the last convolutional layer corresponds to the varying value of the embedding dimension. In our experiments we set this value to 1024. We test the models on tasks for one-shot and fiveshot classifications; the number of query points in each batch always equals to 15. We consider the following learning rate decay scheme: the initial learning rate equals to 10 −3 and is further multiplied by 0.2 every 10 epochs (out of total 200 epochs). The hyperbolic model differs from the baseline in the following aspects. First, the output of the last convolutional block is embedded into Poincaré ball of dimension 1024 using the exponential map defined in Equation. In ProtoNet, one uses a so-called prototype representation of a class, which is defined as a mean of the embedded support set of a class. Generalizing this concept to hyperbolic space, we substitute the Euclidean mean operation by HypAve, defined earlier in the Equation. The initial learning rate equals to 10 −3 and is further multiplied by 0.2 every 10 epochs (out of total 200 epochs). Caltech-UCSD Birds Likewise, we use ProtoNet mentioned above with the following modifications. Here, we fix the embedding dimension to 512 and use a slightly different setup for learning rate scheduler: the initial learning rate of value 10 −3 is multiplied by 0.7 every 20 epochs out of total 100 epochs. Remaining architecture and parameters both in baseline and hyperbolic models are identical to those in the experiments on the MiniImageNet dataset. Person re-identification We use ResNet-50 architecture with one fully connected embedding layer following the global average pooling. Three embedding dimensionalities are used in our experiments: 32, 64 and 128. For the baseline experiments, we add the additional classification linear layer, followed by the cross-entropy loss. For the hyperbolic version of the experiments, we map the descriptors to the Poincaré ball and apply multiclass logistic regression as described in Section 4. We found that in both cases the are very sensitive to the learning rate schedules. We tried four schedules for learning 32-dimensional descriptors for both baseline and hyperbolic versions. Two best performing schedules were applied for the 64 and 128-dimensional descriptors. In these experiments, we also found that smaller c values give better . We finally set c to 10 −5. Therefore, based on the discussion in 4, our hyperbolic setting is quite close to Euclidean. The are compiled in Table 5. We set starting learning rates to 3 · 10 −4 and 6 · 10 −4 for sch#1 and sch#2 correspondingly and multiply them by 0.1 after each of the epochs 200 and 270.

Represent this text to find a much much longer article about it with say hundreds-thousands of words

We show that hyperbolic embeddings are useful for high-level computer vision tasks, especially for few-shot classification.

We propose nearest neighbor overlap, a procedure which quantifies similarity between embedders in a task-agnostic manner, and use it to compare 21 sentence embedders.


Question: represent the text to find a very short summary (1-2 sentences max)

Question: High-dimensional time series are common in many domains. Since human cognition is not optimized to work well in high-dimensional spaces, these areas could benefit from interpretable low-dimensional representations. However, most representation learning algorithms for time series data are difficult to interpret. This is due to non-intuitive mappings from data features to salient properties of the representation and non-smoothness over time. To address this problem, we propose a new representation learning framework building on ideas from interpretable discrete dimensionality reduction and deep generative modeling. This framework allows us to learn discrete representations of time series, which give rise to smooth and interpretable embeddings with superior clustering performance. We introduce a new way to overcome the non-differentiability in discrete representation learning and present a gradient-based version of the traditional self-organizing map algorithm that is more performant than the original. Furthermore, to allow for a probabilistic interpretation of our method, we integrate a Markov model in the representation space. This model uncovers the temporal transition structure, improves clustering performance even further and provides additional explanatory insights as well as a natural representation of uncertainty. We evaluate our model in terms of clustering performance and interpretability on static (Fashion-)MNIST data, a time series of linearly interpolated (Fashion-)MNIST images, a chaotic Lorenz attractor system with two macro states, as well as on a challenging real world medical time series application on the eICU data set. Our learned representations compare favorably with competitor methods and facilitate downstream tasks on the real world data. Interpretable representation learning on time series is a seminal problem for uncovering the latent structure in complex systems, such as chaotic dynamical systems or medical time series. In areas where humans have to make decisions based on large amounts of data, interpretability is fundamental to ease the human task. Especially when decisions have to be made in a timely manner and rely on observing some chaotic external process over time, such as in finance or medicine, the need for intuitive interpretations is even stronger. However, many unsupervised methods, such as clustering, make misleading i.i.d. assumptions about the data, neglecting their rich temporal structure and smooth behaviour over time. This poses the need for a method of clustering, where the clusters assume a topological structure in a lower dimensional space, such that the representations of the time series retain their smoothness in that space. In this work, we present a method with these properties. We choose to employ deep neural networks, because they have a very successful tradition in representation learning BID5. In recent years, they have increasingly been combined with generative modeling through the advent of generative adversarial networks (GANs) BID13 and variational autoencoders (VAEs) BID18. However, the representations learned by these models are often considered cryptic and do not offer the necessary interpretability. A lot of work has been done to improve them in this regard, in GANs as well as VAEs BID16 BID9. Alas, these works have focused entirely on continuous representations, while discrete ones are still underexplored. In order to define temporal smoothness in a discrete representation space, the space has to be equipped with a topological neighborhood relationship. One type of representation space with such a structure is induced by the self-organizing map (SOM) BID21. The SOM allows to map states from an uninterpretable continuous space to a lower-dimensional space with a predefined topologically interpretable structure, such as an easily visualizable two-dimensional grid. However, while yielding promising in visualizing static state spaces, such as static patient states BID27, the classical SOM formulation does not offer a notion of time. The time component can be incorporated using a probabilistic transition model, e.g. a Markov model, such that the representations of a single time point are enriched with information from the adjacent time points in the series. It is therefore potentially fruitful to apply the approaches of probabilistic modeling alongside representation learning and discrete dimensionality reduction in an end-to-end model. In this work, we propose a novel deep architecture that learns topologically interpretable discrete representations in a probabilistic fashion. Moreover, we introduce a new method to overcome the non-differentiability in discrete representation learning architectures and develop a gradient-based version of the classical selforganizing map algorithm with improved performance. We present extensive empirical evidence for the model's performance on synthetic and real world time series from benchmark data sets, a synthetic dynamical system with chaotic behavior and real world medical data. • Devise a novel framework for interpretable discrete representation learning on time series.• Show that the latent probabilistic model in the representation learning architecture improves clustering and interpretability of the representations on time series.• Show superior clustering performance of the model on benchmark data and a real world medical data set, on which it also facilitates downstream tasks. Our proposed model combines ideas from self-organizing maps BID21, variational autoencoders BID18 ) and probabilistic models. In the following, we will lay out the different components of the model and their interactions. A schematic overview of our proposed model is depicted in FIG0. An input x ∈ R d is mapped to a latent encoding z e ∈ R m (usually m < d) by computing z e = f θ (x), where f θ (·) is parameterized by the encoder neural network. The encoding is then assigned to an embedding z q ∈ R m in the dictionary of embeddings E = {e 1, . . ., e k | e i ∈ R m} by sampling z q ∼ p(z q |z e). The form of this distribution is flexible and can be a design choice. In order for the model to behave similarly to the original SOM algorithm (see below), in our experiments we choose the distribution to be categorical with probability mass 1 on the closest embedding to z e, i.e. p(z q |z e) = 1[z q = arg min e∈E z e − e 2], where 1[·] is the indicator function. A reconstructionx of the input can then be computed asx = g φ (z), where g φ (·) is parameterized by the decoder neural network. Since the encodings and embeddings live in the same space, one can compute two different reconstructions, namelyx e = g φ (z e) andx q = g φ (z q).To achieve a topologically interpretable neighborhood structure, the embeddings are connected to form a self-organizing map. A self-organizing map consists of k nodes V = {v 1, . . ., v k}, where every node corresponds to an embedding in the data space e v ∈ R d and a representation in a lower-dimensional discrete space m v ∈ M, where usually M ⊂ N 2. During training on a data set D = {x 1, . . ., x n}, a winner nodẽ v is chosen for every point x i according toṽ = arg min v∈V e v − x i 2. The embedding vector for every [red]. In order to achieve a discrete representation, every latent data point (z e) is mapped to its closest node in the SOM (z q). A Markov transition model [blue] is learned to predict the next discrete representation (z t+1 q) given the current one (z t q). The discrete representations can then be decoded by another neural network back into the original data space. node u ∈ V is then updated according to e u ← e u + N (m u, mṽ)η(x i − e u), where η is the learning rate and N (m u, mṽ) is a neighborhood function between the nodes defined on the representation space M. There can be different design choices for N (m u, mṽ). A more thorough review of the self-organizing map algorithm is deferred to the appendix (Sec. A).We choose to use a two-dimensional SOM because it facilitates visualization similar to BID27. Since we want the architecture to be trainable end-to-end, we cannot use the standard SOM training algorithm described above. Instead, we devise a loss function term whose gradient corresponds to a weighted version of the original SOM update rule (see below). We implement it in such a way that any time an embedding e i,j at position (i, j) in the map gets updated, it also updates all the embeddings in its immediate neighborhood N (e i,j). The neighborhood is defined as N (e i,j) = {e i−1,j, e i+1,j, e i,j−1, e i,j+1} for a two-dimensional map. The loss function for a single input x looks like DISPLAYFORM0 where x, z e, z q,x e andx q are defined as above and α and β are weighting hyperparameters. Every term in this function is specifically designed to optimize a different model component. The first term is the reconstruction loss L reconstruction (x,x q,x e) = x−x q 2 + x−x e 2. The first subterm of this is the discrete reconstruction loss, which encourages the assigned SOM node z q (x) to be an informative representation of the input. The second subterm encourages the encoding z e (x) to also be an informative representation. This ensures that all parts of the model have a fully differentiable credit assignment path to the loss function, which facilitates training. Note that the reconstruction loss corresponds to the evidence lower bound (ELBO) of the VAE part of our model BID18. Since we assume a uniform prior over z q, the KL-term in the ELBO is constant w.r.t. the parameters and can be ignored during optimization. The term L commitment encourages the encodings and assigned SOM nodes to be close to each other and is defined as DISPLAYFORM1 2. Closeness of encodings and embeddings should be expected to already follow from the L reconstruction term in a fully differentiable architecture. However, due to the nondifferentiability of the embedding assignment in our model, the L commitment term has to be explicitly added to the objective in order for the encoder to get gradient information about z q. DISPLAYFORM2 2, where N (·) is the set of neighbors in the discrete space as defined above and sg [·] is the gradient stopping operator that does not change the outputs during the forward pass, but sets the gradients to 0 during the backward pass. It encourages the neighbors of the assigned SOM node z q to also be close to z e, thus enabling the embeddings to exhibit a self-organizing map property, while stopping the gradients on z e such that the encoding is not pulled in the direction of the neighbors. This term enforces a neighborhood relation between the discrete codes and encourages all SOM nodes to ultimately receive gradient information from the data. The gradient stopping in this term is motivated by the observation that the data points themselves do not get moved in the direction of their assigned SOM node's neighbors in the original SOM algorithm either (see above). We want to optimize the embeddings based on their neighbors, but not the respective encodings, since any single encoding should be as close as possible to its assigned embedding and not receive gradient information from any other embeddings that it is not assigned to. Note that the gradient update of a specific SOM node in this formulation depends on its distance to the encoding, while the step size in the original SOM algorithm is constant. It will be seen that this offers some benefits in terms of optimization and convergence (see Sec. 4.1). The main challenge in optimizing our architecture is the non-differentiability of the discrete cluster assignment step. Due to this, the gradients from the reconstruction loss cannot flow back into the encoder. A model with a similar problem is the recently proposed vector-quantized VAE (VQ-VAE) BID29. It can be seen as being similar to a special case of our SOM-VAE model, where one sets β = 0, i.e. disables the SOM structure. In order to mitigate the non-differentiability, the authors of the VQ-VAE propose to copy the gradients from z q to z e. They acknowledge that this is an ad hoc approximation, but observed that it works well in their experiments. Due to our smaller number of embeddings compared to the VQ-VAE setup, the average distance between an encoding and its closest embedding is much larger in our case. The gradient copying (see above) thus ceases to be a feasible approximation, because the true gradients at points in the latent space which are farther apart will likely be very different. In order to still overcome the non-differentiability issue, we propose to add the second reconstruction subterm to L reconstruction, where the reconstructionx e is decoded directly from the encoding z e. This adds a fully differentiable credit assignment path from the loss to the encoder and encourages z e to also be an informative representation of the input, which is a desirable model feature. Most importantly, it works well in practice (see Sec. 4.1).Note that since z e is continuous and therefore much less constrained than z q, this term is optimized easily and becomes small early in training. After that, mostly the z q -term contributes to L reconstruction. One could therefore view the z e -term as an initial encouragement to place the data encodings at sensible positions in the latent space, after which the actual clustering task dominates the training objective. Our ultimate goal is to predict the development of time series in an interpretable way. This means that not only the state representations should be interpretable, but so should be the prediction as well. To this end, we use a temporal probabilistic model. Learning a probabilistic model in a high-dimensional continuous space can be challenging. Thus, we exploit the low-dimensional discrete space induced by our SOM to learn a temporal model. For that, we define a system state as the assigned node in the SOM and then learn a Markov model for the transitions between those states. The model is learned jointly with the SOM-VAE, where the loss function becomes DISPLAYFORM0 with weighting hyperparameters γ and τ.The term L transitions encourages the probabilities of actually observed transitions to be high. It is defined as DISPLAYFORM1 ) being the probability of a transition from state z q (DISPLAYFORM2 The term L smoothness encourages the probabilities for transitions to nodes that are far away from the current data point to be low or respectively the nodes with high transition probabilities to be proximal. It achieves this by taking large values only for transitions to far away nodes that have a high probability under the model. It is defined as L smoothness ( DISPLAYFORM3 2 . The probabilistic model can inform the evolution of the SOM through this term which encodes our prior belief that transitions in natural data happen smoothly and that future time points will therefore mostly be found in the neighborhood of previous ones. In a setting where the data measurements are noisy, this improves the clustering by acting as a temporal smoother. From the early inception of the k-means algorithm for clustering BID24, there has been much methodological improvement on this unsupervised task. This includes methods that perform clustering in the latent space of (variational) autoencoders BID1 or use a mixture of autoencoders for the clustering BID32 ). The method most related to our work is the VQ-VAE (van den BID29, which can be seen as a special case of our framework (see above). Its authors have put a stronger focus on the discrete representation as a form of compression instead of clustering. Hence, our model and theirs differ in certain implementation considerations (see Sec. 2.2). All these methods have in common that they only yield a single number as a cluster assignment and provide no interpretable structure of relationships between clusters. The self-organizing map (SOM) BID21, however, is an algorithm that provides such an interpretable structure. It maps the data manifold to a lower-dimensional discrete space, which can be easily visualized in the 2D case. It has been extended to model dynamical systems BID4 and combined with probabilistic models for time series BID25, although without using learned representations. There are approaches to turn the SOM into a "deeper" model BID8, combine it with multi-layer perceptrons BID11 or with metric learning (Płoński and). However, it has (to the best of our knowledge) not been proposed to use SOMs in the latent space of (variational) autoencoders or any other form of unsupervised deep learning model. Interpretable models for clustering and temporal predictions are especially crucial in fields where humans have to take responsibility for the model's predictions, such as in health care. The prediction of a patient's future state is an important problem, particularly on the intensive care unit (ICU) BID15 BID3. Probabilistic models, such as Gaussian processes, have been successfully applied in this domain BID7 BID26. Recently, deep generative models have been proposed BID10, sometimes even in combination with probabilistic modeling BID23. To the best of our knowledge, SOMs have only been used to learn interpretable static representations of patients BID27, but not dynamic ones. We performed experiments on MNIST handwritten digits BID22, Fashion-MNIST images of clothing BID31, synthetic time series of linear interpolations of those images, time series from a chaotic dynamical system and real world medical data from the eICU Collaborative Research Database BID12. If not otherwise noted, we use the same architecture for all experiments, sometimes including the latent probabilistic model (SOM-VAE_prob) and sometimes excluding it (SOM-VAE). For model implementation details, we refer to the appendix (Sec. B) 1.We found that our method achieves a superior clustering performance compared to other methods. We also show that we can learn a temporal probabilistic model concurrently with the clustering, which is on par with the maximum likelihood solution, while improving the clustering performance. Moreover, we can learn interpretable state representations of a chaotic dynamical system and discover patterns in real medical data. In order to test the clustering component of the SOM-VAE, we performed experiments on MNIST and Fashion-MNIST. We compare our model (including different adjustments to the loss function) against k-means (sklearn-package ), the VQ-VAE (van den), a standard implementation of a SOM (minisom-package BID30) and our version of a GB-SOM (gradient-based SOM), which is a SOM-VAE where the encoder and decoder are set to be identity functions. The k-means algorithm was initialized using k-means++ BID2. To ensure comparability of the performance measures, we used the same number of clusters (i.e. the same k) for all the methods. The of the experiment in terms of purity and normalized mutual information (NMI) are shown in Table 1. The SOM-VAE outperforms the other methods w.r.t. the clustering performance measures. It should be noted here that while k-means is a strong baseline, it is not density matching, i.e. the density of cluster centers is not proportional to the density of data points. Hence, the representation of data in a space induced by the k-means clusters can be misleading. As argued in the appendix (Sec. C), NMI is a more balanced measure for clustering performance than purity. If one uses 512 embeddings in the SOM, one gets a lower NMI due to the penalty term for the number of FIG1: Images generated from a section of the SOM-VAE's latent space with 512 embeddings trained on MNIST. It yields a discrete two-dimensional representation of the data manifold in the higher-dimensional latent space. clusters, but it yields an interpretable two-dimensional representation of the manifolds of MNIST FIG1, Supp. FIG3 ) and Fashion-MNIST (Supp. Fig. S5).The experiment shows that the SOM in our architecture improves the clustering (SOM-VAE vs. VQ-VAE) and that the VAE does so as well (SOM-VAE vs. GB-SOM). Both parts of the model therefore seem to be beneficial for our task. It also becomes apparent that our reconstruction loss term on z e works better in practice than the gradient copying trick from the VQ-VAE (SOM-VAE vs. gradcopy), due to the reasons described in Section 2.2. If one removes the z e reconstruction loss and does not copy the gradients, the encoder network does not receive any gradient information any more and the learning fails completely (no_grads). Another interesting observation is that stochastically optimizing our SOM loss using Adam seems to discover a more performant solution than the classical SOM algorithm (GB-SOM vs. minisom). This could be due to the dependency of the step size on the distance between embeddings and encodings, as described in Section 2.1. Since k-means seems to be the strongest competitor, we are including it as a reference baseline in the following experiments as well. In order to test the probabilistic model in our architecture and its effect on the clustering, we generated synthetic time series data sets of (Fashion-)MNIST images being linearly interpolated into each other. Each time series consists of 64 frames, starting with one image from (Fashion-)MNIST and smoothly changing sequentially into four other images over the length of the time course. After training the model on these data, we constructed the maximum likelihood estimate (MLE) for the Markov model's transition matrix by fixing all the weights in the SOM-VAE and making another pass over the training set, counting all the observed transitions. This MLE transition matrix reaches a negative log likelihood of 0.24, while our transition matrix, which is learned concurrently with the architecture, yields 0.25. Our model is therefore on par with the MLE solution. Comparing these with the clustering performance on the standard MNIST and Fashion-MNIST test sets, we observe that the performance in terms of NMI is not impaired by the inclusion of the probabilistic model into the architecture (Tab. 2). On the contrary, the probabilistic model even slightly increases the performance on Fashion-MNIST. Note that we are using 64 embeddings in this experiment instead of 16, leading to a higher clustering performance in terms of purity, but a slightly lower performance in terms of NMI compared to Table 1. This shows again that the measure of purity has to be interpreted with care when comparing This experiment shows that we can indeed fit a valid probabilistic transition model concurrently with the SOM-VAE training, while at the same time not hurting the clustering performance. It also shows that for certain types of data the clustering performance can even be improved by the probabilistic model (see Sec. 2.3). In order to assess whether our model can learn an interpretable representation of more realistic chaotic time series, we train it on synthetic trajectories simulated from the famous Lorenz system . The Lorenz system is a good example for this assessment, since it offers two well defined macro-states (given by the attractor basins) which are occluded by some chaotic noise in the form of periodic fluctuations around the attractors. A good interpretable representation should therefore learn to largely ignore the noise and model the changes between attractor basins. For a review of the Lorenz system and details about the simulations and the performance measure, we refer to the appendix (Sec. D.2).In order to compare the interpretability of the learned representations, we computed entropy distributions over simulated subtrajectories in the real system space, the attractor assignment space and the representation spaces for k-means and our model. The computed entropy distributions over all subtrajectories in the test set are depicted in FIG2. The experiment shows that the SOM-VAE representations FIG2 are much closer in entropy to the groundtruth attractor basin assignments FIG2 than the k-means representations FIG2. For most of the subtrajectories without attractor basin change they assign a very low entropy, effectively ignoring the noise, while the k-means representations partially assign very high entropies to those trajectories. In total, the k-means representations' entropy distribution is similar to the entropy distribution in the noisy system space FIG2. The representations learned by the SOM-VAE are therefore more interpretable than the k-means representations with regard to this interpretability measure. As could be expected from these figures, the SOM-VAE representation is also superior to the k-means one in terms of purity with respect to the attractor assignment (0.979 vs. 0.956) as well as NMI (0.577 vs. 0.249).Finally, we use the learned probabilistic model on our SOM-VAE representations to sample new latent system trajectories and compute their entropies. The distribution looks qualitatively similar to the one over real Table 3: Performance comparison of our method with and without probabilistic model (SOM-VAE-prob and SOM-VAE) against k-means in terms of normalized mutual information on a challenging unsupervised prediction task on real eICU data. The dynamic endpoints are the maximum of the physiology score within the next 6, 12 or 24 hours (physiology_6_hours, physiology_12_hours, physiology_24_hours). The values are the means of 10 runs and the respective standard errors. Each method is used to fit 64 embeddings/clusters.. It can be seen that our model is the only one that learns a topologically interpretable structure.trajectories FIG2 ), but our model slightly overestimates the attractor basin change probabilities, leading to a heavier tail of the distribution. In order to demonstrate interpretable representation learning on a complex real world task, we trained our model on vital sign time series measurements of intensive care unit (ICU) patients. We analyze the performance of the ing clustering w.r.t. the patients' future physiology states in Table 3. This can be seen as a way to assess the representations' informativeness for a downstream prediction task. For details regarding the data selection and processing, we refer to the appendix (Sec. D.3).Our full model (including the latent Markov model) performs best on the given tasks, i.e. better than k-means and also better than the SOM-VAE without probabilistic model. This could be due to the noisiness of the medical data and the probabilistic model's smoothing tendency (see Sec. 2.3).In order to qualitatively assess the interpretability of the probabilistic SOM-VAE, we analyzed the average future physiology score per cluster FIG3. Our model exhibits clusters where higher scores are enriched compared to the level. Moreover, these clusters form compact structures, facilitating interpretability. We do not observe such interpretable structures in the other methods. For full on acute physiology scores, an analogue experiment showing the future mortality risk associated with different regions of the map, and an analysis of enrichment for particular physiological abnormalities, we refer to the appendix (Sec. D.4).As an illustrative example for data visualization using our method, we show the trajectories of two patients that start in the same state FIG3. The trajectories are plotted in the representation space of the probabilistic SOM-VAE and should thus be compared to the visualization in FIG3. One patient (green) stays in the regions of the map with low average physiology score and eventually gets discharged from the hospital healthily. The other one (red) moves into map regions with high average physiology score and ultimately dies. Such knowledge could be helpful for doctors, who could determine the risk of a patient for certain deterioration scenarios from a glance at their trajectory in the SOM-VAE representation. The SOM-VAE can recover topologically interpretable state representations on time series and static data. It provides an improvement to standard methods in terms of clustering performance and offers a way to learn discrete two-dimensional representations of the data manifold in concurrence with the reconstruction task. It introduces a new way of overcoming the non-differentiability of the discrete representation assignment and contains a gradient-based variant of the traditional self-organizing map that is more performant than the original one. On a challenging real world medical data set, our model learns more informative representations with respect to medically relevant prediction targets than competitor methods. The learned representations can be visualized in an interpretable way and could be helpful for clinicians to understand patients' health states and trajectories more intuitively. It will be interesting to see in future work whether the probabilistic component can be extended to not just improve the clustering and interpretability of the whole model, but also enable us to make predictions. Promising avenues in that direction could be to increase the complexity by applying a higher order Markov Model, a Hidden Markov Model or a Gaussian Process. Another fruitful avenue of research could be to find more theoretically principled ways to overcome the non-differentiability and compare them with the empirically motivated ones. Lastly, one could explore deviating from the original SOM idea of fixing a latent space structure, such as a 2D grid, and learn the neighborhood structure as a graph directly from data. The general idea of a self-organizing map (SOM) is to approximate a data manifold in a high-dimensional continuous space with a lower dimensional discrete one BID21. It can therefore be seen as a nonlinear discrete dimensionality reduction. The mapping is achieved by a procedure in which this discrete representation (the map) is randomly embedded into the data space and then iteratively optimized to approach the data manifold more closely. The map consists of k nodes V = {v 1, . . ., v k}, where every node corresponds to an embedding in the data space e v ∈ R d and a representation in the lower-dimensional discrete space m v ∈ M, where usually M ⊂ N 2. There are two different geometrical measures that have to be considered during training: the neighborhood function N (m u, mṽ) that is defined on the low-dimensional map space and the Euclidean distance D(e u, eṽ) = e u − eṽ 2 in the high-dimensional data space. The SOM optimization tries to induce a coupling between these two properties, such that the topological structure of the representation reflects the geometrical structure of the data. Require: DISPLAYFORM0 for all x i ∈ D do find the closest SOM nodeṽ:= arg min v∈V x i − e v 2 update node embedding eṽ ← eṽ + η (x i − eṽ) for all u ∈ V \ṽ do update neighbor embedding e u ← e u + η N (mṽ, m u)(x i − e u) end for end for end whileThe SOM training procedure is described in Algorithm 1. During training on a data set D, a winner nodeṽ is chosen for every point x i according to the Euclidean distance of the point and the node's embedding in the data space. The embedding vector for the winner node is then updated by pulling it into the direction of the data point with some step size η. The embedding vectors of the other nodes are also updated -potentially with a smaller step size -depending on whether they are neighbors of the winner node in the map space M.The neighborhood is defined by the neighborhood function N (m u, mṽ). There can be different design choices for the neighborhood function, e.g. rectangular grids, hexagonal grids or Gaussian neighborhoods. For simplicity and ease of visualization, we usually choose a two-dimensional rectangular grid neighborhood in this paper. In this original formulation of the SOM training, the nodes are updated one by one with a fixed step size. In our model, however, we use a gradient-based optimization of their distances to the data points and update them in minibatches. This leads to larger step sizes when they are farther away from the data and smaller step sizes when they are close. Overall, our gradient-based SOM training seems to perform better than the original formulation (see Tab. 1).It also becomes evident from this procedure that it will be very hard for the map to fit disjoint manifolds in the data space. Since the nodes of the SOM form a fully connected graph, they do not possess the ability to model spatial gaps in the data. We overcome this problem in our work by mapping the data manifold with a variational autoencoder into a lower-dimensional latent space. The VAE can then learn to close the aforementioned gaps and map the data onto a compact latent manifold, which can be more easily modeled with the SOM. The hyperparameters of our model were optimized using Robust Bayesian Optimization with the packages sacred and labwatch BID14 for the parameter handling and RoBo for the optimization, using the mean squared reconstruction error as the optimization criterion. Especially the weighting hyperparameters α, β, γ and τ (see Eq. and Eq.) have to be tuned carefully, such that the different parts of the model converge at roughly the same rate. We found that 2000 steps of Bayesian optimization sufficed to yield a performant hyperparameter assignment. Since our model defines a general framework, some competitor models can be seen as special cases of our model, where certain parts of the loss function are set to zero or parts of the architecture are omitted. We used the same hyperparameters for those models. For external competitor methods, we used the hyperparameters from the respective publications where applicable and otherwise the default parameters from their packages. The models were implemented in TensorFlow BID0 and optimized using Adam . Given that one of our most interesting tasks at hand is the clustering of data, we need some performance measures to objectively compare the quality of this clustering with other methods. The measures that we decided to use and that have been used extensively in the literature are purity and normalized mutual information (NMI) . We briefly review them in the following. Let the set of ground truth classes in the data be C = {c 1, c 2, . . ., c J} and the set of clusters that from the algorithm Ω = {ω 1, ω 2, . . ., ω K}. The purity π is then defined as π(C, Ω) = DISPLAYFORM0 where N is the total number of data points. Intuitively, the purity is the accuracy of the classifier that assigns the most prominent class label in each cluster to all of its respective data points. While the purity has a very simple interpretation, it also has some shortcomings. One can for instance easily observe that a clustering with K = N, i.e. one cluster for every single data point, will yield a purity of 1.0 but still probably not be very informative for most tasks. It would therefore be more sensible to have another measure that penalizes the number of clusters. The normalized mutual information is one such measure. The NMI is defined as NMI(C, Ω) = Table 1, we performed experiments to assess the influence of the number of clusters k on the clustering performance of our method. We chose different values for k between 4 and 64 and tested the clustering performance on MNIST and Fashion-MNIST (Tab. S1).It can be seen that the purity increases monotonically with k, since it does not penalize larger numbers of clusters (see Sec. C). The NMI, however, includes an automatic penalty for misspecifying the model with too many clusters. It therefore increases first, but then decreases again for too large values of k. The optimal k according to the NMI seems to lie between 16 and 36. The Lorenz system is the system of coupled ordinary differential equations defined by, the system shows chaotic behavior by forming a strange attractor BID28 with the two attractor points being given by DISPLAYFORM0 DISPLAYFORM1 We simulated 100 trajectories of 10,000 time steps each from the chaotic system and trained the SOM-VAE as well as k-means on it with 64 clusters/embeddings respectively. The system chaotically switches back and forth between the two attractor basins. By computing the Euclidian distance between the current system state and each of the attractor points p 1,2, we can identify the current attractor basin at each time point. In order to assess the interpretability of the learned representations, we have to define an objective measure of interpretability. We define interpretability as the similarity between the representation and the system's ground truth macro-state. Since representations at single time points are meaningless with respect to this measure, we compare the evolution of representations and system state over time in terms of their entropy. We divided the simulated trajectories from our test set into spans of 100 time steps each. For every subtrajectory, we computed the entropies of those subtrajectories in the real system space (macro-state and noise), the assigned attractor basin space (noise-free ground-truth macro-state), the SOM-VAE representation and the k-means representation. We also observed for every subtrajectory whether or not a change between attractor basins has taken place. Note that the attractor assignments and representations are discrete, while the real system space is continuous. In order to make the entropies comparable, we discretize the system space into unit hypercubes for the entropy computation. For a representation R with assignments R t at time t and starting time t start of the subtrajectory, the entropies are defined as DISPLAYFORM2 with H(·) being the Shannon information entropy of a discrete set. All experiments were performed on dynamic data extracted from the eICU Collaborative Research Database BID12. Irregularly sampled time series data were extracted from the raw tables and then resampled to a regular time grid using a combination of forward filling and missing value imputation using global population statistics. We chose a grid interval of one hour to capture the rapid dynamics of patients in the ICU.Each sample in the time-grid was then labeled using a dynamic variant of the APACHE score BID20, which is a proxy for the instantaneous physiological state of a patient in the ICU. Specifically, the variables MAP, Temperature, Respiratory rate, HCO3, Sodium, Potassium, and Creatinine were selected from the score definition, because they could be easily defined for each sample in the eICU time series. The value range of each variable was binned into ranges of normal and abnormal values, in line with the definition of the APACHE score, where a higher score for a variable is obtained for abnormally high or low values. The scores were then summed up, and we define the predictive score as the worst (highest) score in the next t hours, for t ∈ {6, 12, 24}. Patients are thus stratified by their expected pathology in the near future, which corresponds closely to how a physician would perceive the state of a patient. The training set consisted of 7000 unique patient stays, while the test set contained 3600 unique stays. As mentioned in the main text (see FIG3 the SOMVAEProb is able to uncover compact and interpretable structures in the latent space with respect to future physiology scores. In this section we show for acute physiology scores in greater detail, analyze enrichment for future mortality risk, arguably the most important severity indicator in the ICU, and explore phenotypes for particular physiological abnormalities. FIG0 : (a) shows the difference in distribution of the acute physiology score in the next 24 hours, between time-points assigned to the most abnormal cell in the SOMVAEprob map with coordinates vs. a normal cell chosen from the middle of the map with coordinates. It is apparent that the distributions are largely disjoint, which means that the representation induced by SOMVAEprob clearly distinguishes these risk profiles. Statistical tests for difference in distribution and location parameter are highly significant at p-values of p ≤ 10 −3, as we have validated using a 2-sample t-test and Kolmogorov-Smirnov test. In (b-c) the enrichment of the map for the mean acute physiology score in the next 6 and 12 hours is shown, for completeness. The enrichment patterns on the 3 maps, for the future horizons {6, 12, 24}, are almost identical, which provides empirical evidence for the temporal stability of the SOMVAEProb embedding. hours. We observe that the left-edge and right-edge regions of the SOMVAEprob map which are enriched for higher acute physiology scores (see FIG3 also exhibit elevated mortality rates over the baseline. Interestingly, according to future mortality risk, which is an important severity indicator, patients on the left-edge are significantly more sick on average than those on the right edge, which is less visible from the enrichment for acute physiology scores. PATIENT STATE PHENOTYPES ON THE SOMVAEP R O B MAP Low sodium and high potassium states are enriched near the left edge, and near the right edge, respectively, which could represent sub-types of the high-risk phenotype found in these regions (compare FIG3 the distribution of the acute physiology score). Elevated creatinine is a trait that occurs in both these regions. A compact structure associated with elevated HCO3 can be found in the center of the map, which could represent a distinct phenotype with lower mortality risk in our cohort. In all phenotypes, the tendency of SOMVAEprob to recover compact structures is exemplified. FIG3: Images generated from the SOM-VAE's latent space with 512 embeddings trained on MNIST. It yields an interpretable discrete two-dimensional representation of the data manifold in the higher-dimensional latent space. Figure S5: Images generated from the SOM-VAE's latent space with 512 embeddings trained on Fashion-MNIST. It yields an interpretable discrete two-dimensional representation of the data manifold in the higherdimensional latent space.

We present a method to learn interpretable representations on time series using ideas from variational autoencoders, self-organizing maps and probabilistic models.

A backward model of previous (state, action) given the next state, i.e. P(s_t, a_t | s_{t+1}), can be used to simulate additional trajectories terminating at states of interest! Improves RL learning efficiency.