Step 1:
从anaconda的base环境中创建新的环境:
$ conda create -n tf2-source python=3.6
$ conda activate tf2-source
| """TensorFlow 2.0 implementation of vanilla Autoencoder.""" | |
| import numpy as np | |
| import tensorflow as tf | |
| __author__ = "Abien Fred Agarap" | |
| np.random.seed(1) | |
| tf.random.set_seed(1) | |
| batch_size = 128 | |
| epochs = 10 |
| import math | |
| import datetime | |
| from tqdm import tqdm | |
| import pandas as pd | |
| import numpy as np | |
| import tensorflow as tf |
Source code: https://github.com/mrange/benchmarksgame/tree/master/src/mandelbrot
Recently I discovered The Computer Language Benchmarks Game which intrigued me, especially the mandelbrot version.
| --- lua-5.1.4/Makefile 2008-08-12 00:40:48.000000000 +0000 | |
| +++ lua-5.1.4-shared-lib/Makefile 2009-01-13 22:01:33.000000000 +0000 | |
| @@ -43,7 +43,7 @@ | |
| # What to install. | |
| TO_BIN= lua luac | |
| TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp | |
| -TO_LIB= liblua.a | |
| +TO_LIB= liblua.a liblua.so | |
| TO_MAN= lua.1 luac.1 |
| --- src/Makefile.original2015-02-27 10:53:53.130125907 -0500 | |
| +++ src/Makefile 2015-02-27 10:53:24.674126798 -0500 | |
| @@ -7,7 +7,7 @@ | |
| PLAT= none | |
| CC= gcc -std=gnu99 | |
| -CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) | |
| +CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC | |
| LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) | |
| LIBS= -lm $(SYSLIBS) $(MYLIBS) |
| GDB commands by function - simple guide | |
| --------------------------------------- | |
| More important commands have a (*) by them. | |
| Startup | |
| % gdb -help print startup help, show switches | |
| *% gdb object normal debug | |
| *% gdb object core core debug (must specify core file) | |
| %% gdb object pid attach to running process | |
| % gdb use file command to load object |
| # INSTALL INSTRUCTIONS: save as ~/.gdbinit | |
| # | |
| # DESCRIPTION: A user-friendly gdb configuration file. | |
| # | |
| # REVISION : 7.3 (16/04/2010) | |
| # | |
| # CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit, | |
| # truthix the cyberpunk, fG!, gln | |
| # | |
| # FEEDBACK: https://www.reverse-engineering.net |
| # Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 | |
| # Run instrumented program, generate and write pgo data | |
| ./runIt | |
| # Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 |