Train a practical language model in modern C++ using two complementary frameworks; MiniDNN, a lightweight CPU-focused library for learning and prototyping, and LibTorch, the production-grade C++ API for PyTorch with full GPU acceleration. This book guides you through both approaches, from setting up your project and preparing text data to building models, configuring training, choosing optimisers, and tracking loss and metrics. You will implement the core components you need in real code: data handling (batching, tokenisation, memory efficiency), model architecture and layer configuration, training utilities (logging, checkpointing), evaluation and cross-validation, and inference for text generation with beam search and sampling. The dual-track approach lets you start with simple, readable MiniDNN code on CPU, then scale to production-ready LibTorch implementations on GPU. Advanced chapters introduce attention mechanisms, transfer learning, and ethical considerations. The appendices provide API references for both frameworks, troubleshooting guidance, and performance benchmarks. If you want a clear, end-to-end path to building and running language models in C++, this book is your starting point.
ThriftBooks sells millions of used books at the lowest everyday prices. We personally assess every book's quality and offer rare, out-of-print treasures. We deliver the joy of reading in recyclable packaging with free standard shipping on US orders over $15. ThriftBooks.com. Read more. Spend less.