public Map<String, Map<String, INDArray>> rnnGetPreviousStates() {
        Map<String, Map<String, INDArray>> states = new HashMap<>();
        for (Layer l : layers) {
            if(l instanceof org.deeplearning4j.nn.layers.wrapper.BaseWrapperLayer){
                l = ((org.deeplearning4j.nn.layers.wrapper.BaseWrapperLayer)l).getUnderlying();
            }
            if (l instanceof RecurrentLayer) {
                states.put(l.conf().getLayer().getLayerName(), ((RecurrentLayer) l).rnnGetPreviousState());
            }
        }
        return states;
    }
public Map < String , Map < String , INDArray > > rnnGetPreviousStates ( ) { Map < String , Map < String , INDArray > > states = new HashMap < > ( ) ; for ( Layer l : layers ) { if ( l instanceof org . deeplearning4j . nn . layers . wrapper . BaseWrapperLayer ) { l = ( ( org . deeplearning4j . nn . layers . wrapper . BaseWrapperLayer ) l ) . getUnderlying ( ) ; } if ( l instanceof RecurrentLayer ) { states . put ( l . conf ( ) . getLayer ( ) . getLayerName ( ) , ( ( RecurrentLayer ) l ) . rnnGetPreviousState ( ) ) ; } } return states ; }
Get a map of states for ALL RNN layers, as used in {@link #rnnTimeStep(INDArray...)}.
Layers that are not RNN layers will not have an entry in the returned map

@return Map of states (keyed by layer name) or null if layer is not an RNN layer
@see #rnnSetPreviousStates(Map)