Creating a knowledge graph using Python and leveraging an NVIDIA GPU can enhance the processing speed, especially if you're dealing with large datasets or complex computations. Here's a general guide to start creating a knowledge graph in Python. We're focusing on utilizing GPU capabilities where applicable. Set up your Python environment. Ensure you have Python installed. You can use environments like Aliconda for easier package management. Install necessary libraries. PIP install NumPyPanda's network X-map public for basic operations. And PIP install KoopiGalax. Replace XXX with your CUDA version for GPU accelerated computations with Koopi. Data collection and preprocessing. Gather your data. This could be text files, databases, or any other structured, unstructured data source relevant to your knowledge graph. Pre-process the data using Python. If you're working with text data, this might include cleaning, tokenization, and entity recognition. Feature extraction and representation. Extract relevant features from your data. This step is domain specific. For example, in biomedical data, features might be specific medical terms or measurements. Represent these features in a structured format, such as a panda's data frame. For GPU acceleration, consider using Koopi, which is similar to NumPy, but leverages GPU for computations. Define entities and relationships. Identify key entities in your data. Entities are the primary objects, like nodes in a graph, that your knowledge graph will consist of. Determine the relationship between these entities. These relationships will form the edges in your graph. Build the knowledge graph. Use NetworkX to create the graph. While NetworkX itself does not run on a GPU, it's a powerful tool for graph creation and analysis. Alternatively, for large-scale graphs where GPU acceleration is needed, consider using a GPU-accelerated graph library like CU Graph from Rapids. Graph analysis. Analyze the graph for insights. You can use NetworkX for various analysis like centrality measures, community detection, etc. For GPU-accelerated graph analytics, explore libraries like CU Graph. Visualization. Visualize the graph using MatProbLib or for interactive visualization, libraries like Plotly or Dash. For large graphs, tools like Geffy or Graphisk can be more effective. Optimization and scaling. If dealing with very large datasets or complex computations, optimize your code to better utilize the GPU. This can include batch processing, parallel computations, and efficient memory management. Iterate and refine. Knowledge Graph creation is often an iterative process. Based on your findings, you might need to go back and adjust your entity definitions, relationships, or the structure of the graph itself. Application-specific development. Depending on your final goal, e.g., data analysis, machine learning, decision support, further develop your project to integrate the Knowledge Graph effectively. Remember, creating a Knowledge Graph is a complex process that depends heavily on the nature of your data and your specific goals. The use of GPU through libraries like QP or CU Graph can significantly speed up computations, and help you in handling large-scale data. Certainly. To start coding a basic Knowledge Graph in Python, we'll begin with a simple example. We won't require GPU acceleration for this initial demonstration, as it's a straightforward task. Let's use a small dataset to illustrate how to create a Knowledge Graph with Python. We use the following steps. Install necessary Python libraries. Create a small dataset. Define entities and relationships. Build the Knowledge Graph using NetworkX. Visualize the graph. Demonstrate the initial setup and the creation of a basic graph. Please make sure you have Python installed on your machine. You can install the necessary libraries using pip. Let's start by coding these steps. Python. Copy code, hash step 1. Install necessary libraries. Hash you can install these libraries by running these commands in your terminal or command prompt. Hash pip install NetworkX mappoblib. Hash step 2. Importing libraries import NetworkX as nx import mappoblib. Pipelot as plt. Hash step 3. Creating a small dataset hash, let's consider a simple example with a few entities and relationships. Entities equals Rain activity EEG Neurological disorder Patient A Treatment 1 Relationships equals Rain activity EEG Neurological disorder Patient A EEG Patient A Treatment 1. Hash step 4. Building the Knowledge Graph. G equals nx Graph G dot add underscore loads underscore from Entities G dot add underscore edges underscore from Relationships. Hash step 5. Visualizing a graph plt. Figure Fig size equals Nx Draw G With underscore labels equals true Node underscore color equals Light blue Edge underscore color equals Gray Node underscore size equals 2,000 Font underscore size equals 15 PLT Title In this code We import NetworkX for graph operations and mappoblib for visualization. We define a small set of entities and relationships. We create a graph G, add entities as nodes and relationships as edges. Finally, we visualize the graph. This is a basic example. In a real-world scenario, the data would be more complex, and you might need additional processing, especially for extracting entities and relationships from your dataset. You can expand on this by incorporating your specific data and more complex relationships. This is a basic example. In a real-world scenario, the data would be more complex, and you might need additional processing, especially for extracting entities and relationships from your dataset. You can expand on this by incorporating your specific data and more complex relationships. This new domain currently nothing on it, it's called the eegeneer.com. So we will be moving, well first of all, creating new tools on it, and eventually moving some of the EEG stuff from BioCaos onto it. And BioCaos will be all other stuff, the CG image processing, etc. Now we want to start with this knowledge graph, which we had ggpt making a code for, kind of works okay, it gives this basic, which looks okay, but it's actually gave us more data before, it's actually gave us this knowledge graph, turning the information about creating and using knowledge graphs for EEG data into a knowledge graph itself involves bestowing the key concepts and their interrelationships into a graphical format. Here's a conceptual representation of how this knowledge graph might look. Yes, we have this more, more nodes in this one, patient data relation, pattern analysis, network analysis, predictive modeling, visualization. So that looks better, just got the folder here, or the EEG, well I mean the website is called the EEG here, so everything on it will be EEG related, knowledge graphs with no space. All right, let's move that into it, have another data, that would be a text file, this in have all these child nodes, parent nodes. Each sub-node like data acquisition and preprocessing and its trial nodes like EEG data collection and EEG data preprocessing represent different aspects of the process and interconnected, showing how one aspect leads to our influences another. For instance, data acquisition and preprocessing would be directly connected to feature extraction and representation, indicating that the preprocessing step is essential before features can be extracted. Creating an actual visual representation of this knowledge graph will involve using a graph visualization tool or software, where each of these nodes and sub nodes are visually represented as points or bubbles and their relationships aligns arrows connecting them. This visual tool helps in understanding the complex process and interrelations involved in building and using a knowledge graph for EEG data in Python. We're using network X, creating node, blinking nodes. I want to add attributes. I assume the attributes will be providing more context. Okay, so let's say this is a data text file and let's pop this in. Hopefully the port will already understand the context. We obviously want to change those entities in the Python code. Yeah, so we have the same code using matplotlib2plot and the network X to do the structure. Right, so we have main nodes, sub nodes and child nodes. Looks legit. Why is my mouse not working? There's something wrong with the chgpt page. Is it going under? Hopefully not just right now. So obviously eventually we'll probably just need the code. Might grab the code and start a new chat because obviously it's not having a good time. Problems already. And we just started. Let's close this one. Let's make a copy because that one, that code actually works. Okay, this thing is the whole page as I was letting go just. Let's restart the page. Big error in Chrome. Okay, did they change the interface again? Yeah, I think that's what happened. They must have, openly I must have changed the interface live because before the previous stuff was on the side here, now it's top left. They keep changing stuff, but chat is still there. Okay, so we have main nodes, sub node, child node, building graph visualization, it's that size 15. Okay, let's just run this. Should be taking the data text. It's in the same file. It's the problem. A file path, copy relative path. Oops. Okay, it just should be a lash like this. That's the problem. Data text is in the same. Let's do the whole path. Okay, now it's running. Couldn't find the file. Okay, so it's scaling quite nicely. The nodes do not move. The page is scaling nicely. The nodes do not move. And also, is it gonna be different when I reload the page? By the way, eventually, we want to turn it into a web application available on a website hosted on Apache server. It is a budget server, but no, that's not what I said, I said Apache. Let's close this for a second, just wondering. Copy the whole control print screen, run it again, see. Yeah, it looks quite different, isn't it? So we have this graph construction construction. Yeah, it's always in a different position, but then reload it from here. Okay, several requirements. Well, I mean, it's okay for them to move, but yeah, maybe they will be loading in the same way, but then you can move them around. Graph layout should be considered each time. Page is reloaded yet, that's not a bad idea. You want to integrate this knowledge graph into a web application? Yep. Stable node placement. Let's just read this. We're power treating it. To ensure the nodes do not move around, you can use a fixed layout for your graph. In NetworkX, this can be achieved by pre-defining positions for each node and using those positions every time the graph is drawn. Alternatively, you can use a layout algorithm that provides stable positions across different runs, such as the spring underscore layout with a fixed random seed. Let's just be back instead, I'll just let it read it. I'm still listening to it, goodbye. Lot of advance is still work, so I'm not going over 10 meters away. Two, consistent layout across reloads. Use a deterministic layout algorithm or a fixed layout as mentioned above. By setting a fixed random seed, you can ensure that the spring underscore layout or some algorithms generates the same layout each time. Save the positions for nodes in a final database and load these positions every time the graph is rendered. Three, web application integration. Determine the knowledge graph into a web application, you will need to use a web framework. Since you're working with Python, Flask, or Django could be good options. The graph can be rendered on the client side using JavaScript libraries like D3.js, which offer great flexibility and interactivity for graph visualization. For hosting another patchy server, ensure your web application is packaged correctly, e.g., using a WSGI file for Flask apps, and configure a patchy to server application. Example integration steps. Backend, Python plus Flask, Django. Your Python code handles data processing and graph construction. The back end can serve JSON data representing the graph structure at the front end. Front end, JavaScript plus D3.js. Use D3.js or similar libraries to draw the graph based on the data received from the back end. D3.js provides functions to create a static layout that remains consistent across reloads. Hosting on a patchy. Deploy your Flask Django app on your patchy server. Configure a patchy with mod underscore WSGI for Flask, Django apps, and serve your web application. Development and testing. Develop the application locally, test the functionalities, and ensure the graph behaves expected. Once everything is functioning properly, deploy the application to your patchy server. This approach combines Python's data processing capabilities with the interactive and dynamic features of JavaScript for web visualization, providing a robust solution for your web-based knowledge graph application. Yeah, we know all that. We're really hosting a bunch of, yes, we're really hosting another website on this patchy server with multiple Flask applications. So this one will be an additional one, so we'll implement it in the same way. Regards the knowledge graph itself, can we improve on it? Any suggestions specifically thinking? Yes, loading it in the same, exactly the same way. Every time the page is loaded, and then allowing, moving the nodes around as per user request, also color can be improved. Yep. Given that you're already hosting multiple Flask applications on your patchy server and are familiar with the setup, adding another Flask app for the knowledge graph should be straightforward. Let's focus on improving the knowledge graph's interactivity and consistency across page loads. To ensure that the graph loads in exactly the same way every time, you can use a deterministic layout algorithm. Here's how you can achieve this. Fixed layout. Define fixed positions for each node in your graph and use these positions every time the graph is rendered. This approach requires you to pre-calculate and store these positions. Deterministic algorithm. Use a layout algorithm with a fixed seed. For instance, in networks' spring underscore layout, you can set a random seed to ensure consistent results. For interactive manipulation of the graph, like moving nodes around, consider using JavaScript libraries like D3, JS. D3, JS allows users to interact with elements of the graph directly in the browser. Dragable nodes. Implement dragable nodes in D3, JS. This feature lets users click and drag nodes to different positions on the screen. State persistence. To remember the node positions as adjusted by the user, you can store these positions in the browser's local storage or send them back to the server to be saved. Improving the color scheme and overall aesthetics can make the graph more user-friendly and visually appealing. Color coding. Use different colors to represent different types of nodes or relationships. This can improve readability and help users quickly identify key parts of the graph. Styling. Apply custom styles to nodes, edges, and labels to improve readability and visual appeal. For instance, larger nodes for more important entities, varying edge thickness based on relationship strength, etc. Tooltips and interaction. Implement tooltips that show additional information when hovering over nodes or edges. Interactive elements like clickable nodes can enhance user engagement. Since you're familiar with Flask, here's a basic outline of how you can structure the application. Backend. Flask. The Flask app serves the initial HTML page and provides endpoints to fetch graph data in JSON format. Frontend. D3. JS. Use D3. JS to render the graph in the browser based on the data from Flask. Implement interactive features like draggable nodes and tooltips. Data persistence. If the user modifies the graph layout, send the new positions to the Flask backend to save them. This can be done via Ajax calls. This example is a starting point for draggable nodes in D3. JS. You would need to expand this to include saving positions and possibly loading initial positions from the server. Integrating these features will create a more dynamic, user-friendly, and visually appealing knowledge graph, enhancing user engagement, and making the data more accessible and understandable. D. Let's get back to it with a JavaScript, bring layout, seed 42. How does that work? Why do I set a random set to get consistent results? Anything random sets would not yield consistent results, but just do something quickly. It doesn't happen often, but we had to remove a user. Sorry for that. Okay, so I have a JavaScript file. The question is, how do I link them all together? So we have a Flask backend, a JavaScript frontend, we have the data file. This example is a starting point for draggable nodes in D3. JS. You would need to expand this to include saving positions and possibly loading initial positions from the server. Integrating these features will create a more dynamic, user-friendly, and visually appealing knowledge graph, enhancing user engagement, and making the data more accessible and understandable. Let's save that. We have the data file that has all these nodes. Move it to the front page of egenia.com, a new website. Question is, don't have positions at the moment, do we? We're already using a spraying layout. We just had big seed come and depth out. Okay, we need to continue to turn this into a Flask application first. More information on this. Okay, the website. I think it's again, OpenAir website is stuck. Come scroll through it, it will know. Yeah, give me. It's not used to get this error message just before. This is a new one. Let's wait a couple of times, see if anything is happening. Yeah, Chrome is currently using like 5% of my CPU, which is quite a lot. Considering it doesn't actually do anything anymore. Okay, is the website back? No, it's not back. Is that to restart it? I think they open AI, making some changes to the Jet page. So this is happening real time. I don't know, maybe the pages are just for me. Snap. Yeah, don't want to learn more. Scary. I don't know what they changed. It doesn't seem like a major change, but the other response is still there. Yeah, we have done this multiple times before, haven't we? So we should know how to do it, be it templates for the static folder, and then dummy data for the knowledge graph. Our question is if we should turn the data text file into a JSON file. It is fun. That is not called GraphJS, it's called t3js. Probably GraphJS is a better name. Okay, so this goes in the static directory and should be name it into GraphJS, can run it from here. We have the link for it and it doesn't show anything. Okay, why not? Provides a basic structure. You need to expand on this, particularly in static slash js slash graph.js, where you'll implement the t3js logic to fetch the graph data from the flask endpoint and render the graph into activity. Also, consider adding adex calls to save any changes made by users, like note positions. Okay, hi, hi, Rohan. I have to remember to, I need some sort of stop sign, so when I'm editing the video, if I eventually decide to include this in a standalone video, I have to remember to edit this bit out. What's the question? Please make one project on sign recognition. So the sign recognition, we already started on it. This is where this face, this mesh and hands come from. This was a while back. Now, the reason this is not on the website, on Byron Chaos is because it was, why is my mouth, I don't know, my mouth is moving. Okay, kind of. I think it's if it's too dark in the room, the hands are much better. I think it's like the way my mouth is facing to the camera. Because another thing you could do like lip reading, recognition and stuff. But yes, you're asking specifically about sign recognition. So we already had it. There is a big project, I'm sure, that you already have seen. It's on kegel.com. Should have a section on Byron Chaos about it. I'm not sure if I actually published it or not. But there will be all the information there. But yeah, if you go and look up kegel competition, they should be all there and then they're using the same media pipe, the same thing that I'm using for their face recognition and taking snippets of hand motions and translating them into text. And yes, I would like to follow up on that, but then maybe you can do it. Because I was doing using that data for the competition before the competition have ended. So supposedly now you will have this winning algorithm for it. So I wonder how well it's performing. But again, maybe you could have a look. Let me know if it's worth another. Yeah, I'm happy to spend a couple of live streams on it again. Pretty sure we had a section on. There will be all the live streams that where I was doing it, that they should be available. But yeah, where is it? It's not EG, Cochlear. Yeah, obviously most of the stuff is on EG, but we have this new domain that most of the EG stuff will be moving on to egnear.com. So, so Barney Chaos will be mainly, yeah, all this other stuff, ECG image processing, speech recognition, and yeah, hopefully the other problem was privacy issues. So for the web application to work in it, to allow a camera, your webcam to be displayed on the website, that's nothing I didn't want to go into because you're getting the tool. So privacy issues, even though that footage is not uploaded to the server. So yeah, if it's not uploaded to the server, then I essentially cannot use the fancy processing for the hand gesture. So everything will have to be happening in your browser. And I think that's where the problem is, those algorithms are too heavy to do so. But again, there were quite a few advancements in it. So you probably should look at it again. Yeah, I can't even find it. But yeah, maybe you can have a look at it again. It's on Kegel. It should be a link and everything. I'll spell Kegel. That's the seizure prediction. Seizure. Yeah, I was doing the seizure prediction competition. Yeah, the hand recognition is not mentioned, but it's a big competition that comes up on Kegel straight away. Let's just quickly go back to the knowledge graph. It's quite important if there are no other questions, get back to the knowledge graph. We can show something useful and see if it has any, it's giving any errors. Probably does. No, it does not. It's actually worse. It doesn't know errors, but it's not showing anything. It's not showing anything. Yeah, there's some sort of integration thing. If your flask application running at http colon slash slash 127 dot zero dot zero dot one colon five zero zero zero slash is not showing anything. There are several steps you can take to troubleshoot and resolve the issue. Ensure your flask application is running without errors. When you run app.py, look for any error messages in the console. Make sure you're running the flask app in a Python environment where flask is installed. Confirm that the index root in app.py is correctly defined and pointing to the right template python copycode at app.root def index return render underscore template index html check that the index html file exists in the templates directory. Ensure that any static files javascript css referenced in index html exist in the static directory and are correctly linked open index html and ensure it contains the correct html content. If you're using javascript to render content dynamically, e.g. with d3 js ensure that the javascript code is error free and properly connected to your flask backend. Open the page in a web browser right click and choose inspect or inspect element open the developer tools. Check the console tab for any javascript errors or network errors. This can give clues if there's an issue with fetching data from the flask server or with the javascript code. In the developer tools, check the network tab to see if the request http colon slash slash 127 dot 0 dot 0 dot 1 colon 500 slash is successful and if any resources like javascript or css files failed to load. Ensure that no firewall or network settings are blocking your access to http colon slash slash 127 dot 0 dot 0 dot 1 colon 500 slash. As a test modify index html to include some simple static content. Yes, we know the problem is the js wasn't references referenced correctly. It's actually in a different folder, but now it's also giving an error. Right, we need to load this d3 js to include it in a html. Okay, so this is some sort of cdn to check that that link is actually working. Okay, it is working. Copyright 2021 is another error. By the way, now I think that I need to edit out, but I'm about to say this person who commented before with swearing using some strong language about AI whatever, I don't know why it's targeted at me. I'm actually trying to explain AI and trying to make it more accessible for everyone and trying to explain what this is actually doing, how to use it, how to develop it, so on so forth. So, well, first of all, any comments with F words and the like will be deleted and the person will be blocked, which I did. But then, yeah, maybe just learn about it some more, see what's what. It is here to stay. So, might as well, you know, at least try and understand what is it all about. No one is taking over, you know, things like that. So, I don't know what movies you watched, but yeah, so just back to reality. Trying to troubleshoot this thing. What we generally try to do is pretty straightforward, pretty simple. Trying to show a graph that actually explains that explains a EEG data processing. So, it's called the knowledge graph. It's quite useful. We'll eventually make it accessible for everyone to see and use and look. Hopefully, we'll be able to move these nodes around or expand on certain sections. But yeah, this is what the generally EEG data involves is analysis data acquisition, challenges, feature extraction, visualization, machine learning integration. So, you have this. Yeah, so hopefully, we will improve on this graph and make it more interactive. So, you start with a few nodes like, well, maybe like this. And then you can expand on some of these sections. And so, it helps you learn about EEG processing. And this hopefully, eventually, will be on egenia.com. Hopefully, today or later this week. And yeah, some of the stuff, EEG stuff from Bionicales.com will move across as well. So, just as a more organized, should be a more organized website. So, not as chaotic as Bionicales. Still having some problems. It is actually to run this app. So, we're doing a last application. This one should be really straightforward. And we don't see anything. Why? We can try to call this graph JS from JS folder. We don't actually have JS folder. So, where is it being? Let's search for it quickly. JS folder. Right, we have it over there. I thought we changed that. Okay, and nodes are not defined in graph JS. Could not find name nodes. This should be a node. This is from a GitHub co-pilot. Look control I. Now actually, a co-pilot fix this. It fix anything. Just change it from nodes to node. Okay, so node actually is there. I mean, GPT-4 was wrong. Hey, can we ask to just confirm this in our Python code? I have a random template that's right and show the template static files. Index HTML is in the folder called templates. Okay, the other thing is, where is it taking the data from? So, I have a data in the text file. Copy this again. This is the file. That's probably should be translated into a different format, like JSON probably be ideal. We can write later to pass this file. That's correct. We already did this before. Okay, how about let's talk this. Something is happening at the open AI again. It's the CEO back and while the CEO was away, they managed to break the site. It keeps crushing. I also have a feeling it might be using this add-on for extension for JGPT voice control thing. Maybe we turn it off, see, because that's changing that page. Maybe that's where the problem was coming from. It's actually finished the code. We might as well use it. Let's create a knowledge graph from the structure provided in your data.txt file. You will need to pass the file and then use the pass data to construct the graph. The structure of your file suggests a hierarchical organization with main nodes, sub nodes and child nodes. That's correct. You need to write a Python script to pass data.txt. The script should recognize main nodes, sub nodes and child nodes and then store these in a structured format like a dictionary or a list of tuples. Okay, so it's not suggesting a JSON file. It's suggesting going straight for dictionary or tuples. After passing the data, use a Python library such as NetworkX to create the graph. You will create nodes for each entity, main node, sub node and child node, and edges that represent their relationships. Once the graph is constructed, you can visualize it using libraries like mapplub or for more complex visualizations, roughies. Yeah, we're using, what are we using? Oh, wait a second, now we should be using JavaScript, the HTML plot. This one's using matplotlib. That's not the flask application. That's what we already had. Okay, we're getting stuck here. So we need to turn this into a web application. Just do full path for now. So it works. Okay, so how do I integrate this with the flask application? Integrating a knowledge graph generation script with a flask application involves a few steps. Essentially, you'll have the flask app serviced to backend, which will handle requests to generate and return the knowledge graph data. This data can then be used by the front end, likely in JavaScript for the library like D3. JS visualized the graph. Here's a high-level overview of that. Going in circles as if it forgets the context of what it generated prior. Implement a flask group that, when accessed, runs the knowledge graph generation script and returns the graph data in a JSON format. This is the data that your front end will use to render the graph. On the front end, use JavaScript to fetch the graph data from your flask backend and visualize it. You can use D3, JS or any other suitable library for this purpose. Give me dummy stuff again.  So I shoot that point to the other Python code. Save that for sec. HTML, have a console log. This HTML doesn't work as it is so. In this example, the flask app serves an HTML page that makes requests to get graph data to fetch the graph data. The data is then logged to the console, but in a real application, you would use D3, JS or a similar library to visualize this data. Remember, this is a basic example. You need to adapt and expand it to suit your specific needs, especially the generate underscore graph underscore data function in app.py and the JavaScript for rendering the graph in index, HTML. You have to do it. Well, first of all, because we already have the code for it. To integrate the function that generates graph data into your flask application, you need to replace the placeholder generate underscore graph underscore data function with your actual function that processes the data.txt file and creates the knowledge graph data structure. Assuming you have a function that reads the data.txt file, passes it and returns a structured representation of your knowledge graph, as shown in previous examples, you can integrate it into your flask application as follows. First, define the function that generates the graph data. This function should read and pass the data.txt file and then transform it into a JSON-like structure, a dictionary in Python that can be easily converted to JSON for frontend. In your flask application, app.py, replace the placeholder generate underscore graph underscore data called the actual function. In your index, HTML, use JavaScript in the library like D3.js to visualize the graph. The graph data will be fetched from your graph data endpoint of your flask application. So we already have that. What the JavaScript? With this setup, when you access your flask application, it will serve the HTML page that, in turn, requests the graph data from the flask backend. This data is then used to render the knowledge graph using D3.js on the frontend. Back again. Just wait once and restart the page. Again, it's like the fourth time today.  So far, so good. Chat GPD. Do you use the pass underscore file function within your flask application? You need to define it in your flask app's code. This function is responsible for reading the data.txt file and passing it to extract the graph structure, which will be used to generate the graph data. Let's define the pass underscore file function based on the structure you provided in your data.txt file. Yeah, I'll just go with this for now. I won't be able to do anything better myself. Anyhow. Now, integrate this function into your flask application, app.py. Include the pass underscore file function and the generate underscore graph underscore data function that uses it. I think we're already doing that. Okay, we're not getting any errors. Let's see the graph. But that error is okay. It's just a sort that one later. Get graph data. Let's see if this work works. Okay, it does have the nodes and everything. Yeah. But do we have another get graph data? I don't see anything displayed on the hd3.js. It's probably loaded in HTML. It's running before any other script. The JavaScript code that handles the graph rendering is crucial. Make sure the script index HTML is correctly fetching the graph data and using d3.js.trinnerd. If you haven't added the d3.js.trinnerd not to get. This is the place to do it. Right. Well, didn't have it. So this is all, okay. Why don't we have a separate, to have a separate graph.js? Okay. So we want to update the graph.js. Move all the.js code into graph.js and update HTML. Here we have a graph.js. It's never actually working. Okay. So generating a graph, fetch graph data, render graph. This is graph.js in HTML. Don't need this script anymore. We're linking to graph.js. It's in a static folder. See if this still works. Yes. See something. Jumping around. That was the same here. Can't move them. There's no lines. There's no text. That's a good start. Considering this is our first knowledge graph. It's not too bad. The graph is loading now. It doesn't have any text. I cannot move the nodes. So how to improve this? Yep. Great to hear that the graph is loading now. To enhance the graph with text labels and interactive features like movable nodes, you can extend your D3.js code in graph.js. Let's go through these improvements step by step. To add text labels to each node, you need to append text elements to your nodes in D3.js. Here's how you can do it. Modify node data. If your nodes don't already have a label property, modify your data to include a label for each node. For simplicity, I'll assume that the node Z is used as its label. Append text elements. After creating the circles for nodes, append text elements to each node. To make nodes movable, you need to implement a drag behavior in D3.js. Here's how you can do it. Define drag behavior. Create a function that defines what happens when you drag a node. Apply drag behavior to nodes. Apply this behavior to each node in your graph. In this code, the drag started, dragged, and drag ended functions define what happens when a node is clicked and dragged. The drag behavior is then applied to each node using node. Call drag. You might need to adjust styles, like the text font size or the node size, for better visibility and usability. Ensure that the simulations tick function updates both the node positions and the text positions. With these changes, your graph should now display text labels for each node and allow users to click and drag nodes around. This will significantly improve the interactivity and usability of your knowledge graph visualization. Yeah, do we have time? Pretty much have this one function in JavaScript. We have the node circles as well, don't we? So we're changing that. Okay, how do I integrate? Probably... Now we have nodes in this one. This node in Singular. Yeah, I have existing code. To make nodes movable, you need to implement a drag behavior in D3.js. Here's how you can do it. Still in render graph graph. In this code, the drag started, dragged, and drag ended functions to find what happens where a node is clicked and dragged. The drag behavior is then applied to each node using node. Call drag. In this code, the drag started, dragged, and drag ended functions to find what happens where a node is clicked and dragged. The drag behavior is then applied to each node using node. Call drag. You might need to adjust styles, like the text font size or the node size, for better visibility and usability. Ensure that the simulations tick function updates both the node positions and the text positions. Is this correct code? I get the text labels separately to the nodes themselves, and the nodes are not movable. It looks like there are a couple of issues in your code that need addressing. Duplicate node creation. You have two blocks of code creating nodes, one creating circles and another creating a group G with circles and text. This duplication likely causes the labels to appear separately from the nodes. Applying drag behavior, the drag behavior needs to be applied to the node groups, G elements, rather than the individual circles to ensure both the circle and its label move together. Let's refact to your code to address these issues. This code creates a group, G element, for each node and depends a circle and a text element to each group. The drag behavior is applied to these groups, allowing both the circle and the text label to be dragged together. The tick function of the simulation now updates the position of the entire group, which moves both the circle and its label. Okay, so it does kind of work. Okay, we could rewrite the data. Okay, this is working much better. I can move nodes around. There are two problems. One is that there are no lines between the nodes, and the second problem is that the text is too long. Too long and overlaps on top of one another between the different nodes. Great to hear that your graph is now interactive. Let's address the two issues you're facing. If the lines, links, between the nodes are not showing, it might be due to missing or incorrect attributes for the lines. Ensure that the link data is correctly bound and the line attributes are set appropriately. In this snippet, ensure you're setting the stroke color and width for the lines. Adjust these attributes as needed for your graph. If the text labels are too long and overlap, you can. Truncate the text if it's too long. Adjust the text positioning or add a text background to make it more readable. Implement collision avoidance or forced layout adjustments to keep labels from overlapping. Here's a simple way to truncate text if it's too long. This will shorten any label with more than 10 characters and append to indicate truncation. You can also improve readability by adjusting a font size or adding a background to each label. This code adds a wide rectangle behind each label to improve contrast and readability. For more advanced label placement and collision avoidance, you might need to implement additional algorithms or use AD3, JS plugin designed for this purpose. However, the solutions above should help improve the immediate issues with your graph. Yes, further. First of all, regarding that lines already have the links a constant, I guess we have to date that. In this snippet, ensure you're setting the stroke color and width for lines. Adjust these attributes as needed for your graph. Yeah, I tell you they will not overlap to begin with. If the text labels are too long an overlap, you can. Truncate the text if it's too long. We already have append text. Yes, we do. Right, this is bad. This will shorten any label with more than 10 characters and append to indicate truncation. You can also improve readability by adjusting the font size or adding a background to each label. Let me have this bit. No, this will only complicate things, whether it's too small as it might get, but just try it out before the text is it. So order in that does better. For more advanced label placement and collision avoidance, you might need to implement additional algorithms or use AD3, JS plugin designed for this purpose. However, the solutions above should help improve the immediate issues with your graph. It's the collision avoidance. Yeah, I want to spread them, spread them out some more. Implementing collision avoidance Implementing collision avoidance or forced layout adjustments in the Implementing collision avoidance or forced layout adjustments in D3. JS can be quite complex, as it involves dynamically adjusting the positions of text labels based on their size and the positions of other elements in the graph. D3, JS doesn't provide a built-in solution for label collision avoidance. You can implement a basic version yourself or use a third-party library. Yeah, this looks like a simple-manning one. A simple approach is to adjust the positions of the labels after they have been placed, moving them slightly if they overlap with others. Here's a basic example. In this function, nodes will be an array of your graph nodes with their x, y, and radius properties. Call this function in your simulations tick event to adjust the positions. This just works as a function as a pasta code even an array. Actually, I'm writing. For more sophisticated collision avoidance, consider these approaches. D3 label a plugin. This plugin uses a simulated annealing algorithm to minimize label overlap. It's a more advanced solution but might require significant integration effort. Forced directed layout adjustments adjust your forced simulation to take into account label dimensions. This approach might involve creating invisible nodes for labels and defining forces to keep them away from other nodes. Quartree-based collision detection implement collision detection using D3 squad tree. This is a more complex approach that requires a good understanding of D3 and spatial indexing. Limitations. Collision avoidance can be computationally expensive, especially for large graphs. Fully preventing overlap in a dense graph might not be feasible. Sometimes simplifying the graph or providing interactive features like zooming and panning can be more effective. These are starting points for implementing label collision avoidance. Depending on the complex degree of graph and performance requirements, you might need to experiment with different approaches to find what works best for your specific case. Radius property. The avoid label collisions function assumes the nodes have a radius property which is defined in your current setup. You need to either calculate or define this radius based on your node size. Known update in simulation, the avoid label collisions function updates the positions of the nodes to avoid collisions but these updates might be overridden by the simulations tick function. Complexity and efficiency. The current approach is a simple brute force method and may not be efficient or effective for complex graphs. It might require a more sophisticated algorithm for better results, especially for dense graphs. Define and use node radius. You can add a radius property to each node, either as a constant or based on some attribute of your data. In the render graph function, when you're setting up the nodes, modify the avoid label collisions function to be more efficient and effective. Here's a revised version. This function iterates through each pair of nodes and adjusts their positions if they overlap. Ensure that the avoid label collisions function is called within the tick function of the simulation. This will repeatedly adjust the node positions during the simulation. Performance. For large graphs, this collision avoidance method may be computationally expensive. Consider optimizing it or using a more sophisticated algorithm for complex graphs. Dynamic layout. Keep in mind that collision avoidance in dynamic, force directed layouts can be challenging due to the constantly changing positions of nodes. This solution shall help improve the collision avoidance in your graph. The fine tuning might be necessary based on the specific characteristics of your data and the desired behavior of the visualization. And so replace the output the image HTML flat complication front panel directly into GPT-4. Let's see what it says. The overlap in your graph labels indicates that the collision avoidance code isn't effectively separating the labels. This can happen due to several reasons such as the force simulation overriding a manual position adjustments or collision detection not accounting for text size. D3, JSV4 and above include a force collide which can be used to prevent elements from overlapping. You can add a dual simulation like so. This will add a collision force that prevents nodes from overlapping based on their radius and the specified padding. Ensure before it said that the D3 does not have code it does not have collision avoidance. Now it says it does but don't have the padding work. Is padding be added to the data? Why is it not staying where it is? There need to make those adaptive somehow depending on the screen size. Yes, it's loading always in the same way which is good we have the data acquisition. Anyway, it's looking good so far. We have been to two hours on this and a nice result. Yeah, we need to do more with the size of this knowledge graph. It's kind of still it's this weird direction bit. The other stuff is keeps moving. Stop moving. Still some major overlap. You know why even let me select the text. Yeah, there is a lot of improvement that can be done but it's a good start. So see


