• OK, it's on.
  • Please note that many, many Email Addresses used for spam, are not accepted at registration. Select a respectable Free email.
  • Done now. Domine miserere nobis.

A.I. python code:

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
I am trying to write some code for a matrix that arranges nodes based on how well they predict other nodes. But I do not understand how Python works. I used chat_gpt and got this far:

1:[1][2][3][4] 2:[1][2][3][4] 3:[1][2][3][4] 4:[1][2][3][4] 5:[1][2][3][4] 6:[1][2][3][4] 7:[1][2][3][4] 8:[1][2][3][4] 9:[1][2][3][4] (input1(random 256)) (input2(random 256)) node1(value = input1) node2(value = input2) node3(value = sum links/3):link1[node1(weight)]link2[node2(weight)]link3[node3(weight)] node4(value = sum links/3):link1[node1(weight)]link2[node2(weight)]link3[node3(weight)] node5(value = sum links/3):link1[node1(weight)]link2[node2(weight)]link3[node3(weight)] node6(value = sum links/3):link1[node1(weight)]link2[node2(weight)]link3[node3(weight)] (output1(node5 value())) (output2(node6 value())) - import random node_value = [] node_position = [] node_prediction_weight = [] def initiate_input(): input_length = 10 input = [] for i in range(input_length): input.append(random.randint(0, 255)) for i in range(input_length): node_value.append(input[i]) def initiate_output(): output_length = 10 output = [] for i in range(output_length): output.append(node_value[x][i]) # a mistake is here ? def initiate_iteration(): matrix_num_x = 10 matrix_num_y = 10 sum_node_value = [] for i in range(matrix_num_x): sum_node_value.append(sum(node_value[i]) / matrix_num_y) for i in range(matrix_num_x): node_value[i] = sum_node_value[i] for i in range(matrix_num_x): for q in range(matrix_num_x): if node_position[i][q]: node_position[i][q] = # incomplete
 

Cognisant

cackling in the trenches
Local time
Yesterday 8:12 PM
Joined
Dec 12, 2009
Messages
11,155
---
That code is gibberish.

In plain speak what are you trying to do?
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
That code is gibberish.

In plain speak what are you trying to do?

to implement the algorithm I invented in 2009: a constant updating probability matrix.

input is from a camera, and output to a motor avatar.

node x has a value between 0 and 256

it is connected to 100 other nodes via links

If they are similar in value then they are arranged in order of how many times they are the same as the core nodes. then they are given a probability of how many times they have been in their position.


core node x (192) node_x_value (29) node_x_value (186) node_x_value (73) node_x_value (116)

sort: most similar values

core_node_x (192) node_x_value (186) node_x_value (116) node_x_value (73) node_x_value (29)

probability: greatest to least

core node(0) probability(1) probability(2) probability(4) probability(8)

replace least probable with new nodes:

core_node_x (192) node_x_value (186) node_x_value (116) node_x_value (44) node_x_value (77)

repeat sort:
update probability:
 

dr froyd

__________________________________________________
Local time
Today 7:12 AM
Joined
Jan 26, 2015
Messages
1,485
---
i didn't understand much of it. How do you define a "core node"? Are there two separate matrices and you loop over all cells in the first matrix, or is there only 1 matrix and you are picking these core nodes at random, or something else?

writing it in psuedo code first would probably help
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
matrix [node, value]
[link[x]:[node, value], probability[x]]

sum links to the node value [node, (value)] += [link[x]:[node, (value)]]

then divide by the number of links [node, (value)] / num links

probability = abs([node, (value)] - link[x]:[node, (value)])

arrange

if probability[x - 1] >= probability[x]
then apend.link[x](probability[x - 1])
 

dr froyd

__________________________________________________
Local time
Today 7:12 AM
Joined
Jan 26, 2015
Messages
1,485
---
it's still impossible to understand, like I have no idea what even "matrix [node, value]" means. Is "value" a column in the matrix, i.e. a vector? Or are these dimensions of the matrix?
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
it's still impossible to understand, like I have no idea what even "matrix [node, value]" means. Is "value" a column in the matrix, i.e. a vector? Or are these dimensions of the matrix?

