Hi there,I'm aware of this, but thank you for writing it. However, I was looking for someone familiar with DL who would like to lend a hand.
Sorry if it's a bit off-topic about your question, but this is something rounding my head time ago. I'm pretty almost sure, Erel is testing something similar not only to offer us some very exciting and blow-heading kind of using AI in some way on B4X, but because his brain is always hungry of new things, like Web3, the new search engine, etc... It maybe with some kind of IDE copilot, or with a web page which could generate code with less errors than chatGPT, etc...I was considering training AI to develop in B4X
D:\qwen tests>python qwen_setup.py
Generating model inputs
Generating ids
Asking : write a quick sort algorithm in B4J.
Sure! Below is a simple implementation of the Quick Sort algorithm in B4J. This algorithm sorts an array in ascending order.
```b4j
Sub QuickSort(arr As Array)
If arr.Length <= 1 Then
Return arr
Else
Dim pivotIndex As Integer = Partition(arr, 0, arr.Length - 1)
QuickSort(arr, 0, pivotIndex - 1)
QuickSort(arr, pivotIndex + 1, arr.Length - 1)
End If
End Sub
Sub Partition(arr As Array, low As Integer, high As Integer) As Integer
Dim pivotValue As Integer = arr(high)
Dim i As Integer = low - 1
For j As Integer = low To high - 1
If arr(j) <= pivotValue Then
i = i + 1
arr(i), arr(j) = arr(j), arr(i)
End If
Next
arr(i + 1), arr(high) = arr(high), arr(i + 1)
Return i + 1
End Sub
```
### Explanation:
1. **Partition Function**:
- This function takes an array and two indices (`low` and `high`) as parameters.
- It selects the last element as the pivot.
- It iterates through the array from the start to the pivot index.
- If it finds an element that is less than or equal to the pivot, it increments the index and swaps the elements at the current index and the pivot index.
- After the loop, it swaps the pivot element with the element at the index `i + 1`.
2. **Quick Sort Function**:
- The `QuickSort` function first checks if the array has 0 or 1 element, in which case it returns the array as is.
- Otherwise, it partitions the array into three parts: elements less than or equal to the pivot, elements equal to the pivot, and elements greater than the pivot.
- It recursively calls itself on the partitioned sub-arrays.
This implementation is simple and works well for small to moderately sized arrays. For very large arrays, consider using more advanced sorting algorithms like Merge Sort or Heap Sort.
You mean you want it to write b4x code?Is there anyone with experience training TensorFlow? I was considering training AI to develop in B4X. I'm following several tutorials, but I need someone already experienced. Who would embark on a crazy project?
YesYou mean you want it to write b4x code?
const newInvoiceDate = parseDate('20241201');
const newCustomerID = 1;
const newAmount = 29.50;
const prediction = model.predict(tf.tensor2d([[newInvoiceDate, newCustomerID, newAmount]])).dataSync();
You can do better with Excel's statistical functions.I have already started studying the TensorFlow library with Python, but I came across TensorFlow.js
It's less powerful but it's good to start understanding and above all I can combine it with my recent work with BANano and create something that I can add into WebApps.
This is my first experiment for evaluating when an invoice will be collected by creating a model from a DataSet of collections for the last 3 years. It is not precise but very useful for teaching purposes.
Here is the first experiment where we predict when an invoice will be paid considering the past collections of the last 3 years
View attachment 160102
JavaScript:const newInvoiceDate = parseDate('20241201'); const newCustomerID = 1; const newAmount = 29.50; const prediction = model.predict(tf.tensor2d([[newInvoiceDate, newCustomerID, newAmount]])).dataSync();
Ok it is dividing distance of days.. but is an example of what can do... without thinking the way, just using predict..You can do better with Excel's statistical functions.