投稿時間:2021-09-29 00:41:55 RSSフィード2021-09-29 00:00 分まとめ(46件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese Xbox Series X|SがDolby Vision正式対応。Halo Infiniteなど100タイトル以上で利用可能に https://japanese.engadget.com/xbox-dolby-vision-141723204.html XboxSeriesXSがDolbyVision正式対応。 2021-09-28 14:17:23
AWS AWS Government, Education, and Nonprofits Blog 10 years of government cloud innovation with AWS GovCloud (US) https://aws.amazon.com/blogs/publicsector/10-years-of-government-cloud-innovation-aws-govcloud-us/ years of government cloud innovation with AWS GovCloud US Ten years ago the federal government was only just beginning to adopt cloud computing services In the early days there were concerns about how much cloud services would cost and whether they d be secure enough for sensitive government data Ten years ago the federal government was only just beginning to adopt cloud computing services In the early days there were concerns about how much cloud services would cost and whether they d be secure enough for sensitive government data 2021-09-28 14:48:41
AWS AWS Government, Education, and Nonprofits Blog AWS in Virginia: The economic impact of solar https://aws.amazon.com/blogs/publicsector/aws-in-virginia-the-economic-impact-of-solar/ AWS in Virginia The economic impact of solarThis week at Amazon Web Services AWS Summit Washington DC we announced the findings of a year economic study about AWS s presence in Virginia The report shows the impact that can happen when government and industry work together to create growth opportunities for communities One component of this that is worth re highlighting is the positive impact that Amazon solar investments are having and will have on the local economy in Virginia 2021-09-28 14:44:34
AWS AWS Government, Education, and Nonprofits Blog How AWS supports state of Virginia and US veterans: new impact study highlights partnership’s success https://aws.amazon.com/blogs/publicsector/how-aws-supports-state-of-virginia-and-us-veterans-new-impact-study-highlights-partnerships-success/ How AWS supports state of Virginia and US veterans new impact study highlights partnership s successThis week AWS rolled out our year economic impact study highlighting how successful the partnership between Virginia and AWS has been for both Since AWS has invested billion into the state through our infrastructure investments As both a Virginian and an Amazonian I m most proud of the civic programs and workforce development we ve created with Virginia to enhance the lives of citizens with our presence Terry Dickerson a practice manager at AWS and U S Army veteran is an illustration of the success we ve realized with Amazon s Veteran Technical Apprenticeship Terry shares his story of how our partnership with the higher education system in Virginia has opened the door to his career 2021-09-28 14:30:07
AWS AWS Japan Blog AWS IoT Deep Dive #5 – Industrial IoT 向けサービス・ソリューション特集 資料と録画、Q&Aを公開 https://aws.amazon.com/jp/blogs/news/aws-iot-deep-dive-5/ AWSIoTDeepDiveIndustrialIoT向けサービス・ソリューション特集第回となる今回は、工場やプラントでのデータ収集や制御といった産業分野で使われるIndustrialIoT向けのサービスやソリューションをご紹介しました。 2021-09-28 14:15:03
python Pythonタグが付けられた新着投稿 - Qiita AWSでAIサービスを使ってみる〜第14回personalize編その④〜 https://qiita.com/AInosukey/items/65de0237165a5374a5a4 なんと番目には隠しアイテムの赤いスイトピーがお勧めされてます笑まとめpersonalizeでレコメンデーションを取得するまでのプログラムでした。 2021-09-28 23:50:00
python Pythonタグが付けられた新着投稿 - Qiita FastAPIのチュートリアルに取り組んでみた https://qiita.com/ToaruEngineer/items/cd59130df88ef24a3187 FastAPIのチュートリアルに取り組んでみたこちら番最初のinstallをしようとしたところpipが入ってないと怒られたので、まずはpipをインストールしたcurlogetpippypythongetpippypipVpipfromusrlocallibpythonsitepackagespippythonこれで完了した。 2021-09-28 23:37:20
python Pythonタグが付けられた新着投稿 - Qiita ABC198 C - Compass Walking から学んだ https://qiita.com/AKpirion/items/85de771b6132535dde1a targetを超えた歩と、そのひとつ前の歩を直線ではなく、組み合わせて迂回させることで丁度targetにつくことが出来る問題文で小数点を許したのは、そういう意図か。 2021-09-28 23:19:34
js JavaScriptタグが付けられた新着投稿 - Qiita 【Jest入門】Errorの評価しよう~toThrow関数~ https://qiita.com/YSasago/items/b5aae0c35a629f834752 【Jest入門】Errorの評価しようtoThrow関数JestでErrorを確認しようJestでErrorを評価する際は、toThrow関数を使用します。 2021-09-28 23:47:38
js JavaScriptタグが付けられた新着投稿 - Qiita mapメソッドのまとめ https://qiita.com/kinoshitaken123/items/60780cd051f77f764ddf MDNリファレンスmapメソッドの使用例数字の配列に対して一つずつ倍にして新しい配列を作りたいと思います。 2021-09-28 23:39:45
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) お名前.comのネームサーバーの向きをさくらサーバーから元に戻す https://teratail.com/questions/361784?rss=all お名前comのネームサーバーの向きをさくらサーバーから元に戻すお名前comで取得した独自ドメインをさくらサーバーにネームサーバーを向けて運用していたのですが、googleワークスペースのドメインの紐付けに伴い、さくらサーバーからお名前comにネームサーバーの向きを戻し、AレコードにさくらサーバーのIPアドレスを入力する方針になりました。 2021-09-28 23:59:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 数字を重複しないようにランダムに繰り返す https://teratail.com/questions/361783?rss=all また繰り返しでは値は重複しないようにしたいです。 2021-09-28 23:54:59
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) C++ エクスプローラーのフォルダから画像を読み込みたい https://teratail.com/questions/361782?rss=all 2021-09-28 23:48:00
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 構文エラーのエラー個所がわからなくて困っております… https://teratail.com/questions/361781?rss=all 2021-09-28 23:38:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) python リストの文字列を取得したい https://teratail.com/questions/361780?rss=all pythonリストの文字列を取得したいpythonについての質問です。 2021-09-28 23:32:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 多対多の操作(SQLAlchemy) https://teratail.com/questions/361779?rss=all 2021-09-28 23:30:15
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ActiveRecord オブジェクトに、attribute で日付データを入れたい https://teratail.com/questions/361778?rss=all ActiveRecordオブジェクトに、attributeで日付データを入れたい達成したいことは以下の通りです。 2021-09-28 23:24:20
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) bulmaにてブラウザのサイズを小さくしても大きい状態と同様のレイアウトにしたい https://teratail.com/questions/361777?rss=all bulmaにてブラウザのサイズを小さくしても大きい状態と同様のレイアウトにしたい前提・実現したいことBulmaのフレームを使いNavbarを製作中です。 2021-09-28 23:17:44
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) joy_nodeから常に軸の値を読み取りたい https://teratail.com/questions/361776?rss=all joynodeから常に軸の値を読み取りたい前提・実現したいことrosのjoynodeから、axesの読み取り値を常に受信したい発生している問題・エラーメッセージrosのgithubから配布されているjoynodeについてjoynodeからjoystickのaxesの読み取り値を受信するsubscribenbsppkgを作り、axesの読み取り値を受信することに成功したのですが、おそらくjoynodeはaxesの値が変動しないと、読み取り値をpublishしてくれないらしく、常時同じ周波数でaxesの値を読み取ることができません。 2021-09-28 23:09:34
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) M1 MacBook Air クラムシェルモードのスリープ解除が有線マウス・キーボードからできない。 https://teratail.com/questions/361775?rss=all MMacBookAirクラムシェルモードのスリープ解除が有線マウス・キーボードからできない。 2021-09-28 23:08:50
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) squidのcache.logのformatが知りたい https://teratail.com/questions/361774?rss=all squidのcachelogのformatが知りたいsquidのcachelogのformatを教えてください。 2021-09-28 23:01:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) [rails]Refileがbundle installできない https://teratail.com/questions/361773?rss=all railsRefileがbundleinstallできないやりたいこと正常にbundlenbspinstallを行いたい。 2021-09-28 23:01:54
Ruby Rubyタグが付けられた新着投稿 - Qiita 【Rails】ancestryを用いてエリアの登録(多階層、親-子)を行う https://qiita.com/ysdiary/items/62e495da15d5f6e785c2 【Rails】ancestryを用いてエリアの登録多階層、親子を行うはじめにancestryを用いてエリアの登録親、子を行ったので、まとめておきます。 2021-09-28 23:43:56
Ruby Rubyタグが付けられた新着投稿 - Qiita rbenvを利用してのrubyのインストールに失敗したときの対処 m1 mac macOS 11.6 https://qiita.com/raowat/items/cd78c5b56bbead6aa704 rbenvを利用してのrubyのインストールに失敗したときの対処mmacmacOS書いた理由日間くらいずっと詰まっていたのが解決したので、同じ事象が起きている人に届けばと思い、以下に記載します。 2021-09-28 23:20:43
AWS AWSタグが付けられた新着投稿 - Qiita AWSでAIサービスを使ってみる〜第14回personalize編その④〜 https://qiita.com/AInosukey/items/65de0237165a5374a5a4 なんと番目には隠しアイテムの赤いスイトピーがお勧めされてます笑まとめpersonalizeでレコメンデーションを取得するまでのプログラムでした。 2021-09-28 23:50:00
技術ブログ Developers.IO [react-sound] Webアプリでサウンドを鳴らしてみた https://dev.classmethod.jp/articles/react-sound-i-tried-playing-a-sound-in-a-web-app/ reactsound 2021-09-28 14:52:50
技術ブログ Developers.IO Cloud Oneに日本リージョンが追加されたので確認してみた! https://dev.classmethod.jp/articles/cloudone-japan/ cloudone 2021-09-28 14:14:21
海外TECH Ars Technica We’re about to run out of Atlantic hurricane names—again https://arstechnica.com/?p=1798963 supplemental 2021-09-28 14:20:28
海外TECH DEV Community Self-Parking Car in <500 Lines of Code https://dev.to/trekhleb/self-parking-car-in-500-lines-of-code-58ea Self Parking Car in lt Lines of CodeTraining the car to do self parking using a genetic algorithm TL DRIn this article we ll train the car to do self parking using a genetic algorithm We ll create the st generation of cars with random genomes that will behave something like this On the ≈th generation the cars start learning what the self parking is and start getting closer to the parking spot Another example with a bit more challenging starting point Yeah yeah the cars are hitting some other cars along the way and also are not perfectly fitting the parking spot but this is only the th generation since the creation of the world for them so be merciful and give the cars some space to grow DYou may launch the Self parking Car Evolution Simulator to see the evolution process directly in your browser The simulator gives you the following opportunities You may train the cars from scratch and adjust genetic parameters by yourselfYou may see the trained self parking cars in actionYou may also try to park the car manuallyThe genetic algorithm for this project is implemented in TypeScript The full genetic source code will be shown in this article but you may also find the final code examples in the Evolution Simulator repository We re going to use a genetic algorithm for the particular task of evolving cars genomes However this article only touches on the basics of the algorithm and is by no means a complete guide to the genetic algorithm topic Having that said let s deep dive into more details The PlanStep by step we re going to break down a high level task of creating the self parking car to the straightforward low level optimization problem of finding the optimal combination of bits finding the optimal car genome Here is what we re going to do Give the muscles engine steering wheel to the car so that it could move towards the parking spot Give the eyes sensors to the car so that it could see the obstacles around Give the brain to the car that will control the muscles movements based on what the car sees obstacles via sensors The brain will be simply a pure function movements f sensors Evolve the brain to do the right moves based on the sensors input This is where we will apply a genetic algorithm Generation after generation our brain function movements f sensors will learn how to move the car towards the parking spot Giving the muscles to the carTo be able to move the car would need muscles Let s give the car two types of muscles Engine muscle allows the car to move ↓back ↑forth or stand steel neutral gear Steering wheel muscle allows the car to turn ←left →right or go straight while movingWith these two muscles the car can perform the following movements In our case the muscles are receivers of the signals that come from the brain once every ms milliseconds Based on the value of the brain s signal the muscles act differently We ll cover the brain part below but for now let s say that our brain may send only possible signals to each muscle or type MuscleSignal For example the brain may send the signal with the value of to the engine muscle and it will start moving the car forward The signal to the engine moves the car backward At the same time if the brain will send the signal of to the steering wheel muscle it will turn the car to the left etc Here is how the brain signal values map to the muscle actions in our case MuscleSignal Signal Signal Engine↓Backward Neutral↑ForwardSteering wheel←Left Straight→RightYou may use the Evolution Simulator and try to park the car manually to see how the car muscles work Every time you press one of the WASD keyboard keys or use a touch screen joystick you send these or signals to the engine and steering wheel muscles Giving the eyes to the carBefore our car will learn how to do self parking using its muscles it needs to be able to see the surroundings Let s give it the eyes in a form of distance sensors Each sensor can detect the obstacle in a distance range of m meters Each sensor reports the latest information about the obstacles it sees to the car s brain every ms Whenever the sensor doesn t see any obstacles it reports the value of On the contrary if the value of the sensor is small but not zero i e m it would mean that the obstacle is close You may use the Evolution Simulator and see how the color of each sensor changes based on how close the obstacle is type Sensors number Giving the brain to the carAt this moment our car can see and move but there is no coordinator that would transform the signals from the eyes to the proper movements of the muscles We need to give the car a brain Brain inputAs an input from the sensors every ms the brain will be getting float numbers each one in range of For example the input might look like this const sensors Sensors s s s s s s s s i e ← Brain outputEvery ms the brain should produce two integers as an output One number as a signal for the engine engineSignalOne number as a signal for the steering wheel wheelSignalEach number should be of the type MuscleSignal and might take one of three values or Brain formulas functionsKeeping in mind the brain s input and output mentioned above we may say that the brain is just a function const engineSignal wheelSignal brainToMuscleSignal brainFunction sensors i e engineSignal wheelSignal ←← Where brainToMuscleSignal is a function that converts raw brain signals any float number to muscle signals to or number so that muscles could understand it We ll implement this converter function below The main question now is what kind of a function the brainFunction is To make the car smarter and its movements to be more sophisticated we could go with a Multilayer Perceptron The name is a bit scary but this is a simple Neural Network with a basic architecture think of it as a big formula with many parameters coefficients I ve covered Multilayer Perceptrons with a bit more details in my homemade machine learning machine learning experiments and nano neuron projects You may even challenge that simple network to recognize your written digits However to avoid the introduction of a whole new concept of Neural Networks we ll go with a much simpler approach and we ll use two Linear Polynomials with multiple variables to be more precise each polynomial will have exactly variables since we have sensors which will look something like this engineSignal brainToMuscleSignal e s e s e s e lt brainFunction wheelSignal brainToMuscleSignal w s w s w s w lt brainFunction Where s s s the variables which are the sensor values These are dynamic e e e the coefficients for the engine polynomial These the car will need to learn and they will be static w w w the coefficients for the steering wheel polynomial These the car will need to learn and they will be staticThe cost of using the simpler function for the brain will be that the car won t be able to learn some sophisticated moves and also won t be able to generalize well and adapt well to unknown surroundings But for our particular parking lot and for the sake of demonstrating the work of a genetic algorithm it should still be enough We may implement the generic polynomial function in the following way type Coefficients number Calculates the value of a linear polynomial based on the coefficients and variables const linearPolynomial coefficients Coefficients variables number number gt if coefficients length variables length throw new Error Incompatible number of polynomial coefficients and variables let result coefficients forEach coefficient number coefficientIndex number gt if coefficientIndex lt variables length result coefficient variables coefficientIndex else The last coefficient needs to be added up without multiplication result coefficient return result The car s brain in this case will consist of two polynomials and will look like this const engineSignal MuscleSignal brainToMuscleSignal linearPolynomial engineCoefficients sensors const wheelSignal MuscleSignal brainToMuscleSignal linearPolynomial wheelCoefficients sensors The output of a linearPolynomial function is a float number The brainToMuscleSignal function need to convert the wide range of floats to three particular integers and it will do it in two steps Convert the float of a wide range i e or or to the float in a range of i e or Convert the float in a range of to one of three integer values of or For example the floats that are close to will be converted to the floats that are close to will be converted to and the floats that are close to will be converted to To do the first part of the conversion we need to introduce a Sigmoid Function which implements the following formula It converts the wide range of floats the x axis to float numbers with a limited range of the y axis This is exactly what we need Here is how the conversion steps would look on the Sigmoid graph The implementation of two conversion steps mentioned above would look like this Calculates the sigmoid value for a given number const sigmoid x number number gt return Math E x Converts sigmoid value to the muscle signals The margin parameter is a value between and margin margin const sigmoidToMuscleSignal sigmoidValue number margin number MuscleSignal gt if sigmoidValue lt margin return if sigmoidValue gt margin return return Converts raw brain signal to the muscle signal const brainToMuscleSignal rawBrainSignal number MuscleSignal gt const normalizedBrainSignal sigmoid rawBrainSignal return sigmoidToMuscleSignal normalizedBrainSignal Car s genome DNA The main conclusion from the Eyes Muscles and Brain sections above should be this the coefficients e e e and w w w defines the behavior of the car These numbers together form the unique car s Genome or car s DNA Car genome in a decimal formLet s join the e e e and w w w brain coefficients together to form a car s genome in a decimal form Car genome as a list of decimal numbers coefficients const carGenomeBase e e e w w w i e carGenomeBase Car genome in a binary formLet s move one step deeper to the level of the genes and convert the decimal numbers of the car s genome to the binary format to the plain s and s I ve described in the detail the process of converting the floating point numbers to binary numbers in the Binary representation of the floating point numbers article You might want to check it out if the code in this section is not clear Here is a quick example of how the floating point number may be converted to the bits binary number again feel free to read this first if the example is confusing In our case to reduce the genome length we will convert each floating coefficient to the non standard bits binary number sign bit exponent bits fraction bits We have coefficients in total every coefficient will be converted to bits number It means that the car s genome will be an array of s and s with a length of bits For example for the genome in a decimal format that was mentioned above its binary representation would look like this type Gene type Genome Gene const genome Genome Engine coefficients lt lt lt lt lt lt lt lt lt Wheels coefficients lt lt lt lt lt lt lt lt lt Oh my The binary genome looks so cryptic But can you imagine that these zeroes and ones alone define how the car behaves in the parking lot It s like you hacked someone s DNA and know what each gene means exactly Amazing By the way you may see the exact values of genomes and coefficients for the best performing car on the Evolution Simulator dashboard Here is the source code that performs the conversion from binary to decimal format for the floating point numbers the brain will need it to decode the genome and to produce the muscle signals based on the genome data type Bit type Bits Bit type PrecisionConfig signBitsCount number exponentBitsCount number fractionBitsCount number totalBitsCount number type PrecisionConfigs custom PrecisionConfig const precisionConfigs PrecisionConfigs Custom made bits precision for faster evolution progress custom signBitsCount exponentBitsCount fractionBitsCount totalBitsCount Converts the binary representation of the floating point number to decimal float number function bitsToFloat bits Bits precisionConfig PrecisionConfig number const signBitsCount exponentBitsCount precisionConfig Figuring out the sign const sign bits Calculating the exponent value const exponentBias exponentBitsCount const exponentBits bits slice signBitsCount signBitsCount exponentBitsCount const exponentUnbiased exponentBits reduce exponentSoFar number currentBit Bit bitIndex number gt const bitPowerOfTwo exponentBitsCount bitIndex return exponentSoFar currentBit bitPowerOfTwo const exponent exponentUnbiased exponentBias Calculating the fraction value const fractionBits bits slice signBitsCount exponentBitsCount const fraction fractionBits reduce fractionSoFar number currentBit Bit bitIndex number gt const bitPowerOfTwo bitIndex return fractionSoFar currentBit bitPowerOfTwo Putting all parts together to calculate the final number return sign exponent fraction Converts the bit binary representation of the floating point number to decimal float number function bitsToFloat bits Bits number return bitsToFloat bits precisionConfigs custom Brain function working with binary genomePreviously our brain function was working with the decimal form of engineCoefficients and wheelCoefficients polynomial coefficients directly However these coefficients are now encoded in the binary form of a genome Let s add a decodeGenome function that will extract coefficients from the genome and let s rewrite our brain functions Car has distance sensors const CAR SENSORS NUM Additional formula coefficient that is not connected to a sensor const BIAS UNITS How many genes do we need to encode each numeric parameter for the formulas const GENES PER NUMBER precisionConfigs custom totalBitsCount Based on distance sensors we need to provide two formulas that would define car s behavior Engine formula input sensors output backward neutral forward Wheels formula input sensors output left straight right const ENGINE FORMULA GENES NUM CAR SENSORS NUM BIAS UNITS GENES PER NUMBER const WHEELS FORMULA GENES NUM CAR SENSORS NUM BIAS UNITS GENES PER NUMBER The length of the binary genome of the car const GENOME LENGTH ENGINE FORMULA GENES NUM WHEELS FORMULA GENES NUM type DecodedGenome engineFormulaCoefficients Coefficients wheelsFormulaCoefficients Coefficients Converts the genome from a binary form to the decimal form const genomeToNumbers genome Genome genesPerNumber number number gt if genome length genesPerNumber throw new Error Wrong number of genes in the numbers genome const numbers number for let numberIndex numberIndex lt genome length numberIndex genesPerNumber const number number bitsToFloat genome slice numberIndex numberIndex genesPerNumber numbers push number return numbers Converts the genome from a binary form to the decimal form and splits the genome into two sets of coefficients one set for each muscle const decodeGenome genome Genome DecodedGenome gt const engineGenes Gene genome slice ENGINE FORMULA GENES NUM const wheelsGenes Gene genome slice ENGINE FORMULA GENES NUM ENGINE FORMULA GENES NUM WHEELS FORMULA GENES NUM const engineFormulaCoefficients Coefficients genomeToNumbers engineGenes GENES PER NUMBER const wheelsFormulaCoefficients Coefficients genomeToNumbers wheelsGenes GENES PER NUMBER return engineFormulaCoefficients wheelsFormulaCoefficients Update brain function for the engine muscle export const getEngineMuscleSignal genome Genome sensors Sensors MuscleSignal gt const engineFormulaCoefficients coefficients decodeGenome genome const rawBrainSignal linearPolynomial coefficients sensors return brainToMuscleSignal rawBrainSignal Update brain function for the wheels muscle export const getWheelsMuscleSignal genome Genome sensors Sensors MuscleSignal gt const wheelsFormulaCoefficients coefficients decodeGenome genome const rawBrainSignal linearPolynomial coefficients sensors return brainToMuscleSignal rawBrainSignal Self driving car problem statement So finally we ve got to the point when the high level problem of making the car to be a self parking car is broken down to the straightforward optimization problem of finding the optimal combination of ones and zeros finding the good enough car s genome Sounds simple doesn t it Naive approachWe could approach the problem of finding the good enough genome in a naive way and try out all possible combinations of genes and then and then and then and then But let s do some math With bits and with each bit being equal either to or to we would have or possible combinations Let s say we would need to give s to each car to see if it will park successfully or not Let s also say that we may run a simulation for cars at once Then we would need seconds which is years Pretty long waiting time Just as a side thought it is only years that have passed after Christ was born Genetic approachWe need a faster algorithm to find the optimal value of the genome This is where the genetic algorithm comes to the rescue We might not find the best value of the genome but there is a chance that we may find the optimal value of it And what is more importantly we don t need to wait that long With the Evolution Simulator I was able to find a pretty good genome within hours Genetic algorithm basicsA genetic algorithms GA inspired by the process of natural selection and are commonly used to generate high quality solutions to optimization problems by relying on biologically inspired operators such as crossover mutation and selection The problem of finding the good enough combination of genes for the car looks like an optimization problem so there is a good chance that GA will help us here We re not going to cover a genetic algorithm in all details but on a high level here are the basic steps that we will need to do CREATE the very first generation of cars can t come out of nothing so we will generate a set of random car genomes set of binary arrays with the length of at the very beginning For example we may create cars With a bigger population the chances to find the optimal solution and to find it faster increase SELECT we will need to select the fittest individuums out of the current generation for further mating see the next step The fitness of each individuum will be defined based on the fitness function which in our case will show how close the car approached the target parking spot The closer the car to the parking spot the fitter it is MATE simply saying we will allow the selected father cars to have sex with the selected mother cars so that their genomes could mix in a proportion and produce children cars genomes The idea is that the children cars might get better or worse in self parking by taking the best or the worst bits from their parents MUTATE during the mating process some genes may randomly mutate s and s in child genome may flip This may bring a wider variety of children genomes and thus a wider variety of children cars behavior Imagine that the st bit was accidentally set to for all cars The only way to try the car with the st bit being set to is through the random mutations At the same time extensive mutations may ruin healthy genomes Go to Step unless the number of generations has reached the limit i e generations have passed or unless the top performing individuums have reached the expected fitness function value i e the best car has approached the parking spot closer than meter Otherwise quit Evolving the car s brain using a Genetic AlgorithmBefore launching the genetic algorithm let s go and create the functions for the CREATE SELECT MATE and MUTATE steps of the algorithm Functions for the CREATE stepThe createGeneration function will create an array of random genomes a k a population or generation and will accept two parameters generationSize defines the size of the generation This generation size will be preserved from generation to generation genomeLength defines the genome length of each individuum in the cars population In our case the length of the genome will be There is a chance for each gene of a genome to be either or type Generation Genome type GenerationParams generationSize number genomeLength number function createGenome length number Genome return new Array length fill null map gt Math random lt function createGeneration params GenerationParams Generation const generationSize genomeLength params return new Array generationSize fill null map gt createGenome genomeLength Functions for the MUTATE stepThe mutate function will mutate some genes randomly based on the mutationProbability value For example if the mutationProbability then there is a chance for each genome to be mutated Let s say if we would have a genome of length that looks like then after the mutation there will be a chance that gene will be mutated and we may get a genome that might look like The number between and type Probability number see genetic algorithm function mutate genome Genome mutationProbability Probability Genome for let geneIndex geneIndex lt genome length geneIndex const gene Gene genome geneIndex const mutatedGene Gene gene genome geneIndex Math random lt mutationProbability mutatedGene gene return genome Functions for the MATE stepThe mate function will accept the father and the mother genomes and will produce two children We will imitate the real world scenario and also do the mutation during the mating Each bit of the child genome will be defined based on the values of the correspondent bit of the father s or mother s genomes There is a probability that the child will inherit the bit of the father or the mother For example let s say we have genomes of length for simplicity reasons Father s genome Mother s genome ↓↓↓↓Possible kid Possible kid In the example above the mutation were not taken into account Here is the function implementation Performs Uniform Crossover each bit is chosen from either parent with equal probability see genetic algorithm function mate father Genome mother Genome mutationProbability Probability Genome Genome if father length mother length throw new Error Cannot mate different species const firstChild Genome const secondChild Genome Conceive children for let geneIndex geneIndex lt father length geneIndex firstChild push Math random lt father geneIndex mother geneIndex secondChild push Math random lt father geneIndex mother geneIndex return mutate firstChild mutationProbability mutate secondChild mutationProbability Functions for the SELECT stepTo select the fittest individuums for further mating we need a way to find out the fitness of each genome To do this we will use a so called fitness function The fitness function is always related to the particular task that we try to solve and it is not generic In our case the fitness function will measure the distance between the car and the parking spot The closer the car to the parking spot the fitter it is We will implement the fitness function a bit later but for now let s introduce the interface for it type FitnessFunction genome Genome gt number Now let s say we have fitness values for each individuum in the population Let s also say that we sorted all individuums by their fitness values so that the first individuums are the strongest ones How should we select the fathers and the mothers from this array We need to do the selection in a way that the higher the fitness value of the individuum the higher the chances of this individuum being selected for mating The weightedRandom function will help us with this Picks the random item based on its weight The items with a higher weight will be picked more often const weightedRandom lt T gt items T weights number item T index number gt if items length weights length throw new Error Items and weights must be of the same size Preparing the cumulative weights array For example weights cumulativeWeights const cumulativeWeights number for let i i lt weights length i cumulativeWeights i weights i cumulativeWeights i Getting the random number in a range sum weights For example weights maxCumulativeWeight range for the random number is const maxCumulativeWeight cumulativeWeights cumulativeWeights length const randomNumber maxCumulativeWeight Math random Picking the random item based on its weight The items with higher weight will be picked more often for let i i lt items length i if cumulativeWeights i gt randomNumber return item items i index i return item items items length index items length The usage of this function is pretty straightforward Let s say you really like bananas and want to eat them more often than strawberries Then you may call const fruit weightedRandom banana strawberry and in ≈ out of cases the fruit variable will be equal to banana and only in ≈ out of times it will be equal to strawberry To avoid losing the best individuums let s call them champions during the mating process we may also introduce a so called longLivingChampionsPercentage parameter For example if the longLivingChampionsPercentage then of the best cars from the previous population will be carried over to the new generation You may think about it as there are some long living individuums that can live a long life and see their children and even grandchildren Here is the actual implementation of the select function The number between and type Percentage number type SelectionOptions mutationProbability Probability longLivingChampionsPercentage Percentage see genetic algorithm function select generation Generation fitness FitnessFunction options SelectionOptions const mutationProbability longLivingChampionsPercentage options const newGeneration Generation const oldGeneration generation First one the fittest one oldGeneration sort genomeA Genome genomeB Genome number gt const fitnessA fitness genomeA const fitnessB fitness genomeB if fitnessA lt fitnessB return if fitnessA gt fitnessB return return Let long liver champions continue living in the new generation const longLiversCount Math floor longLivingChampionsPercentage oldGeneration length if longLiversCount oldGeneration slice longLiversCount forEach longLivingGenome Genome gt newGeneration push longLivingGenome Get the data about he fitness of each individuum const fitnessPerOldGenome number oldGeneration map genome Genome gt fitness genome Populate the next generation until it becomes the same size as a old generation while newGeneration length lt generation length Select random father and mother from the population The fittest individuums have higher chances to be selected let father Genome null null let fatherGenomeIndex number null null let mother Genome null null let matherGenomeIndex number null null To produce children the father and mother need each other It must be two different individuums while father mother fatherGenomeIndex matherGenomeIndex const item randomFather index randomFatherGenomeIndex weightedRandom lt Genome gt generation fitnessPerOldGenome const item randomMother index randomMotherGenomeIndex weightedRandom lt Genome gt generation fitnessPerOldGenome father randomFather fatherGenomeIndex randomFatherGenomeIndex mother randomMother matherGenomeIndex randomMotherGenomeIndex Let father and mother produce two children const firstChild secondChild mate father mother mutationProbability newGeneration push firstChild Depending on the number of long living champions it is possible that there will be the place for only one child sorry if newGeneration length lt generation length newGeneration push secondChild return newGeneration Fitness functionThe fitness of the car will be defined by the distance from the car to the parking spot The higher the distance the lower the fitness The final distance we will calculate is an average distance from car wheels to the correspondent corners of the parking spot This distance we will call the loss which is inversely proportional to the fitness Calculating the distance between each wheel and each corner separately instead of just calculating the distance from the car center to the parking spot center will make the car preserve the proper orientation relative to the parking spot The distance between two points in space will be calculated based on the Pythagorean theorem like this type NumVec number number number Calculates the XZ distance between two points in space The vertical Y distance is not being taken into account const euclideanDistance from NumVec to NumVec gt const fromX from const fromZ from const toX to const toZ to return Math sqrt fromX toX fromZ toZ The distance the loss between the car and the parking spot will be calculated like this type RectanglePoints fl NumVec Front left fr NumVec Front right bl NumVec Back left br NumVec Back right type GeometricParams wheelsPosition RectanglePoints parkingLotCorners RectanglePoints const carLoss params GeometricParams number gt const wheelsPosition parkingLotCorners params const fl flWheel fr frWheel br brWheel bl blWheel wheelsPosition const fl flCorner fr frCorner br brCorner bl blCorner parkingLotCorners const flDistance euclideanDistance flWheel flCorner const frDistance euclideanDistance frWheel frCorner const brDistance euclideanDistance brWheel brCorner const blDistance euclideanDistance blWheel blCorner return flDistance frDistance brDistance blDistance Since the fitness should be inversely proportional to the loss we ll calculate it like this const carFitness params GeometricParams number gt const loss carLoss params Adding to avoid a division by zero return loss You may see the fitness and the loss values for a specific genome and for a current car position on the Evolution Simulator dashboard Launching the evolutionLet s put the evolution functions together We re going to create the world launch the evolution loop make the time going the generation evolving and the cars learning how to park To get the fitness values of each car we need to run a simulation of the cars behavior in a virtual D world The Evolution Simulator does exactly that it runs the code below in the simulator which is made with Three js Evolution setup example Configurable via the Evolution Simulator const GENERATION SIZE const LONG LIVING CHAMPIONS PERCENTAGE const MUTATION PROBABILITY const MAX GENERATIONS NUM Fitness function It is like an annual doctor s checkup for the cars const carFitnessFunction genome Genome number gt The evolution simulator calculates and stores the fitness values for each car in the fitnessValues map Here we will just fetch the pre calculated fitness value for the car in current generation const genomeKey genome join return fitnessValues genomeKey Creating the world with the very first cars generation let generationIndex let generation Generation createGeneration generationSize GENERATION SIZE genomeLength GENOME LENGTH lt genes Starting the time while generationIndex lt MAX GENERATIONS NUM SIMULATION IS NEEDED HERE to pre calculate the fitness values Selecting mating and mutating the current generation generation select generation carFitnessFunction mutationProbability MUTATION PROBABILITY longLivingChampionsPercentage LONG LIVING CHAMPIONS PERCENTAGE Make the time go by generationIndex Here we may check the fittest individuum of the latest generation const fittestCar generation After running the select function the generation array is sorted by the fitness values in descending order Therefore the fittest car will always be the first car in the array The st generation of cars with random genomes will behave something like this On the ≈th generation the cars start learning what the self parking is and start getting closer to the parking spot Another example with a bit more challenging starting point The cars are hitting some other cars along the way and also are not perfectly fitting the parking spot but this is only the th generation since the creation of the world for them so you may give the cars some more time to learn From generation to generation we may see how the loss values are going down which means that fitness values are going up The P Avg Loss shows the average loss value average distance from the cars to the parking spot of the of fittest cars The Min Loss shows the loss value of the fittest car in each generation You may see that on average the of the fittest cars of the generation are learning to get closer to the parking spot from m away from the parking spot to m in generations The trend for the Min Loss values is less obvious from m to m with some noise signals however from the animations above you may see that cars have learned some basic parking moves ConclusionIn this article we ve broken down the high level task of creating the self parking car to the straightforward low level task of finding the optimal combination of ones and zeroes finding the optimal car genome Then we ve applied the genetic algorithm to find the optimal car genome It allowed us to get pretty good results in several hours of simulation instead of many years of running the naive approach You may launch the Self parking Car Evolution Simulator to see the evolution process directly in your browser The simulator gives you the following opportunities You may train the cars from scratch and adjust genetic parameters by yourselfYou may see the trained self parking cars in actionYou may also try to park the car manuallyThe full genetic source code that was shown in this article may also be found in the Evolution Simulator repository If you are one of those folks who will actually count and check the number of lines to make sure there are less than of them excluding tests please feel free to check the code here 🥸 There are still some unresolved issues with the code and the simulator The car s brain is oversimplified and it uses linear equations instead of let s say neural networks It makes the car not adaptable to the new surroundings or to the new parking lot types We don t decrease the car s fitness value when the car is hitting the other car Therefore the car doesn t feel any guilt in creating the road accident The evolution simulator is not stable It means that the same car genome may produce different fitness values which makes the evolution less efficient The evolution simulator is also very heavy in terms of performance which slows down the evolution progress since we can t train let s say cars at once Also the Evolution Simulator requires the browser tab to be open and active to perform the simulation and more However the purpose of this article was to have some fun while learning how the genetic algorithm works and not to build a production ready self parking Teslas So even with the issues mentioned above I hope you ve had a good time going through the article 2021-09-28 14:43:58
海外TECH DEV Community [Launch] Sunflower - Rewire your brain to associate sobriety with reward 🌻 https://dev.to/kobyconrad/launch-sunflower-rewire-your-brain-to-associate-sobriety-with-reward-3i01 Launch Sunflower Rewire your brain to associate sobriety with reward After years of learning to code half a bootcamp Github commits and one failed startup I finally built an iOS app that people actually use Despite being a super shitty programmer today I am proud to announce the launch of Sunflower Sunflower is an iOS app that uses a version of bastardized Cognitive Behavioral Therapy combined with the core tenants of progression tracking to help train your brain into associating sobriety with reward In this post I m going to outline the story behind Sunflower the product strategy that helped me build something people actually use and the technical specs of how it s built Story TimeI m a high preforming addict Starting from the age of I smoked Cannabis almost every day for about years I was really good at smoking Cannabis I started a Hippie Shop that had followers I started the highest rated cleaning service in Idaho I built an amazing digital marketing agency I became the National Advertising Director for a M mortgage bank Between society telling me weed isn t addictive and my own personal achievements it took a LOT of soul searching to realize that I had a problem After spending enough time on r leaves I decided it was time to quit I threw away all of my Cannabis gave away my glass and then hours later I relapsed for the first time Turns out quitting Cannabis after years of daily heavy use fucking sucks At least it did for me For about the first two weeks I could hardly eat or sleep After that a heavy depression set in for about months I continued to fail at getting sober relapse after relapse after relapse After maybe the th time of trying to quit smoking I painfully started to learn the core tenant of Sunflower It s not enough to stay sober You HAVE to rewire your brain As a product manager we learn there are core motivators rewards of the self of the tribe and of the hunt Drugs are a cheat code They teach you to ignore these natural rewards and to seek them through substances Simply stopping your use isn t enough because even once you make it through the physical withdrawals your brain still deeply associates your drug of choice with reward The true secret to becoming sober is learning to associate healthy activities with reward For me it was a combination of exercise Brazilian Jiu Jitsu and learning to code Learning things is deeply addictive It s a good kind of addictive The kind that triggers your reward of self that pushes you to be a better person Programming to me is this beautiful never ending rabbit hole of self improvement I was a high preforming addict but getting sober just drastically multiplied my potential Programming was something I always failed at because I was high and Sunflower is my testament that while I m still a major noob I m now good enough to build a shitty product that some people use Building Something People UseI built Sunflower around a few core tasks to be done that has resulted in a product that has extremely flat retention and that a small core group of users actually love Addicts need to track how long they have been sober for Addicts need to track their cravings and learn to overcome them Addicts need to learn to associate positive activities with reward The first point is the core of the product Every day you stay sober you earn a new sunflower within the app It s cheesy but this is surprisingly effective at helping you to associate sobriety with reward AND it helps create very strong retention If you are an addict you never give up your sobriety chip Cravings are a trigger that bring people back into the app There is a guided journaling exercise that helps to track you cravings and identify common fallacies with your thinking Finally there is a second guided journaling exercise that uses a bastardized version of Cognitive Behavioral Therapy to help teach your brain to associate positive activities with reward It s really simple and again I m a shit programmer but the combination of building around these core tasks to be done has resulted in super flat retention amp a strong NPS Tech StackThe entire app is built using React Native I went through half of a Hack Reactor bootcamp which helped boost my javascript skills so while I kind of want to learn Swift I am mainly a Javascript programmer I use Expo as my framework it s honestly really amazing for building and testing mobile apps If you ve never tried it I highly recommend It comes with a number of libraries that I ve used to add in the haptics splash screen ask for review feature Segment analytics and a ton more Expo makes it super easy to run a Simulator on my computer or iPhone and then I can simply expo build ios to create the build which I use Transporter to send to the iOS store For analytics I set up Segment and then hooked up a combination of Posthog amp Amplitude Amplitude is probably the main analytics tool that allows me to see DAU anonymized journal usage and retention but I just love the funnel visualizations that Posthog provides If you have some sadistic desire to look at my terrifying code you can check it out on Github here TL DR Today I launched Sunflower An iOS app that helps you rewire your mind to associate sobriety with reward through a combination of progression tracking amp bastardized Cognitive Behavioral Therapy 2021-09-28 14:29:46
海外TECH DEV Community Hi, I'm Tricky, and I just started learning webdev, about a week ago. Here is a small website I made :D https://dev.to/tricky4747/hi-i-m-tricky-and-i-just-started-learning-webdev-about-a-week-ago-here-is-a-small-website-i-made-d-3i02 Hi I x m Tricky and I just started learning webdev about a week ago Here is a small website I made DHere is the website gt Here is the repo gt Let me know your thoughts 2021-09-28 14:28:41
海外TECH DEV Community Update an object in nested array in MongoDB https://dev.to/rajeshroyal/update-an-object-in-nested-array-in-mongodb-o5a Update an object in nested array in MongoDBHello Reader To update an object inside a nested array in MongoDB you can use this approach Its well tested and working Case Update nested array objects See below picture for a better Idea what we are going to do We will update the object which is nested by levels of array discussionList discussionList object value to be updated Solution public courseCategoryPostCommentReplyUpdate operation CommentReplyUpdateMutation Promise lt IDocumentUpdateType gt return this courseCategoryPostCommentsModel updateOne postId operation postId discussionList elemMatch id operation commentId discussionList id operation replyId set discussionList outer discussionList inner payload operation payload discussionList outer discussionList inner isUpdated true discussionList outer discussionList inner commentUpdateTime new Date arrayFilters outer id operation commentId inner id operation replyId FootNotes this code is to update the reply of a comment That s how you can perform operations on an object in nested array in mongoDB document You can also update delete the objects which are having the more level of nesting by just modifying the query Please let me know if the code needs an explanation Thanks 2021-09-28 14:06:46
Apple AppleInsider - Frontpage News Adobe plans big updates for masking features in Lightroom and Camera Raw https://appleinsider.com/articles/21/09/28/adobe-plans-big-updates-for-masking-features-in-lightroom-and-camera-raw?utm_medium=rss Adobe plans big updates for masking features in Lightroom and Camera RawAdobe s Lightroom Lightroom Classic and Camera Raw will get some significant improvements to the way users make selective adjustments thanks to AI powered selection tools Photographers will soon be able to harness the power of Adobe Sensei Adobe s AI and machine learning toolset when it comes to making selective adjustments to their photographs A new improved masking engine will make its way to Lightroom Lightroom Classic and Camera Raw In addition features such as Select Subject and Select Sky will be available allowing photographers to make quick work of areas that previously required photographers to paint in masks by hand Read more 2021-09-28 15:00:02
Apple AppleInsider - Frontpage News Apple iPhone 13 camera engineers discuss Cinematic Mode, recycling https://appleinsider.com/articles/21/09/28/apple-iphone-13-camera-engineers-discuss-cinematic-mode-recycling?utm_medium=rss Apple iPhone camera engineers discuss Cinematic Mode recyclingIn a continuation of promoting the iPhone line s updates to the camera system Apple s vice presidents who headed up the developments went into more detail in another interview covering the creation of Cinematic Mode and working towards Apple s environmentalist aims Apple s iPhone launch heavily featured the cameras and associated features it is implementing in its lineup which has prompted the company to talk more about photography in its promotional work In a second interview with VP of Camera Software Engineering Jon McCormack and VP of Camera Hardware Engineering Graham Townsend more information about the changes is uncovered On coming up with the changes in the first place Townsend said to GQ The planning has to start about three years ahead because that s when we actually fix the specification of the silicon So for instance the sensor gets defined at that point and the A Bionic processor is also frozen That s when we have to begin to talk with Jon and predict the experiences that we want Read more 2021-09-28 14:33:38
Apple AppleInsider - Frontpage News DxOMark says iPhone 13 Pro has a great camera with 'outstanding video' https://appleinsider.com/articles/21/09/28/dxomark-says-iphone-13-pro-has-a-great-camera-with-outstanding-video?utm_medium=rss DxOMark says iPhone Pro has a great camera with x outstanding video x Apple s iPhone Pro has scored highly in DxOMark testing ranking fourth among all smartphones thanks to its general camera improvement and outstanding video Credit AppleThe camera testing firm gave the latest flagship model a score of which is lower than the Huawei P Pro s the Xiaomo Mi Ultra s and the Huawei s Pro s However the iPhone Pro is currently the highest ranked iPhone model in DxOMark s list Read more 2021-09-28 14:29:14
Cisco Cisco Blog How Cisco Talent Bridge helps to build a more inclusive future https://blogs.cisco.com/csr/how-cisco-talent-bridge-helps-to-build-a-more-inclusive-future How Cisco Talent Bridge helps to build a more inclusive futureCisco Talent Bridge is helping to build a more inclusive future by helping more people re skill or enter the IT workforce and by offering career resources 2021-09-28 14:40:53
金融 RSS FILE - 日本証券業協会 10月1日(土)サーバメンテナンスのお知らせ https://www.jsda.or.jp/shinchaku/servermaintenance/20210928140806.html 月日 2021-09-28 14:08:00
金融 金融庁ホームページ 金融機能強化審査会(第22・23回)の議事録について公表しました。 https://www.fsa.go.jp/news/r3/ginkou/20210928/20210928-3.html Detail Nothing 2021-09-28 16:00:00
金融 金融庁ホームページ 経営強化計画等の履行状況(令和3年3月期)について公表しました。 https://www.fsa.go.jp/news/r3/ginkou/20210928/20210928-4.html 計画 2021-09-28 16:00:00
金融 金融庁ホームページ 資金交付制度に係る「実施計画」の認定について公表しました。 https://www.fsa.go.jp/news/r3/ginkou/20210928/20210928-1.html 資金 2021-09-28 16:00:00
金融 金融庁ホームページ 経営強化計画の承認等について公表しました。 https://www.fsa.go.jp/news/r3/ginkou/20210928/20210928-2.html 計画 2021-09-28 16:00:00
金融 金融庁ホームページ 第26回金融機能強化審査会議事要旨について公表しました。 https://www.fsa.go.jp/singi/soff/gijiyoshi/20210902.html Detail Nothing 2021-09-28 16:00:00
金融 金融庁ホームページ 第27回金融機能強化審査会議事要旨について公表しました。 https://www.fsa.go.jp/singi/soff/gijiyoshi/20210909.html Detail Nothing 2021-09-28 16:00:00
ニュース BBC News - Home Petrol shortage: How is the fuel crisis being tackled? https://www.bbc.co.uk/news/explainers-58709456?at_medium=RSS&at_campaign=KARANGA queues 2021-09-28 14:48:33
ニュース BBC News - Home Covid passports: How do I get one and when will I need it? https://www.bbc.co.uk/news/explainers-55718553?at_medium=RSS&at_campaign=KARANGA scotland 2021-09-28 14:13:37
北海道 北海道新聞 6日のJリーグで実証実験へ 愛知でのルヴァンカップ準決勝 https://www.hokkaido-np.co.jp/article/594111/ 西村康稔 2021-09-28 23:16:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)