As always, this is part of a series of videos. There should be an annotation on the screen to the full playlist. I recommend checking out the previous tutorials, or you might be a little lost. Now, so far we've been working with a lot of creating objects and rotating the camera. Let's make a ground, I'm going to say ground plane, but it's not actually a plane. We're going to create a bunch of lines and then make a grid out of them. It's very simple to do. I've created a very basic script here, so I don't have to type everything over again, even though we're starting with a new script here. But I got the 3JS minimal script here. I also should mention that if you're watching this way down the line, some things might change. Some of the documentation, not necessarily the documentation, if you're reading the older documentation or looking at older examples of 3JS, some stuff has become obsolete and been replaced with newer stuff, where so things are relatively the same, but you might be trying to call something that isn't in the regular libraries anymore. And if you have the older libraries, they'll work, but they might be outdated. So I just want to say that so far most of what we've been doing is very basic stuff. But if things change on how they work years down the line, I'm sorry I can't magically change this video. I just wanted to say, because I haven't said that in any of the videos prior to this, I don't have the tracking ball script in here. That's because next week we're going to learn how to do similar things with the cameras without that extra script, just using the basic 3JS script and some math. But today we're going to make a basic grid. And so far we've got our basic 3JS installed here. And we've also got variables that we're creating here, camera, scene, and renderer, which we're pretty much always going to have. Then we're going to call our initial function, which is created here. Initial function, initfunk, a function initch, yeah. Anyway, this is where we assign the stuff that we've created. We created the scene variable here. Now we're going to make it an object based out of the 3JS script up here. We're saying it's a new scene. Camera, we're going to say it's a camera with perspective. It's a perspective camera. And give it some information here. It's going to be the full screen, how close the clipping is, how far away clipping is. This is all stuff that we've gone over many, many times. So I'm just going over it quickly here. We're going to create a renderer once again from the 3JS screen or JavaScript. We're using WebGL in this particular case. And we're going to set the size of that to be the full window with an height. So it will take up the full screen besides the padding around the body, since that's what we're putting it in. So we're going to take this renderer and put it within our body. And then we're going to call it to render once. Since there's no animations or anything in this particular code, we're just going to render it once where normally we would have it render whenever the change in the animation comes, which we will add next week, we've done in the past. So here we go. We are going to just create basic lines and then use a for loop to spread them out. So so far when we've created geometry, we've created geometry such as a cube geometry or a plane geometry or a cone geometry or a sphere geometry. You can also create just geometry, in which case you have to give it vectors and other information. And we're not going to go into too much detail on that in this tutorial, but this is what allows you to create more advanced shapes. See, the cubes and the spheres and the cones and all that are already shapes that have vectors inside the 3JS code where if you export something from Blender as a DAE file or an OPJ file and then you import it into here, and those are just some examples of things we're going to get into in the future, basically they're text files with a list of coordinates for vertices and how they're connected. And luckily there's libraries that will do the math for you, but we're going to create some basic stuff here. So let's go ahead and get started after all that explanation. OK, we are going to say var and we'll just call it geometry. Again, you can call the stuff on the left side of the equal sign, pretty much whatever you want within reason. And we're going to say that's a new and we're going to use the three. Remember case sensitive, and in the past we've done cube geometry and what forth. We're just going to say geometry in this case. And we'll also give it a material. We'll save our material. And again, in our earlier tutorials we put this into our mesh. In this case we're going to be creating a line, not a mesh. And you could do that as well. It's just nice to do it outside of this so you can utilize these things elsewhere, especially when we're using a loop like we are now. It saves a little bit of typing. Line, basic, material. So again, so far we've worked with meshes. This time we're working with lines. And similar if you watched the earlier Canvas tutorials on drawing lines, it's similar. It's just in the 3D world. We're going to give it a color. If you don't give it a color there is a default color. Oops, I didn't mean to put quotations here. I meant to put curly braces. I don't know what the default color is. I'm going to guess black, which is what our background is. It's either going to be black or white. But I'm going to put them white just to be sure. But you can make it any color you'd like. But we're just going to go with a basic white here. Now we're going to make a for loop. But before we make the for loop, let's set some variables. I'll put them up here. Var, we'll say size. And we'll make those 14. And we'll make the steps equal to 1. Now you can put those right in the for loop. But it's nice to have them separate like that to clarify what they are. And so if you want to modify it later, you're going to change those variables a little bit easier than you would in the for loop itself. We're going to say for loop var i equals. And we will say equals the negative size. And we're going to say loop while i is less than or equal to size. So i is less than or equal to size. And then we're going to say i plus equals step. So let's close the for loop before we forget. OK. I could say in here i equals negative 14. And as long as i is less than 14. Now I can say i plus plus, which would add one each time. But again, if you want to change the size and the spacing of your grid, it's nice to have these variables outside of that. And we'll play around with that after we get our main script typed here. So here I'm going to say geometry. And we're going to set some vertices. And we'll push them. And we will say new 3.vector 3. And we're going to say negative size. Let's face things out, just make it look nicer. Negative size comma negative point o dot o4 comma i. And this is, once again, just the measurements for our grid. And to save some time, I'm just going to copy and paste that line, but change size to negative size to size. And then I'm going to come over here. And let's see. Again, to save time, I'm just going to copy and paste a little bit. So here we're going to switch this around and say here, I'm going to say i. Here I'm going to say i. And here I'm going to say negative size. And here I'm going to say size. To just briefly explain what's going on is basically we're drawing lines one way here, basically from here to here, from the negative to the positive. So we're going across the median there, the little middle part. And here, so let's just say we're going left and right here, and then here we're going up and, or forward and back, drawing our grid. OK, so now that we have that, let's go ahead and outside of the loop, far line. So we're creating a new object called a line. And it's going to be a new from our 3JS library line. And it will be our geometry that we have created with the material we have created. And we will say three dot line pieces. And then we will take that and take our scene and add to our scene line. OK, one more thing to do in here, and then we'll quickly look at it, make sure I typed everything right, and then review real quick. Create a camera here, but we didn't set a position. So it's right at smack at the middle. We don't want, well, we will leave it there for now. And then we'll add something here in a moment. So if I typed everything right, I think I should hit F5 here. Nope, no dice. Let's do what I was going to do here and see if that makes a difference. We're going to say our camera position. Now in the previous tutorials, we set x, y, and z separately on each line. You can actually call them all together by saying position set. And I'll say 2, 4, 5 for that. And let's save that. Come here, refresh nothing. Let's hit F12 to bring up Firebug. And here it's saying I typed something wrong. Oh, I've forgotten E there. OK, so line 23, we'll go to line 23. Oops, I hit undo by accident instead of I. But there should be an E here. And let's go back and say 2, 4, 5 there. Save that F5. There we go. So there's our plane F5 to refresh that. And we're just kind of on the plane, sitting there looking out. So I'm going to show you another new thing here, real simple. So we showed you the positioning here, doing it all on one line like that. We can also set what it looks at. Now you can rotate the camera by saying it's rotation of x, y, and z, so forth. But if you want the camera to look at a specific object, you can just point it directly to the position. Or you can give a coordinates or the position which is the coordinate. So I'm going to say camera dot look at. So this is what it's going to look at. And again, you can give a coordinates in here. But we're just going to say scene dot position, which is going to be 0, 0, 0, since the center of our world is the scene. Now make sure if you're going to call it, tell it to look at an object, such as the scene, that you do it after the object is created. So if you were to create the scene down here somewhere, you couldn't have this up here. So now if we save that, run it again, we're looking right down at the center of the grid, or actually the center of our world. And we're looking at it from an angle because we're not directly at the center of it. We can move the camera away a little bit more. Let's say we set this to 20, 40, and 50. And now you can see we can see our full plane. Now that we have that, let's play with some of these numbers a little bit real quick. Let's change size 14 to size 10. Save that, refresh. You can see it shrunk a little bit. And if I go 20 and refresh, you can see it got larger. But you'll notice that each grid, each little block has stayed the same. We're changing the number of blocks. So that's what the size is. Step would be the space in between. So let's change this to two. Save it, refresh it. Now you can see it's the same size, but the blocks are larger. So that's how you can control that. And that's why it's nice to have these variables up here separate. And again, we can say three here if we'd like. Of course, now our grid is uneven because it's getting cut off. Basically, this is not divisible into this. So if this is 30, we'll get a nice even round number like that so we get the grid all the way through. So real quick on the review, creating a scene, creating a camera, positioning the camera and telling it to point directly at the scene. Of course, again, you can point it at any object. So if you create a certain cube, you can say cube dot position. The camera would look directly at that cube. We're going to create a renderer, put it into the body, set it to be the height and width of the screen, set the size and steps of our grid. Then we're going to create a geometry, a basic geometry, and material, which will be a line material, which here is white. Let's go ahead and just for fun, we'll change this to say green. And you can see we now have a green grid. So that's the line material. And then we're looping through basically saying, draw a line from here to here, move, bit, draw a line from here. Actually, we're saying draw a line here to here and a line from here to here and then move. And then we're going to draw a line left and right and up and down or forward and back, actually. So that's what we're doing within our loop here based on the variables we've created up here. Then we're actually going to draw that and add the line and render it just once since nothing will change. Next week, we're going to work on rotating the camera without any extra scripts, just with basic math, in which case we would constantly be needing to re-render. We're going to actually have an animate function again that we'll call the renderer. But we're going to render the scene from that camera view the one time. Again, this script will be up on my site. There'll be a link in the description of the video to it and all the other code from this series. Be sure to check the annotation for the full playlist. If you're watching the full playlist and you get to a video that is marked private, that is because it hasn't been posted publicly yet. I post a new one every week. Just wait till next Friday. There'll be a new video up.  I do have videos on other topics on other days of the weeks, currently Mondays and Wednesdays on other topics, but Fridays currently are HTML5 and specifically right now 3D stuff in HTML5. I want to thank you for watching. I hope that you visit my site. If you like this tutorial and you like this topic, be sure to give this video a like, a thumbs up. I appreciate it and I hope that you have a great day.