nodes have continuous values.

these values come from the sum of the connections/number of connections.

then they are given a probability and then arranged in the order in which they predict the total value of the node (sum of the connections/number of connections)

sorry I explain things poorly, I made this image:

kYWt63c.png
 

birdsnestfern

Earthling
Local time
Today 2:12 AM
Joined
Oct 7, 2021
Messages
1,897
---
I did take COBOL 1 and 2 programming, systems design, and even designed a Naval RFQ /RFP program for a Sub base to order and build a nuclear sub (to order parts for one anyway). I don't know python, but seeing it brings back memories of trying to memorize two pages of code for a test. We used an AS 400 to compile programs on. Spreadsheets, databases, IT and accounting - works together.
 

Attachments

  • cobol language.jpg
    cobol language.jpg
    86.6 KB · Views: 79
  • cobol book.jpg
    cobol book.jpg
    83.7 KB · Views: 81

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
Create a network list where nodes are like cellphone directories so that the contacts with the most calls predict the most and are at the top of the list. [node(value)][connection[x]:[node, value, probability[x]]] Node 1 vector: [{'node': 'Node 2', 'value': 1, 'probability': 0.5}, {'node': 'Node 3', 'value': 2, 'probability': 0.5}] Node 2 vector: [{'node': 'Node 3', 'value': 3, 'probability': 1.0}] Node 3 vector: []
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama

Scalable Hypothesis testing​

Any system that can generate predictions must premake representations before they are seen. this must be done in real-time. Self-organizing.

xtW9Ktk.png
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama

Solving the alignment problem​


78NtPCj.png
 

scorpiomover

The little professor
Local time
Today 7:12 AM
Joined
May 3, 2011
Messages
3,383
---
I am trying to write some code for a matrix that arranges nodes based on how well they predict other nodes. But I do not understand how Python works.
Then write it in a programming language you DO know.

Or, learn Python. It's not that difficult to learn. You can find courses and tutorials for Python online.

I used chat_gpt and got this far:
That's like asking chatGPT to write the Chinese symbol for courage, so you can get it tattooed on your arm, when you don't read Chinese. You could very easily end up with a tattoo that says "soup" in Chinese.
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
I am trying to write some code for a matrix that arranges nodes based on how well they predict other nodes. But I do not understand how Python works.
Then write it in a programming language you DO know.

Or, learn Python. It's not that difficult to learn. You can find courses and tutorials for Python online.

Maybe asking a forum for help was not such a good idea.

I used chat_gpt and got this far:
That's like asking chatGPT to write the Chinese symbol for courage, so you can get it tattooed on your arm, when you don't read Chinese. You could very easily end up with a tattoo that says "soup" in Chinese.

6fkoYla.jpg
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
insert_input

Node_vector_0 : [ node_value = input_1 ]

Node_vector_1 : [ node_value = input_2 ]

Node_vector_2 :

[ node_value = [total = all node values / num vectors (20)]:

{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},
{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},
{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},
{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},

]

Node_vector_3 :

[ node_value = [total = all node values / num vectors (20)]:

{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},
{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},
{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},
{‘node’: x, ‘value’: random node (0 to total number of nodes), ‘probability’: 0.5},

]
 

EndogenousRebel

Even a mean person is trying their best, right?
Local time
Today 1:12 AM
Joined
Jun 13, 2019
Messages
2,252
---
Location
Narnia
On a side note I'm increasing convinced that AI as it is now will be a fad that eliminated menial tasks, but never got much more use in the public sector.

If youve seen chatgpt play chess it very clearly disregards context and just inputs, without any hesitation illegal moves.

That is to say that its not really designed at this point to look at a system wholly.

I would say that in order for you to use it effectively in this way you would need the knowledge, at least the infrastructure of the system, and what the system contains, lines of code and such.

You would then have to very precisely describe what you want to be done.

Even as a learning tool, it's bad at picking between new and old information unless you deliver unto it a hyper specific query that checks a whole bunch of boxes the average person would never bother to discover or try.
 

birdsnestfern

