Replies: 1 comment
-
Hi! I just saw this post. I've been dabbling in TorchSharp for about a week and I'm very pleased so far. I'm a game developer making a Monogame based fighting game "Warring Winds" and I am using TorchSharp to to a DQN based ensemble model for the games AI. I got a pipeline working between Python and Monogame via shared memory access but it was too slow to train at 30-60 FPS, so I decided to do it all in-engine inside of Monogame with TorchSharp. To that end, I've been making a UI in a tool that is very familiar to me called JavaFX. JavaFX is really really good for making UIs both with built in "controls" or "nodes" and a large community of developers and libraries with special tooling. This is what my UI looks like right now https://imgur.com/a/wlgjMao - note I've only been working for a few days and ive been doing a variety of things in that time. I'm also not focusing on professionalism of appearance so much as I am raw utility as right now its a tool for just me. But theres a ton of modern frameworks for JavaFX that look really trendy and flashy, they just werent worth my time just yet as I wanted something working ASAP, If you're interested in the source code I'd be happy to share it, the Java code is basically the same as C# anyways. Of particular note is that I use Sockets between C# and Java for very easy and fast transferring of JSON based data between my envronment (C# game training at 120 fps) and my Java "dashboard" or "tool". I have previously made an online game with Java / JavaFX so I had some specialization in making a networked application. The fact that its over a server socket is kind of cool because I'm going to be exporting a JAR (Java executable) for my friend so he can enter hyperparameters for trials and control the application / game and interact via the internet. Java has HTTP sockets also so you could do a HTTP based system to connect to the JavaFX UI, or you could use regular TCP sockets, If you're main application is .net / C# focused making a socket to connect to Java is like 10 lines of code and then you can just use JSON. Thats for a live socket via internet or localhost, you can also do funny things like in-memory shared access (really tricky but very performant if you do a double buffer system - I have proof of concepts for that but I gave up on the that side because Pythons GIL didnt have the throughput I wanted). The core of my API / network architecture is reading the reqeusts on a separate thread and parsing strings into what I call "ResearchAPIObjects" - JSON - based - which has the following fields so far (I'm still cooking) - the research request is the sub-category of the request, and I had to do string reluctantly because of how enums in Java vs C# are. I'm doing some fun things like building in a messaging system and the ability to send pictures / charts, but if I do post the code on GitHub I'll document those features and have them disabled by default. The objects below kind of say what they are, but a "PerformanceDataCheckpoint" is just a step and the variables associated with that step, or more usefully, the average value of those steps for that period of steps, and the TrialProfile is the hyperparameters and trial name etc. Basically, the application I am making is both the server and the client. Right now its set to turn on "server" mode if the running PC has my mac address, but its a few lines of code to make it configurable so anybody could host their dashboard and then have a friend / peer / colleague connect to the dashboard to retrieve research reports / "TrialProfiles" and order new trials. Anyways that was an essay, IDK if any of this is interesting or helpful but I hope it is! I'm certainly enjoying making my tool even if for now its just used by me. ResearchAPIObject
|
Beta Was this translation helpful? Give feedback.
-
Hey TorchSharp community.
I am about to embark on making some primitive version of TensorBoard for my DRL library built with TorchSharp.
If any of you are interested in something like this perhaps you can give me some tips how to make it more universal. I've no idea how original TensorBoard is built and I'm not going to check.
For this one I'm planning on using the stack:
Blazor Server for backend
Plotly for charting
rxnet to wire things internally
SignalR to talk to Blazor Server application
I'm going to write it as standalone application so its always possible to add something later... Eventually it will be customisable but for now I dont have time/energy. I was going to expose interfaces for things such as:
Plots over time:
Loss
Learning Rate
Rewards
Cumulative reward
Episode length
KL Divergence
Entropy
Methods:
-Export plot as csv
-Save model to path
-Save buffer to path
Beta Was this translation helpful? Give feedback.
All reactions