First question is from Jaina roller fit. Can you actually reset your body's set point? I used to be 310 pounds. I got down to 155 pounds, but never can stay there long My body keeps rebounding and staying at 195. I've been lifting for five years and tracking macros to lose weight I would like to my body to sit at 145 to 160 pounds How can I reset my set point, you know, I never I'm 10 years in personal training I don't think I even heard someone talk about set point. That was not like a common Is it like getting marketed like crazy? Because I feel like we've we've dressed this multiple times in the show net carbs. Yeah, yeah, right That is that is definitely one that's new for sure. No, I feel for her So I feel for this person because or I'm I think it's a her but for them because this is this can definitely be challenging But here's the deal set point the body set point Definitely has been used by marketers to make you to sell you products What they'll say is you it's your set point your body's natural physiology is Making you this overweight try our product or our process to change your set point as if you would have this new Normal and now no matter what you do you can't gain weight because you have this new set point. Okay, so here's the truth The 99% there's definitely some physiological stuff that happens. We'll get to that in a second But 99% of a set point is behavior Okay When you have behaviors that have caused you to weigh 310 pounds at some point which did not happen overnight, right? It takes a long time It's a slow process of weight gain oftentimes starting it as a child, right? Oftentimes someone who's 310 pounds as an adult probably dealt with weight issues as a child These are hard set psychological behaviors and attachments to food or food relationship issues and that's very hard to change just because you lose weight Doesn't mean you change those hard set behaviors and coping mechanisms Yeah, many times you've just been really disciplined for an extended period of time You've done it just to sheer will exactly sheer you see this at the highest level and competing I mean you'd be surprised how many of these kids that are getting up on stage and competing Have all kinds of eating issues just like these 310 pound people that just different, you know But they've been able to get on stage present their physiques because through sheer wheel will they can discipline themselves for a year straight of Eating like regimen. Hey, this is it. Look I'll tell you what statistically speaking There's a significant percentage of people who get gastric bypass surgery who gained the way back now consider gastric bypass is about as extreme as it gets in terms of Setting up blocks preventing you from gaining weight. They literally bypass your stomach So you don't have one essentially making it almost impossible to overeat and yet a significant portion of people Forced themselves to gain weight actually worked with someone like this. I couldn't believe that this actually happened So if the set point is a behavior one So here's my advice to to this person asking this question If you want to change your set point work with the therapist work with someone who's gonna work with your behaviors That's where the issue lies. It's not some Issue with your body that it wants to be in a particular way because if I if we locked you in a laboratory And fed you the same amount and kept you certain period of active or whatever your body would weigh whatever we'd want it To weigh so well also I think it's important to acknowledge like where homeostasis is like where let that maintenance is where your body's most Comfortable based off of like behaviors based off the way you're you know training or eating all these things To then stretch yourself and and push yourself to sort of get into a different category into a different level You know like like you mentioned a lot of its behavioral driven. This isn't like a genetic limitation Which is kind of like what this implies. There's something metabolically going on here though, too That we have to address that's very common right somebody who's 310 pounds drops all the way down to the 150 range The amount of calorie reduction and movement and cardio and training this problem This person probably did to get to that point was a lot I bet probably and a lot of times it wasn't it was done and with the intentions of How fast can I get this off my body versus? What is the smartest the smartest way for me to write because we don't know what she did Right exactly and many times what happens is the person who was this heavy got all the way down to 155 by doing things like eating 900 to 1200 calories a day doing cardio weight training staying super active to get that point And then what ends up happening when they reach that 155? Let's say that was their target.  No, you don't have to literally when you've slowed your metabolism down to 900 to 1200 calories a day with intensive training all the time It doesn't take much for that weight to start piling on make a couple bad choices a week And it and it comes on rapidly. Yeah, you see this when when it's really fast, you know It's like everything is all cylinders and going 100% and this is what we caution a lot with our clients coming I want to lose a lot of weight is to really consider that you know, you're gonna be Dramatically dropping calories. It's not sustainable so to kind of like slowly edge your way down and build muscle at the same time is a better Approach. Yeah, now I will say this I'd like to add this as well To this person is also be kind to yourself your body sitting at 195 That's still a big that's all it's over a hundred pounds lower than where it used to sit Yeah, so you've gone a long way and you're still kicking ass and so be okay with that be you know Accept the fact that you've gone a long distance be you know have some gratitude or I should say be proud of that And it's a slow process It takes a long time longer than people realize the the weight keeping the weight off for Forever part takes a lot longer than getting it off Well, it takes you also got a reframe your goal Like so a lot of times when the goal is when you're at 310 you want you just want to get the fat off You just want to get you want to make that decision Yeah, you just want to lose weight or you want to get down you want to get down But you you really should be focused on building muscle, which means actually increasing calories and protein and strength training Reduction probably of all the high intensity and cardio and I'm making a lot of assumptions right now But this is speaking from experience normally the client that you get like in this situation They cut calories like crazy and they picked up activities They just do tons of tons significantly to get to that point and then they they're in this And this is why we see biggest loser people always pile the weight back on and the only ones that you see keep it off For an extended period of time hire a personal trainer to like hammer them every day You know you there is a small percentage of biggest losers if you guys don't know that actually maintain 15% It's yeah super it's super low and out of those almost all of them Like enroll in something or have a trainer coach that they hire to just keep pushing them and keep burning The most success I ever had with clients like this were when they worked with me So I was the trainer and then they also had a therapist and they worked with the therapist It was always the most successful formula by far me by myself I could do pretty well especially towards the end of my career because I got experience But it just it wasn't as good when they had a therapist working on those Behavioral issues on a weekly or bi-weekly basis and then they train with me on top of it two days a week or three days a week Tremendous success and there's a couple people that I still keep in contact with who lost Well over a hundred pounds who've kept it off years and years later And they still are working with the therapist. They still meet with the therapist once a month or once every other week


