Jump to content

Search the Community

Showing results for tags 'keras4delphi'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. https://github.com/Roelof1986/Keras4Delphi---New-FULL-LSTM-Fix-Delphi-10.3-Rio- Hello everyone, I've been working extensively with Keras4Delphi and wanted to share a solid fix for using stateful=True in LSTM layers — something that normally leads to frustrating errors like: ValueError: When using 'stateful=True' in a RNN, the batch size must be static. Found: (None, 4, 2) After reverse-engineering how Keras handles batch_input_shape, I've built a working solution that lets you: Use stateful LSTM models in Delphi without runtime shape errors Define a static batch shape via class vars instead of fragile .SetItem(...) calls Cleanly set stateful, return_sequences, and batch_input_shape using hardcoded defaults Stack multiple LSTM layers (with only the first one being stateful, as recommended) ✅ Highlights: Fully functional fix for stateful=True Tested with TensorFlow 2.19 and Delphi 10.4 Shape is passed cleanly to Python using PyDict_SetItemString(...) Uses class var overrides, e.g.: TBase.UseStateful := True; TBase.UseReturnSequences := True; TBase.UseBatchInputShape := [2, 4, 2]; 🔧 Example setup: lstm1 := TLSTM.Create(32); // parameters pulled from class vars model.Add(lstm1); lstm2 := TLSTM.Create(64); // stateful := False, return_sequences := False model.Add(lstm2); 🧠 Why this helps: Keras4Delphi is a great bridge between Pascal and TensorFlow, but its current design struggles with RNN state handling. This fix brings full stability, predictable behavior, and makes LSTM-based time-series modeling in Delphi a reality. 🗂 Repo (MIT-licensed): GitHub: keras4delphi-stateful-fix --- Let me know if you're also working with RNNs or time-sequence data in Delphi — I'd love to share ideas. Kind regards, Roelof Emmerink ---
×