In recent years, the incidence of autistic children has shown rapid growth worldwide. The rapid development of education and rehabilitation institutions for autistic children is of great significance to the rehabilitation of this group. However, the research on indoor space environments and functional facilities for autistic children in China is still in its infancy. Reasonably and effectively, zoning the education and rehabilitation space for autistic children can promote better communication and learning between autistic children and rehabilitation therapists and effectively promote the rehabilitation progress of autistic children. However, the existing education and rehabilitation space for autistic children has some problems, such as unscientific indoor partition, indoor space layouts mainly relying on manual work, heavy workload and low efficiency. Therefore, it is of great research value and practical significance to explore the intuitive design and optimization of the education and rehabilitation space layout for autistic children. This study first evaluates and optimizes the educational space for autistic children based on the affordability theory. Then, this study proposes a layout recommendation algorithm based on deep learning, which is used to improve the layout efficiency of the education and rehabilitation space for autistic children and realize real-time online layout. The scene information is digitized in binary code. The segmentation and layout network models are constructed through bidirectional long short-term memory (LSTM) to discover the long segment pre-segmentation of house type and obtain the layout results. The word embedding algorithm is used to abstract the cross features between each vector segment, and the dimension of the feature matrix is reduced to improve the speed and accuracy of the layout scheme recommendation. The experimental results show that our method can learn the design rules from the data set and has achieved better results than the existing methods. This study provides an adequate theoretical basis and design reference for the research of residential education space for autistic children.