Bummer, I have two 11kg torque servos, but theyre those continuous rotation MG996Rs. So I guess its sg90s until we get some production cash. They are expensive in this part of the world......
Either way, I
ll try make a chassis thats easy to swap out for bulkier bois. but I also would like to make custom servo horns only once, and the likelihood of the sg90s horn
`s fitting some metal geared bad boy is very unlikely.
Unless we can fiddle with the eg. code so that 2 servos = which would carry the most weight- are programmed as continuous rotation ones?
I quickly tried some cont. servo example code on RPi , and it worked, but after the program finishes the motherfuckers just keep spinning forever, as happened with you in your previous post. what a mess.
Category: Locomotion
// also had a thought- if we have the arm hanging from bottom instead of reaching from top – it could be more like ‘tail’, and thus the whole robot moves the other way. That’ll be freaky as hell, ha, kinda exorcisty, lol. Also, if its coming out the bottom that’s gonna be a bit structurally / weightedly dodgy – so we need a nice “not in use” / walking / idle position, or maybe it helps with locomotion too, I dunno. See eg. of spot with arm below for nice inspires.
Heh I love how Spot1 is like awwww I wanna open this door but I have no arms!!! đ Booooo, Spot_with_arm plrz herlp thnx k I’m useless imma go now and go get pushed with hockey sticks
Diegetic Prototype
Egg-protecting Robot
Made with chicken bones from the trash (v. nice prototyping material)
Radomir Strikes Again!
https://hackaday.io/project/9065-tote-zero
https://bitbucket.org/thesheep/tote0/downloads/
and, using an adafruit “feather” board, but I dunno maybe interesting at some point https://bitbucket.org/thesheep/circuitpython-spiderwing/src/default/python/
Raspberry Pi Powered Quadruped
Samira PeirisPublished January 25, 2019 © GPL3+
A four-legged robot imbued with the power of deep learning.
https://www.hackster.io/yasaspeiris/raspberry-pi-powered-quadruped-bbb68b
mrnda meets rpi
+ pca9685
https://learn.adafruit.com/16-channel-pwm-servo-driver/python-circuitpython
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh/enabling-ssh
https://github.com/adafruit/Adafruit_CircuitPython_ServoKit
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/adafruit-pi-code
https://github.com/adafruit/Adafruit_CircuitPython_PCA9685/tree/master/examples
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/pwm-outputs-servos
https://github.com/adafruit/Adafruit_CircuitPython_PCA9685
https://cdn-learn.adafruit.com/downloads/pdf/adafruit-16-channel-servo-driver-with-raspberry-pi.pdf
https://circuitpython.readthedocs.io/projects/pca9685/en/latest/index.html
+Misc
aka what is Computors
https://www.lifewire.com/uses-of-command-cd-2201063
+PYTHON
aka snakes or something idk I`m not a programmer
https://www.guru99.com/learn-python-main-function-with-examples-understand-main.html
(Population Based Training, and Augmented Random Search)
Got a reward of 902 with this robotable. That’s a success. It’s an amusing walk. Still has a way to go, probably.
Miranda doesn’t want to train it with that one dodge ball algorithm you sometimes see, for toughening up AIs. I’ll see about adding in the uneven terrain though, and maybe trying to run that obstacle course library.
But there are other, big things to do, which take some doing.
The egg-scooper, or candler, or handler, or picker-upper will likely use an approach similar to the OpenAI Rubik’s cube solver, with a camera in simulation as the input to a Convolutional Neural Network of some sort, so that there is a transferred mapping, between simulated camera, and real camera.
Also, getting started on Sim-to-Real attempts, of transferring locomotion policies to the RPi robot, seeing if it will walk.
The PBT algorithm changes up the hyperparameters occasionally.
It might be smart to use ensemble or continuous learning by switching to a PPO implementation at the 902 reward checkpoint.
I get the sense that gradient descent becomes more useful once you’ve got past the novelty pitfalls, like learning to step forward instead of falling over. It can probably speed up learning at this point.
DCGAN and PGGAN and PAGAN
GAN – Generative Adversarial Networks
It looks like the main use of GANs, when not generating things that don’t exist, is to generate sample datasets based on real datasets, to increase the sample size of training data for some machine learning task, like detecting tomato diseases, or breast cancer.
The papers all confirm that it generates fake data that is pretty much indistinguishable from the real stuff.
DCGAN – Deep Convolutional GAN – https://arxiv.org/pdf/1511.06434.pdf https://github.com/carpedm20/DCGAN-tensorflow
PGGAN – Progressively Growing GAN – https://arxiv.org/pdf/1710.10196.pdf https://github.com/akanimax/pro_gan_pytorch
PA-GAN – Progressive Attention GAN – https://deepai.org/publication/pa-gan-progressive-attention-generative-adversarial-network-for-facial-attribute-editing – https://github.com/LynnHo/PA-GAN-Tensorflow
Examining the Capability of GANs to Replace Real
Biomedical Images in Classification Models Training
(Trying to generate Chest XRays and Histology images for coming up with new material for datasets)
https://arxiv.org/pdf/1904.08688.pdf –
Interesting difference between the algorithms, like the PGGANs didn’t mess up male and female body halves. Lots of talk about ‘model collapse’ – https://www.geeksforgeeks.org/modal-collapse-in-gans/
Modal Collapse in GANs
25-06-2019
Prerequisites: General Adversarial Network
Although Generative Adversarial Networks are very powerful neural networks which can be used to generate new data similar to the data upon which it was trained upon, It is limited in the sense that that it can be trained upon only single-modal data ie Data whose dependent variable consists of only one categorical entry.
If a Generative Adversarial Network is trained on multi-modal data, it leads to Modal Collapse. Modal Collapse refers to a situation in which the generator part of the network generates only a limited amount of variety of samples regardless of the input. This means that when the network is trained upon a multi-modal data directly, the generator learns to fool the discriminator by generating only a limited variety of data.
The following flow-chart illustrates training of a Generative Adversarial Network when trained upon a dataset containing images of cats and dogs:
The following approaches can be used to tackle Modal Collapse:-
- Grouping the classes: One of the primary methods to tackle Modal Collapse is to group the data according to the different classes present in the data. This gives the discriminator the power to discriminate against sub-batches and determine whether a given batch is real or fake.
- Anticipating Counter-actions: This method focuses on removing the situation of the discriminator âchasingâ the generator by training the generator to maximally fool the discriminator by taking into account the counter-actions of the discriminator. This method has the downside of increased training time and complicated gradient calculation.
- Learning from Experience: This approach involves training the discriminator on the old fake samples which were generated by the generator in a fixed number of iterations.
- Multiple Networks: This method involves training multiple Generative networks for each different class thus covering all the classes of the data. The disadvantages include increased training time and typical reduction in the quality of the generated data.
Oh wow so many GANs out there:
PATE-GAN, GANSynth, ProbGAN, InstaGAN, RelGAN, MisGAN, SPIGAN, LayoutGAN, KnockoffGAN
Yee hah!
Tensorboard
Tensorboard is TensorFlow’s graphs website at localhost:6006
tensorboard –logdir=.
tensorboard –logdir=/root/ray_results/ for all the experiments
I ran the ARS algorithm with Ray, on the robotable environment, and left it running for a day with the UI off. I set it up to run Tune, but the environments are 400MB of RAM each, so it’s pretty close to the 4GB in this laptop, so I was only running a single experiment.
So the next thing is to get it to start play back from a checkpoint.
(A few days pass, the github issue I had was something basic, that I thought I’d checked.)
So now I have a process where it’s running 100 iterations, then uses the best checkpoint as the starting policy for the next 100 iterations. Now it might just be wishful thinking, but i do actually see a positive trend through the graphs, in ‘wall’ view. There’s also lots of variation of falling over, so I think we might just need to get these hyperparameters tuning. (Probably need to tweak reward weights too. But lol, giving AI access to its own reward function… )
Just a note on that, the AI will definitely just be like, *999999
After training it overnight, with the PBT & ARS, it looks like one policy really beat out the other ones.
It ran a lot longer than the others.
Replay
After seeing the ‘Replay Buffer’ in The TF-Agents SAC minitaur https://www.tensorflow.org/agents/tutorials/7_SAC_minitaur_tutorial tutorial, I’m starting to think replay is going to be a thing for the robot, one way or another.
I’m sticking to the google protobuf code that the minitaur uses, and will just need to save the best episodes, and work out how to replay them. The comments ask “use recordio?”
https://stackoverflow.com/questions/53219720/tfrecord-vs-recordio
import os import inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0, parentdir) import argparse from gym_robotable.envs import logging if __name__ == "__main__": parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--log_file', help='path to protobuf file', default='/opt/gym-robotable/logs/robotable_log_2020-07-12-204613') args = parser.parse_args() logging = logging.RobotableLogging() episode = logging.restore_episode(args.log_file) print(dir (episode)) print("episode=",episode) fields = episode.ListFields()
So that’s printing out the episode.
Next step is saving only the best episodes
Then next step is stepping the simulation with the actions stored.
But now I’m not as sure. It might be better to switch to RLLAB (&Ray)
Would rather hide the details of serialization if I can.