Jump to content

Artificial intelligence - genetics

Recommended Posts

  • Moderators

In the past I've written some posts on neural networks and how to implement them from first principles in smart pascal :

-  MNIST handwritten character recognition by neural network
-  Whats happening inside a neural network during training : visualisation through voronoi cells
(use train-button, not the test-button)
-  A pre-trained neural network playing Pong
(use go-button, not the re-train button)
Recently I came across this article from OpenAI (Elon Musks sideline) :
In this article they describe a working and sometimes better alternative to neural networking;
The big thing is that this re-invention of an old idea (genetic programming) has a couple of very important advantages over neural network solutions.
One of them being that it involves only a single forward pass, no back-propagation necessary.
The other advantage is that learning time can be greatly reduced.
The demo code in this OpenAI article is written in python / numpy,
but looked simple enough to see if this can be turned into a smart project.
I did find some external javascript libraries which emulate numpy (num.js, numpy.js, others) and I gave these a try
However either these libraries are incomplete and/or sometimes are in error
In the end it was easier to re-write the numpy functions directly in Smart
See project here
Link to post
Share on other sites

Thanks for the input.


I think SmartMS team should focus on the IDE and the compiler. Allow easy UI development for mobile, since SMS does wonders for the Controller part. If you are following https://jonlennartaasenden.wordpress.com/news/, it seems the focus now is on Smart Desktop/Node.JS instead of the UI mobile side improvements.


I think it would be really useful an official kitchen Sink example showing up all the Smart features, it should be BIG app: 

