SS-LSTM | SS-LSTM model for pedestrian trajectory prediction | Predictive Analytics library

 by   xuehaouwa Python Version: Current License: No License

kandi X-RAY | SS-LSTM Summary

kandi X-RAY | SS-LSTM Summary

SS-LSTM is a Python library typically used in Analytics, Predictive Analytics applications. SS-LSTM has no bugs, it has no vulnerabilities and it has low support. However SS-LSTM build file is not available. You can download it from GitHub.

SS-LSTM model for pedestrian trajectory prediction
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              SS-LSTM has a low active ecosystem.
              It has 51 star(s) with 32 fork(s). There are 8 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 0 have been closed. On average issues are closed in 738 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of SS-LSTM is current.

            kandi-Quality Quality

              SS-LSTM has 0 bugs and 0 code smells.

            kandi-Security Security

              SS-LSTM has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              SS-LSTM code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              SS-LSTM does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              SS-LSTM releases are not available. You will need to build from source code and install.
              SS-LSTM has no build file. You will be need to create the build yourself to build the component from source.
              SS-LSTM saves you 128 person hours of effort in developing the same functionality from scratch.
              It has 321 lines of code, 24 functions and 4 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed SS-LSTM and discovered the below as its top functions. This is intended to give you an instant insight into SS-LSTM implemented functionality, and help decide if they suit your requirements.
            • Calculates the log - group model input for each observation
            • Compute the log - circle occupancy map
            • Calculate the angle between two points
            • Calculates the input shape of a circle group model
            • Calculate the occupancy map for a circle
            • Helper function for group_model_input
            • Generate a rectangular occupancy map
            • Return a list of all TrajectoryTrajectory objects
            • Convert a file to a list of coordinates
            • Load a numpy array from a file
            Get all kandi verified functions for this library.

            SS-LSTM Key Features

            No Key Features are available at this moment for SS-LSTM.

            SS-LSTM Examples and Code Snippets

            No Code Snippets are available at this moment for SS-LSTM.

            Community Discussions

            QUESTION

            Understanding Keras LSTMs: Role of Batch-size and Statefulness
            Asked 2018-Feb-15 at 22:04
            Sources

            There are several sources out there explaining stateful / stateless LSTMs and the role of batch_size which I've read already. I'll refer to them later in my post:

            [1] https://machinelearningmastery.com/understanding-stateful-lstm-recurrent-neural-networks-python-keras/

            [2] https://machinelearningmastery.com/stateful-stateless-lstm-time-series-forecasting-python/

            [3] http://philipperemy.github.io/keras-stateful-lstm/

            [4] https://machinelearningmastery.com/use-different-batch-sizes-training-predicting-python-keras/

            Ans also other SO threads like Understanding Keras LSTMs and Keras - stateful vs stateless LSTMs which didn't fully explain what I'm looking for however.

            My Problem

            I am still not sure what is the correct approach for my task regarding statefulness and determining batch_size.

            I have about 1000 independent time series (samples) that have a length of about 600 days (timesteps) each (actually variable length, but I thought about trimming the data to a constant timeframe) with 8 features (or input_dim) for each timestep (some of the features are identical to every sample, some individual per sample).

            Input shape = (1000, 600, 8)

            One of the features is the one I want to predict, while the others are (supposed to be) supportive for the prediction of this one “master feature”. I will do that for each of the 1000 time series. What would be the best strategy to model this problem?

            Output shape = (1000, 600, 1)

            What is a Batch?

            From [4]:

            Keras uses fast symbolic mathematical libraries as a backend, such as TensorFlow and Theano.

            A downside of using these libraries is that the shape and size of your data must be defined once up front and held constant regardless of whether you are training your network or making predictions.

            […]

            This does become a problem when you wish to make fewer predictions than the batch size. For example, you may get the best results with a large batch size, but are required to make predictions for one observation at a time on something like a time series or sequence problem.

            This sounds to me like a “batch” would be splitting the data along the timesteps-dimension.

            However, [3] states that:

            Said differently, whenever you train or test your LSTM, you first have to build your input matrix X of shape nb_samples, timesteps, input_dim where your batch size divides nb_samples. For instance, if nb_samples=1024 and batch_size=64, it means that your model will receive blocks of 64 samples, compute each output (whatever the number of timesteps is for every sample), average the gradients and propagate it to update the parameters vector.

            When looking deeper into the examples of [1] and [4], Jason is always splitting his time series to several samples that only contain 1 timestep (the predecessor that in his example fully determines the next element in the sequence). So I think the batches are really split along the samples-axis. (However his approach of time series splitting doesn’t make sense to me for a long-term dependency problem.)

            Conclusion

            So let’s say I pick batch_size=10, that means during one epoch the weights are updated 1000 / 10 = 100 times with 10 randomly picked, complete time series containing 600 x 8 values, and when I later want to make predictions with the model, I’ll always have to feed it batches of 10 complete time series (or use solution 3 from [4], copying the weights to a new model with different batch_size).

            Principles of batch_size understood – however still not knowing what would be a good value for batch_size. and how to determine it

            Statefulness

            The KERAS documentation tells us

            You can set RNN layers to be 'stateful', which means that the states computed for the samples in one batch will be reused as initial states for the samples in the next batch.

            If I’m splitting my time series into several samples (like in the examples of [1] and [4]) so that the dependencies I’d like to model span across several batches, or the batch-spanning samples are otherwise correlated with each other, I may need a stateful net, otherwise not. Is that a correct and complete conclusion?

            So for my problem I suppose I won’t need a stateful net. I’d build my training data as a 3D array of the shape (samples, timesteps, features) and then call model.fit with a batch_size yet to determine. Sample code could look like:

            ...

            ANSWER

            Answered 2018-Jan-29 at 17:37

            Let me explain it via an example:

            So let's say you have the following series: 1,2,3,4,5,6,...,100. You have to decide how many timesteps your lstm will learn, and reshape your data as so. Like below:

            if you decide time_steps = 5, you have to reshape your time series as a matrix of samples in this way:

            1,2,3,4,5 -> sample1

            2,3,4,5,6 -> sample2

            3,4,5,6,7 -> sample3

            etc...

            By doing so, you will end with a matrix of shape (96 samples x 5 timesteps)

            This matrix should be reshape as (96 x 5 x 1) indicating Keras that you have just 1 time series. If you have more time series in parallel (as in your case), you do the same operation on each time series, so you will end with n matrices (one for each time series) each of shape (96 sample x 5 timesteps).

            For the sake of argument, let's say you 3 time series. You should concat all of three matrices into one single tensor of shape (96 samples x 5 timeSteps x 3 timeSeries). The first layer of your lstm for this example would be:

            Source https://stackoverflow.com/questions/48491737

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install SS-LSTM

            You can download it from GitHub.
            You can use SS-LSTM like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/xuehaouwa/SS-LSTM.git

          • CLI

            gh repo clone xuehaouwa/SS-LSTM

          • sshUrl

            git@github.com:xuehaouwa/SS-LSTM.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link