diff --git a/.gitignore b/.gitignore index d62f706..c1934a7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ notebooks/data notebooks/cifar_net.pth .ipynb_checkpoints/ partial_movie_files +src/notebook/media/* +!src/notebook/media/videos/notebook +__pycache__ diff --git a/src/notebook/impredicativty.ipynb b/src/notebook/impredicativty.ipynb new file mode 100644 index 0000000..9f3c63b --- /dev/null +++ b/src/notebook/impredicativty.ipynb @@ -0,0 +1,314 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "9c2d80f9", + "metadata": {}, + "source": [ + "Firefox is not well supported in GitHub Codespaces, so using Chrome.\n", + "Cannot play mp4 in Notebook via GitHub, maybe Colab is a solution." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "f0cb14bf-3621-41cd-bc8b-f8837f82d12c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
[04/29/24 08:10:10] WARNING  Missing Plugins: {''}                                                   __init__.py:17\n",
+       "
\n" + ], + "text/plain": [ + "\u001b[2;36m[04/29/24 08:10:10]\u001b[0m\u001b[2;36m \u001b[0m\u001b[31mWARNING \u001b[0m Missing Plugins: \u001b[1m{\u001b[0m\u001b[32m''\u001b[0m\u001b[1m}\u001b[0m \u001b]8;id=273296;file:///usr/local/lib/python3.11/site-packages/manim/plugins/__init__.py\u001b\\\u001b[2m__init__.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=216321;file:///usr/local/lib/python3.11/site-packages/manim/plugins/__init__.py#17\u001b\\\u001b[2m17\u001b[0m\u001b]8;;\u001b\\\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from manim import *\n", + "import random " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "7540c9e8-aae4-401e-9ab5-68b980962d99", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Manim Community v0.18.0\n",
+       "\n",
+       "
\n" + ], + "text/plain": [ + "Manim Community \u001b[32mv0.\u001b[0m\u001b[32m18.0\u001b[0m\n", + "\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + " \r" + ] + }, + { + "data": { + "text/html": [ + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "%%manim -ql --fps 30 -v WARNING ImpredicativityAnimation\n", + "\n", + "class ImpredicativityAnimation(Scene):\n", + " def construct(self):\n", + " self.camera.background_color = GREY\n", + "\n", + " # Create the spheres\n", + " transformer = Circle(radius=1, color=BLUE, fill_color=BLUE, fill_opacity=1).shift(LEFT*2)\n", + " transformer.set_z_index(1)\n", + " subsystem = Square(side_length=2, color=BLACK, fill_color=BLACK, fill_opacity=1).shift(RIGHT*2)\n", + " subsystem.set_z_index(3) # Ensure the square is always in front\n", + " #transformer_label = Text(\"Transformer\", font_size=24).next_to(transformer, DOWN)\n", + " #subsystem_label = Text(\"Subsystem\", font_size=24).next_to(subsystem, DOWN)\n", + " #self.add(transformer, subsystem, transformer_label, subsystem_label)\n", + " self.add(transformer, subsystem)\n", + "\n", + " for _ in range(4): # Loop the animation sequence twice\n", + " # Initial system_input propertiesradius\n", + " system_input = Circle(color=WHITE, fill_color=WHITE, fill_opacity=1).move_to(LEFT * 8)\n", + " system_input.scale(0.3)\n", + "\n", + " # Animation: system_input moves to transformer and changes color\n", + " self.play(system_input.animate.move_to(transformer.get_center()), run_time=2)\n", + " self.play(system_input.animate.set_color(transformer.color))\n", + "\n", + " transformed_input_shape_class = type(transformer)\n", + " transformed_input = transformed_input_shape_class(color=transformer.color, fill_color=transformer.color, fill_opacity=1).move_to(transformer.get_center())\n", + " transformed_input.scale(0.3)\n", + " transformed_input.scale_to_fit_height(system_input.height)\n", + "\n", + " system_output = transformed_input.copy().move_to(subsystem.get_center())\n", + " \n", + " # Animation: transformed_input moves to subsystem\n", + " self.play(\n", + " ReplacementTransform(system_input, transformed_input),\n", + " transformed_input.animate.move_to(subsystem.get_center()), \n", + " run_time=2\n", + " )\n", + "\n", + " new_color = transformer.color\n", + " new_shape_class = random_shape(type(transformer))\n", + " efficient_cause = new_shape_class(color=BLACK, fill_color=BLACK, fill_opacity=1).move_to(subsystem.get_center())\n", + " efficient_cause.scale(0.3)\n", + " efficient_cause.set_z_index(2)\n", + " efficient_cause.scale_to_fit_height(system_input.height)\n", + "\n", + " # Define a curved feedback path to the transformer\n", + " path = ArcBetweenPoints(start=subsystem.get_center(), \n", + " end=transformer.get_center(), \n", + " angle=TAU/2)\n", + "\n", + " # Combined animation sequence\n", + " self.play(\n", + " system_output.animate.move_to(RIGHT * 8),\n", + " MoveAlongPath(efficient_cause, path),\n", + " run_time=3,\n", + " )\n", + "\n", + " # Change the shape of the transformer\n", + " new_transformer = new_shape_class(color=new_color, fill_color=new_color, fill_opacity=1).move_to(transformer.get_center())\n", + " new_transformer.set_z_index(1)\n", + " new_transformer.scale_to_fit_height(transformer.height)\n", + "\n", + " # efficient_cause arrives and changes the color of the transformer and fades out simultaneously\n", + " self.play(\n", + " ReplacementTransform(transformer, new_transformer),\n", + " FadeOut(efficient_cause)\n", + " )\n", + "\n", + " transformer = new_transformer\n", + " \n", + " self.wait(2) # Pause before next loop iteration\n", + "\n", + " self.play(*[FadeOut(mob) for mob in self.mobjects])\n", + " self.wait(2) \n", + "\n", + "import random\n", + "\n", + "def random_shape(current_shape_class):\n", + " shapes = [Circle, Square, Triangle]\n", + " available_shapes = [shape for shape in shapes if shape != current_shape_class]\n", + " return random.choice(available_shapes)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "0e8248f9-60d1-4bae-9241-8a23978aa137", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Manim Community v0.18.0\n",
+       "\n",
+       "
\n" + ], + "text/plain": [ + "Manim Community \u001b[32mv0.\u001b[0m\u001b[32m18.0\u001b[0m\n", + "\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Usage: manim render [OPTIONS] FILE [SCENE_NAMES]...\n", + "\n", + " Render SCENE(S) from the input FILE.\n", + "\n", + " FILE is the file path of the script or a config file.\n", + "\n", + " SCENES is an optional list of scenes in the file.\n", + "\n", + "Global options:\n", + " -c, --config_file TEXT Specify the configuration file to use for\n", + " render settings.\n", + " --custom_folders Use the folders defined in the [custom_folders]\n", + " section of the config file to define the output\n", + " folder structure.\n", + " --disable_caching Disable the use of the cache (still generates\n", + " cache files).\n", + " --flush_cache Remove cached partial movie files.\n", + " --tex_template TEXT Specify a custom TeX template file.\n", + " -v, --verbosity [DEBUG|INFO|WARNING|ERROR|CRITICAL]\n", + " Verbosity of CLI output. Changes ffmpeg log\n", + " level unless 5+.\n", + " --notify_outdated_version / --silent\n", + " Display warnings for outdated installation.\n", + " --enable_gui Enable GUI interaction.\n", + " --gui_location TEXT Starting location for the GUI.\n", + " --fullscreen Expand the window to its maximum possible size.\n", + " --enable_wireframe Enable wireframe debugging mode in opengl.\n", + " --force_window Force window to open when using the opengl\n", + " renderer, intended for debugging as it may\n", + " impact performance\n", + " --dry_run Renders animations without outputting image or\n", + " video files and disables the window\n", + " --no_latex_cleanup Prevents deletion of .aux, .dvi, and .log files\n", + " produced by Tex and MathTex.\n", + "\n", + "Output options:\n", + " -o, --output_file TEXT Specify the filename(s) of the rendered\n", + " scene(s).\n", + " -0, --zero_pad INTEGER RANGE Zero padding for PNG file names. [0<=x<=9]\n", + " --write_to_movie Write the video rendered with opengl to a file.\n", + " --media_dir PATH Path to store rendered videos and latex.\n", + " --log_dir PATH Path to store render logs.\n", + " --log_to_file Log terminal output to file.\n", + "\n", + "Render Options:\n", + " -n, --from_animation_number TEXT\n", + " Start rendering from n_0 until n_1. If n_1 is\n", + " left unspecified, renders all scenes after n_0.\n", + " -a, --write_all Render all scenes in the input file.\n", + " --format [png|gif|mp4|webm|mov]\n", + " -s, --save_last_frame Render and save only the last frame of a scene\n", + " as a PNG image.\n", + " -q, --quality [l|m|h|p|k] Render quality at the follow resolution\n", + " framerates, respectively: 854x480 15FPS,\n", + " 1280x720 30FPS, 1920x1080 60FPS, 2560x1440\n", + " 60FPS, 3840x2160 60FPS\n", + " -r, --resolution TEXT Resolution in \"W,H\" for when 16:9 aspect ratio\n", + " isn't possible.\n", + " --fps, --frame_rate FLOAT Render at this frame rate.\n", + " --renderer [cairo|opengl] Select a renderer for your Scene.\n", + " -g, --save_pngs Save each frame as png (Deprecated).\n", + " -i, --save_as_gif Save as a gif (Deprecated).\n", + " --save_sections Save section videos in addition to movie file.\n", + " -t, --transparent Render scenes with alpha channel.\n", + " --use_projection_fill_shaders Use shaders for OpenGLVMobject fill which are\n", + " compatible with transformation matrices.\n", + " --use_projection_stroke_shaders\n", + " Use shaders for OpenGLVMobject stroke which are\n", + " compatible with transformation matrices.\n", + "\n", + "Ease of access options:\n", + " --progress_bar [display|leave|none]\n", + " Display progress bars and/or keep them\n", + " displayed.\n", + " -p, --preview Preview the Scene's animation. OpenGL does a\n", + " live preview in a popup window. Cairo opens the\n", + " rendered video file in the system default media\n", + " player.\n", + " -f, --show_in_file_browser Show the output file in the file browser.\n", + " --jupyter Using jupyter notebook magic.\n", + "\n", + "Other options:\n", + " --help Show this message and exit.\n", + "\n", + "Made with <3 by Manim Community developers.\n" + ] + } + ], + "source": [ + "%%manim render --help\n", + "\n", + "pass" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1c3e55a1-9b84-4119-a2dc-55f440d0a7d1", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/src/notebook/media/videos/notebook/480p30/ComplexGroupScene.mp4 b/src/notebook/media/videos/notebook/480p30/ComplexGroupScene.mp4 deleted file mode 100644 index e257e7d..0000000 Binary files a/src/notebook/media/videos/notebook/480p30/ComplexGroupScene.mp4 and /dev/null differ diff --git a/src/notebook/media/videos/notebook/480p30/ImpredicativityAnimation.mp4 b/src/notebook/media/videos/notebook/480p30/ImpredicativityAnimation.mp4 index 0be23fb..d9c63fb 100644 Binary files a/src/notebook/media/videos/notebook/480p30/ImpredicativityAnimation.mp4 and b/src/notebook/media/videos/notebook/480p30/ImpredicativityAnimation.mp4 differ diff --git a/src/notebook/media/videos/notebook/480p30/LayeredGraphProjection.mp4 b/src/notebook/media/videos/notebook/480p30/LayeredGraphProjection.mp4 deleted file mode 100644 index efac1f2..0000000 Binary files a/src/notebook/media/videos/notebook/480p30/LayeredGraphProjection.mp4 and /dev/null differ diff --git a/src/notebook/media/videos/notebook/480p30/processism.mp4 b/src/notebook/media/videos/notebook/480p30/processism.mp4 deleted file mode 100644 index 0b73f7a..0000000 Binary files a/src/notebook/media/videos/notebook/480p30/processism.mp4 and /dev/null differ diff --git a/src/notebook/media/videos/notebook/480p30/processism_3D.mp4 b/src/notebook/media/videos/notebook/480p30/processism_3D.mp4 deleted file mode 100644 index ad401b1..0000000 Binary files a/src/notebook/media/videos/notebook/480p30/processism_3D.mp4 and /dev/null differ diff --git a/src/notebook/processism.ipynb b/src/notebook/processism.ipynb index 1049c26..2640ee5 100644 --- a/src/notebook/processism.ipynb +++ b/src/notebook/processism.ipynb @@ -2,9 +2,23 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
[04/29/24 08:09:19] WARNING  Missing Plugins: {''}                                                   __init__.py:17\n",
+       "
\n" + ], + "text/plain": [ + "\u001b[2;36m[04/29/24 08:09:19]\u001b[0m\u001b[2;36m \u001b[0m\u001b[31mWARNING \u001b[0m Missing Plugins: \u001b[1m{\u001b[0m\u001b[32m''\u001b[0m\u001b[1m}\u001b[0m \u001b]8;id=104100;file:///usr/local/lib/python3.11/site-packages/manim/plugins/__init__.py\u001b\\\u001b[2m__init__.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=368616;file:///usr/local/lib/python3.11/site-packages/manim/plugins/__init__.py#17\u001b\\\u001b[2m17\u001b[0m\u001b]8;;\u001b\\\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import sys\n", "\n", @@ -14,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -54,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -87,9 +101,46 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
Manim Community v0.18.0\n",
+       "\n",
+       "
\n" + ], + "text/plain": [ + "Manim Community \u001b[32mv0.\u001b[0m\u001b[32m18.0\u001b[0m\n", + "\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + " \r" + ] + }, + { + "data": { + "text/html": [ + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "%%manim -ql --disable_caching --fps 10 -v WARNING processism\n", "\n", @@ -198,7 +249,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.11.9" } }, "nbformat": 4,