I'm collecting/creating a suite of tools for a newer/better version of @roborosewater (not affiliated with the people who run that account in any way) to showcase the progress that's been made since that time.
I'd be very interested in both the pre-trained model as well as the source code (if it's not too embarrasing / you're willing to open source it).
I can't take full credit of the source code. It's based on this implementation on github: https://github.com/moxiegushi/pokeGAN. I added things like gradient penalty for improved training, changed the architecture to handle the different input/output, added dropout, improved output processing etc.
I don't mind sharing it. Just give me a few days to find some hyperparameters that give the nicest results. I only have access to the GTX 1070 during the weekends unfortunately. The GTX 680 doesn't have enough memory...
Here's the latest batch with lower dropout rate: https://imgur.com/a/G0yFY
Are you in touch with the people running @roborosewater? Do you know if it's still actively being worked on?
Hi!
I've been training for 7 hours and came up with everything 'soinason98e3984nfsldnlf s9f&saflnsdoon' etc.
It took those 7 hours to do 100. How can I make it go faster? Running on my laptop i5 6300 2.3 8gb ram. Is this simply too little? I'm also running through a VM. I'm not good at linux or neural nets, I can't believe I was even able to set em both up.
Thanks.
Seven hours isn't long on a CPU. Expect about 24 to make something sensible. Make sure to use the revised versions of the script and the formats from the original post too.
Turns it out I had the VM set to using 1 processor and 1 gb ram. Turned it up. 6-7 seconds per now. Much better. Got enough good cards (some too ridiculously powerful) for a 160 card set... and one called Dragon Gay. Terribly excited about this.
I can't take full credit of the source code. It's based on this implementation on github: https://github.com/moxiegushi/pokeGAN. I added things like gradient penalty for improved training, changed the architecture to handle the different input/output, added dropout, improved output processing etc.
I don't mind sharing it. Just give me a few days to find some hyperparameters that give the nicest results. I only have access to the GTX 1070 during the weekends unfortunately. The GTX 680 doesn't have enough memory...
Here's the latest batch with lower dropout rate: https://imgur.com/a/G0yFY
Are you in touch with the people running @roborosewater? Do you know if it's still actively being worked on?
These are awesome. Do you think I could get a zip file with these images? I just grabbed 200 images for a set but don't want to do it again for another set.
These are awesome. Do you think I could get a zip file with these images? I just grabbed 200 images for a set but don't want to do it again for another set.
Here's a little experiment. I made a video by changing the input to the generator slightly over each frame. The result is some kind of AI lava lamp: https://gfycat.com/FluidFlawlessIndianjackal
I am going to make my own 'RoboRosewater' for learning about node.js and twitter api and the like. I would like to use these images, what do you want me to link for your credit?
I think the bot should be paired with the image-generation software.
It would be easy to set the intelligence of the network on the Expansion symbol, since that isn't being used to rely information at all. The other possibility is to make it show the intelligence level with a watermark.
I mean, the image-generation does pretty nice results and would get the bot character.-
The script to assign the images has pretty much been written too, and the image generation has been done specifically for this, so there shoudn't be a problem... no?
Also, looking forward to getting my own robo-cards made, but I am an absolute beginner in this, with a phone connection only, so possibly not going anywhere-
___
PD: retty sure I had more than just three posts and I'm not "Just getting started" if I got registered on frigging 2008. Thanks forum
Here's a little experiment. I made a video by changing the input to the generator slightly over each frame. The result is some kind of AI lava lamp: https://gfycat.com/FluidFlawlessIndianjackal
That's really cool! I've been working a bit on putting together a RNN cube to play with friends (keeps getting put on hold because I don't have enough free time though), and having blank art is a bit dull. I'm definitely interested in the source code so I can run the network myself, if you don't mind sharing.
Is anyone still either actively doing this, or at least willing to help me out with this? I know it's kinda a dead post, but I'm just picking it up now and I'm running into some difficulties... reaching out for some help...
Is anyone still either actively doing this, or at least willing to help me out with this? I know it's kinda a dead post, but I'm just picking it up now and I'm running into some difficulties... reaching out for some help...
I have been fooling around with the MTG cards as a dataset recently... I haven't gotten so far as to reproduce the results in this forum but I've been learning the core datascience libraries (pandas, numpy, matplotlib, sklearn, tensorflow) and managed to get a nice looking dataframe put together... I'd like to help out if I can. I find this stuff great for practicing working with data.
I'm following the tutorial presented earlier, and have run into a few problems. Most notably my learn loss increases, no matter how much I lower the learn rate by. I'm also having trouble setting the passes it will make... it seems random (sometimes 200, sometimes 14932, sometimes 120, etc.) I can go into greater detail later, or we can move to private comm if we're flooding the thread.
Hey again. I meant to post a reply last night, I guess I must have not clicked the 'post reply' button...
My strategy for getting this to work has been to start from a different code example that doesn't fail on my windows 10 machine.
After a few hours I got something working. I'll post some examples at the bottom
I borrowed the code from here: https://github.com/sherjilozair/char-rnn-tensorflow
Our friend sherjilozair also based their code on that of Andrej Kaparthy (as did the starter of this thread).
I've been reading through this forum today for hints on improving the performance.
One thing I need to do is find every instance where the card name is repeated in the text and replace it with $THIS, that way the card will properly reference itself. You're supposed to replace the word $THIS with the name of the generated card,
but for some reason people in this forum don't often bother.
Another simple trick I plan to use is putting the type directly in front of the power/toughness;
this way the network should learn to discern the difference in format between creatures and other cards.
EDIT. it seems somebody flagged my last reply as spam.
Flying (This creature can\'t be blocked except by creatures with flying or reach.)
Chen-Goarch Squantion deal 1 damage to each creature.
*/*
Shimeral Engines
{3}{B}{B}
+1: Until end of turn, you may play that many +1/+1 counters from Remrling Scryinglazystrounce, add three or moren\'s converted mana cost is dealt top thre enchant creature. Attach it to target creature you control to their owners\' hands. A creature was dobberwomp. (They dealt damage this wellbosi, shuffle your library.
Malony Fiend
{1}{W}{W}
Haste
Rebelisis Battle Rats is dealt to its owner\'s hand instead of puttinn or her library.
2/1
Mystic Wall
{1}{B}
Return target green creature card from your graveyard to your hand.
Aetheri, the Killare Spider
{3}{B}
When Centaur Scout Horror enters the battlefield, choose a color.
At the beginning of your upkeep, put a +1/+1 counter on Oblic enters the battlefield, destroy target spell unless its controller pays {X}.
Howdy folks, if anyone is still paying attention, Wizards of the coast seem to be interested in ML these days.
Check out this quote from their website:
"We want to create a game that can evolve. We've created an all-new Games Rules Engine (GRE) that uses sophisticated machine learning that can read any card we can dream up for Magic. That means the shackles are off for our industry-leading designers to build and create cards and in-depth gameplay around new mechanics and unexpected but widly fun concepts, all of which can be adapted for MTG Arena thanks to the new GRE under the hood."
[https://magic.wizards.com/en/articles/archive/feature/everything-you-need-know-about-magic-gathering-arena-2017-09-07]
I for one am hoping to see something done with MTG similar to what has been done with starcraft II in the AI community.
Using the mtg rnn tutorial and the NN stopped training after trying to make one checkpoint. Anyone know what might have caused this? I'm pretty green to the code aspects of all this.
I had been following this thread when it was active and trying to teach myself machine learning. Periodically I would wonder why things weren't done a different way, or an idea would come up that got me super excited, but never (to my knowledge) was tried. Coming back and seeing it basically dead has encouraged me to try and implement a bunch of those things to see if I can move the project forward.
First, a pretty fundamental change: we aren't using (just) LSTMs anymore. Now we're using what's called a VAE. Feel free to read tutorials and whatnot yourself, but I always think that you don't understand a thing until you can explain it, so I will attempt to do that.
An LSTM works by keeping a bit of memory around about how it sees the world. If it's pretty smart, it might only keep a very dense bit of knowledge ("we're writing a type, it's an instant, we're on character 3") so that it doesn't really have to think very hard to keep things straight. If it's a bit dumber it can still do a good job, but in a less intelligent, more error-prone way ("we just wrote 'ins', I have no idea where we are in the card, but maybe that's instant? I guess the next letter should be a t?").
A VAE (Variational Auto-Encoder) at a high level is all about managing that idea of memory. You split the network into two parts. They go by different names, but I will call them an encoder and a decoder. You might see me refer to the decoder as the posterior later. The first part of the network, the encoder, is tasked with creating the encoded state of things. For our purposes you would expect to see the type of card encoded, as well as things like CMC. These are neural networks, so they're somewhat black boxes (though we can and hopefully will make them less of a black box later) but that's theoretically how it works.
The second half, you guessed it, decodes that memory into the original card again. Why is that useful? We're essentially squeezing the encoded representation down as far as it can possibly go. By doing so we can force it to remove redundant or useless information so that it can fit what IS necessary. Going back to CMC, it probably wouldn't actually store the CMC in the memory directly. It would probably store the mana cost -- CMC can be derived. Since it's deriving derived information, it should force things to become more self-consistent.
Now, this encoded memory has some fun properties. We can encode a card and mess with the individual numbers in the encoded memory space to see what it does. I would expect to be able to modify a number and make a card "more red" or "more creature-like." I don't get the PICK what each axis represents, but anything the machine chooses to put on an axis is a thing that I can twiddle after the fact. That sounds exciting!
As my last major tweak, I am actually using one LSTM per type of input (so mana cost, name, power, toughness, etc.) I am doing this for two reasons:
a) Memory length. LSTMs are better than older forms of RNNs, but they too suffer from a lack of very long term memory. I want to reduce the length of LSTM memory strands. If the card body is its own LSTM strand, that's about as short as it can realistically be (a fun REALLY out there project would be to try and make each sentence in the body its own LSTM... I have no idea if that could possibly work). Since the different outputs should be correlated in the memory itself, they shouldn't need to be correlated explicitly in the LSTM outputs.
b) Infilling. Infilling is a fun big concept in machine learning with images. You remove a part of an image and train a neural network to paint in the missing parts. We can (in theory) do the same with this network. I should be able to train the network to fill in the mana cost if I put in a special value that represents "I don't know" and give it the rest of the card. This is, I hope, a better way to prime the network than the previous way.
As a FINAL note on the technical parts -- this encoded information about the card... that's the perfect sort of thing to try and generate card art out of. It SHOULD contain enough info to tell that it's a creature, its cmc, its name, and anything else that's actually on the card.
In my next post I will be providing a link to my current code (it's messy, in python and Keras, I only use python for machine learning and don't really follow language conventions... sorry) and some details about my current status.
I made an EDH deck using neural cards from roborosewater and some other places. Hilariously busted.
The general, which I renamed to Simic Lord Roborosewater, was this bad boy
Simic Lord Roborosewater [4B]
2/2 Human Wizard
Whenever Simic Lord Roborosewater deals combat damage to a player, put a +1/+1 counter on it
RW: Create a 2/2 red and green saproling creature token
UG(Tap): Create a 0/1 white spirit creature token with intimidate and huster.
Okay, the promised second (of probably many, but trying to spread this out) post.
First, the code. I have just noticed that there isn't directories for ./logs, ./stats, and ./weights. There should be. It might explode without those. I will spend more time polishing it once I have confirmation that literally anyone but me is trying to do this stuff again.
Now, current status.
I will go over the technical bits more in a later post, but I already threw a lot of technical stuff earlier. For this one I will go over the results I've seen and things I've learned about how this type of network learns. I am doing all current experiments with just type and mana cost because those are fairly independent and doing on only two allows me to train very quickly.
a) There is value in tweaking the numbers for each individual data type. I originally gave only four nodes explicitly to type because there's not a lot of combinations that are possible. Going that low started to affect the effectiveness of mana cost. It kinda makes sense, it couldn't do a good enough job with the nodes that are dedicated, so it tries to use the general nodes... but doesn't have enough time to use them effectively, making things worse overall.
b) Length seems to be the easiest thing for it to learn. Looking at epoch 1 of this most current training set, it turned "instant" into "creatur". Creatur is the same length as instant (the right answer). It makes that mistake a lot. It takes a bit longer to fully learn length for mana cost but even there it quickly gets into the point where it's the right LENGTH, and it's the right FORMAT, but it doesn't get things fully right. It turns {3}{g}{g} -> {2}{u}{b}. Same length. It never seems to make the mistake of something like {u}{2}{b}, so it's getting the general format down pretty quickly, too. I have an experiment I'm going to run soon to see if I can nudge it into the right direction without increasing the number of nodes.
c) Planeswalkers are hard. No different from the old system, though mine does get to the point of encoding planeswalker after a while. In theory that means that it can generate them by picking specific numbers in the encoding.
d) White, for whatever reason, seems to be the easiest. I have it set up to encode/decode six specific cards chosen largely at random. It seems to get the white mana symbols much easier than other colors. It likes to turn green into either blue or black. Epoch 92 of this run with the largest numbers I've thrown at it comes back with {3}{g}{g} -> {2}{u}{b}, {w} -> {w}, {4}{u}{u} -> {1}{u}{u}, {3}{w} -> {1}{w}, and {7} -> {3}. In this case it got the double blue card right, too, but it often doesn't. It always seems to get the white right after a full training run though.
d) Before it "gets" planeswalkers, it usually wants to make them enchantments.
I'm collecting/creating a suite of tools for a newer/better version of @roborosewater (not affiliated with the people who run that account in any way) to showcase the progress that's been made since that time.
I'd be very interested in both the pre-trained model as well as the source code (if it's not too embarrasing / you're willing to open source it).
I'm collecting/creating a suite of tools for a newer/better version of @roborosewater (not affiliated with the people who run that account in any way) to showcase the progress that's been made since that time.
I'd be very interested in both the pre-trained model as well as the source code (if it's not too embarrasing / you're willing to open source it).
I can't take full credit of the source code. It's based on this implementation on github: https://github.com/moxiegushi/pokeGAN. I added things like gradient penalty for improved training, changed the architecture to handle the different input/output, added dropout, improved output processing etc.
I don't mind sharing it. Just give me a few days to find some hyperparameters that give the nicest results. I only have access to the GTX 1070 during the weekends unfortunately. The GTX 680 doesn't have enough memory...
Here's the latest batch with lower dropout rate: https://imgur.com/a/G0yFY
Are you in touch with the people running @roborosewater? Do you know if it's still actively being worked on?
I've been training for 7 hours and came up with everything 'soinason98e3984nfsldnlf s9f&saflnsdoon' etc.
It took those 7 hours to do 100. How can I make it go faster? Running on my laptop i5 6300 2.3 8gb ram. Is this simply too little? I'm also running through a VM. I'm not good at linux or neural nets, I can't believe I was even able to set em both up.
Thanks.
These are awesome. Do you think I could get a zip file with these images? I just grabbed 200 images for a set but don't want to do it again for another set.
Sure, 3000+ images fresh from the oven: https://www.dropbox.com/s/udj71rp2y56tu47/output.zip?dl=0
Here's a little experiment. I made a video by changing the input to the generator slightly over each frame. The result is some kind of AI lava lamp: https://gfycat.com/FluidFlawlessIndianjackal
It would be easy to set the intelligence of the network on the Expansion symbol, since that isn't being used to rely information at all. The other possibility is to make it show the intelligence level with a watermark.
I mean, the image-generation does pretty nice results and would get the bot character.-
The script to assign the images has pretty much been written too, and the image generation has been done specifically for this, so there shoudn't be a problem... no?
Also, looking forward to getting my own robo-cards made, but I am an absolute beginner in this, with a phone connection only, so possibly not going anywhere-
___
PD: retty sure I had more than just three posts and I'm not "Just getting started" if I got registered on frigging 2008. Thanks forum
That's really cool! I've been working a bit on putting together a RNN cube to play with friends (keeps getting put on hold because I don't have enough free time though), and having blank art is a bit dull. I'm definitely interested in the source code so I can run the network myself, if you don't mind sharing.
I have been fooling around with the MTG cards as a dataset recently... I haven't gotten so far as to reproduce the results in this forum but I've been learning the core datascience libraries (pandas, numpy, matplotlib, sklearn, tensorflow) and managed to get a nice looking dataframe put together... I'd like to help out if I can. I find this stuff great for practicing working with data.
My strategy for getting this to work has been to start from a different code example that doesn't fail on my windows 10 machine.
After a few hours I got something working. I'll post some examples at the bottom
I borrowed the code from here:
https://github.com/sherjilozair/char-rnn-tensorflow
Here is my copy of the repo, with almost no changes, except that I took out the old datasets and replaced the default folder for input data to MTG.
(data included)
https://github.com/aztecman/Magic_the_gathering_python_ML/tree/master/MTG_RNN
Our friend sherjilozair also based their code on that of Andrej Kaparthy (as did the starter of this thread).
I've been reading through this forum today for hints on improving the performance.
One thing I need to do is find every instance where the card name is repeated in the text and replace it with $THIS, that way the card will properly reference itself. You're supposed to replace the word $THIS with the name of the generated card,
but for some reason people in this forum don't often bother.
Another simple trick I plan to use is putting the type directly in front of the power/toughness;
this way the network should learn to discern the difference in format between creatures and other cards.
EDIT. it seems somebody flagged my last reply as spam.
{2}{W}
Flying (This creature can\'t be blocked except by creatures with flying or reach.)
Chen-Goarch Squantion deal 1 damage to each creature.
*/*
Shimeral Engines
{3}{B}{B}
+1: Until end of turn, you may play that many +1/+1 counters from Remrling Scryinglazystrounce, add three or moren\'s converted mana cost is dealt top thre enchant creature. Attach it to target creature you control to their owners\' hands. A creature was dobberwomp. (They dealt damage this wellbosi, shuffle your library.
Malony Fiend
{1}{W}{W}
Haste
Rebelisis Battle Rats is dealt to its owner\'s hand instead of puttinn or her library.
2/1
Mystic Wall
{1}{B}
Return target green creature card from your graveyard to your hand.
Aetheri, the Killare Spider
{3}{B}
When Centaur Scout Horror enters the battlefield, choose a color.
At the beginning of your upkeep, put a +1/+1 counter on Oblic enters the battlefield, destroy target spell unless its controller pays {X}.
1/1
Garnane Carrieles
{2}{U}{U}
{T}: Gadrosan Equut unless you pay {1}.
2/1
Check out this quote from their website:
"We want to create a game that can evolve. We've created an all-new Games Rules Engine (GRE) that uses sophisticated machine learning that can read any card we can dream up for Magic. That means the shackles are off for our industry-leading designers to build and create cards and in-depth gameplay around new mechanics and unexpected but widly fun concepts, all of which can be adapted for MTG Arena thanks to the new GRE under the hood."
[https://magic.wizards.com/en/articles/archive/feature/everything-you-need-know-about-magic-gathering-arena-2017-09-07]
I for one am hoping to see something done with MTG similar to what has been done with starcraft II in the AI community.
If you want to see what that format might look like, take a look at the Forge fan project.
First, a pretty fundamental change: we aren't using (just) LSTMs anymore. Now we're using what's called a VAE. Feel free to read tutorials and whatnot yourself, but I always think that you don't understand a thing until you can explain it, so I will attempt to do that.
An LSTM works by keeping a bit of memory around about how it sees the world. If it's pretty smart, it might only keep a very dense bit of knowledge ("we're writing a type, it's an instant, we're on character 3") so that it doesn't really have to think very hard to keep things straight. If it's a bit dumber it can still do a good job, but in a less intelligent, more error-prone way ("we just wrote 'ins', I have no idea where we are in the card, but maybe that's instant? I guess the next letter should be a t?").
A VAE (Variational Auto-Encoder) at a high level is all about managing that idea of memory. You split the network into two parts. They go by different names, but I will call them an encoder and a decoder. You might see me refer to the decoder as the posterior later. The first part of the network, the encoder, is tasked with creating the encoded state of things. For our purposes you would expect to see the type of card encoded, as well as things like CMC. These are neural networks, so they're somewhat black boxes (though we can and hopefully will make them less of a black box later) but that's theoretically how it works.
The second half, you guessed it, decodes that memory into the original card again. Why is that useful? We're essentially squeezing the encoded representation down as far as it can possibly go. By doing so we can force it to remove redundant or useless information so that it can fit what IS necessary. Going back to CMC, it probably wouldn't actually store the CMC in the memory directly. It would probably store the mana cost -- CMC can be derived. Since it's deriving derived information, it should force things to become more self-consistent.
Now, this encoded memory has some fun properties. We can encode a card and mess with the individual numbers in the encoded memory space to see what it does. I would expect to be able to modify a number and make a card "more red" or "more creature-like." I don't get the PICK what each axis represents, but anything the machine chooses to put on an axis is a thing that I can twiddle after the fact. That sounds exciting!
As my last major tweak, I am actually using one LSTM per type of input (so mana cost, name, power, toughness, etc.) I am doing this for two reasons:
a) Memory length. LSTMs are better than older forms of RNNs, but they too suffer from a lack of very long term memory. I want to reduce the length of LSTM memory strands. If the card body is its own LSTM strand, that's about as short as it can realistically be (a fun REALLY out there project would be to try and make each sentence in the body its own LSTM... I have no idea if that could possibly work). Since the different outputs should be correlated in the memory itself, they shouldn't need to be correlated explicitly in the LSTM outputs.
b) Infilling. Infilling is a fun big concept in machine learning with images. You remove a part of an image and train a neural network to paint in the missing parts. We can (in theory) do the same with this network. I should be able to train the network to fill in the mana cost if I put in a special value that represents "I don't know" and give it the rest of the card. This is, I hope, a better way to prime the network than the previous way.
As a FINAL note on the technical parts -- this encoded information about the card... that's the perfect sort of thing to try and generate card art out of. It SHOULD contain enough info to tell that it's a creature, its cmc, its name, and anything else that's actually on the card.
In my next post I will be providing a link to my current code (it's messy, in python and Keras, I only use python for machine learning and don't really follow language conventions... sorry) and some details about my current status.
The general, which I renamed to Simic Lord Roborosewater, was this bad boy
Simic Lord Roborosewater [4B]
2/2 Human Wizard
Whenever Simic Lord Roborosewater deals combat damage to a player, put a +1/+1 counter on it
RW: Create a 2/2 red and green saproling creature token
UG(Tap): Create a 0/1 white spirit creature token with intimidate and huster.
Never found out wtf huster was lol
First, the code. I have just noticed that there isn't directories for ./logs, ./stats, and ./weights. There should be. It might explode without those. I will spend more time polishing it once I have confirmation that literally anyone but me is trying to do this stuff again.
Now, current status.
I will go over the technical bits more in a later post, but I already threw a lot of technical stuff earlier. For this one I will go over the results I've seen and things I've learned about how this type of network learns. I am doing all current experiments with just type and mana cost because those are fairly independent and doing on only two allows me to train very quickly.
a) There is value in tweaking the numbers for each individual data type. I originally gave only four nodes explicitly to type because there's not a lot of combinations that are possible. Going that low started to affect the effectiveness of mana cost. It kinda makes sense, it couldn't do a good enough job with the nodes that are dedicated, so it tries to use the general nodes... but doesn't have enough time to use them effectively, making things worse overall.
b) Length seems to be the easiest thing for it to learn. Looking at epoch 1 of this most current training set, it turned "instant" into "creatur". Creatur is the same length as instant (the right answer). It makes that mistake a lot. It takes a bit longer to fully learn length for mana cost but even there it quickly gets into the point where it's the right LENGTH, and it's the right FORMAT, but it doesn't get things fully right. It turns {3}{g}{g} -> {2}{u}{b}. Same length. It never seems to make the mistake of something like {u}{2}{b}, so it's getting the general format down pretty quickly, too. I have an experiment I'm going to run soon to see if I can nudge it into the right direction without increasing the number of nodes.
c) Planeswalkers are hard. No different from the old system, though mine does get to the point of encoding planeswalker after a while. In theory that means that it can generate them by picking specific numbers in the encoding.
d) White, for whatever reason, seems to be the easiest. I have it set up to encode/decode six specific cards chosen largely at random. It seems to get the white mana symbols much easier than other colors. It likes to turn green into either blue or black. Epoch 92 of this run with the largest numbers I've thrown at it comes back with {3}{g}{g} -> {2}{u}{b}, {w} -> {w}, {4}{u}{u} -> {1}{u}{u}, {3}{w} -> {1}{w}, and {7} -> {3}. In this case it got the double blue card right, too, but it often doesn't. It always seems to get the white right after a full training run though.
d) Before it "gets" planeswalkers, it usually wants to make them enchantments.
I'm collecting/creating a suite of tools for a newer/better version of @roborosewater (not affiliated with the people who run that account in any way) to showcase the progress that's been made since that time.
I'd be very interested in both the pre-trained model as well as the source code (if it's not too embarrasing / you're willing to open source it).