Today we're gonna talk about the four stages men and women must go through before they commit in a significant relationship. Now, did you hear me say significant relationship? Because I certainly wanna differentiate between casual relationships, out there, situationships, friends with benefits. I'm here to talk about significant relationship and what is a significant relationship? Well, my mind is significant relationship demonstrates an all-in component. I'm all-in. It's kind of the reason why the wedding vows were created. I mean, at the end of the day, what is the wedding vows all about? It's all-in. Now, nobody's gonna reach all-in on the first, second, or third date and certainly no one's gonna reach all-in at the 90-day mark. Although some do, certainly that has happened throughout history. Men and women have known each other for a few days or weeks and they got married. So there was certainly an all-in component there. And yet most of that was driven by the desire to be physically intimate with one another because in the past, physical intimacy was reserved for people who were in a marriage. So there's an all-in component to it. But today we're gonna talk about it from a different perspective and I recognize why it's so frustrating for women today in the dating marketplace because to some degree, you have to assess whether a man's heart is open to going all-in or is it close to going all-in. I repeat that. Is his heart open to go all-in or is it close to go all-in? See, the reality is these days, particularly for those of us that are in midlife, which I call after baby making years and before retirement, a significant percentage of men and women are divorced, probably 75% of singles over 45 years old are divorced. Now, why is this so critically important? Because divorce comes with it an emotional trauma and depending on the severity, severity, the circumstances of this exiting of the relationship, it could leave lasting wounds within a human being. I'm gonna repeat that. It can create lasting wounds. And this is true for women as well as men. I think a significant percentage of the population who is single in midlife are trying to fill the void through physical connection with someone else. I mean, a relationship. And remember, I started this conversation with are you in a casual relationship? Are you in a situation ship? Are you within a friends with benefits? Are you a booty call? So recognize that a significant relationship requires a healing from our wounds and traumas and not just the ones that happen in midlife, but certainly going all the way back to those initial wounds and traumas that happen in childhood. This is why I'm such a big proponent of human beings doing personal development, self-help and spiritual work. I've wrapped it up in the concept of what I call self-love.  A Journey of Personal Development, Self-Help and Spiritual Work. And by the way, this isn't a dating book. It's a book designed to really examine what could be getting in the way of what I want in life. And particularly when it comes to romantic love, you see what happens is most humans confuse attachment to another human being as romantic love, attachment to another human being. See, we can get rather attached through chemical bonding with another. If you're not familiar with oxytocin, women tend to bond with men after physical intimacy. Although men bond with women as well. We release oxytocin as well, but it seems to be stronger for women. And I'm not an expert in this field. You may wanna Google the effects of oxytocin in the early stage of the mating. But there's also some psychological attachment that can occur, bonding can occur. Centered around what's known as the Amago, I-M-A-G-O, I-M-A-G-O, or attachment. And if you're not familiar with the book, two books I recommend. Attached by Amir Levine and Rachel Heller and the book Getting the Love You Want by Harvelle Hendricks and Helen Hunt. Many of us confuse love because we're attached to another human being because there's a deep wound in our childhood that hasn't been fulfilled. So what happens is you might be committed to a man in relationship who may not be as equally committed to you because most humans don't understand the dynamics of creating an all in relationship. And what is all in? I wanna really emphasize this for a moment. All in says we are a team. We are a team and we are going to work together as a team to build this relationship. Now what I've observed, and I'll get to the four stages and just literally give me another minute to get this other point across. What I've observed is the first 90 days is kind of the make or break period of time within the human mating process. And what I mean to say is the first 90 days where you're having regular contact with each other. See these days for people who live relatively in the same proximity, if they've gone on one or two or three dates within three weeks, it usually starts a liftoff point to whether or not they get to this 90 day mark. Now I know some of you were going, but Jonathan, I'm in a long distance dynamic. We've been communicating for months, if not years via text messaging. We've never faced time with one another. We've never spoken on the phone. Folks, I'm not speaking to you. You guys are in La La Land, okay? You guys are in La La Land. And being in La La Land is not conducive to a significant relationship where you're spending regular time together, doing shared activities and hobbies and mutual interests and spending time together and teamwork building skills that leads to fully commitment, full commitment, okay? So let's get into the four stages. Now I'm gonna read from my notes. So just bear with me for a second. But today I will apply the Tuckman model to illustrate a point. Every one of you, I want you to Google Tuckman's stages of development, Tuckman, T-U-C-K-M-A-N-S, Tuckman's stages of development describe the four stages of psychological development a team goes through as they work on a project. So I'm gonna use a professional capacity to illustrate a point for those in romantic relationship. Teams move through each stage as they overcome challenges, learn to work together and eventually focus on accomplishing a goal. So we're gonna apply a business model here to this conversation because I believe, and again, this is not a fact, this is merely an opinion, I believe this perfectly illustrates the challenges we're faced with in the human mating process. Now stage number one is called forming, forming, okay? Now mostly focus on attraction in the early stages, everything seems to be focused on the attraction two people have for one another. I was speaking to a group of people the other night, I was at a singles event and one of the women was telling me about a man she went on a date with and he walked by, they were walking out to their car after the date and she, I guess he saw some vomit on the street and he goes, ooh, like this.   So we all have in the early stages what we find attractive, certainly it could be physical attractiveness, it could be emotional attractiveness, it could be the intellectual attractiveness for within a person. But in the forming stage, we're kind of in this dance, are we attracted to each other? Are we not attracted to each other? And most humans hyper focus on the physical attraction, the physical attraction of being physically intimate with one another and they quickly enter into a dynamic where they oftentimes have sex with one another, okay? This is the early stages of forming and this is very common, okay? Now what we have to recognize that in many cases, men can have physical intimacy with you and as I said earlier, women might bond to a man and a man might not commensurately bond to a woman. So you might want to really do some vetting before you're physically intimate with a man. Do you see this link right here? JonathanAslee.com forward slash coaching. By the way, there's a link below to do this as well. My whole coaching practice is centered around how to vet for compatibility and emotional maturity and vetting is simply the getting to know you process to see if two people are fit with one another. So I encourage you to do a little bit more pre-work before you're physically intimate with someone during this forming stage of the relationship. So forming and well, I've said it's the first 90 days, this can go longer than 90 days. That's just a rough guide, but certainly I've noticed that many women that get past the 90 days seem to have a greater chance of relationship success given that a lot of first, second, third, fourth dates rarely actually ever manifest into a relationship. And there's a whole another conversation with that as well. I think it's just important to recognize that stage one is the forming stage. Okay, stage two is the storming stage, the storming stage. This is where different differences begin to emerge. Differences begin to emerge. This could be on your communication style differences. This could mean your commitment desires might be different. Usually during this period of time, there is a level of storm. In other words, there's some friction. Now we can mitigate quite a bit of this friction by asking better questions in the early stages. This is why I talk about vetting to get a sense, are you on the same page of what you desire? Now ladies, I've said this before, I've said it again, there's basically three types of people actively dating out here. And I want you to look at my chart. Please forgive the glare. This is, by the way, listed here. This is not a fact, it's merely an opinion. But roughly there's three types of people active dating. The users, which I say is about 20% of the population. The grower and builders, those are about 20% of the population. And I might be kind of generous there.  Now the users are in it for the short run. They're in it for to get what they want. These are the entitled people, these are the players, the gold diggers, that sort of thing. Those are the users. And the grower builders are those that truly want a significant relationship. But the vast majority are what I call spenders. They wanna spend time with you. They want companionship, they want connection, they want sex, but they're missing this key ingredient. So recognizing your commitment desires, see the key ingredient that's missing is a desire to go all in, to be partners with one another, excuse me, to be partners with someone, okay? And it requires a capacity to want to go all in. And let's think about what all in is. At the end of the day, it says, I wanna take care of you. Now I know many of you women have said to me, well, Jonathan, I don't wanna take care of anyone. I don't wanna become a nurse or a purse. Well, believe it or not, that is a subconscious sabotage for getting what you do want because if you already have a predisposition to a no based on some criteria, you might be sabotaging a significant relationship because at the end of the day, this is what it's all about. For those of us in midlife, this is about, let's face it, growing old with someone. Or better yet, growing with someone, growing with someone. And I recognize that those of us in midlife, certainly those that are over 50 like myself, people that are in their 60s and 70s, this becomes even more problematic because at the end of the day, what's it all about? It's about being all in that you're gonna be there for each other during the hard times. So the storming period as I just illustrated is recognizing that you're gonna have differences and are you capable of overcoming these differences? And just like in teamwork, there's the initial stage of connecting with someone, then they're gonna find their differences. And the third stage is norming, is norming. And that's overcoming differences because the whole is greater than the parts. Overcoming the differences because there's something bigger here that goes beyond, that goes beyond the surface. Now this is where a lot of couples get stuck. They get stuck in the normalization of a relationship.  They get stuck in the complacency. This happens for couples that get married at a young age, this happens, actually happens where a lot of couples reach the stage of norming, for example.  We'll talk about that in a second. And it lacks the invigoration of keeping the relationship alive because within norming, it's really great to be in a state of norming in the sense that you feel comfortable, you feel safe, you feel a level of trust. That's all great. And that's so important to have a transactional relationship. There I said it, a transactional relationship. And even casual, oh, by the way, my coffee mug says swear a little, you'll feel better. No swearing on my weekend videos.  But if we wanna take the relationship to another level, if we wanna take a relationship to the deeper level, to that deep level of all in, you need this fourth stage and that is performing, performing. So let me repeat these stages one more time.  There's forming, there's storming, there's norming and performing. And performing is a shared vision and growing together consciously. Whatever that looks like for each couple, there's a shared vision. Now for younger couples, this is usually centered around starting a family, building a family together. This is why some of my contemporaries out there that are married with children that are young at this point in their life, they're caught up in that, they're building a family together. You see, for those of us in midlife who are gone through divorce, as I talked about, it's a whole different ball game. And this is where a lot of people get stuck because they don't know what performing looks like at midlife. See, I think back to the TV show, The Brady Bunch, it took two, I think he was a widower, she, we don't know what happened until the movie that came out 30 years later that she was divorced, but they just combined their children together and it was about building a family together in a different format. But for those of us, especially those of us that are empty nesters, those of us that have much older children, the family isn't the shared vision in the relationship. That could be grandchildren, but a lot of men in their 50s and 60s don't wanna necessarily go down that path, yet maybe men that are in their 70s or maybe their 80s might wanna go down that path. So this is the challenge for most of you find is you don't know how to perform in relationship. And what that requires is a shared vision. It requires a conscious effort to grow one another. And most men are clueless to what I'm about, what I just shared. Most men are rather clueless. That's why, you know, this whole thing, you know, I just need to surrender in my feminine, let the man lead. You're giving the job to the wrong person. Most guys are clueless to most of this content. They're winging it. And why is it critically important to understand this? Because let's face it, for those of us in midlife, do you realize that 65 to 75% of relationships? I was gonna use the word fail, but they end. Why did they end? Because they're not consciously aware of the mechanics to a healthy, happy relationship. And this is why I sometimes sound agitated. I sometimes sound righteous. Sometimes I'm screaming at the top of my lungs and it's merely just a wake up call. For you, particularly the women who follow my work because I believe you are the better directors of a relationship than men. Everything I've learned about emotional IQ, I've learned from a woman. And I believe men are trainable. You just have to learn the mechanics. And today we've just illustrated the four stages of what needs to happen for men and women to mutually commit to one another. And I'll just repeat it. It's the forming. It's the storming. It's the norming and performing. And if you don't, performing is a critical component for those of us in midlife to achieve relationship success. Is this sinking in? Is this resonating? Please let me know if it is. Post a comment below. I do my best to read all of the comments. And if you found value in this video, please tell your friends about Midlife Love Mastery, my group where you can have direct access to me on a regular basis. Simply go to my website, JonathanAsley.com and have them click the group coaching button so they can join our fantastic group. All right, I'm gonna sign off this video as I always do.  I'm gonna reach into the camera and give you a hug of love if that's okay. I'm gonna ask you to turn to someone. A pet, a teddy bear, a pillow, and give Iter them a hug of love because hugs are a great source of love. And let's face it, we could use more love in our lives. Thanks a bunch. Thanks a bunch.