Source-linked AI summary

Modular Deep Recurrent Neural Network: Application to Quadrotors

Nima Mohajerin, Steven L. Waslander

arXiv:2609.04339v1cs.LG

TL;DR

The paper addresses the difficulty of training multilayer RNNs for high-order nonlinear dynamics, particularly when modeling quadrotor behavior. It introduces MODERNN, a modular architecture with feedforward inter-layer connections and derivative computation, and demonstrates successful altitude-dynamics learning with reduced computation time.

  • Problem

    Multilayer RNNs can represent higher-order nonlinearities, but gradients may vanish or explode across layers, producing ill-conditioned optimization for complex dynamical systems.

  • Method

    MODERNN is a modular class of recurrent architectures with configurable inter-layer connections, including feedforward connections, and a modular method for calculating network Jacobians.

  • Results

    Approximately 0.5 hours of computation time was required for MODERNN, compared with 5.5 hours for RMLP and 7.5 hours for NARX.

  • Takeaways & Limitations

    Feedforward connections alleviated spatial vanishing or exploding gradients and enabled a smaller network to learn simulated quadrotor altitude dynamics with reduced computation time.

Abstract

from arXiv · show

A modular deep Recurrent Neural Network (RNN) is introduced to facilitate the process of deploying various architectures of RNNs, and to automatically compute derivatives for gradient-based learning methods. The modularity leads to a set of new architectures, one of which includes feedforward inter-layer connections. By adding feedforward inter-layer connections in a multi-layer RNN, it is observed that the capability of the RNN to learn and model high-order dynamics and nonlinearities is significantly improved. The problem of vanishing/exploding gradient in space for a multilayer RNN is also alleviated using feedforward connections. These results are demonstrated using a quadrotor case study, for which a model of the altitude dynamics is learned with our particular network structure, while existing methods are unable to generalize as quickly or at all.

I. INTRODUCTION

Deep RNNs could represent higher-order nonlinear dynamics, but multilayer training is hindered by vanishing or exploding gradients and ill-conditioned optimization. The paper addresses this with a modular architecture and evaluates it for quadrotor modeling.

  • Most existing RNN architectures use at most two hidden layers, limiting their capacity to represent higher-order and more complex nonlinearities.
  • Vanishing or exploding gradients arise as error gradients propagate through both time and network layers, causing ill-conditioned Jacobians and numerical instability.
  • Accurate quadrotor models are difficult because aerodynamic effects, sensor and actuator uncertainties, and other nonlinearities are hard to capture using physical attributes alone.
  • Empirical flight data offers an alternative modeling basis that must capture both the quadrotor's dynamic characteristics and nonlinearities.
  • MODERNN provides a modular multilayer RNN architecture with feedforward connections intended to reduce spatial vanishing or exploding gradients and support gradient-based training.

II. MODULAR DEEP RECURRENT NEURAL NETWORK

MODERNN represents recurrent architectures through locally recurrent layers and a configurable connection matrix, supporting multiple inter-layer connection patterns and generalized derivative computation.

  • Network definition: Each layer is a locally recurrent dynamic MIMO system with defined activation functions, neuron counts, inputs, states, and vectorized weights.Layer inputs can include independent inputs and outputs from other layers at the previous time step.
  • Connection matrix: A connection matrix C specifies the presence or absence of connections among the L layers, independent inputs, and network outputs.Its dimensions are (L + 2) × L, with entries representing connection presence or absence.
  • Attainable architectures: The modular formulation supports multiple recurrent architectures, including RMLP with locally recurrent, sequentially connected layers.In the illustrated four-layer RMLP, each layer connects to itself and the next layer, while inputs enter the first layer and output comes from the final layer.
  • Attainable architectures: MODERNN can also derive outputs from multiple layers rather than only the final layer.The paper gives a three-layer architecture whose outputs are derived from the first and last layers.
  • Derivative computation: The framework provides generalized output-Jacobian calculations for architectures defined through the connection matrix.The authors use MODERNN specifically for the case with all inter-layer connections present and identify those connections as important for training.
  • Sequence formulation: Inputs over a time horizon can be arranged as a matrix U, producing an output matrix Y whose kth column is y(k).The formulation uses k = 1, . . . , T and maps the input sequence through the network.

III. NETWORK JACOBIANS FOR MODERNN

