如何使用菜单充气器更改Firestore Collection?

时间:2018-03-08 15:38:05

标签: java android firebase menuitem google-cloud-firestore

我在My Cloud Firestore中有一些不同的收藏,

  1. ProjectList1
  2. ProjectList2
  3. ++
  4. 我想用菜单项切换它们,但在'firestore.collection'中我只坐 ProjectList1 ,现在我该如何设置或切换 ProjectList2或ProjectList3 在firestore.collection(ProjectList1)..

    代码如下:

    flex

    我尝试切换菜单,但没有正常工作,它先保留所有以前的数据..

    from keras.layers import Input, Embedding, LSTM, Dense
    from keras.models import Model
    
    headline_data=[[i for i in range(100)]]
    additional_data=[[100,200]]
    labels=[1,2]
    # Headline input: meant to receive sequences of 100 integers, between 1 and 10000.
    
    # Note that we can name any layer by passing it a "name" argument.
    main_input = Input(shape=(100,), dtype='int32', name='main_input')
    
    # This embedding layer will encode the input sequence
    # into a sequence of dense 512-dimensional vectors.
    x = Embedding(output_dim=512, input_dim=10000, input_length=100)(main_input)
    
    # A LSTM will transform the vector sequence into a single vector,
    # containing information about the entire sequence
    lstm_out = LSTM(32)(x)
    
    
    auxiliary_output = Dense(1, activation='sigmoid', name='aux_output')(lstm_out)
    
    auxiliary_input = Input(shape=(5,), name='aux_input')
    x = keras.layers.concatenate([lstm_out, auxiliary_input])
    
    # We stack a deep densely-connected network on top
    x = Dense(64, activation='relu')(x)
    x = Dense(64, activation='relu')(x)
    x = Dense(64, activation='relu')(x)
    
    # And finally we add the main logistic regression layer
    main_output = Dense(1, activation='sigmoid', name='main_output')(x)
    
    
    # This defines a model with two inputs and two outputs:
    model = Model(inputs=[main_input, auxiliary_input], outputs=[main_output, auxiliary_output])
    
    # We compile the model and assign a weight of 0.2 to the auxiliary loss. 
    # To specify different  loss_weights or loss for each different output, 
    # you can use a list or a dictionary. Here we pass a single loss as the loss argument, 
    # so the same loss will be used on all outputs.
    
    # Since our inputs and outputs are named (we passed them a "name" argument), We could also have compiled the model via:
    model.compile(optimizer='rmsprop',
                  loss={'main_output': 'binary_crossentropy', 'aux_output': 'binary_crossentropy'},
                  loss_weights={'main_output': 1., 'aux_output': 0.2})
    
    # And trained it via:
    model.fit({'main_input': headline_data, 'aux_input': additional_data},
              {'main_output': labels, 'aux_output': labels},
              epochs=50, batch_size=32)
    

1 个答案:

答案 0 :(得分:0)

在从Firebase添加更多内容之前,您需要清除现有列表中的数据

{{1}}