Run Mathematica armhf on RaspberryPi aarch64

Why The Mathematica + Python web framework is used to provide an external service platform, which, due to the fact that it is running on the machine, can be used as an external service. ARM Mathematica currently only supports 32-bit v6 v7, but a runtime library for armhf v6 v7 needs to be added to aarch64. Small TIPS To be able to run Mathematica ARM 32Bit on Ubuntu 20.04 aarch64 systems, a review of the A lot of information about it, and finally the experiment worked, and you can run 32-bit Mathematica on an aarch64 system in the following way. ...

August 25, 2020 · 3 min · alexchen

Intro Wolfram Physic Project

Memories I still remember clearly that I was particularly interested in mathematics and theoretical physics when I graduated from junior high school, and studied advanced mathematics and basic physics on my own. After that, I was full of pleasure in exploring physics and mathematics, and every day after entering my first year of high school, I would go to the library after lunch and flip through science and technology magazines, then I participated in the National High School Students Applied Physics Knowledge Contest for the first time, and I remember the final question of the paper I used calculus to solve the problem, and when I got out of the examination room, I didn’t even think that I would get it. I was very happy at that time, and I am still very grateful to Mr. Yao, our class teacher and chemistry teacher in my first year of high school, for having seen the ranking list of science scores in his hands when I went to the school to register. He was the class representative in chemistry, and in every exam he would praise me for the clarity of the solution to a particular problem. Every Sunday, on the way to school, I would stand in the Xinhua bookstore for one to two hours to look up books and scientific materials related to relativity. ...

August 10, 2020 · 4 min · alexchen

Mathematica Json parsing

Today, in the course of work, I need to parse a JSON file to get a keyword, and I’m going to use Mathematica to practice. ``` `` { “apiVersion”: “v1”, “data”: { “voting-keystore.json”: “{ "version": 4, "pubkey": " a94300da6d73a11d8ba72c99dd385b7a9d5043c9ee83ffd4190d89b7677e68d384fbceb556d2a0652e81250ad4b8477d", ""uuid”: "09e5c322-bf6b-401a -b90d-1aef6d57996a", "crypto": {"checksum": {"message": "704e947d244bc8020ef6d6f0844c4aea08af18ecf345bb98ab999df6441377d7\ "function": "sha256", "params": {}}, "kdf": {"message": """, "function": "scrypt", "params": {"p": 1, "n": 32768, "salt": "b891518a06f1d3f67a6d485bba8627f5320497f98c08cb52e4391e50071ac97d", "dklen": 32, "r": 8}}, "cipher": {\" message": "bcd85ce03e82e645e135e13501f717d907c03a23ee1f8dc6bd045c53001719ddc7a5\", "function": "aes-128-ctr", "paragraphs": {"iv\ “: "7f05ffce95bcd0157e520c6b949b90b1"}}}, "path": """}”" }, “kind”: “ConfigMap”, “metadata”: { “creationTimestamp”: “2020-07-25T11:35:24Z”, “managedFields”: [ { “apiVersion”: “v1”, “fieldsType”: “FieldsV1”, “ffieldsV1”: { “f:data”: { “.” : {}, “f:voting-keystore.json”: {} } }, “manager”: “Swagger-Codegen”, “operation”: “Update”, “time”: “2020-07-25T11:35:24Z” } ], “name”: “lighthouse-validator-a94300da6d73”, “namespace”: “eth”, “resourceVersion”: “1200502”, “selfLink”: “/api/v1/namespaces/eth/configmaps/lighthouse-validator-a94300da6d73”, “uid”: “05b37640-be81-4944-9c9f-868431b6107f” } } ...

July 27, 2020 · 2 min · alexchen

Mathemtica Machine Learning Convolutional Neural Networks(1)

Convolutional neural networks About convolution can be abstracted into mathematical expressions: I can represent the matrix of an image, K is the convolution kernel The computational layer of the convolution Object Recogition with Gradient-Based Learning input layer Input Layer Convolution Layer Conv Layer Restricted Layer RELU Layer pooling layer Pooling Layer full connected layer Creating a network Basic learning to distinguish between dogs and cats (* Create model *) myCatDogModel = NetChain[{ ConvolutionLayer[32, 3], Ramp, PoolingLayer[2, 2], ConvolutionLayer[64, 3], Ramp, PoolingLayer[2, 2], FlattenLayer[], 128, Ramp, 2, SoftmaxLayer[]}, "Input" -> NetEncoder[{"Image", {224, 224}, ColorSpace -> "RGB"}] , "Output" -> NetDecoder[{"Class", {"cat", "dog"}}]] (* Collect samples, training set and test set *) (* Convert data sets to Association format *) dataSetsConvert[dateSets_] := Module[ {}, File[#] -> StringSplit[FileBaseName[#], "."] [[1]] & /@ dateSets] traingDataFiles = RandomSample[dataSetsConvert[traingData]]; testDataFiles = RandomSample[dataSetsConvert[testData]]; SetDirectory[ "/Users/alexchen/datasets/Convolutional_Neural_Networks/dataset"]; FileNames["*.jpg", "training_set/cats/"]; FileNames["*.jpg", "training_set/dogs/"]; traingData = Join[FileNames["*.jpg", "training_set/cats/"], FileNames["*.jpg", "training_set/dogs/"]]; testData = Join[FileNames["*.jpg", "test_set/cats"], FileNames["*.jpg", "test_set/dogs"]]; (* Generate training and validation sets *) traingDataFiles = RandomSample[dataSetsConvert[traingData]]; testDataFiles = RandomSample[dataSetsConvert[testData]]; (* sample is randomly selected for display *) RandomSample[traingDataFiles, 5] (* train the model *) mytrainedModel = NetTrain[catdogModel, traingDataFiles, All, ValidationSet -> testDataFiles, MaxTrainingRounds -> 20] (* Generate training model evaluation report *) myModelPlot = mytrainedModel["FinalPlots"] (* Generate the trained model to calculate the model correctness *) myTrainedNet = mytrainedModel["TrainedNet"] ClassifierMeasurements[myTrainedNet, testDataFiles, "Accuracy"] ...

May 22, 2020 · 8 min · alexchen

Epidemic Modeling

SIR Modeling The SIR classical model is mainly used in the field of infectious diseases to predict future trends in the number of infections. S[t] denotes susceptible susceptible population I[t] denotes infected population already infected R[t] indicates recovered recovered population Reference: MathWorld: SIR Model Kermack-McKendrick Model Kermack-McKendrick Model The original Kermack-McKendrick model was designed to account for changes in the number of people infected over time, like the plague that occurred in 1665-1666 and the cholera that occurred in 1865. The model assumes that the total population is fixed, that the incubation period for infectious diseases is instantaneous, that the duration of infection is the same as the disease cycle, and that the population is assumed to be non-differentiable, without differences by gender or race. ...

April 6, 2020 · 2 min · alexchen