Earthling
Local time
Today 2:12 AM
Joined
Oct 7, 2021
Messages
1,897
---
Here is a youtube tutorial on Python:
 

dr froyd

__________________________________________________
Local time
Today 7:12 AM
Joined
Jan 26, 2015
Messages
1,485
---
@Animekitty
I don't mean to be a constant critic but as someone who finds it interesting to understand algorithms my feedback would be that the principal problem of how you write the algo here is that you tend to omit any definition of the variables, data structures, and operators you use.

for example

link[x]:[node, (value)]

it is 100% impossible to know what this means without definitions of what data structures link, node, value are, and what the bracket operator "[ ]" does, what the ":" operator does, and so on

I suspect without those definitions it makes it hard to formalize the idea on your own part too

and btw the good news is that if one can make all of these definitions very clear, implementing the code is the easy part
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
it is 100% impossible to know what this means without definitions of what data structures link, node, value are, and what the bracket operator "[ ]" does, what the operator does, and so on

A directed graph network is a set of objects (called vertices or nodes) that are connected together, where all the edges are directed from one vertex to another. A directed graph is sometimes called a digraph or a directed network.


This is an array


This means it is in the area where the label shows what is contained.

node_vector [{ ‘node’: x }, { ‘node’: x }, { ‘node’: x }]

‘node’ is the label

x is the edge

node_vector is the vertex

value is the sum of the node's connections as in the weighted sum

and btw the good news is that if one can make all of these definitions very clear, implementing the code is the easy part

I understand the algorithm

I designed the algorithm

I do not understand Python syntax

not understanding the syntax prevents me from doing my algorithm in Python

because I cannot get things in or out of the arrays.

I cannot understand how to sort things in Python.

but everyone uses Python for a.i. coding today so I have no choice.

I suspect without those definitions it makes it hard to formalize the idea on your own part too

I do not understand object-oriented programming

I understand cellular automata

that is how my mind works

but C++ is way too hard so I do not know what else to do.

no one will use it if I do it in anything other than Python.

I perfectly understand how my algorithm operates, I invented it in 2009.

I could do it in Java but no one uses Java,

and it would not have any functions.

python requires functions so I do not know how to make cellular automata in it.

-

The algorithm I invented is like Google page rank, but for deep learning.

The network automatically rewires itself based on a dynamic set of input matching.

So it is like the internet, but with fixed input and output.

a collection of links on a webpage is like a brain cell.

These links change based on the way in which the network is directed to the input and output.
 

dr froyd

__________________________________________________
Local time
Today 7:12 AM
Joined
Jan 26, 2015
Messages
1,485
---
if you know java then you should 100% do it in java

then people could see what it does. Porting it from java to python, if one would wish that, would be much easier than implementing it from scratch in python while working purely from a conceptual description
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
This is the best I can do for now:

It runs a window but I am not sure why I do not see the pixels going randomly to start since I initiated them to be random and them start learning.