The paper presents a modular procedure for deriving MODERNN network Jacobians with respect to all network weights. Layer-local derivative matrices are combined recursively to support different architectures and simplify architecture deployment.

  • Jacobian derivation: The modular Jacobian method addresses the time-consuming calculation of network-output derivatives for different recurrent architectures.It is intended to speed modification and deployment of existing and new architectures.
  • Network parameterization: The full parameter vector p concatenates the weights of all locally recurrent layers, with q denoting the total number of network weights.The layers are indexed from input toward output.
  • Recursive update: For each layer Gi, the Jacobian update recursively combines derivatives with respect to layer inputs and network weights.Jy_i(k) is the output Jacobian, Ju_i(k) is the input Jacobian, and Γi(k) maps layer-weight derivatives to network-weight derivatives.
  • Recursive update: Independent inputs contribute zero rows to the input Jacobian because they do not depend on network weights.The remaining Jacobian elements are computed recursively from the previous time step.
  • Local derivatives: The local derivative matrix Λi(k) captures each layer’s sensitivity to its own weights before the layer Jacobians are assembled into Γi(k).Its dimensions are R^ni × R^qi, and its terms use previous layer outputs and current layer inputs.
  • Recursive update: After Γi(k) is defined, the network Jacobian is updated recursively for each layer and time step.This provides the derivatives required by gradient-based training.

IV. A LEARNING ALGORITHM FOR TRAINING MODERNN

The training procedure uses offline batch learning with Levenberg–Marquardt optimization and explicitly computed network Jacobians. Four nested loops select trajectory samples, perform validation-controlled optimization, and adjust the damping parameter.

  • Training setup: The quadrotor altitude task uses time trajectories pairing summed motor speeds as input with vehicle altitude as output.The presented setup has one network output: the approximated altitude.
  • Optimization: Levenberg–Marquardt optimization minimizes a Sum-of-Squared Errors cost using the network Jacobian over time.The residual at time k is e(k) = y(k) − z_d(k).
  • Initialization: The network is initialized to zero during early training because its unknown state evolution depends strongly on initially random weights.Training trajectories should also start from a stationary point.
  • Nested-loop training: The algorithm divides optimization into four nested loops for sample selection, training-validation splitting, LM optimization, and damping-parameter updates.The outer loop selects samples, the middle loops perform cross-validated optimization, and the inner loop modifies λ.
  • Sample management: Each iteration selects n_S = n_tr + n_v trajectory segments and divides them into training and validation sets.Both n_tr and n_v are kept small to reduce computational complexity.
  • Stopping and updates: Optimization continues until validation error increases, while Jacobians and errors are computed over the entire training set at each iteration.Weight updates are based on Jacobians computed simultaneously over multiple trajectory segments rather than on individual samples.

V. SIMULATION RESULTS

The experiments train MODERNN, RMLP, and NARX on simulated quadrotor altitude data and compare architecture, training, and conditioning behavior. MODERNN learns the model with substantially shorter computation time, while feedforward connections are associated with a less ill-conditioned Hessian.

  • Dataset: The simulated dataset varies altitude from [0, 2] meters, uses 10 Hz sampling, and applies random sums of 10 sinusoids at frequencies from [1, 10]Hz.The input is designed to produce flyable trajectories rather than random-noise excitation.
  • Experimental setup: MODERNN, RMLP, and NARX are trained on the generated quadrotor altitude dataset and evaluated across layers, hidden neurons, minibatch size, and NARX delays.The reported metrics include mean dataset error and training time.
  • Conditioning: NARX and RMLP eventually reach much larger Hessian condition numbers than MODERNN as optimization progresses, introducing more numerical error.The larger condition numbers may contribute to NARX and RMLP failing to learn on small batches.
  • Conditioning: Because MODERNN differs from RMLP through forward connections, the authors conclude that these connections contribute to a less ill-conditioned Hessian.Both networks have the same number of layers and hidden neurons in this comparison.

VI. CONCLUSION

The paper presents MODERNN as a modular RNN class for high-order nonlinear dynamics, with modular Jacobian calculation and feedforward connections. In a simulated quadrotor altitude task, it supports reliable modeling with smaller networks and substantially lower computation time.

  • Contribution: MODERNN is a modular, flexible class of RNN architectures for modeling high-order dynamic and nonlinear systems.It also encompasses a large class of previously studied RNNs.
  • Contribution: MODERNN provides a modular, easy-to-implement method for calculating network Jacobians.The Jacobian calculation supports gradient-based learning across the architecture class.
  • Contribution: Feedforward connections in an RNN can significantly alleviate vanishing and exploding gradients in space.The conclusion links this property to the multi-layer architecture.
  • Application: A Levenberg–Marquardt learning algorithm successfully learns simulated quadrotor altitude dynamics with MODERNN.The demonstrated application concerns a simulated quadrotor rather than measured flight data.
  • Implication: Smaller networks reduce the computation time needed to obtain reliable models for moderately complex dynamical systems with significant nonlinearities.The conclusion presents this reduction as enabled by modeling the same-complexity dynamics with fewer network resources.
Loading 2609.04339v1…