Recent

Author Topic: Pascal for TensorFlow  (Read 12518 times)

domasz

  • Sr. Member
  • ****
  • Posts: 423
Re: Pascal for TensorFlow
« Reply #15 on: January 27, 2023, 03:42:07 pm »
I can help fix some inline variables. With just a few people we could get it done by the end of the weekend. Anybody else wants to help?

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Pascal for TensorFlow
« Reply #16 on: January 27, 2023, 04:11:19 pm »
Alas there is the rather unfortunate dependence on string4delphi. Will take more than a weekend, I suppose.
Specialize a type, not a var.

Root

  • New member
  • *
  • Posts: 7
Re: Pascal for TensorFlow
« Reply #17 on: January 27, 2023, 04:54:30 pm »
Thanks, any contribution is welcome .

i have limited the use of spring4d. I use it for the Enumerable<TSource> type because it includes practically all the methods of the IEnumerable class of c# and python. then it is used for Tuple and Nullable types.

domasz

  • Sr. Member
  • ****
  • Posts: 423
Re: Pascal for TensorFlow
« Reply #18 on: January 27, 2023, 05:51:05 pm »
I use it for the Enumerable<TSource> type because it includes practically all the methods of the IEnumerable class of c# and python. then it is used for Tuple and Nullable types.
So perhaps we should just create a replacement for this class in Lazarus and ditch Springs4Delphi.

domasz

  • Sr. Member
  • ****
  • Posts: 423
Re: Pascal for TensorFlow
« Reply #19 on: February 03, 2023, 12:13:05 am »
I tried but can't compile it under Lazarus because of Springs4Delphi. Anybody knows how to use Springs4Delphi in Lazarus?

PierceNg

  • Sr. Member
  • ****
  • Posts: 369
    • SamadhiWeb
Re: Pascal for TensorFlow
« Reply #20 on: February 03, 2023, 02:44:36 am »
I tried but can't compile it under Lazarus because of Springs4Delphi. Anybody knows how to use Springs4Delphi in Lazarus?

There are two separate wrappers mentioned in this thread. Does the other one compile?

domasz

  • Sr. Member
  • ****
  • Posts: 423
Re: Pascal for TensorFlow
« Reply #21 on: February 03, 2023, 09:36:11 am »
There are two separate wrappers mentioned in this thread. Does the other one compile?
This one? https://github.com/zsoltszakaly/tensorflowforpascal
Yeah, compiles, no problems.

This one https://github.com/Pigrecos/TensorFlow.Delphi uses Spring4Delphi which can't compiled because of types like this:
Code: Pascal  [Select][+][-]
  1. TTimeSpan = TimeSpan.TTimeSpan
  2.   TStopwatch = Diagnostics.TStopwatch;
  3.  
I don't know how to substitute.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Pascal for TensorFlow
« Reply #22 on: February 03, 2023, 10:20:09 am »
system.Timespan exists in trunk.

jollytall

  • Sr. Member
  • ****
  • Posts: 306
Re: Pascal for TensorFlow
« Reply #23 on: April 28, 2023, 05:07:47 pm »
I have just found that this thread is still alive and found in it: https://github.com/Pigrecos/TensorFlow.Delphi. There was a question above on the comparison with https://github.com/zsoltszakaly/tensorflowforpascal. Now I looked at TensorFlow.Delphi and found that the two are not comparable.
The tensorflowforpascal is only a wrapper around the core Tensorflow functionality, i.e. the elementary operations. In my view it is simple, easy to use, with limited dependency, however it is as basic as basic tensorflow itself is.
The TensorFlow.Delphi on the other hand is a much more sophisticated, complex system, basically implementing the Keras functionality in pascal. As Keras is much more than TensorFlow (we remember that Keras was built as an AI environment over multiple mathematical libraries, and only recently it became TF only), so is its pascal counterpart. It has much more functionality, much more tuned for AI development, but also much more complex and has much more dependencies.
So, if you need something simple in programming, but hard(er) work to make an AI NN, and especially if you want to work under Linux, then I think tensorflowforpascal is a better choice.
On the other hand if you are under Windows/Delphi and are already familiar with the Keras world then TensorFlow.Delphi is a much better choice to migrate Keras to the pascal world.

 

TinyPortal © 2005-2018