投稿

4月, 2018の投稿を表示しています

Reinforcement Learning: Maze Solving

イメージ
Keywords: Xamarin.Forms, Device.StartTimer, OrderByDescending, Reinforcement Learning, Maze Solving, Q-Learning, Sarsa, ε-greedy strategy, Boltzmann exploration I developed a Xamarin.Forms app that solves simple mazes with reinforcement learning algorithms.  The source code is here . The screen shot just after launching the app. MainPage.xaml Designed the screen layout with 1 column and 5 rows Grid.  From the upper row, App title, some Buttons to control the reinforcement learning, main area displaying the maze, and two data displaying areas for debug. MazeData.cs Defined the "Route" class for modeling mazes.  The "SetStateGrid" method creates and displays a maze by setting BoxViews in Grid layout.  And also, this method sets start cell of the maze, sets Grid cell color, and places some Labels. MainPage.xaml.cs Defined the "State" and "Action" class for states and actions of reinforcement learning.  The "Learning" and &

Get the Color Code from an Image Pixel

イメージ
Keywords:  Xamarin.Forms, Image Class, Pan Gesture, Pinch Gesture, SkiaSharp, SKBitmap, SKBitmp.GetPixel, Slider I developed an App to easily get the color code from a image pixel, because when I found an App with good coloring sense, I wanted to know some color codes in the App.  Getting the color from image is very common function, and there are many Apps and Webs.  But I wanted to make it by myself, I wanted to learn image data handling in Xamarin.Forms, so I have tried to do it anyway. The screenshot just after launching this App (left), a screenshot (middle) when the image is dragged by Pan Gesture, and a screenshot (right) when the image is scaled by Pinch Gesture.  You can see a figure like a rifle sight.  The color code of the pixel on the center of the figure are shown below the image. MainPage.xaml <? xml  version = " 1.0 "  encoding = " UTF-8 " ?> < ContentPage   xmlns = " http://xamarin.com/schemas/2014/forms "