/* * This java program adds together the probabilities of nodes. * */ package javaapplication1; import java.util.Random; import java.awt.Color; import java.awt.Graphics; import javax.swing.JComponent; import javax.swing.JFrame; public class JavaApplication1 extends JComponent implements Runnable { int[][] pixel_values = new int[100][100]; int edges = 100; int nodes = 10000; int input_num = 500; int[] sum_v = new int [nodes]; int[] vertex_value = new int [nodes]; int[][] probability = new int [nodes][edges]; int[] input_values = new int[input_num]; int[] output_values = new int[input_num]; public JavaApplication1() { initialData(); new Thread(this).start(); } // End function public void run() { while (true) { try { changeData(); repaint(); Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } } } // End function // This function is just used once at the start of the program. private void initialData() { Random r = new Random(); synchronized (vertex_value){ for (int x = 0; x < input_num; x++) { vertex_value[x] = r.nextInt(255); output_values[x] = vertex_value[x+100]; } // Initiate random values for (int x = input_num; x < nodes; x++) { vertex_value[x] = r.nextInt(255); } // Keep vertex_value in bounds for (int x = 0; x < nodes; x++) { if (vertex_value[x] >= 255) vertex_value[x] = 252; else if (vertex_value[x] <= 0) vertex_value[x] = 2; } // Initiate random probabilities for (int x = 0; x < nodes; x++) { for (int y = 0; y < edges; y++) { probability[x][y] = r.nextInt(255); } } } } // End function private void changeData() { synchronized (vertex_value){ for (int x = 0; x < nodes; x++) { sum_v[x] = 0; } // Sum node values for (int x = 0; x < nodes; x++) { for (int y = 0; y < edges; y++) { sum_v[x] += probability [x][y]; } vertex_value[x] = sum_v[x] / edges; sum_v[x] = 0; } // Keep vertex_value in bounds for (int x = 0; x < nodes; x++) { if (vertex_value[x] >= 255) vertex_value[x] = 252; else if (vertex_value[x] <= 0) vertex_value[x] = 2; } // change probibility for (int x = 0; x < nodes; x++) { for (int y = 0; y < edges; y++) { if (probability[x][y] >= vertex_value[x]) probability[x][y] -= 1; else if (probability[x][y] < vertex_value[x]) probability[x][y] += 1; } } // Keep probability in bounds for (int x = 0; x < nodes; x++) { for (int y = 0; y < edges; y++) { if (probability[x][y] >= 255) probability[x][y] = 252; else if (probability[x][y] <= 0) probability[x][y] = 2; } } } } // End function public void paint(Graphics g) { synchronized (vertex_value){ int res = 5; int ws = 100; //window_size = ws for (int x = 0; x < ws; x += 1) { for (int y = 0; y < ws; y += 1) { pixel_values[x][y] += vertex_value[x+y]; try { g.setColor(new Color(0, pixel_values[x][y], 0)); g.fillRect(0 + 00, 0 + 00, ws*res, ws*res); } catch (IllegalArgumentException ex) { System.out.println("Error value: " + vertex_value[x+y] + ", [x,y] = [" + x + "," + y +"]"); } } } } } // End function public static void main(String[] args) { int ws = 500; //window_size = ws JFrame f = new JFrame("Cortex Ripples"); f.add(new JavaApplication1()); f.setSize((ws+16), (ws+39)); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } // End function } // End Program
 

Black Rose

An unbreakable bond
Local time
Today 12:12 AM
Joined
Apr 4, 2010
Messages
11,431
---
Location
with mama
I tried using Google's Bard:

import random

class Node:
def __init__(self, value, probability):
self.value = value
self.probability = probability

def initiate_node_network(num_nodes):
"""Initiates a node network with the given number of nodes.

Args:
num_nodes: The number of nodes in the network.

Returns:
A list of nodes.
"""

# Create a list of nodes.
nodes = []
for i in range(num_nodes):
nodes.append(Node(value=random.randint(1, num_nodes), probability=random.random()))

# Shuffle the nodes.
random.shuffle(nodes)

# Sort the nodes by their probabilities.
sorted_nodes = sorted(nodes, key=lambda node: node.probability)

# Return the sorted list of nodes.
return sorted_nodes

def update_node_probabilities(nodes):
"""Updates the probabilities of the nodes in the network.

Args:
nodes: A list of nodes.

Returns:
A list of nodes with updated probabilities.
"""

# Calculate the total probability of all the nodes.
total_probability = sum(node.probability for node in nodes)

# Update the probabilities of each node.
for node in nodes:
node.probability = node.probability / total_probability

# Return the list of nodes with updated probabilities.
return nodes

def update_node_values(nodes):
"""Updates the values of the nodes in the network.

Args:
nodes: A list of nodes.

Returns:
A list of nodes with updated values.
"""

# Calculate the total probability of all the nodes.
total_probability = sum(node.probability for node in nodes)

# Update the values of each node.
for node in nodes:
node.value = node.probability * total_probability

# Return the list of nodes with updated values.
return nodes

if __name__ == "__main__":
# Create a list of 10 nodes.
nodes = initiate_node_network(10)

# Update the probabilities of the nodes.
nodes = update_node_probabilities(nodes)

# Update the values of the nodes.
nodes = update_node_values(nodes)

# Print the values of the nodes.
for node in nodes:
print(node.value)
 
Top Bottom