Exemplo n.º 1
0
    def test_zonotope_1(self):
        data = helper.load_test_npz("test_spec_decomp_1.npz")
        df0 = data["df"]

        sub = ss.Subspaces()
        sub.compute(df0)
        sub.partition(2)

        np.random.seed(42)
        bavd = dom.BoundedActiveVariableDomain(sub)
        bavm = dom.BoundedActiveVariableMap(bavd)
        Y = av_design(bavm, 8, NMC=1)[0]

        vertices = bavd.vertY
        plt.zonotope_2d_plot(vertices, design=Y)
Exemplo n.º 2
0
    def test_zonotope_3(self):
        data = helper.load_test_npz("test_spec_decomp_1.npz")
        df0 = data["df"]

        sub = ss.Subspaces()
        sub.compute(df0)
        sub.partition(2)

        np.random.seed(42)
        bavd = dom.BoundedActiveVariableDomain(sub)
        bavm = dom.BoundedActiveVariableMap(bavd)
        Y = av_design(bavm, 8, NMC=1)[0]

        vertices = bavd.vertY

        Yp, Yw = av_quadrature_rule(bavm, 8)

        plt.zonotope_2d_plot(vertices, design=Y, y=Yp, f=Yw, out_label="quadrature rule")
Exemplo n.º 3
0
    def test_zonotope_2(self):
        data = helper.load_test_npz("test_spec_decomp_1.npz")
        df0 = data["df"]

        sub = ss.Subspaces()
        sub.compute(df0)
        sub.partition(2)

        np.random.seed(42)
        bavd = dom.BoundedActiveVariableDomain(sub)
        bavm = dom.BoundedActiveVariableMap(bavd)
        Y = av_design(bavm, 8, NMC=1)[0]

        vertices = bavd.vertY

        Xp = np.random.uniform(-1.0, 1.0, size=(20, sub.W1.shape[0]))
        Yp = np.dot(Xp, sub.W1)
        fp = np.sum(Yp, axis=1)

        plt.zonotope_2d_plot(vertices, design=Y, y=Yp, f=fp)