"SMS_kitchen_sink" = {
	"IA/neural network" : [
		"Face rec"
	"Graphics" : [
		"Retro Game",
		"Sprite 3D"
	"Panels" : [
		"Basic Panel",
		"Framed Panel",
		"Header Positioning",
	"Grids" : [
		"Array Grid",
		"Grouped Grid",
		"Locking Grid",
		"Grouped Header Grid",
		"Multiple Sort Grid",
		"Progress Bar Pager",
		"Sliding Pager",
		"XML Grid",
		"Grid Plugins",
		"Grid Filtering",
		"Reconfigure Grid",
		"Property Grid",
		"Cell Editing",
		"Row Expander",
		"Big Data",
		"Widget grid",
		"Customer/Order grid"

	"Data Binding" : [
		"Hello World",
		"Two Way",
		"Component State",
		"Chaining Stores",
		"Chained ComboBoxes",
		"Model Validation",
		"Field Validation",
		"Two-Way Formulas",
		"Slider and Form Fields",
		"Isolated Child Sessions"
	"Trees" : [
		"Basic Trees",
		"Tree Reorder",
		"Tree Grid",
		"Two Trees",
		"Check Tree",
		"XML Tree",
		"Filtered Tree",
		"Heterogeneous Tree"
	"Tabs" : [
		"Basic Tabs",
		"Plain Tabs",
		"Framed Tabs",
		"Icon Tabs",
		"Ajax Tabs",
		"Advanced Tabs",
		"Navigation Tabs",
		"Side Navigation Tabs",
		"Header Tabs",
		"Reorderable Tabs"
	"Windows" : [
		"Basic Window",
		"Message Box"
	"Buttons" : [
		"Basic Buttons",
		"Toggle Buttons",
		"Menu Buttons",
		"Menu Bottom Buttons",
		"Split Buttons",
		"Split Bottom Buttons",
		"Left Text Buttons",
		"Right Text Buttons",
		"Link Buttons",
		"Segmented Buttons",
		"Vertical Segmented Buttons"
	"DataView" : [
		"Multisort DataView"
	"Form Fields" : [
		"Number Field",
		"Date/Month Picker",
		"Combo Boxes",
		"File Uploads",
		"Field Replicator",
		"Form with Grid",
		"Tag Field",
		"Multi-Selector Grid",
		"Field Types",
		"Field Container",
		"Checkbox Groups",
		"Radio Groups",
		"Slider Field"
	"Forms" : [
		"Basic Toolbar",
		"Docked Toolbar",
		"Breadcrumb Toolbar"
	"Toolbars" : [
		"Absolute Layout",
		"Accordion Layout",
		"Border Layout",
		"Card Layout",
		"Card (Tabs)",
		"Center Layout",
		"Column Layout",
		"Fit Layout",
		"HBox Layout",
		"Table Layout",
		"VBox Layout"
	"Layouts" : [
		"Field to Grid",
		"Grid to Form",
		"Grid to Grid"
	"Drag & Drop" : [
		"AMF Grid",
		"Soap Grid"
	"Enterprise" : [
		"mORMot DB connector"

Link to post
Share on other sites

The smart pascal community can create a shared non-official kitchen sink example, but I think there need to be someone "official" to write and maintain these examples that is nice to the users to get started.
I totally agree with Arnaud Bouchez comment.[/size]

I'm a bit worried about SmartMobileStudio future.
I have renewed by annual subscription, but the development seems very very very quite.
There is still a lot to do on SMS, both the IDE and the visual library, for instance.
How is the team going? Do you have enough time working on it?
From our customer side, it is difficult to invest time on a technology which is very promising, but seems not to be very active.
I spent months writing code targeting SMS, in addition to FPC and Delphi.
The logical part is almost finished, with proper regression tests.
The SMS compiler is a piece of art, really.
But I doubt I may use SMS IDE and components to build the apps, i.e. the UI consuming this logic...
Any news?


If you don't know, AB has created an extremely useful library to communicate SMS with Delphi/FPC. We can consume native SOA services from windows/linux for instance, perform CRUD operations easily, but unfortunately stopped the improve that library because the RAD approach. 


Anyway, we can surely create this shared kitchen sink example using the RAD approach. It seems there's just a bit too much work involved to meet even baseline expectations, just for instance, when it comes to writing smart components, interesting components, such as reactive components, it seems everybody ends up writing a framework, it seems, likely waste a lot of time solving problems others have already solved.


Another thing, that's not necessarily a bad thing using a Framework with SmartMS. We have to consider that Smart Mobile Studio has its strengths and limits. Some areas, SMS is so rudimentary that, in practice, that RTL alone  does not provide a sufficient framework to development.

Link to post
Share on other sites
  • Moderators

I suppose its a good thing to lean back every now and then and see what's happening


I'm not a member of the smart development team, nor am I affiliated in any way

so below is purely my own opinion


A couple of years ago I was actively looking for a product enabling application development in a structured way and most importantly deployable everywhere.

When I came across sms I thought well, let's give it a go - it may turn out a flop or be really useful


The domain I develop for is business applications and websites/webapps.

I'm not into other types of application development, like games or tools or what have you

So business apps only


I've been using my Delphi enterprise license for that, but found it frustratingly difficult if not impossible to deploy on mobile platforms etc

So using sms was a relief.

I've been using it for a number of years now for the majority of my projects


Is it complete ?

Not really. I could easily come up with a wish-list, even one a mile long.

The end of the day the question though is, does it enable me to produce solutions for projects i do

and for my purposes it's mostly fine


Is it future proof ?

Not really. If there is a very limited development capacity, then changes and additions will lag behind

I'm not too fussed about it though. Smart is a layer over the browser (and node) and as long as the modern browser family keeps on improving it will be possible to follow.

Not talking the rtl down, I think its an amazing piece of work.

However if necessary the visual side can be bypassed completely by coding on the html-element level.

Or extend the rtl yourself, its all very open.


Is it easy to learn and use ?

Not really. Documentation is messy, fragmented and mostly simply not there.

Primoz book is the best bit and i find that i still use it regularly

Jon announced he's writing a book and that will help. I might be some time coming though

So yes it takes effort in learning the rtl and I found I had to relearn my HTML, CSS and JS skills as well


What do I really miss ?

Not so much an extended list of visual components to be honest. If I need something special its pretty easy to code from scratch or copy from another framework

But what I really miss is

- DB support - Delphi is a lot stronger in that

- Python like libraries for use in ai. The only reason I'm delving in Python at the moment is the lack of ai support in sms and its too much to rewrite everything.

  To be fair, all the other development platforms are lacking here too , delphi, fpc and all the js frameworks don't provide this either

- an active community which acts as a peer environment. It would be good to be able to submit a piece of code or a design or an idea in one of the forums and have it peer-reviewed by others


In the end I think its a product worth saving





Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...