Update super cores
This commit is contained in:
		
							
								
								
									
										80
									
								
								notebooks/spaces/random-search-mlp.ipynb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										80
									
								
								notebooks/spaces/random-search-mlp.ipynb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,80 @@ | ||||
| { | ||||
|  "cells": [ | ||||
|   { | ||||
|    "cell_type": "code", | ||||
|    "execution_count": 2, | ||||
|    "metadata": {}, | ||||
|    "outputs": [ | ||||
|     { | ||||
|      "name": "stdout", | ||||
|      "output_type": "stream", | ||||
|      "text": [ | ||||
|       "library path: /Users/xuanyidong/Desktop/XAutoDL/lib\n" | ||||
|      ] | ||||
|     } | ||||
|    ], | ||||
|    "source": [ | ||||
|     "#####################################################\n", | ||||
|     "# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.03 #\n", | ||||
|     "#####################################################\n", | ||||
|     "import abc, os, sys\n", | ||||
|     "from pathlib import Path\n", | ||||
|     "\n", | ||||
|     "__file__ = os.path.dirname(os.path.realpath(\"__file__\"))\n", | ||||
|     "\n", | ||||
|     "lib_dir = (Path(__file__).parent / \"..\" / \"lib\").resolve()\n", | ||||
|     "print(\"library path: {:}\".format(lib_dir))\n", | ||||
|     "assert lib_dir.exists(), \"{:} does not exist\".format(lib_dir)\n", | ||||
|     "if str(lib_dir) not in sys.path:\n", | ||||
|     "    sys.path.insert(0, str(lib_dir))" | ||||
|    ] | ||||
|   }, | ||||
|   { | ||||
|    "cell_type": "code", | ||||
|    "execution_count": 3, | ||||
|    "metadata": {}, | ||||
|    "outputs": [ | ||||
|     { | ||||
|      "name": "stdout", | ||||
|      "output_type": "stream", | ||||
|      "text": [ | ||||
|       "SuperRunType.FullModel\n", | ||||
|       "SuperRunType.FullModel\n", | ||||
|       "True\n", | ||||
|       "True\n" | ||||
|      ] | ||||
|     } | ||||
|    ], | ||||
|    "source": [ | ||||
|     "from layers.super_core import SuperLinear\n", | ||||
|     "from layers.super_module import SuperRunMode\n", | ||||
|     "\n", | ||||
|     "print(SuperRunMode.Default)\n", | ||||
|     "print(SuperRunMode.FullModel)\n", | ||||
|     "print(SuperRunMode.Default == SuperRunMode.FullModel)\n", | ||||
|     "print(SuperRunMode.FullModel == SuperRunMode.FullModel)" | ||||
|    ] | ||||
|   } | ||||
|  ], | ||||
|  "metadata": { | ||||
|   "kernelspec": { | ||||
|    "display_name": "Python 3", | ||||
|    "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.8.3" | ||||
|   } | ||||
|  }, | ||||
|  "nbformat": 4, | ||||
|  "nbformat_minor": 4 | ||||
| } | ||||
		Reference in New Issue
	
	Block a user